|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
<view class="activity">
|
|
|
- <image :src="banner" mode="widthFix"></image>
|
|
|
+ <image :src="banner" mode="widthFix" @click="previewImg()"></image>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
@@ -9,18 +9,28 @@
|
|
|
data() {
|
|
|
return {
|
|
|
banner:'',
|
|
|
+ productImage:[]
|
|
|
}
|
|
|
},
|
|
|
onLoad() {
|
|
|
-
|
|
|
+ this.GetHomeLiveAdvertising()
|
|
|
},
|
|
|
methods:{
|
|
|
GetHomeLiveAdvertising(){
|
|
|
this.CommonService.GetHomeLiveAdvertising().then(response =>{
|
|
|
this.banner = response.data
|
|
|
+ this.productImage.push(response.data)
|
|
|
}).catch(error =>{
|
|
|
this.$util.msg(error.msg,3000);
|
|
|
})
|
|
|
+ },
|
|
|
+ previewImg (index) {//顶部商品图片预览
|
|
|
+ let previewUrls = this.productImage
|
|
|
+ uni.previewImage({
|
|
|
+ current: 0, //图片索引
|
|
|
+ urls: previewUrls, //必须是http图片,本地图片无效
|
|
|
+ longPressActions:''
|
|
|
+ })
|
|
|
}
|
|
|
},
|
|
|
onPullDownRefresh() {
|
|
@@ -30,7 +40,7 @@
|
|
|
}, 200)
|
|
|
},
|
|
|
onShow() {
|
|
|
- this.GetHomeLiveAdvertising()
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
</script>
|