|
|
@@ -26,12 +26,12 @@
|
|
26
|
26
|
<u-popup title="图片识别结果" :show="show" @open="openImgPopup" mode="bottom" :round="10" :closeOnClickOverlay="false">
|
|
27
|
27
|
<view class="img-preview-container" @touchstart="handleTouchStart" @touchmove="handleTouchMove" @touchend="handleTouchEnd">
|
|
28
|
28
|
<view class="image-section" :class="{ 'expanded': isImageExpanded }">
|
|
29
|
|
- <view class="image-container" v-if="currentImg" :style="isImageExpanded ? 'height: 500rpx; width: 670rpx;' : ''">
|
|
30
|
|
- <image v-show="!isImageExpanded" :src="currentImg" class="preview-image" :class="{ 'zoomed': isImageExpanded }" @load="handleImageLoad" id="previewImage"></image>
|
|
|
29
|
+ <view class="image-container" v-if="currentImg" :style="imageContainerStyle">
|
|
|
30
|
+ <image v-show="!isImageExpanded" :src="currentImg" class="preview-image" @load="handleImageLoad" id="previewImage"></image>
|
|
31
|
31
|
<bt-cropper v-if="isImageExpanded" ref="cropper" :imageSrc="currentImg" :ratio="0" :fileType="fileType" :key="currentImg" :containerSize="{width: 670, height: 500}" @loadFail="handleCropLoadFail"></bt-cropper>
|
|
32
|
|
- <view v-if="isImageExpanded" class="confirm-crop-btn">
|
|
33
|
|
- <u-button type="primary" size="mini" @click="confirmCrop">确认裁剪</u-button>
|
|
34
|
|
- </view>
|
|
|
32
|
+ </view>
|
|
|
33
|
+ <view class="confirm-crop-btn-container" :class="{ 'show': isImageExpanded }">
|
|
|
34
|
+ <u-button class="confirm-crop-btn" type="primary" size="mini" @click="confirmCrop">确认裁剪</u-button>
|
|
35
|
35
|
</view>
|
|
36
|
36
|
|
|
37
|
37
|
<view class="img-result-container">
|
|
|
@@ -173,6 +173,14 @@ export default {
|
|
173
|
173
|
}
|
|
174
|
174
|
},
|
|
175
|
175
|
computed: {
|
|
|
176
|
+ imageContainerStyle() {
|
|
|
177
|
+ return {
|
|
|
178
|
+ height: this.isImageExpanded ? '500rpx' : '300rpx', // 给一个基础高度以使过渡平滑
|
|
|
179
|
+ width: '670rpx',
|
|
|
180
|
+ transition: 'all 0.4s cubic-bezier(0.25, 1, 0.5, 1)',
|
|
|
181
|
+ overflow: 'hidden'
|
|
|
182
|
+ };
|
|
|
183
|
+ },
|
|
176
|
184
|
currentImg:{
|
|
177
|
185
|
get(){
|
|
178
|
186
|
return this.localCurrentImg || ''
|