From 9c1ec1ef2a9d59360e15ce976b2884fa82e4ac2f Mon Sep 17 00:00:00 2001 From: XiaoMo Date: Wed, 7 May 2025 22:37:21 +0800 Subject: [PATCH] =?UTF-8?q?feat(washing):=20=E8=B0=83=E6=95=B4=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E8=B7=B3=E8=BD=AC=E9=80=BB=E8=BE=91=E5=92=8C=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E6=97=B6=E9=95=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修改了 `washing` 页面的跳转逻辑,将 `switchTab` 和 `reLaunch` 替换为 `redirectTo`,以改善用户体验。同时,调整了提示信息的显示时长,确保用户有足够的时间阅读提示。 --- pages/washing/washing.js | 17 +++++++++-------- project.private.config.json | 7 +++++++ 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/pages/washing/washing.js b/pages/washing/washing.js index 3c50578..1ad7a06 100644 --- a/pages/washing/washing.js +++ b/pages/washing/washing.js @@ -18,18 +18,19 @@ Page({ */ onLoad(options) { var a = this; - e.request('/miniprogram/index/balance', {}, !0).then(function(res) { + e.request('/miniprogram/index/balance', {}, !0).then(function (res) { if (!res.data || !res.data.progressorder) { wx.showToast({ title: '没有进行中的订单', icon: 'none', - duration: 2000 + duration: 3000 }); setTimeout(() => { - wx.switchTab({ + // 跳转到首页 + wx.redirectTo({ url: '/pages/index/index' }); - }, 2000); + }, 1000); return; } @@ -47,17 +48,17 @@ Page({ if (remainingTime > 0) { a.countdown(); } - }).catch(function(err) { + }).catch(function (err) { wx.showToast({ title: '获取订单信息失败', icon: 'none', duration: 2000 }); setTimeout(() => { - wx.switchTab({ + wx.redirectTo({ url: '/pages/index/index' }); - }, 2000); + }, 1000); }); }, @@ -126,7 +127,7 @@ Page({ }); setTimeout(() => { wx.removeStorageSync('progressorder'); - wx.reLaunch({ + wx.redirectTo({ url: '/pages/index/index' }); }, 2000); diff --git a/project.private.config.json b/project.private.config.json index 900c8d4..16cd4f5 100644 --- a/project.private.config.json +++ b/project.private.config.json @@ -8,6 +8,13 @@ "condition": { "miniprogram": { "list": [ + { + "name": "pages/washing/washing", + "pathName": "pages/washing/washing", + "query": "", + "launchMode": "default", + "scene": null + }, { "name": "pages/washCodeDetail/washCodeDetail", "pathName": "pages/washCodeDetail/washCodeDetail",