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({ ...@@ -51,7 +51,7 @@ Page({
tabClick(e) { tabClick(e) {
this.setData({ this.setData({
entryStatus: e?.detail || "", entryStatus: e?.detail || "",
pageNum: 1, currentPage: 1,
list: [], list: [],
nothing: false nothing: false
},() => { },() => {
......
...@@ -2,14 +2,6 @@ const _routeHooks = Symbol('_routeHooks') ...@@ -2,14 +2,6 @@ const _routeHooks = Symbol('_routeHooks')
const _query = Symbol('_query') const _query = Symbol('_query')
const _routerList = Symbol('_routerList') const _routerList = Symbol('_routerList')
import util from '../utils/util.js' 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 => { const generateRoutList = routerList => {
let _routerList = routerList let _routerList = routerList
try { try {
...@@ -36,17 +28,9 @@ class Router { ...@@ -36,17 +28,9 @@ class Router {
wx.onAppRoute && wx.onAppRoute &&
wx.onAppRoute(e => { wx.onAppRoute(e => {
const thisPage = this.getPageInstance() const thisPage = this.getPageInstance()
const routeKey = normalizeRoutePath(e.path) const thisRouter = this[_routerList].find(item => item.url === `/${e.path}`)
const thisRouter = this[_routerList].find( // console.log(thisRouter)
item => normalizeRoutePath(item.url) === routeKey if (thisRouter.isTab) {
)
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) {
wx.showTabBar({ wx.showTabBar({
success(result) { success(result) {
// console.log(result) // console.log(result)
......
function collectWxPagePaths() { export default __wxConfig.pages.map(item => ({
const main = __wxConfig.pages || [] url: `/${item}`,
const subPkgs = __wxConfig.subPackages || __wxConfig.subpackages || [] name: item.split('/').pop(),
const subPaths = subPkgs.flatMap(pkg => { parent: item.split('/')[0]
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]
}))
\ No newline at end of file \ 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!