feat(washing): 调整页面跳转逻辑和提示时长
修改了 `washing` 页面的跳转逻辑,将 `switchTab` 和 `reLaunch` 替换为 `redirectTo`,以改善用户体验。同时,调整了提示信息的显示时长,确保用户有足够的时间阅读提示。
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user