yeyouzi-cropper.wxml 1.8 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: 32rpx;">-180°</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: 32rpx;">360°</text>
  21. </view>
  22. <view class="btnContainer">
  23. <text style="color: #fff;font-size: 34rpx;" 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: 34rpx;" bindtap="_confirmCut">裁剪</text>
  26. </view>
  27. </view>
  28. <canvas type="2d" id="imgCanvas" class='imgCanvas'></canvas>
  29. </view>