This commit is contained in:
2020-08-09 18:39:35 +08:00
parent 9631e9f827
commit 9b93b6a5a9
20 changed files with 148 additions and 66 deletions

View File

@@ -6,7 +6,7 @@
<scroll-view scroll-y class="scroll-coupon">
<view v-if="couponList[index]">
<view class="coupon-item" v-for="(coupon, c_index) in couponList[index]" :key="c_index">
<Coupon :couponInfo="coupon" :status='index' :type="1" @use="useCoupon($event)" :goodsClass="goodsClass"></Coupon>
<Coupon :couponInfo="coupon" :status='index' @use="useCoupon($event)" :goodsClass="goodsClass"></Coupon>
</view>
</view>
<u-empty text="暂无优惠券" mode="coupon" v-if="!couponList[index] || !couponList[index].length"></u-empty>
@@ -68,12 +68,22 @@ export default {
this.$forceUpdate();
})
},
useCoupon(id) {
console.log(id);
useCoupon(coupon) {
// console.log(coupon);
if(coupon.type == 1) {
this.$u.route({
type: 'switchTab',
url: 'pages/shop/index',
})
} else if(coupon.type == 2) {
this.$u.route('pageC/merchant/index', {
id: coupon.voucher_store_id,
});
}
},
setViewHeight() {
const res = uni.getSystemInfoSync();
this.swiperHeight = res.windowHeight - (88 / 2 + 11 / 2) + 'px';
this.swiperHeight = res.windowHeight - (100 * (res.windowWidth / 750)) + 'px';
},
tabsChange(index) {
this.swiperCurrent = index;