From d46fb5460b33bd8be17cd77072a0455fbb30bd27 Mon Sep 17 00:00:00 2001 From: zhangds Date: Wed, 28 Feb 2024 10:28:46 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=AE=A2=E5=8D=95url?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/index.html b/index.html index 8b912e5..c606d3a 100644 --- a/index.html +++ b/index.html @@ -168,13 +168,13 @@ /** TODO: 判断是否是包码逻辑 **/ if (res.data.settlement_data && res.data.settlement_data.settlement_type > 0) { - self.goToPackKey({ token: res.data.token, settlement_data: res.data.settlement_data }); + self.goToPackKey({ token: res.data.token, settlement_data: res.data.settlement_data }, 1); } else { let clr = setTimeout(() => { if (this.pageType === 4 || this.pageType === 8) { - locationReplace('/coupon/couponCollection.html'); + window.location.replace('/coupon/couponCollection.html'); } else { - locationReplace('/homepage.html'); + window.location.replace('/homepage.html'); } clearTimeout(clr); }, 1000); @@ -223,7 +223,7 @@ }, methods: { // 判断是否是包码 跳转对应的包码页面 **** - goToPackKey(data) { + goToPackKey(data, type) { // 包码打开结算 if (!data.settlement_data.is_settlement && data.settlement_data.settlement_type === 2) { settlementFun(data.token, data.settlement_data.settlement_type); @@ -232,8 +232,14 @@ sessionStorage.setItem("bm_auth", JSON.stringify(data)); setTimeout(() => { - // 跳转包码页面 - window.location.href = '/packkey/bm-index.html'; + if (type) { + // 跳转包码页面 + window.location.replace("/packkey/bm-index.html"); + } else { + // 跳转包码页面 + window.location.href = '/packkey/bm-index.html'; + } + }, 300) }, @@ -357,18 +363,13 @@ localStorage.setItem('getTokenList', JSON.stringify(getTokenList)); this.openDialog('正在加载商品...'); localStorage.setItem('entryLink', window.location.href);//存储起始页链接 - /** TODO: 判断是否是包码逻辑 **/ - if (res.data.settlement_data && res.data.settlement_data.settlement_type > 0) { - self.goToPackKey({ token: res.data.token, settlement_data: res.data.settlement_data }); - } else { - setTimeout(() => { - if (this.pageType === 4 || this.pageType === 8) { - window.location.href = './coupon/couponCollection.html'; - } else { - window.location.href = './homepage.html'; - } - }, 1000); - } + setTimeout(() => { + if (this.pageType === 4 || this.pageType === 8) { + window.location.href = './coupon/couponCollection.html'; + } else { + window.location.href = './homepage.html'; + } + }, 1000); } else { self.openErrorDialog(self.tiptext);