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",