轮播图图片预览

This commit is contained in:
lnn19986213 2024-03-11 09:51:53 +08:00
parent 99062299fa
commit edcc5c39fe
15 changed files with 128 additions and 24 deletions

View File

@ -5,7 +5,7 @@
</view> </view>
<view v-if="load == false"> <view v-if="load == false">
<view class="top_swiper"> <view class="top_swiper">
<u-swiper :list="img" indicator indicatorMode="line" circular height="200" imgMode="aspectFit"></u-swiper> <u-swiper :list="img" indicator indicatorMode="line" circular height="200" imgMode="aspectFit" @click="previewImage"></u-swiper>
</view> </view>
<view class="top_title"> <view class="top_title">
标题 标题
@ -94,6 +94,14 @@
uni.navigateTo({ uni.navigateTo({
url: "/pagesA/activeManage/qdList?type=" + type + '&activityId=' + this.id url: "/pagesA/activeManage/qdList?type=" + type + '&activityId=' + this.id
}) })
},
previewImage(index) {
let photoList = this.img
uni.previewImage({
current: index, //
urls: photoList, // photoList
loop: true, //
})
} }
} }
} }

View File

@ -20,8 +20,8 @@
this.http.request('/auth/logout', {}, "GET").then(res => { this.http.request('/auth/logout', {}, "GET").then(res => {
if (res.code == 200) { if (res.code == 200) {
uni.redirectTo({ uni.redirectTo({
// url: "/pages/pageHome/shwxLogin", //h5 url: "/pages/pageHome/shwxLogin", //h5
url: '/pagesC/Login/Login' // // url: '/pagesC/Login/Login' //
}) })
} }
}).catch(e => { }).catch(e => {

View File

@ -9,8 +9,8 @@
<image style="width: 100%;" :src="cover" mode="widthFix"></image> <image style="width: 100%;" :src="cover" mode="widthFix"></image>
</view> --> </view> -->
<!-- 轮播图 --> <!-- 轮播图 -->
<u-swiper v-if="list.length > 0" :list="list" :autoplay="true" @change="e => currentNum = e.current" indicatorStyle="right: 20px"> <u-swiper v-if="list.length > 0" :list="list" :autoplay="true" @change="e => currentNum = e.current" indicatorStyle="right: 20px" imgMode="aspectFit" @click="previewImage">
<view slot="indicator" class="indicator-num" imgMode="aspectFit"> <view slot="indicator" class="indicator-num" >
<text class="indicator-num__text">{{ currentNum + 1 }}/{{ list.length }}</text> <text class="indicator-num__text">{{ currentNum + 1 }}/{{ list.length }}</text>
</view> </view>
</u-swiper> </u-swiper>
@ -214,6 +214,14 @@
this.androidOpenPdf(this.contractUrl); this.androidOpenPdf(this.contractUrl);
break; break;
} }
},
previewImage(index) {
let photoList = this.list
uni.previewImage({
current: index, //
urls: photoList, // photoList
loop: true, //
})
} }
} }

View File

@ -9,7 +9,7 @@
</view> </view>
<view class="pageImg"> <view class="pageImg">
<u-swiper v-if="list.length > 0" :list="list" :autoplay="true" @change="e => currentNum = e.current" <u-swiper v-if="list.length > 0" :list="list" :autoplay="true" @change="e => currentNum = e.current"
indicatorStyle="right: 20px" height='440rpx' imgMode="aspectFit"> indicatorStyle="right: 20px" height='440rpx' imgMode="aspectFit" @click="previewImage">
<view slot="indicator" class="indicator-num"> <view slot="indicator" class="indicator-num">
<text class="indicator-num__text">{{ currentNum + 1 }}/{{ list.length }}</text> <text class="indicator-num__text">{{ currentNum + 1 }}/{{ list.length }}</text>
</view> </view>
@ -230,6 +230,14 @@
} }
return 0; return 0;
} }
},
previewImage(index) {
let photoList = this.list
uni.previewImage({
current: index, //
urls: photoList, // photoList
loop: true, //
})
} }
}, },

View File

@ -9,7 +9,7 @@
</view> </view>
<view class="pageImg"> <view class="pageImg">
<u-swiper v-if="list.length > 0" :list="list" :autoplay="true" @change="e => currentNum = e.current" <u-swiper v-if="list.length > 0" :list="list" :autoplay="true" @change="e => currentNum = e.current"
indicatorStyle="right: 20px" height='440rpx' imgMode="aspectFit"> indicatorStyle="right: 20px" height='440rpx' imgMode="aspectFit" @click="previewImage">
<view slot="indicator" class="indicator-num"> <view slot="indicator" class="indicator-num">
<text class="indicator-num__text">{{ currentNum + 1 }}/{{ list.length }}</text> <text class="indicator-num__text">{{ currentNum + 1 }}/{{ list.length }}</text>
</view> </view>
@ -168,6 +168,14 @@
if(aaa > 100){ if(aaa > 100){
this.value = '100' this.value = '100'
} }
},
previewImage(index) {
let photoList = this.list
uni.previewImage({
current: index, //
urls: photoList, // photoList
loop: true, //
})
} }
}, },

View File

@ -10,8 +10,8 @@
</view> --> </view> -->
<!-- 轮播图 --> <!-- 轮播图 -->
<u-swiper v-if="list.length > 0" :list="list" :autoplay="true" @change="e => currentNum = e.current" indicatorStyle="right: 20px" height="200"> <u-swiper v-if="list.length > 0" :list="list" :autoplay="true" @change="e => currentNum = e.current" indicatorStyle="right: 20px" height="200" imgMode="aspectFit" @click="previewImage">
<view slot="indicator" class="indicator-num" imgMode="aspectFit"> <view slot="indicator" class="indicator-num" >
<text class="indicator-num__text">{{ currentNum + 1 }}/{{ list.length }}</text> <text class="indicator-num__text">{{ currentNum + 1 }}/{{ list.length }}</text>
</view> </view>
</u-swiper> </u-swiper>
@ -322,6 +322,14 @@
}); });
}) })
}, },
previewImage(index) {
let photoList = this.list
uni.previewImage({
current: index, //
urls: photoList, // photoList
loop: true, //
})
}
} }
} }
</script> </script>

View File

@ -4,7 +4,7 @@
<u-loading-page :loading="load"></u-loading-page> <u-loading-page :loading="load"></u-loading-page>
</view> </view>
<view class="workDetail" v-if="load == false"> <view class="workDetail" v-if="load == false">
<u-swiper :list="list" :autoplay="true" @change="e => currentNum = e.current" indicatorStyle="right: 20px" height="300px" imgMode="aspectFit"> <u-swiper :list="list" :autoplay="true" @change="e => currentNum = e.current" indicatorStyle="right: 20px" height="300px" imgMode="aspectFit" @click="previewImage">
<view slot="indicator" class="indicator-num"> <view slot="indicator" class="indicator-num">
<text class="indicator-num__text">{{ currentNum + 1 }}/{{ list.length }}</text> <text class="indicator-num__text">{{ currentNum + 1 }}/{{ list.length }}</text>
</view> </view>
@ -88,7 +88,15 @@
}); });
}) })
} },
previewImage(index) {
let photoList = this.list
uni.previewImage({
current: index, //
urls: photoList, // photoList
loop: true, //
})
}
} }
} }
</script> </script>

View File

@ -13,7 +13,7 @@
</view> </view>
</view> </view>
</view> </view>
<u-swiper :list="list" indicator indicatorMode="dot" circular height="240" imgMode="aspectFit"></u-swiper> <u-swiper :list="list" indicator indicatorMode="dot" circular height="240" imgMode="aspectFit" @click="previewImage"></u-swiper>
<view class="layout"> <view class="layout">
<!-- 文创展厅(功能不明先隐藏) --> <!-- 文创展厅(功能不明先隐藏) -->
<view class="activityColumn"> <view class="activityColumn">
@ -221,7 +221,15 @@
uni.navigateTo({ uni.navigateTo({
url: "/pagesC/AwardWinningWork/AwardDetail?id=" + String(id) url: "/pagesC/AwardWinningWork/AwardDetail?id=" + String(id)
}) })
} },
previewImage(index) {
let photoList = this.list
uni.previewImage({
current: index, //
urls: photoList, // photoList
loop: true, //
})
}
}, },
// //
onPullDownRefresh() { onPullDownRefresh() {

View File

@ -9,7 +9,7 @@
</view> </view>
<view class="pageImg"> <view class="pageImg">
<u-swiper v-if="list.length > 0" :list="list" :autoplay="true" @change="e => currentNum = e.current" <u-swiper v-if="list.length > 0" :list="list" :autoplay="true" @change="e => currentNum = e.current"
indicatorStyle="right: 20px" height='440rpx' imgMode="aspectFit"> indicatorStyle="right: 20px" height='440rpx' imgMode="aspectFit" @click="previewImage">
<view slot="indicator" class="indicator-num"> <view slot="indicator" class="indicator-num">
<text class="indicator-num__text">{{ currentNum + 1 }}/{{ list.length }}</text> <text class="indicator-num__text">{{ currentNum + 1 }}/{{ list.length }}</text>
</view> </view>
@ -223,6 +223,14 @@
icon: "none", icon: "none",
}); });
}) })
},
previewImage(index) {
let photoList = this.list
uni.previewImage({
current: index, //
urls: photoList, // photoList
loop: true, //
})
} }
} }
} }

View File

@ -2,7 +2,7 @@
<view> <view>
<view class="help_bg_box"> <view class="help_bg_box">
<view class=" bg_img_box"> <view class=" bg_img_box">
<u-swiper :list="img" indicator indicatorMode="line" circular height="200" imgMode="aspectFit"></u-swiper> <u-swiper :list="img" indicator indicatorMode="line" circular height="200" imgMode="aspectFit" @click="previewImage"></u-swiper>
</view> </view>
</view> </view>
<view class="header"> <view class="header">
@ -345,6 +345,14 @@
icon: "none", icon: "none",
}); });
}, },
previewImage(index) {
let photoList = this.img
uni.previewImage({
current: index, //
urls: photoList, // photoList
loop: true, //
})
}
} }
} }

View File

@ -4,7 +4,7 @@
<u-loading-page :loading="load"></u-loading-page> <u-loading-page :loading="load"></u-loading-page>
</view> </view>
<view class="workDetail" v-if="load == false"> <view class="workDetail" v-if="load == false">
<u-swiper :list="list" :autoplay="true" @change="e => currentNum = e.current" indicatorStyle="right: 20px" height="300px" imgMode="aspectFit"> <u-swiper :list="list" :autoplay="true" @change="e => currentNum = e.current" indicatorStyle="right: 20px" height="300px" imgMode="aspectFit" @click="previewImage">
<view slot="indicator" class="indicator-num"> <view slot="indicator" class="indicator-num">
<text class="indicator-num__text">{{ currentNum + 1 }}/{{ list.length }}</text> <text class="indicator-num__text">{{ currentNum + 1 }}/{{ list.length }}</text>
</view> </view>
@ -83,7 +83,15 @@
}); });
}) })
} },
previewImage(index) {
let photoList = this.list
uni.previewImage({
current: index, //
urls: photoList, // photoList
loop: true, //
})
}
} }
} }
</script> </script>

View File

@ -10,7 +10,7 @@
:duration="duration"> :duration="duration">
<swiper-item v-for="(v,i) in img" :key="i"> <swiper-item v-for="(v,i) in img" :key="i">
<view class="swiper_box"> <view class="swiper_box">
<image class="swiper_img" :src='img[i]' mode="aspectFit"></image> <image class="swiper_img" :src='img[i]' mode="aspectFit" @click="previewImage(i)"></image>
</view> </view>
</swiper-item> </swiper-item>
</swiper> </swiper>
@ -407,6 +407,14 @@
url: "/pagesA/msg/chat/chat?name=" + this.orderDet[0].userName + '&linkId=' + '' + '&toUser=' + url: "/pagesA/msg/chat/chat?name=" + this.orderDet[0].userName + '&linkId=' + '' + '&toUser=' +
this.orderDet[0].id + '&toUserImg=' + this.orderDet[0].userImg this.orderDet[0].id + '&toUserImg=' + this.orderDet[0].userImg
}) })
},
previewImage(index) {
let photoList = this.img
uni.previewImage({
current: index, //
urls: photoList, // photoList
loop: true, //
})
} }
} }
} }

View File

@ -6,7 +6,7 @@
<view class="page" v-if="load == false"> <view class="page" v-if="load == false">
<view class="pageImg" v-if="list.length > 0"> <view class="pageImg" v-if="list.length > 0">
<u-swiper v-if="list.length > 0" :list="list" :autoplay="true" @change="(e) => (currentNum = e.current)" <u-swiper v-if="list.length > 0" :list="list" :autoplay="true" @change="(e) => (currentNum = e.current)"
indicatorStyle="right: 20px" height="440rpx" imgMode="aspectFit"> indicatorStyle="right: 20px" height="440rpx" imgMode="aspectFit" @click="previewImage">
<view slot="indicator" class="indicator-num"> <view slot="indicator" class="indicator-num">
<text class="indicator-num__text">{{ currentNum + 1 }}/{{ list.length }}</text> <text class="indicator-num__text">{{ currentNum + 1 }}/{{ list.length }}</text>
</view> </view>
@ -74,6 +74,14 @@
}); });
}) })
}, },
previewImage(index) {
let photoList = this.list
uni.previewImage({
current: index, //
urls: photoList, // photoList
loop: true, //
})
}
}, },
}; };
</script> </script>

View File

@ -6,7 +6,7 @@
<view class="page" v-if="load == false"> <view class="page" v-if="load == false">
<view class="pageImg" v-if="list.length > 0"> <view class="pageImg" v-if="list.length > 0">
<u-swiper v-if="list.length > 0" :list="list" :autoplay="true" @change="(e) => (currentNum = e.current)" <u-swiper v-if="list.length > 0" :list="list" :autoplay="true" @change="(e) => (currentNum = e.current)"
indicatorStyle="right: 20px" height="440rpx" imgMode="aspectFit"> indicatorStyle="right: 20px" height="440rpx" imgMode="aspectFit" @click="previewImage">
<view slot="indicator" class="indicator-num"> <view slot="indicator" class="indicator-num">
<text class="indicator-num__text">{{ currentNum + 1 }}/{{ list.length }}</text> <text class="indicator-num__text">{{ currentNum + 1 }}/{{ list.length }}</text>
</view> </view>
@ -96,6 +96,14 @@
}); });
}) })
}, },
previewImage(index) {
let photoList = this.list
uni.previewImage({
current: index, //
urls: photoList, // photoList
loop: true, //
})
}
}, },
}; };
</script> </script>

View File

@ -5,10 +5,10 @@
export default { export default {
config: { config: {
baseUrl: "http://192.168.2.48:8080/h5/api", //俞燕红-小程序不能配跨域 // baseUrl: "http://192.168.2.48:8080/h5/api", //俞燕红-小程序不能配跨域
// baseUrl: "/pre", //俞燕红-跨域 // baseUrl: "/pre", //俞燕红-跨域
// baseUrl: "https://yxx.ydool.net/h5/api", //线上 // baseUrl: "https://yxx.ydool.net/h5/api", //线上
// baseUrl: "/h5/api", //h5 baseUrl: "/h5/api", //h5
header: { header: {
'Content-Type': 'application/json;charset=UTF-8', 'Content-Type': 'application/json;charset=UTF-8',
// 'Content-Type':'application/x-www-form-urlencoded' // 'Content-Type':'application/x-www-form-urlencoded'
@ -104,8 +104,8 @@ export default {
}); });
setTimeout(() => { setTimeout(() => {
uni.navigateTo({ uni.navigateTo({
url: '/pagesC/Login/Login' //小程序跳转 // url: '/pagesC/Login/Login' //小程序跳转
// url: '/pages/pageHome/shwxLogin' //h5-山海万象跳转 url: '/pages/pageHome/shwxLogin' //h5-山海万象跳转
}) })
}, 1200) }, 1200)