提交 c14c4eb5 编写于 作者: Q qiang

Merge branch 'dev' into alpha

......@@ -75,8 +75,10 @@
"prompt.run.devtools.mp--kuaishou": "Kuaishou Mini Program Devtools",
"prompt.run.devtools.mp-lark": "Lark Mini Program Devtools",
"prompt.run.devtools.mp-qq": "QQ Mini Program Devtools",
"prompt.run.devtools.mp-toutiao": "ByteDance Mini Program Devtools",
"prompt.run.devtools.mp-toutiao": "Douyin Mini Program Devtools",
"prompt.run.devtools.mp-weixin": "Weixin Mini Program Devtools",
"prompt.run.devtools.mp-jd": "Jingdong Mini Program Devtools",
"prompt.run.devtools.mp-xhs": "Xiaohongshu Mini Program Devtools",
"prompt.run.devtools.quickapp-webview": "Quick App Alliance Devtools | Huawei Quick App Devtools",
"prompt.run.devtools.quickapp-webview-huawei": "Huawei Quick App Devtools",
"prompt.run.devtools.quickapp-webview-union": "Quick App Alliance Devtools"
......
......@@ -75,8 +75,10 @@
"prompt.run.devtools.mp--kuaishou": "快手开发者工具",
"prompt.run.devtools.mp-lark": "飞书开发者工具",
"prompt.run.devtools.mp-qq": "QQ小程序开发者工具",
"prompt.run.devtools.mp-toutiao": "字节跳动开发者工具",
"prompt.run.devtools.mp-toutiao": "抖音开发者工具",
"prompt.run.devtools.mp-weixin": "微信开发者工具",
"prompt.run.devtools.mp-jd": "京东开发者工具",
"prompt.run.devtools.mp-xhs": "小红书开发者工具",
"prompt.run.devtools.quickapp-webview": "快应用联盟开发者工具 | 华为快应用开发者工具",
"prompt.run.devtools.quickapp-webview-huawei": "华为快应用开发者工具",
"prompt.run.devtools.quickapp-webview-union": "快应用联盟开发者工具"
......
function initPushNotification() {
// 仅 App 端
if (typeof plus !== 'undefined' && plus.push) {
plus.globalEvent.addEventListener('newPath', ({ path }) => {
if (!path) {
return;
}
// 指定的页面为当前页面
const pages = getCurrentPages();
const currentPage = pages[pages.length - 1];
if (currentPage &&
currentPage.$page &&
currentPage.$page.fullPath === path) {
return;
}
// 简单起见,先尝试 navigateTo 跳转,失败后,再尝试 tabBar 跳转
uni.navigateTo({
url: path,
fail(res) {
if (res.errMsg.indexOf('tabbar') > -1) {
uni.switchTab({
url: path,
fail(res) {
console.error(res.errMsg);
},
});
}
else {
console.error(res.errMsg);
}
},
});
});
}
function initPushNotification() {
// 仅 App 端
if (typeof plus !== 'undefined' && plus.push) {
plus.globalEvent.addEventListener('newPath', ({ path }) => {
if (!path) {
return;
}
// 指定的页面为当前页面
const pages = getCurrentPages();
const currentPage = pages[pages.length - 1];
if (currentPage &&
currentPage.$page &&
currentPage.$page.fullPath === path) {
return;
}
// 简单起见,先尝试 navigateTo 跳转,失败后,再尝试 tabBar 跳转
uni.navigateTo({
url: path,
fail(res) {
if (res.errMsg.indexOf('tabbar') > -1) {
uni.switchTab({
url: path,
fail(res) {
console.error(res.errMsg);
},
});
}
else {
console.error(res.errMsg);
}
},
});
});
}
}
// @ts-expect-error
uni.invokePushCallback({
type: 'enabled',
offline: true,
});
Promise.resolve().then(() => {
initPushNotification();
plus.push.setAutoNotification && plus.push.setAutoNotification(false);
// @ts-expect-error
uni.invokePushCallback({
type: 'enabled',
offline: true,
});
Promise.resolve().then(() => {
initPushNotification();
plus.push.setAutoNotification && plus.push.setAutoNotification(false);
});
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册