1、链接:/components/couponListWindow/index.vue
方便复制:
<view v-if="coupon.count[0]" class="h-100 flex-y-center" :class="coupon.type === 0 ? 'active' : ''" @tap="setType(0)">通用券</view>
<view v-if="coupon.count[1]" class="h-100 flex-y-center" :class="coupon.type === 1 ? 'active' : ''" @tap="setType(1)">品类券</view>
<view v-if="coupon.count[2]" class="h-100 flex-y-center" :class="coupon.type === 2 ? 'active' : ''" @tap="setType(2)">商品券</view>
<view v-if="coupon.count[3]" class="h-100 flex-y-center" :class="coupon.type === 3 ? 'active' : ''" @tap="setType(3)">品牌券</view>
2、链接:/pages/order_addcart/order_addcart.vue
查找函数getCouponList(),进行替换
方便复制:
getCouponList(type) {
let that = this,
obj = {
page: 1,
limit: 20,
product_id: that.id ? that.id : '',
type: type
};
getCoupons(obj).then(res => {
let count = res.data.count;
that.$set(that.coupon, 'count', count);
if (type === undefined || type === null) {
let indexs = 0,list = [];
count.forEach((item,index)=>{
if(item !=0){
return that.indexs = index;
}
})
that.$set(that.coupon, 'type', indexs);
res.data.list.forEach(item=>{
if(item.type == indexs){
that.$set(item,'ruleshow',false);
list.push(item)
}
})
that.$set(that.coupon, 'list', list);
} else {
res.data.list.map(item=>{
that.$set(item,'ruleshow',false);
})
that.$set(that.coupon, 'list', res.data.list);
}
});
},
3、打包上传