Commit 8b5f8465 by 前端

缩放

1 parent b6449277
...@@ -78,7 +78,24 @@ ...@@ -78,7 +78,24 @@
</view> </view>
<view class="popup-body"> <view class="popup-body">
<view class="img-detail"> <view class="img-detail">
<image :src="detailUrl" mode="heightFix" :style="{ transform: `scale(${scale})` }" @touchstart="touchstart" @touchmove="touchmove" @touchend="touchend" @touchcancel="touchcancel" /> <view class="swiper-button swiper-button-prev" @click="prevSwiper" v-if="currentStage > 0">
<uni-icons type="left" size="14" color="#fff"></uni-icons>
</view>
<swiper class="swiper-warp" :current="currentStage" @change="onSwiperChange" :disable-touch="true">
<swiper-item v-for="(step, index) in stageList" :key="index">
<view class="swiper-item">
<movable-area style="width: 100%; height: 100%">
<movable-view direction="all" :x="-9999" :key="index" :out-of-bounds="true" :scale="true">
<image :src="step.imageUrl" class="swiper-image" mode="heightFix" />
<!-- <view class="swiper-content">{{ step.imageUrl }}</view> -->
</movable-view>
</movable-area>
</view>
</swiper-item>
</swiper>
<view class="swiper-button swiper-button-next" @click="nextSwiper" v-if="currentStage < stageList.length - 1">
<uni-icons type="right" size="14" color="#fff"></uni-icons>
</view>
</view> </view>
</view> </view>
</view> </view>
...@@ -585,6 +602,7 @@ export default { ...@@ -585,6 +602,7 @@ export default {
height: 96rpx; height: 96rpx;
color: #fff; color: #fff;
position: relative; position: relative;
z-index: 10000;
.back { .back {
margin-left: 60rpx; margin-left: 60rpx;
height: 100%; height: 100%;
...@@ -608,10 +626,46 @@ export default { ...@@ -608,10 +626,46 @@ export default {
.img-detail { .img-detail {
height: calc(100vh - 96rpx); height: calc(100vh - 96rpx);
text-align: center; text-align: center;
width: auto; width: 100%;
image { position: relative;
.swiper-button {
position: absolute;
top: 50%;
transform: translateY(-50%);
background: rgba($color: #fff, $alpha: 0.3);
color: #000;
border-radius: 50%;
width: 68rpx;
height: 68rpx;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
z-index: 100;
&.swiper-button-prev {
left: 32rpx;
}
&.swiper-button-next {
right: 32rpx;
}
}
.swiper-warp {
width: calc(100% - 240rpx);
margin-left: 118rpx;
height: 100%; height: 100%;
width: auto; .swiper-item {
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
border-radius: 24rpx;
overflow: hidden;
}
.swiper-image {
height: calc(100vh - 96rpx);
width: auto;
}
} }
} }
} }
......
/* /*
* @Author: 前端 qianduan01@didihu.com.cn * @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2024-04-08 17:16:46 * @Date: 2024-04-08 17:16:46
* @LastEditors: limin * @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2024-11-07 15:56:05 * @LastEditTime: 2024-12-19 10:19:05
* @FilePath: \gl_tape\utils\utils.js * @FilePath: \gl_tape\utils\utils.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/ */
...@@ -151,6 +151,7 @@ function getFilePath() { ...@@ -151,6 +151,7 @@ function getFilePath() {
/** 比较版本号的大小 /** 比较版本号的大小
**/ **/
function compareVersions(version1, version2) { function compareVersions(version1, version2) {
if (!version1 || !version2) return 0
const v1 = version1.split('.').map(v => +v) // 转化成数字数组 const v1 = version1.split('.').map(v => +v) // 转化成数字数组
const v2 = version2.split('.').map(v => +v) const v2 = version2.split('.').map(v => +v)
const b1 = v1.every(v => !isNaN(v)) // 判断数组的每一项是否是数字 const b1 = v1.every(v => !isNaN(v)) // 判断数组的每一项是否是数字
...@@ -179,11 +180,11 @@ export function serializeIfObject(msg) { ...@@ -179,11 +180,11 @@ export function serializeIfObject(msg) {
} }
export function isInteger(value) { export function isInteger(value) {
if (typeof value === 'number') { if (typeof value === 'number') {
return Number.isInteger(value); return Number.isInteger(value)
} else if (typeof value === 'string') { } else if (typeof value === 'string') {
return /^-?\d+$/.test(value); return /^-?\d+$/.test(value)
} }
return false; return false
} }
export default { export default {
compareVersions, compareVersions,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!