feat(washing): 调整页面跳转逻辑和提示时长

修改了 `washing` 页面的跳转逻辑,将 `switchTab` 和 `reLaunch` 替换为 `redirectTo`,以改善用户体验。同时,调整了提示信息的显示时长,确保用户有足够的时间阅读提示。
This commit is contained in:
XiaoMo 2025-05-07 22:37:21 +08:00
parent a5fc1f38f6
commit 9c1ec1ef2a
2 changed files with 16 additions and 8 deletions

View File

@ -18,18 +18,19 @@ Page({
*/ */
onLoad(options) { onLoad(options) {
var a = this; 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) { if (!res.data || !res.data.progressorder) {
wx.showToast({ wx.showToast({
title: '没有进行中的订单', title: '没有进行中的订单',
icon: 'none', icon: 'none',
duration: 2000 duration: 3000
}); });
setTimeout(() => { setTimeout(() => {
wx.switchTab({ // 跳转到首页
wx.redirectTo({
url: '/pages/index/index' url: '/pages/index/index'
}); });
}, 2000); }, 1000);
return; return;
} }
@ -47,17 +48,17 @@ Page({
if (remainingTime > 0) { if (remainingTime > 0) {
a.countdown(); a.countdown();
} }
}).catch(function(err) { }).catch(function (err) {
wx.showToast({ wx.showToast({
title: '获取订单信息失败', title: '获取订单信息失败',
icon: 'none', icon: 'none',
duration: 2000 duration: 2000
}); });
setTimeout(() => { setTimeout(() => {
wx.switchTab({ wx.redirectTo({
url: '/pages/index/index' url: '/pages/index/index'
}); });
}, 2000); }, 1000);
}); });
}, },
@ -126,7 +127,7 @@ Page({
}); });
setTimeout(() => { setTimeout(() => {
wx.removeStorageSync('progressorder'); wx.removeStorageSync('progressorder');
wx.reLaunch({ wx.redirectTo({
url: '/pages/index/index' url: '/pages/index/index'
}); });
}, 2000); }, 2000);

View File

@ -8,6 +8,13 @@
"condition": { "condition": {
"miniprogram": { "miniprogram": {
"list": [ "list": [
{
"name": "pages/washing/washing",
"pathName": "pages/washing/washing",
"query": "",
"launchMode": "default",
"scene": null
},
{ {
"name": "pages/washCodeDetail/washCodeDetail", "name": "pages/washCodeDetail/washCodeDetail",
"pathName": "pages/washCodeDetail/washCodeDetail", "pathName": "pages/washCodeDetail/washCodeDetail",