From d315bb2ab8e1e7b3e46d65824b0811eaf8d3b15a Mon Sep 17 00:00:00 2001 From: lf <1534621107@qq.com> Date: Fri, 14 Jun 2024 09:38:21 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8E=B7=E5=8F=96activity=5Fcode=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/coupon/product.vue | 2 +- src/pages/index/index.vue | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/pages/coupon/product.vue b/src/pages/coupon/product.vue index a5a6455..6e03352 100644 --- a/src/pages/coupon/product.vue +++ b/src/pages/coupon/product.vue @@ -50,7 +50,7 @@ const exchange = () => { uni.hideLoading() // uni.stopPullDownRefresh(); uni.navigateTo({ - url: '/pages/coupon/index', + url: '/pages/coupon/index?activity_code=' + route.activity_code, }) } else { uni.showToast({ diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue index a915364..0504d53 100644 --- a/src/pages/index/index.vue +++ b/src/pages/index/index.vue @@ -76,9 +76,13 @@ const getUrlParm = () => { } const getUrlPathName = () => { - const url = window.location.pathname.length > 1 ? window.location.pathname : window.location.href - const str = url.split('/') - return str[str.length - 1] || '' + const url = window.location.href + const str = url.split('#/')[1] + if (str.indexOf('/') === -1) { + return str || '' + } else { + return str.split('/')[0] + } } window.parent.addEventListener('message', function (event) {