图片功能url实现
This commit is contained in:
@@ -44,4 +44,24 @@ if (typeof uni !== 'undefined' && typeof uni.connectSocket === 'function') {
|
||||
return task
|
||||
}
|
||||
}
|
||||
// #endif
|
||||
|
||||
// 全局安全返回:首屏无法后退时自动回到首页 tab(微信小程序)
|
||||
// #ifdef MP-WEIXIN
|
||||
if (typeof uni !== 'undefined' && typeof uni.navigateBack === 'function') {
|
||||
const _navigateBack = uni.navigateBack
|
||||
uni.navigateBack = function(params = {}) {
|
||||
try {
|
||||
const pages = typeof getCurrentPages === 'function' ? getCurrentPages() : []
|
||||
const maxDelta = pages.length > 0 ? (pages.length - 1) : 0
|
||||
const d = Number(params.delta || 1)
|
||||
if (maxDelta >= 1 && d <= maxDelta) {
|
||||
return _navigateBack.call(this, params)
|
||||
}
|
||||
return uni.switchTab({ url: '/pages/index/index' })
|
||||
} catch (e) {
|
||||
return uni.switchTab({ url: '/pages/index/index' })
|
||||
}
|
||||
}
|
||||
}
|
||||
// #endif
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
16
frontend/unpackage/dist/dev/mp-weixin/app.js
vendored
16
frontend/unpackage/dist/dev/mp-weixin/app.js
vendored
@@ -62,6 +62,22 @@ if (typeof common_vendor.index !== "undefined" && typeof common_vendor.index.con
|
||||
return task;
|
||||
};
|
||||
}
|
||||
if (typeof common_vendor.index !== "undefined" && typeof common_vendor.index.navigateBack === "function") {
|
||||
const _navigateBack = common_vendor.index.navigateBack;
|
||||
common_vendor.index.navigateBack = function(params = {}) {
|
||||
try {
|
||||
const pages = typeof getCurrentPages === "function" ? getCurrentPages() : [];
|
||||
const maxDelta = pages.length > 0 ? pages.length - 1 : 0;
|
||||
const d = Number(params.delta || 1);
|
||||
if (maxDelta >= 1 && d <= maxDelta) {
|
||||
return _navigateBack.call(this, params);
|
||||
}
|
||||
return common_vendor.index.switchTab({ url: "/pages/index/index" });
|
||||
} catch (e) {
|
||||
return common_vendor.index.switchTab({ url: "/pages/index/index" });
|
||||
}
|
||||
};
|
||||
}
|
||||
createApp().app.mount("#app");
|
||||
exports.createApp = createApp;
|
||||
//# sourceMappingURL=../.sourcemap/mp-weixin/app.js.map
|
||||
|
||||
Reference in New Issue
Block a user