123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- <template>
- <view class="activity">
- <image :src="banner" mode="widthFix" @click="previewImg()"></image>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- banner:'',
- productImage:[]
- }
- },
- onLoad() {
- this.GetHomeLiveAdvertising()
- },
- methods:{
- GetHomeLiveAdvertising(){
- this.CommonService.GetHomeLiveAdvertising().then(response =>{
- this.banner = response.data.liveImage
- this.productImage.push(this.banner)
- }).catch(error =>{
- this.$util.msg(error.msg,3000)
- })
- },
- previewImg (index) {//顶部商品图片预览
- let previewUrls = this.productImage
- uni.previewImage({
- current: 0, //图片索引
- urls: previewUrls, //必须是http图片,本地图片无效
- longPressActions:''
- })
- }
- },
- onPullDownRefresh() {
- setTimeout(() => {
- this.GetHomeLiveAdvertising()
- uni.stopPullDownRefresh()
- }, 200)
- },
- onShow() {
-
- }
- }
- </script>
-
- <style lang="scss">
- .activity{
- width: 100%;
- height: auto;
- image{
- width: 100%;
- height: auto;
- }
- }
- </style>
|