新增营销系统、分销系统、会员功能、门店、提现功能
This commit is contained in:
@ -99,12 +99,13 @@ export const useRouter = () => {
|
||||
const currentPageList = getCurrentPageList();
|
||||
// 如果页面栈,说明只有一个页面,直接重定向到首页
|
||||
if (currentPageList.length === 1) {
|
||||
pushToTab({url: '/pages/index/index'})
|
||||
pushToTab({url: '/root/index/index'})
|
||||
return
|
||||
}
|
||||
uni.navigateBack({
|
||||
...options,
|
||||
success: () => {
|
||||
uni.$emit('update', {msg: '页面更新'})
|
||||
resolve(true)
|
||||
},
|
||||
fail: (error) => {
|
||||
@ -130,13 +131,25 @@ export const useRouter = () => {
|
||||
function getParams(options) {
|
||||
if (typeof options !== 'object') return {}
|
||||
if (!options[PARAMS_KEY]) return {}
|
||||
console.log('参数原始-----',options[PARAMS_KEY])
|
||||
console.log('参数原始-----', options[PARAMS_KEY])
|
||||
// #ifdef MP-WEIXIN
|
||||
// console.log(typeof options[PARAMS_KEY],options[PARAMS_KEY],decodeURIComponent(options[PARAMS_KEY]))
|
||||
// #endif
|
||||
return JSON.parse(decodeURIComponent(options[PARAMS_KEY]));
|
||||
}
|
||||
|
||||
/**
|
||||
* 从url获取跳转页参数解析对象
|
||||
* @returns {object}
|
||||
*/
|
||||
function getUrlParams() {
|
||||
let pageArr = getCurrentPages();//获取应用页面栈
|
||||
let currentPagePath = pageArr[pageArr.length - 1];//获取当前页面信息
|
||||
const options = currentPagePath.options ? currentPagePath.options : currentPagePath.$page.options
|
||||
if (!options[PARAMS_KEY]) return {}
|
||||
return JSON.parse(decodeURIComponent(options[PARAMS_KEY]));
|
||||
}
|
||||
|
||||
/**
|
||||
* 预加载页面
|
||||
* @param {string} url 路径
|
||||
@ -190,6 +203,7 @@ export const useRouter = () => {
|
||||
pushToTab,
|
||||
goBack,
|
||||
getParams,
|
||||
getUrlParams,
|
||||
preLoad,
|
||||
getCurrentPage,
|
||||
getCurrentPageList
|
||||
|
Reference in New Issue
Block a user