|
|
@ -145,38 +145,33 @@ |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
|
|
|
<!-- 图片预览弹窗 --> |
|
|
<!-- 图片预览弹窗 --> |
|
|
<view class="image-preview-container" wx:if="{{showImagePreview}}"> |
|
|
<view class="image-preview-mask" wx:if="{{showImagePreview}}" style="position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.9); display: flex; justify-content: center; align-items: center; z-index: 10001;" catchtouchmove="true"> |
|
|
<view class="preview-header"> |
|
|
<view style="width: 100%; height: 100%; display: flex; justify-content: center; align-items: center;"> |
|
|
<view class="preview-close" bindtap="closeImagePreview"> |
|
|
<swiper |
|
|
<text class="close-icon">×</text> |
|
|
style="width: 100%; height: 100%;" |
|
|
</view> |
|
|
current="{{previewImageIndex}}" |
|
|
<view class="preview-indicator"> |
|
|
bindchange="onPreviewImageChange" |
|
|
<text>{{previewImageIndex + 1}} / {{previewImageUrls.length}}</text> |
|
|
indicator-dots="true" |
|
|
</view> |
|
|
indicator-color="rgba(255,255,255,0.5)" |
|
|
</view> |
|
|
indicator-active-color="#fff"> |
|
|
<swiper |
|
|
<block wx:for="{{previewImageUrls}}" wx:key="*this"> |
|
|
class="preview-swiper" |
|
|
<swiper-item> |
|
|
current="{{previewImageIndex}}" |
|
|
|
|
|
bindchange="onPreviewImageChange" |
|
|
|
|
|
> |
|
|
|
|
|
<block wx:for="{{previewImageUrls}}" wx:key="index"> |
|
|
|
|
|
<swiper-item> |
|
|
|
|
|
<view |
|
|
|
|
|
class="preview-image-wrapper" |
|
|
|
|
|
bindtap="handleImageTap" |
|
|
|
|
|
bindtouchstart="handleTouchStart" |
|
|
|
|
|
bindtouchmove="handleTouchMove" |
|
|
|
|
|
bindtouchend="handleTouchEnd" |
|
|
|
|
|
> |
|
|
|
|
|
<image |
|
|
<image |
|
|
src="{{item}}" |
|
|
src="{{item}}" |
|
|
mode="aspectFit" |
|
|
mode="aspectFit" |
|
|
class="preview-image" |
|
|
style="width: 100%; height: 100%; transform: scale({{scale}}) translate({{offsetX}}px, {{offsetY}}px); transition: {{isScaling ? 'none' : 'transform 0.3s'}};" |
|
|
style="transform: scale({{scale}}) translate({{offsetX}}px, {{offsetY}}px); transform-origin: center center; transition: transform 0.1s ease-out;" |
|
|
bindtap="handleImageTap" |
|
|
/> |
|
|
bindtouchstart="handleTouchStart" |
|
|
</view> |
|
|
bindtouchmove="handleTouchMove" |
|
|
</swiper-item> |
|
|
bindtouchend="handleTouchEnd" |
|
|
</block> |
|
|
bindtouchcancel="handleTouchEnd" |
|
|
</swiper> |
|
|
></image> |
|
|
|
|
|
</swiper-item> |
|
|
|
|
|
</block> |
|
|
|
|
|
</swiper> |
|
|
|
|
|
<view style="position: absolute; top: 40rpx; right: 40rpx; color: white; font-size: 40rpx;"> |
|
|
|
|
|
<text bindtap="closeImagePreview" style="background: rgba(0,0,0,0.5); padding: 10rpx 20rpx; border-radius: 50%;">×</text> |
|
|
|
|
|
</view> |
|
|
|
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |