feat:左下缩略图放大到100rpx,点击图片可放大预览
This commit is contained in:
parent
0d7eff7df0
commit
037afffe2a
@ -36,20 +36,20 @@
|
||||
<view class="cc-footer">
|
||||
<!-- 左侧:缩略图预览 -->
|
||||
<view class="cc-footer-left">
|
||||
<view class="cc-thumb-preview" v-if="capturedList.length > 0" @click="confirmCapture">
|
||||
<view class="cc-thumb-preview" v-if="capturedList.length > 0" @click="previewLast">
|
||||
<image class="cc-thumb-last" :src="capturedList[capturedList.length-1]" mode="aspectFill"></image>
|
||||
<text class="cc-thumb-badge">{{ capturedList.length }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 中间:拍照按钮(放大) -->
|
||||
<!-- 中间:拍照按钮 -->
|
||||
<view class="cc-footer-center">
|
||||
<view class="cc-capture-outer">
|
||||
<view class="cc-capture-btn" @click="capturePhoto"></view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 右侧:完成按钮(拍完显示) -->
|
||||
<!-- 右侧:完成按钮 -->
|
||||
<view class="cc-footer-right">
|
||||
<text class="cc-confirm-btn" @click="confirmCapture" v-if="capturedList.length > 0">完成 {{ capturedList.length }}</text>
|
||||
</view>
|
||||
@ -60,7 +60,7 @@
|
||||
<scroll-view scroll-x="true" show-scrollbar="false" style="flex-direction:row;">
|
||||
<view style="flex-direction:row;">
|
||||
<view class="cc-thumb-item" v-for="(img, idx) in capturedList" :key="idx">
|
||||
<image class="cc-thumb-img" :src="img" mode="aspectFill"></image>
|
||||
<image class="cc-thumb-img" :src="img" mode="aspectFill" @click.stop="previewPhoto(idx)"></image>
|
||||
<view class="cc-thumb-del" @click.stop="deletePhoto(idx)">
|
||||
<text class="cc-del-icon">✕</text>
|
||||
</view>
|
||||
@ -158,6 +158,19 @@
|
||||
prevPage.$vm.capturedPhotoList = this.capturedList
|
||||
}
|
||||
uni.navigateBack()
|
||||
},
|
||||
// 放大预览指定图片
|
||||
previewPhoto(idx) {
|
||||
if (this.capturedList.length > 0) {
|
||||
uni.previewImage({
|
||||
current: this.capturedList[idx],
|
||||
urls: this.capturedList
|
||||
})
|
||||
}
|
||||
},
|
||||
// 放大预览最新一张
|
||||
previewLast() {
|
||||
this.previewPhoto(this.capturedList.length - 1)
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -302,8 +315,8 @@
|
||||
|
||||
/* 缩略图预览(最新一张) */
|
||||
.cc-thumb-preview {
|
||||
width: 80rpx; height: 80rpx;
|
||||
border-radius: 10rpx;
|
||||
width: 100rpx; height: 100rpx;
|
||||
border-radius: 12rpx;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
border-width: 2rpx;
|
||||
@ -311,19 +324,19 @@
|
||||
border-style: solid;
|
||||
}
|
||||
.cc-thumb-last {
|
||||
width: 80rpx; height: 80rpx;
|
||||
width: 100rpx; height: 100rpx;
|
||||
}
|
||||
.cc-thumb-badge {
|
||||
position: absolute;
|
||||
top: -6rpx; right: -6rpx;
|
||||
min-width: 30rpx; height: 30rpx;
|
||||
border-radius: 30rpx;
|
||||
top: -8rpx; right: -8rpx;
|
||||
min-width: 34rpx; height: 34rpx;
|
||||
border-radius: 34rpx;
|
||||
background-color: #409eff;
|
||||
color: #ffffff;
|
||||
font-size: 20rpx;
|
||||
font-size: 22rpx;
|
||||
text-align: center;
|
||||
line-height: 30rpx;
|
||||
padding-left: 4rpx; padding-right: 4rpx;
|
||||
line-height: 34rpx;
|
||||
padding-left: 6rpx; padding-right: 6rpx;
|
||||
}
|
||||
|
||||
/* 缩略图横条 */
|
||||
|
||||
Loading…
Reference in New Issue
Block a user