@@ -141,23 +164,25 @@
data() {
return {
swiperDataList: [], //轮播
- baseimgurl: 'https://lsxd-customcard-h5.oss-cn-hangzhou.aliyuncs.com/category_icon/'
- ,
- layout:1,
+ layout:3,
maskshow:false,
proname:'黄金爱奇艺',
promtshow:false,
promttip:'',
+ codebid:'',
account:'',
reaccount:'',
product_id:'',
productType:1,
placeholder:'请输入手机号',
iptshow:false,
+ gstatus:1,
popboxshow:false,
popboxtype:'兑换',
topImg:'',
+ exchangeCommity:{},//兑换选择的商品
bgcolor:'',
+ tiptext:'还没开始哟,兑换时间为2021-12-05 12:12:12至2021-01-01 12:12:12',
successTip:'兑换成功,请关注短信通知!'
}
},
@@ -166,7 +191,6 @@
this.topImg=sessionStorage.getItem('top_img');
// this.layout=sessionStorage.getItem('showTyle');
this.swiperDataList=JSON.parse(sessionStorage.getItem('goodsList'));
-
},
mounted() {
let self = this;
@@ -190,6 +214,7 @@
onSelected(item) {
this.proname=item.product_name;
this.product_id=item.product_id;
+ this.exchangeCommity=item;
},
// 单条弹框
openDialog() {
@@ -198,14 +223,32 @@
this.promtshow = false;
this.promttip = '';
}, 3000)
- },
- //兑换
- exchangeBtn(row){
- this.maskshow=true;
- this.iptshow=true;
- this.proname=row.product_name;
- this.product_id=row.product_id;
- this.productType=row.product_type;
+ },
+ //选择商品点击兑换
+ exchangeBtn(row=this.exchangeCommity){
+ this.codebid=row.code_batch_id;
+ let gstatus=row.available;
+ this.gstatus=gstatus;
+ if(gstatus==1){
+ this.maskshow=true;
+ this.iptshow=true;
+ this.proname=row.product_name;
+ this.product_id=row.product_id;
+ this.productType=row.product_type;
+ }else{
+ this.maskshow=true;
+ this.popboxshow=true;
+ this.popboxtype='提示';
+ if(gstatus==2){//未开始
+ this.tiptext='还没开始哟,兑换时间为'+row.begin_time+'至'+row.end_time;
+ }else if(gstatus==3){//已结束
+ this.tiptext='兑换码已过期,兑换时间为'+row.begin_time+'至'+row.end_time;
+ }else if(gstatus==4){//仅兑换一次
+ this.tiptext='亲,仅可兑换一次哦!';
+ }else if(gstatus==6){//无库存
+ this.tiptext='暂无库存,看看其他商品吧~';
+ }
+ }
},
//取消
cancelBtn(){
@@ -264,6 +307,7 @@
"key":sessionStorage.getItem('key'),
"product_id":this.product_id,
"account":this.account,
+ "code_batch_id":this.codebid
}
req.axiosPostusage('/key/usage',data).then(res=>{
if(res.code==200){
@@ -307,7 +351,7 @@
} else {
this.placeholder = "请输入手机号或QQ号";
}
- }
+ },
},
});