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