Commit 696d32dc authored by Mac's avatar Mac

优惠券跳转修改

parent ac83def6
...@@ -59,7 +59,7 @@ export default { ...@@ -59,7 +59,7 @@ export default {
loading: false, loading: false,
coupon_id:0, coupon_id:0,
isreceive:false, isreceive:false,
type:0 type:0,//type 1是优惠券列表来的 2 是领券中心来的
}; };
}, },
...@@ -113,14 +113,18 @@ export default { ...@@ -113,14 +113,18 @@ export default {
); );
}, },
gouseUrl(g){ gouseUrl(g){
let id let data = []
if(this.type == 1){ if(g.UseType==1 || g.UseType==2){
id = g.ID g.ProductList.forEach(x=>{
data.push(x.ProductId)
}else if(this.type == 2){ })
id = g.CouponId let id = data.toString()
uni.redirectTo({ url: '/pages/goods/list?coupon_id='+ id+'&UseType='+g.UseType });
}else{
uni.redirectTo({ url: '/pages/goods/list'});
} }
uni.redirectTo({ url: '/pages/goods/list?coupon_id='+ id});
} }
}, },
......
...@@ -93,8 +93,15 @@ ...@@ -93,8 +93,15 @@
onLoad(option) { onLoad(option) {
this.mainColor = this.$uiConfig.mainColor; this.mainColor = this.$uiConfig.mainColor;
this.catId = option.cat_id; this.catId = option.cat_id;
if (option.coupon_id != undefined) { if (option && option.coupon_id && option.UseType) {//优惠券带过来的参数
this.coupon_id = option.coupon_id //优惠券带过来的参数 console.log(option.coupon_id)
if(option.UseType==1){
this.msg.CategoryIds = option.coupon_id
}else if(option.UseType==2){
this.msg.GoodsIds = option.coupon_id
}
} }
if (option.CategoryIds) { if (option.CategoryIds) {
this.msg.CategoryIds = option.CategoryIds; this.msg.CategoryIds = option.CategoryIds;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment