From 00e728ca486b868a04dfeaf6af9a49b18041800e Mon Sep 17 00:00:00 2001 From: wangsongsole Date: Tue, 9 Jan 2024 17:53:34 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat:=20=E6=96=B0=E5=A2=9E=E5=BD=93?= =?UTF-8?q?=E5=8D=95=E4=B8=AA=E5=9C=A8=E7=BA=BF=E6=9F=A5=E7=9C=8B=E5=8D=A1?= =?UTF-8?q?=E5=AF=86=E5=95=86=E5=93=81=E3=80=81=E5=8F=AA=E8=83=BD=E5=85=91?= =?UTF-8?q?=E6=8D=A2=E4=B8=80=E6=AC=A1=E6=97=B6=E4=B8=94=E5=B7=B2=E5=85=91?= =?UTF-8?q?=E6=8D=A2=E7=9A=84=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- exchange.html | 4 +++- homepage.html | 23 ++++++++++++++++++++--- 2 files changed, 23 insertions(+), 4 deletions(-) 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]);