Commit dacfe24f authored by 王宝峰's avatar 王宝峰

更改投票详情页点击预览的图片由一张到全部

parent beec6061
......@@ -4,7 +4,7 @@
<swiper v-if="opusType == '1'" class="swiper-home" indicator-dots="true" autoplay="true" interval="2000"
circular="true" indicator-color="#000" indicator-active-color="#FF0000">
<swiper-item v-for="(item,index) in bannerList" :key="index">
<image :src="item.url" :webp="true" @click="clickImg(item.url)"></image>
<image :src="item.url" :webp="true" @click="clickImg(index)"></image>
</swiper-item>
</swiper>
<video v-if=" opusType == '2'" id="myVideo" class="video" show-fullscreen-btn :src="bannerList[0].url"
......@@ -54,7 +54,7 @@
...mapState('m_user', ['userInfo']),
},
onLoad(option) { //option为object类型,会序列化上个页面传递的参数
this.weChatId = this.userInfo.wechatId
this.weChatId = this.userInfo.wechatId
console.log("详情页获取的信息:", JSON.parse(option.param))
if (option.param) {
console.log("详情页获取的信息:", JSON.parse(option.param))
......@@ -68,18 +68,25 @@
this.opusType = JSON.parse(option.param).opusType
this.opusId = JSON.parse(option.param).productionId
}
},
methods: {
clickImg(imgUrl) {
wx.previewImage({
urls: [imgUrl], //需要预览的图片http链接列表,多张的时候,url直接写在后面就行了
current: '', // 当前显示图片的http链接,默认是第一个
success: function(res) {},
fail: function(res) {},
complete: function(res) {},
clickImg(index) {
let photoList = this.bannerList.map(item => {
return item.url;
});
uni.previewImage({
current: index,
urls: photoList
})
// wx.previewImage({
// urls: [imgUrl], //需要预览的图片http链接列表,多张的时候,url直接写在后面就行了
// current: '', // 当前显示图片的http链接,默认是第一个
// success: function(res) {},
// fail: function(res) {},
// complete: function(res) {},
// })
},
setVote() {
......@@ -122,7 +129,7 @@
})
}
},
}
</script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment