💊 fix: 修复bug

This commit is contained in:
wangsongsole 2023-06-29 16:03:24 +08:00
parent 00197db102
commit 74e2fc29e7
3 changed files with 22 additions and 11 deletions

View File

@ -15,7 +15,8 @@
<link rel="stylesheet" href="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/css/homepage2_0.css?v=2">
<link rel="stylesheet" href="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/css/loading.css">
<script src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/js/loading.js"></script>
<script src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/js/api2_0.js"></script>
<!-- <script src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/js/api2_0.js"></script> -->
<script src="./api2_0.js"></script>
</head>
<style scoped>
* {
@ -71,17 +72,19 @@
<div class="imgbox">
<!-- type :1 兑换码 2:立减金,channel:1支付宝2微信 -->
<img class="le-img" :src="distinguishLogo(item)"
:class="(item.stock&&item.stock<0)||(item.available!=1)&&(item.available!=2?'changegray':'')"></img>
:class="(item.available===1||(item.type===3&&item.available===8))?'':'changegray'"></img>
</div>
<div class="item-name" v-html="item.type==1?item.entity.product_name:item.entity.batch_goods_name"
:class="(item.stock&&item.stock<0)||(item.available!=1)&&(item.available!=2?'changegray':'')">
<div class="item-name"
:class="(item.available===1||(item.type===3&&item.available===8))?'':'changegray'">
{{item.type==1?item.entity.product_name:item.entity.batch_goods_name}}
</div>
</div>
</div>
</div>
</div>
<!-- 立即兑换 -->
<div class="exchangeBtn" :class="gstatus!=1?'bottomBtn noexchangeBtn':''"
<div class="exchangeBtn"
:class="(gstatus===1||(exchangeCommity.type===3&&gstatus===8))?'':'bottomBtn noexchangeBtn'"
:style="{'background': bgcolor,'color':ftcolor}" @click="exchangeBtn()">
立即兑换
</div>
@ -100,8 +103,8 @@
<li v-for="(item,i) in swiperDataList" :key="i" @click="exchangeBtn(item)">
<div>
<img :src="distinguishLogo(item)" alt=""
:class="item.stock&&item.stock<0||item.available!=1&&item.available!=2?'changegray':''">
<font :class="item.stock&&item.stock<0||item.available!=1&&item.available!=2?'changegray':''">
:class="(item.available===1||(item.type===3&&item.available===8))?'':'changegray'">
<font :class="(item.available===1||(item.type===3&&item.available===8))?'':'changegray'">
{{item.type==1?item.entity.product_name:item.entity.batch_goods_name}}</font>
</div>
<span class="goodsStatus">
@ -130,7 +133,7 @@
</div>
<ul class="listcommity" v-if="goodsNum">
<li :class="item.stock&&item.stock<0||item.available!=1&&item.available!=2?'changegray':''"
<li :class="(item.available===1||(item.type===3&&item.available===8))?'':'changegray'"
v-for="(item,i) in swiperDataList" :key="i" @click="exchangeBtn(item)">
<div>
<span class="goodsIcon">
@ -192,6 +195,7 @@
</div>
</body>
<script>
/***************************** type 1:直冲 2:立减金 3:红包 *****************************/
new Vue({
el: '#homepage',
data () {
@ -427,11 +431,15 @@
});
}
},
//选择商品点击兑换
exchangeBtn (row = this.exchangeCommity) {
let gstatus = row.available;
this.gstatus = gstatus;
if (gstatus == 1) {
/* 直冲、立减金商品状态为 1 时可兑换。
* 红包商品状态为 1 8 时也可兑换
*/
if (gstatus == 1 || (row.type === 3 && [1, 8].includes(row.available))) {
// 跳转商品详情页面
if (this.showType == 1) { //白名单
localStorage.setItem('token', row.token);
@ -446,6 +454,7 @@
this.tiptext = product_status(gstatus, row);
}
},
//关闭,关闭弹框
closeBtn () {
this.popboxshow = false;
@ -510,7 +519,8 @@
if (type == 3) {
window.location.replace("./redPackets.html");
}
}
},
}
})
</script>

View File

@ -1173,6 +1173,7 @@ img.changegray {
}
.weekTime > li {
text-align: center;
width: 30%;
margin: 0;
}

View File

@ -12,7 +12,7 @@
</script>
<!-- <script src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/js/api2_0.js"></script> -->
<script src="./api2_0.js"></script>
<link rel="stylesheet" href="./redPackets.css" />
<link rel="stylesheet" href="./homepage2_0.css" />
<script src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/common/modelPop.js"></script>
<style>
* {