diff --git a/exchange.html b/exchange.html index 0ed400d..92b9bd7 100644 --- a/exchange.html +++ b/exchange.html @@ -75,7 +75,8 @@
订单
@@ -185,6 +186,7 @@ this.goodsShow = goods_desc.length > 0 ? goods_desc : [goodsInform.show_url]; this.detailUrl = goodsInform.detail_url ? goodsInform.detail_url : ''; this.productType = goodsDetail.entity.account_type; + /* 区分卡密短信 */ if (goodsInform.product_type === 2 && goodsInform.card_show == 1) { this.productType = 1; diff --git a/homepage.html b/homepage.html index 02c60a1..d7c9b75 100644 --- a/homepage.html +++ b/homepage.html @@ -388,9 +388,26 @@ self.goodsShow = res.data.length > 1; let ua = window.navigator.userAgent.toLowerCase();/* 判断是否web-view打开 */ if ((res.data && res.data.length == 1) || /miniProgram/i.test(ua)) {//单个商品直接进入详情页面 - sessionStorage.setItem('goodsInfo', JSON.stringify(res.data[0])); - this.toPage(res.data[0]); - return false; + const product = 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; + } } else if (res.data && res.data.length >= 1) { self.goodsNum = true; self.onSelected(res.data[0]);