Commit e41fc942 by 张立顺

Merge branch 'SAAS+V5.7.1' of http://192.168.3.233:8090/saas_plus/dj-car-boutiqu…

…e-work-wechat into SAAS+V5.7.1
2 parents dde6c79d 2471c803
......@@ -51,7 +51,7 @@ Page({
tabClick(e) {
this.setData({
entryStatus: e?.detail || "",
pageNum: 1,
currentPage: 1,
list: [],
nothing: false
},() => {
......
......@@ -2,14 +2,6 @@ const _routeHooks = Symbol('_routeHooks')
const _query = Symbol('_query')
const _routerList = Symbol('_routerList')
import util from '../utils/util.js'
/** 与 tabBar 等处一致:去掉前导 /、.html 后缀,避免开发与真机 path 形态不一致导致 find 失败 */
function normalizeRoutePath(p) {
if (p == null || p === '') return ''
return String(p)
.replace(/^\/+/, '')
.replace(/\.html$/i, '')
}
const generateRoutList = routerList => {
let _routerList = routerList
try {
......@@ -36,17 +28,9 @@ class Router {
wx.onAppRoute &&
wx.onAppRoute(e => {
const thisPage = this.getPageInstance()
const routeKey = normalizeRoutePath(e.path)
const thisRouter = this[_routerList].find(
item => normalizeRoutePath(item.url) === routeKey
)
try {
const app = typeof getApp === 'function' ? getApp() : null
if (!thisRouter && app && app.globalData && app.globalData.routeDebug) {
console.warn('[router] onAppRoute 未命中', e.path, 'normalized:', routeKey)
}
} catch (err) { }
if (thisRouter?.isTab) {
const thisRouter = this[_routerList].find(item => item.url === `/${e.path}`)
// console.log(thisRouter)
if (thisRouter.isTab) {
wx.showTabBar({
success(result) {
// console.log(result)
......
function collectWxPagePaths() {
const main = __wxConfig.pages || []
const subPkgs = __wxConfig.subPackages || __wxConfig.subpackages || []
const subPaths = subPkgs.flatMap(pkg => {
const root = (pkg.root || '').replace(/\/$/, '')
return (pkg.pages || []).map(p => {
const page = String(p || '').replace(/^\//, '')
return root ? `${root}/${page}` : page
})
})
return [...main, ...subPaths]
}
export default collectWxPagePaths().map(item => ({
url: `/${item}`,
name: item.split('/').pop(),
parent: item.split('/')[0]
}))
export default __wxConfig.pages.map(item => ({
url: `/${item}`,
name: item.split('/').pop(),
parent: item.split('/')[0]
}))
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!