From c629562190550564673049cd9f0dd997087708b2 Mon Sep 17 00:00:00 2001 From: ZF sun <34314687@qq.com> Date: Mon, 29 Jun 2026 08:40:27 +0800 Subject: [PATCH] =?UTF-8?q?refactor(login-redirect):=20=E7=BB=9F=E4=B8=80?= =?UTF-8?q?=E7=99=BB=E5=BD=95=E8=B7=B3=E8=BD=AC=E9=80=BB=E8=BE=91=EF=BC=8C?= =?UTF-8?q?=E6=8F=90=E5=8F=96=E5=85=AC=E5=85=B1=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 将多处手动调用登录弹窗的逻辑替换为公共的redirectTologin方法,简化代码并统一跳转处理流程 --- components-diy/diy-listmenu.vue | 2 +- pages_order/list.vue | 13 +++++-------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/components-diy/diy-listmenu.vue b/components-diy/diy-listmenu.vue index f90cd01..9a50c77 100644 --- a/components-diy/diy-listmenu.vue +++ b/components-diy/diy-listmenu.vue @@ -64,7 +64,7 @@ export default { redirectTo(link) { if (link.wap_url) { if (this.$util.getCurrRoute() == this.$util.MEMBER_PAGE_URL && !this.storeToken) { - this.$refs?.login?.open(link.wap_url); + this.redirectTologin(link.wap_url) return; } } diff --git a/pages_order/list.vue b/pages_order/list.vue index d54a78f..aef7d3a 100644 --- a/pages_order/list.vue +++ b/pages_order/list.vue @@ -205,17 +205,14 @@ export default { if (option.order_id) this.order_id = option.order_id; }, onShow() { + if (!this.storeToken) { + this.redirectTologinOnShowLifecycle('/pages_order/list?status=' + this.orderStatus); + return; + } this.isIphoneX = this.$util.uniappIsIPhoneX(); this.getEvaluateConfig(); this.getOrderStatus(); - - if (this.storeToken) { - if (this.$refs.mescroll) this.$refs.mescroll.refresh(); - } else { - this.$nextTick(() => { - this.$refs?.login?.open('/pages_order/list?status=' + this.orderStatus, 'redirectTo'); - }) - } + if (this.$refs.mescroll) this.$refs.mescroll.refresh(); }, onUnload() { if (!this.storeToken && this.$refs.login) this.$refs.login.cancelCompleteInfo();