yeyouzi-cropper.wxml 1.9 KB

1234567891011121314151617181920212223242526272829303132333435
  1. <!--components/yeyouzi-cropper/yeyouzi-cropper.wxml-->
  2. <!-- <view class="Container{{img.path != '' ? '-show' : ''}}"> -->
  3. <view class="Container-show" wx:if="{{img.path != ''}}">
  4. <view class="imgContainer">
  5. <canvas type="2d" id="cutCanvas" style="width: 100%;height: 100%;z-index:9999;" bindtouchstart="_touchStart"
  6. bindtouchend="_touchEnd" bindtouchmove="_touchMove"></canvas>
  7. <view
  8. style="position: absolute;top:{{imageTop}}px;left: {{imageLeft}}px;transform: rotateY({{imgMirror}}deg);transform-origin:{{originWidthShow * 100}}% {{originHeightShow * 100}}%;">
  9. <image src="{{img.path}}"
  10. style="width:{{imageWidth}}px;height:{{imageHeight}}px;transform: rotateZ({{imgMirror == 180 ? -imgRotate : imgRotate}}deg);transform-origin:{{originWidthShow * 100}}% {{originHeightShow * 100}}%;">
  11. </image>
  12. </view>
  13. </view>
  14. <view class="settingContainer">
  15. <view class="rotate" style="color: #fff;width: 100%;text-align: center;">{{imgRotate}}°</view>
  16. <view class="rotateContainer">
  17. <text style="color: #fff;font-size: 20px;" bindtap="_imageMirror">⇌</text>
  18. <slider style="width: 100%;" min="-180" max="180" value="{{imgRotate}}" block-size="18px"
  19. selected-color="#fff" bindchanging="_rotateChange"></slider>
  20. <text style="color: #fff;font-size: 22px;" bindtap="_rotateNinety">⊙</text>
  21. </view>
  22. <view class="btnContainer">
  23. <text style="color: #fff;font-size: 24px;" bindtap="_cancelCut">×</text>
  24. <!-- <text style="color: #fff;font-size: 16px;text-align:center;align-self: center;" bindtap="_imgRestore">还原</text> -->
  25. <text style="color: #fff;font-size: 24px;" bindtap="_confirmCut">✓</text>
  26. </view>
  27. </view>
  28. <canvas type="2d" id="imgCanvas" style="width: 0;height: 0;"></canvas>
  29. </view>