9.20/3
This commit is contained in:
@@ -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()
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user