diff --git a/src/core/libs/utils.js b/src/core/libs/utils.js index 7c2eb38..b4ce6db 100644 --- a/src/core/libs/utils.js +++ b/src/core/libs/utils.js @@ -154,11 +154,26 @@ function rpx2px(rpx) { return (rpx / 750) * windowWidth; } -function toPage(url, options) { - uni.navigateTo({ +function toPage(url, options, type) { + if (typeof type === "undefined") { + type = "navigate"; + } + let params = { ...{ url: url, }, ...options - }); + }; + switch (type) { + case "relaunch": + uni.reLaunch(params); + break; + case "redirect": + uni.redirectTo(params); + break; + case "navigate": + default: + uni.navigateTo(params); + break; + } } function toast(title, options) {