完善问题
This commit is contained in:
@@ -6,14 +6,13 @@
|
||||
</view>
|
||||
<u-tabs-swiper ref="coupon" :list="couponGroupList" name="gc_name" :is-scroll="true" active-color="#FF780F" :current="couponCurrent" font-size="24" :show-bar="false" @change="couponTabsChange" height="88" ></u-tabs-swiper>
|
||||
<!-- :style="{ height: swiperHeight }" -->
|
||||
<swiper :current="swiperCouponCurrent" @animationfinish="couponAnimationFinish">
|
||||
<swiper :current="swiperCouponCurrent" @animationfinish="couponAnimationFinish" :style="{height: swiperHeight}">
|
||||
<swiper-item class="swiper-coupon-item" v-for="(_, i) in couponGroupList" :key="i">
|
||||
<!-- <scroll-view scroll-y style="height: 100%;"> -->
|
||||
<view v-for="(coupon, index) in couponList.slice(0, 4)" :key="index" class="coupon-item">
|
||||
<Coupon :couponInfo="coupon" :status='0' :type="0"></Coupon>
|
||||
</view>
|
||||
<u-empty text="暂无优惠券" mode="coupon" color="#000" v-if="!couponList.length"></u-empty>
|
||||
<!-- </scroll-view> -->
|
||||
<!-- 最多显示四个 -->
|
||||
<view v-for="(coupon, index) in couponList.slice(0, 4)" :key="index" class="coupon-item">
|
||||
<Coupon :couponInfo="coupon" :status='0' :type="0"></Coupon>
|
||||
</view>
|
||||
<u-empty text="暂无优惠券" mode="coupon" color="#000" v-if="!couponList.length"></u-empty>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
</view>
|
||||
@@ -40,7 +39,6 @@ export default {
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.setViewHeight();
|
||||
this.getGoodsClass();
|
||||
},
|
||||
methods: {
|
||||
@@ -62,6 +60,8 @@ export default {
|
||||
} else {
|
||||
this.couponList = [];
|
||||
}
|
||||
// 设置 swiper 高度
|
||||
this.setViewHeight();
|
||||
})
|
||||
},
|
||||
couponTabsChange(index) {
|
||||
@@ -73,9 +73,9 @@ export default {
|
||||
this.couponCurrent = current;
|
||||
},
|
||||
setViewHeight() {
|
||||
const res = uni.getSystemInfoSync();
|
||||
// this.swiperHeight = res.windowHeight - ((88 + 10 + 88) / 2) + 'px';
|
||||
this.swiperHeight = '450px';
|
||||
// 一个优惠券的高度 97px, 下距离 10px
|
||||
const num = this.couponList.length;
|
||||
this.swiperHeight = (97 + 10) * num - 10 + 'px';
|
||||
},
|
||||
toCouponPage() {
|
||||
this.$u.route({
|
||||
|
||||
Reference in New Issue
Block a user