yeyouzi-cropper.wxml 1.7 KB

123456789101112131415161718192021222324252627282930
  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" bindtouchend="_touchEnd" bindtouchmove="_touchMove" ></canvas>
  6. <view style="position: absolute;top:{{imageTop}}px;left: {{imageLeft}}px;transform: rotateY({{imgMirror}}deg);transform-origin:{{originWidthShow * 100}}% {{originHeightShow * 100}}%;">
  7. <image src="{{img.path}}" style="width:{{imageWidth}}px;height:{{imageHeight}}px;transform: rotateZ({{imgMirror == 180 ? -imgRotate : imgRotate}}deg);transform-origin:{{originWidthShow * 100}}% {{originHeightShow * 100}}%;"></image>
  8. </view>
  9. </view>
  10. <view class="settingContainer">
  11. <view class="rotate" style="color: #fff;width: 100%;text-align: center;">{{imgRotate}}°</view>
  12. <view class="rotateContainer">
  13. <text style="color: #fff;font-size: 20px;" bindtap="_imageMirror">⇌</text>
  14. <slider style="width: 100%;" min="-180" max="180" value="{{imgRotate}}" block-size="18px" selected-color="#fff" bindchanging="_rotateChange"></slider>
  15. <text style="color: #fff;font-size: 22px;" bindtap="_rotateNinety">⊙</text>
  16. </view>
  17. <view class="btnContainer">
  18. <text style="color: #fff;font-size: 24px;" bindtap="_cancelCut">×</text>
  19. <text style="color: #fff;font-size: 16px;text-align:center;align-self: center;" bindtap="_imgRestore">还原</text>
  20. <text style="color: #fff;font-size: 24px;" bindtap="_confirmCut">✓</text>
  21. </view>
  22. </view>
  23. <canvas type="2d" id="imgCanvas" style="width: 0;height: 0;"></canvas>
  24. </view>