This commit is contained in:
2025-09-20 18:03:22 +08:00
parent d857eca39f
commit d343a1389a
35 changed files with 330 additions and 141 deletions

View File

@@ -203,8 +203,11 @@
},
onLoad(query) {
try {
const biz = query && query.biz
const type = query && query.type
// 1) 优先读取本地预设参数(来自首页九宫格)
const preset = uni.getStorageSync('ORDER_DEFAULT_PARAMS') || {}
// 2) 再读取路由 query 作为兜底(兼容历史调用)
const biz = (query && query.biz) || preset.biz
const type = (query && query.type) || preset.type
if (biz === 'sale' || biz === 'purchase' || biz === 'income' || biz === 'expense') {
this.biz = biz
}
@@ -214,6 +217,8 @@
if (this.biz === 'purchase' && (type === 'in' || type === 'return' || type === 'pay')) {
this.purchaseType = type
}
// 一次性参数,读取后清空
try { uni.removeStorageSync('ORDER_DEFAULT_PARAMS') } catch(_) {}
} catch(e) {}
this.fetchCategories()
},