bug修复,及体验优化
This commit is contained in:
@@ -490,6 +490,18 @@ const obj2Params = (obj = {}, encode = false) => {
|
||||
return result.join('&');
|
||||
};
|
||||
|
||||
/**
|
||||
* 标记某条需求需要在列表页刷新状态
|
||||
* 用 globalData 传递,不依赖页面栈深度(backAndRefresh 的 delta 在多层跳转后容易算错上一页)
|
||||
* @param {number|string} demandId 需求ID
|
||||
*/
|
||||
function markDemandRefresh(demandId) {
|
||||
const app = getApp();
|
||||
if (app && app.globalData) {
|
||||
app.globalData.refreshDemandId = Number(demandId) || 0;
|
||||
}
|
||||
}
|
||||
|
||||
function backAndRefresh(delta = 1, freshField = 'freshPage') {
|
||||
const pages = getCurrentPages(); // 获取页面栈
|
||||
const prevPage = pages[pages.length - (delta + 1)]; // 上一页实例
|
||||
@@ -567,6 +579,7 @@ module.exports = {
|
||||
transferBoxShadow,
|
||||
obj2Params,
|
||||
backAndRefresh,
|
||||
markDemandRefresh,
|
||||
checkSubscriptionsSetting,
|
||||
getUid
|
||||
};
|
||||
Reference in New Issue
Block a user