feat: 新增当单个在线查看卡密商品、只能兑换一次时且已兑换的逻辑

This commit is contained in:
wangsongsole 2024-01-09 17:53:34 +08:00
parent 3f16ee63ae
commit 00e728ca48
2 changed files with 23 additions and 4 deletions

View File

@ -75,7 +75,8 @@
<div v-html="describe.content" class="goodsTip" v-show="describe.type==3&&describe.content"></div> <div v-html="describe.content" class="goodsTip" v-show="describe.type==3&&describe.content"></div>
</div> </div>
<div class="e-btn-box"> <div class="e-btn-box">
<div class="order-box" v-if="!backAble&&goodInfo.product_type===2&&goodInfo.card_show==2"> <div class="order-box"
v-if="!backAble&&goodInfo.product_type===2&&goodInfo.card_show==2&&goodsDetail.restrict>1">
<img src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/toOrder.png" alt="" <img src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/toOrder.png" alt=""
@click="()=>{location.href='./order.html'}"> @click="()=>{location.href='./order.html'}">
<p>订单</p> <p>订单</p>
@ -185,6 +186,7 @@
this.goodsShow = goods_desc.length > 0 ? goods_desc : [goodsInform.show_url]; this.goodsShow = goods_desc.length > 0 ? goods_desc : [goodsInform.show_url];
this.detailUrl = goodsInform.detail_url ? goodsInform.detail_url : ''; this.detailUrl = goodsInform.detail_url ? goodsInform.detail_url : '';
this.productType = goodsDetail.entity.account_type; this.productType = goodsDetail.entity.account_type;
/* 区分卡密短信 */ /* 区分卡密短信 */
if (goodsInform.product_type === 2 && goodsInform.card_show == 1) { if (goodsInform.product_type === 2 && goodsInform.card_show == 1) {
this.productType = 1; this.productType = 1;

View File

@ -388,9 +388,26 @@
self.goodsShow = res.data.length > 1; self.goodsShow = res.data.length > 1;
let ua = window.navigator.userAgent.toLowerCase();/* 判断是否web-view打开 */ let ua = window.navigator.userAgent.toLowerCase();/* 判断是否web-view打开 */
if ((res.data && res.data.length == 1) || /miniProgram/i.test(ua)) {//单个商品直接进入详情页面 if ((res.data && res.data.length == 1) || /miniProgram/i.test(ua)) {//单个商品直接进入详情页面
sessionStorage.setItem('goodsInfo', JSON.stringify(res.data[0])); const product = res.data[0];
this.toPage(res.data[0]); /* 满足3个条件进入此判断 仅兑换一次 已兑换 在线查看卡密商品 */
if (product.exchange == 1 && product.restrict == 1 && product.type == 1 && product.entity.card_show == 2) {
return req
.axiosGet(`/key/order/queryList`, {
token: data.token,
page: 1,
limit: 10
})
.then(({ data, code, }) => {
if (code === 200) {
localStorage.setItem('orderNumber', data[0].order_number);
window.location.href = './coupon/lookCard.html';
}
});
} else {
sessionStorage.setItem('goodsInfo', JSON.stringify(product));
this.toPage(product);
return false; return false;
}
} else if (res.data && res.data.length >= 1) { } else if (res.data && res.data.length >= 1) {
self.goodsNum = true; self.goodsNum = true;
self.onSelected(res.data[0]); self.onSelected(res.data[0]);