解决c端bug

This commit is contained in:
red-deng-deng 2021-11-29 14:14:27 +08:00
parent 966bb4e006
commit cd4a4067a9
1 changed files with 13 additions and 6 deletions

View File

@ -116,8 +116,8 @@
<font :class="item.stock&&item.stock<0?'changegray':''">{{item.product_name}}</font>
</div>
<span v-if="item.available==1" :style="{'background':bgcolor?bgcolor:'#F98F5B'}"
@click="exchangeBtn(item)">兑换</span>
<span v-if="item.available!=1" :style="{'background':item.available==2?'#3E8EE2':'#CCCCCC'}"
@click="exchangeBtn(item)" >兑换</span>
<span v-if="item.available!=1" class="bindexchange" :class="item.available==2?'begin':''"
@click="exchangeBtn(item)">{{item.available==2?'即将开始':item.available==3?'已过期':item.available==4?'已兑换':'已兑完'}}</span>
</li>
</ul>
@ -133,7 +133,7 @@
</div>
<ul class="listcommity" v-if="goodsNum">
<li :class="item.stock&&item.stock<0?'changegray':''" v-for="(item,i) in swiperDataList" :key="i"
<li :class="item.stock&&item.stock<0||item.available!=1?'changegray':''" v-for="(item,i) in swiperDataList" :key="i"
@click="exchangeBtn(item)">
<div>
<span class="goodsIcon">
@ -210,7 +210,7 @@
data() {
return {
swiperDataList: [], //轮播
layout: 3,
layout: 1,
maskshow: false,
proname: '黄金爱奇艺',
promtshow: false,
@ -224,6 +224,7 @@
iptshow: false,
orderNo: '',
loading: true,
lastid:0,
gstatus: 1,
popboxshow: false,
popboxtype: '兑换',
@ -260,7 +261,8 @@
getGoods() {
let self = this;
let data = {
"token": sessionStorage.getItem('token')
"token": sessionStorage.getItem('token'),
"last_product_id":sessionStorage.getItem('lastid')|0,
}
req.axiosPostproducts('/key/products', data).then(res => {
if (res.code == 200) {
@ -328,6 +330,10 @@
this.tiptext = '亲,仅可兑换一次哦!';
} else if (gstatus == 6) { //无库存
this.tiptext = '暂无库存,看看其他商品吧~';
}else if (gstatus == 7) { //其他商品处于兑换中
this.tiptext = '当前商品不可兑换';
}else if (gstatus == 8) { //已兑换次数
this.tiptext = '当前商品不可兑换';
}
}
},
@ -396,11 +402,12 @@
"token":sessionStorage.getItem('token')
}
req.axiosPostusage('/key/usage', data).then(res => {
sessionStorage.setItem('lastid',self.product_id);
if (res.code == 200) {
// 查询订单接口
this.popboxtype = '成功';
this.popboxshow = true;
this.successTip = '兑换成功,请关注短信通知!';
} else {
this.popboxtype = '提示';