首页限时优惠图改成方图,修改轮播图是否点击跳转

master
chen 2022-03-04 18:12:10 +08:00
parent dc4c52e857
commit 826c9bf12e
2 changed files with 12 additions and 7 deletions

View File

@ -1,12 +1,12 @@
<template> <template>
<view> <view id="main-img">
<!-- <view class="mar-x40" v-for="(item,index) in list" :key="index"> --> <!-- <view class="mar-x40" v-for="(item,index) in list" :key="index"> -->
<!-- 活动商品 start --> <!-- 活动商品 start -->
<view v-for="(item,index) in activityList" :key="index" class="mar-x50"> <view v-for="(item,index) in activityList" :key="index" class="mar-x50">
<h1 class="fon36 bold">{{item.name}}</h1> <h1 class="fon36 bold">{{item.name}}</h1>
<view class="colpeili fon26 mar-s20 mar-x40 clips1">{{item.subtitle}}</view> <view class="colpeili fon26 mar-s20 mar-x40 clips1">{{item.subtitle}}</view>
<view class="posir" @tap="goDetail(item.id)"> <view class="posir" @tap="goDetail(item.id)">
<image class="radius30 animated fadeIn" :src="item.cover" mode="aspectFill" lazy-load style="height: 425rpx;width: 100%;"></image> <image class="radius30 animated fadeIn" :src="item.cover" mode="aspectFill" lazy-load style="height: 425rpx;width: 100%;" :style="{height:activityHeight + 'px'}"></image>
<view v-if="item.tag!=''" class="posia fon24 colf pad-zy10 pad-s10 pad-x20 activity-img"></view> <view v-if="item.tag!=''" class="posia fon24 colf pad-zy10 pad-s10 pad-x20 activity-img"></view>
</view> </view>
</view> </view>
@ -45,9 +45,16 @@
}, },
data() { data() {
return { return {
check:uni.getStorageSync('is_active') check:uni.getStorageSync('is_active'),
activityHeight:''
}; };
}, },
mounted() {
uni.createSelectorQuery().in(this).select('#main-img').boundingClientRect().exec(rect => {
this.activityHeight = rect[0].width;
console.log(this.activityHeight,55);
});
},
methods:{ methods:{
goDetail(id){// goDetail(id){//
if(this.check){ if(this.check){

View File

@ -65,7 +65,6 @@
// } // }
], ],
current:0, // tabswiper current:0, // tabswiper
swiperHeight:uni.getSystemInfoSync().screenHeight,
publicColor:'', // publicColor:'', //
showTop:false, // showTop:false, //
dataList:[], // dataList:[], //
@ -97,9 +96,8 @@
this.isAutoPlay = false; this.isAutoPlay = false;
}, },
onReady() { onReady() {
// IDtab // uni.createSelectorQuery().in(this).select('#swiper-box').boundingClientRect().exec(rect => {
// uni.createSelectorQuery().in(this).select('#tab').boundingClientRect().exec(rect => { // this.swiperHeight = rect[0].width
// this.swiperHeight = this.swiperHeight - rect[0].height
// }); // });
}, },
onShow() { onShow() {