yeyouzi-cropper.wxml 1.7 KB

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