plus.navigator.createShortcut({
name: this.appItem.appName,
icon: uni.getStorageSync(JSON.stringify(this.appItem.logoUrl)),
toast: '',
extra: { appId: this.appItem.appId },
// extra: { appItem: JSON.stringify(this.appItem), path: '/1234' },
force: false,
}, function (e) {
uni.showToast({
title:'创建成功',
icon:'none'
});
});
onShow: function () {
console.error(plus.runtime.launcher,'plus.runtime.launcher;')
// #ifdef APP-PLUS
setTimeout(() => {
let args = plus.runtime.arguments;
console.warn(args,'app-onShow' )
if (args) {
if (uni.getStorageSync('LoginInfo')) {
let appId;
if (plus.os.name === 'iOS') {
appId = args.split('?appId=')[1];
} else {
appId = JSON.parse(args).appId;
}
appTool.getIdTokenAction().then(() => {
getThirdLink({ appId }).then((res) => {
let appItem = uni.getStorageSync('appItem');
const pages = getCurrentPages();
const currentPage = pages[pages.length - 1];
const currentRoute = currentPage.route;
if ((appItem.appId == res.appId && currentRoute == 'pages/webView/superWebview') || currentRoute == 'pages/preView/preView') {
if (currentRoute == 'pages/preView/preView') {
} else {
plus.runtime.arguments = null;
plus.runtime.arguments = '';
}
return;
}
appRouter.appJumpAction(res, 'mainView', 'app', this);
plus.runtime.arguments = null;
plus.runtime.arguments = '';
});
});
}
}
}, 100);
// #endif
}