袁磊 3 months ago
parent
commit
f3f961a48f
  1. 42
      uni_modules/vrapile-cut-image/components/vrapile-cut-image/vrapile-cut-image.vue

42
uni_modules/vrapile-cut-image/components/vrapile-cut-image/vrapile-cut-image.vue

@ -3,23 +3,35 @@
<view class='cropper-content'> <view class='cropper-content'>
<view v-if="showImage" class="uni-corpper"> <view v-if="showImage" class="uni-corpper">
<view class="uni-corpper-content"> <view class="uni-corpper-content">
<image class="uni-corpper-content-image" :src="imageSrc" mode="aspectFit" :style="'transform:rotate('+rotateAll + 'deg) rotateY('+rotateY + 'deg) rotateX('+rotateX + 'deg)'"></image>
<view class="uni-corpper-crop-box" @touchstart.stop="contentStartMove" @touchmove.stop="contentMoveing" @touchend.stop="contentTouchEnd"
<image class="uni-corpper-content-image" :src="imageSrc" mode="aspectFit"
:style="'transform:rotate('+rotateAll + 'deg) rotateY('+rotateY + 'deg) rotateX('+rotateX + 'deg)'">
</image>
<view class="uni-corpper-crop-box" @touchstart.stop="contentStartMove"
@touchmove.stop="contentMoveing" @touchend.stop="contentTouchEnd"
:style="'left:'+cutL+'rpx;top:'+cutT+'rpx;right:'+cutR+'rpx;bottom:'+cutB+'rpx'"> :style="'left:'+cutL+'rpx;top:'+cutT+'rpx;right:'+cutR+'rpx;bottom:'+cutB+'rpx'">
<view class="uni-cropper-view-box"> <view class="uni-cropper-view-box">
<view class="uni-cropper-dashed-h"></view> <view class="uni-cropper-dashed-h"></view>
<view class="uni-cropper-dashed-v"></view> <view class="uni-cropper-dashed-v"></view>
<view class="uni-cropper-line-t" data-drag="top" @touchstart.stop="dragStart" @touchmove.stop="dragMove"></view>
<view class="uni-cropper-line-r" data-drag="right" @touchstart.stop="dragStart" @touchmove.stop="dragMove"></view>
<view class="uni-cropper-line-b" data-drag="bottom" @touchstart.stop="dragStart" @touchmove.stop="dragMove"></view>
<view class="uni-cropper-line-l" data-drag="left" @touchstart.stop="dragStart" @touchmove.stop="dragMove"></view>
<view class="uni-cropper-point point-t" data-drag="top" @touchstart.stop="dragStart" @touchmove.stop="dragMove"></view>
<view class="uni-cropper-line-t" data-drag="top" @touchstart.stop="dragStart"
@touchmove.stop="dragMove"></view>
<view class="uni-cropper-line-r" data-drag="right" @touchstart.stop="dragStart"
@touchmove.stop="dragMove"></view>
<view class="uni-cropper-line-b" data-drag="bottom" @touchstart.stop="dragStart"
@touchmove.stop="dragMove"></view>
<view class="uni-cropper-line-l" data-drag="left" @touchstart.stop="dragStart"
@touchmove.stop="dragMove"></view>
<view class="uni-cropper-point point-t" data-drag="top" @touchstart.stop="dragStart"
@touchmove.stop="dragMove"></view>
<view class="uni-cropper-point point-tr" data-drag="topTight"></view> <view class="uni-cropper-point point-tr" data-drag="topTight"></view>
<view class="uni-cropper-point point-r" data-drag="right" @touchstart.stop="dragStart" @touchmove.stop="dragMove"></view>
<view class="uni-cropper-point point-rb" data-drag="rightBottom" @touchstart.stop="dragStart" @touchmove.stop="dragMove"></view>
<view class="uni-cropper-point point-b" data-drag="bottom" @touchstart.stop="dragStart" @touchmove.stop="dragMove" @touchend.stop="dragEnd"></view>
<view class="uni-cropper-point point-r" data-drag="right" @touchstart.stop="dragStart"
@touchmove.stop="dragMove"></view>
<view class="uni-cropper-point point-rb" data-drag="rightBottom" @touchstart.stop="dragStart"
@touchmove.stop="dragMove"></view>
<view class="uni-cropper-point point-b" data-drag="bottom" @touchstart.stop="dragStart"
@touchmove.stop="dragMove" @touchend.stop="dragEnd"></view>
<view class="uni-cropper-point point-bl" data-drag="bottomLeft"></view> <view class="uni-cropper-point point-bl" data-drag="bottomLeft"></view>
<view class="uni-cropper-point point-l" data-drag="left" @touchstart.stop="dragStart" @touchmove.stop="dragMove"></view>
<view class="uni-cropper-point point-l" data-drag="left" @touchstart.stop="dragStart"
@touchmove.stop="dragMove"></view>
<view class="uni-cropper-point point-lt" data-drag="leftTop"></view> <view class="uni-cropper-point point-lt" data-drag="leftTop"></view>
</view> </view>
</view> </view>
@ -80,16 +92,16 @@
<script> <script>
// //
let sysInfo = uni.getSystemInfoSync()
let SCREEN_WIDTH = sysInfo.screenWidth
const sysInfo = uni.getWindowInfo();
const SCREEN_WIDTH = sysInfo.screenWidth;
let PAGE_X, // x let PAGE_X, // x
PAGE_Y, // y PAGE_Y, // y
T_PAGE_X, // x T_PAGE_X, // x
T_PAGE_Y, // Y T_PAGE_Y, // Y
CUT_L, // left CUT_L, // left
CUT_T, // top CUT_T, // top
CUT_R, //
CUT_B, //
CUT_R, // right
CUT_B, // bottom
IMG_RATIO, // IMG_RATIO, //
IMG_REAL_W, // IMG_REAL_W, //
IMG_REAL_H, // IMG_REAL_H, //

Loading…
Cancel
Save