🐛 fix: 修复卡密页面bug

This commit is contained in:
wangsongsole 2024-01-10 10:20:51 +08:00
parent 3840abecc9
commit 56d8716e9a
1 changed files with 4 additions and 1 deletions

View File

@ -390,6 +390,10 @@
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)) {//单个商品直接进入详情页面
const product = res.data[0]; const product = res.data[0];
/* 满足3个条件进入此判断 仅兑换一次 在线查看卡密商品 则卡密页面不能返回 */
if (product.restrict == 1 && product.type == 1 && product.entity.card_show == 2) {
sessionStorage.setItem('backShow', 1);
}
/* 满足3个条件进入此判断 仅兑换一次 已兑换 在线查看卡密商品 */ /* 满足3个条件进入此判断 仅兑换一次 已兑换 在线查看卡密商品 */
if (product.exchange == 1 && product.restrict == 1 && product.type == 1 && product.entity.card_show == 2) { if (product.exchange == 1 && product.restrict == 1 && product.type == 1 && product.entity.card_show == 2) {
return req return req
@ -401,7 +405,6 @@
.then(({ data, code, }) => { .then(({ data, code, }) => {
if (code === 200) { if (code === 200) {
sessionStorage.setItem('orderNumber', data[0].order_number); sessionStorage.setItem('orderNumber', data[0].order_number);
sessionStorage.setItem('backShow', 1);
window.location.href = './coupon/lookCard.html'; window.location.href = './coupon/lookCard.html';
} }
}); });