111
This commit is contained in:
parent
1785e9309e
commit
f4c8df1950
58
App.vue
58
App.vue
@ -22,32 +22,32 @@ export default {
|
|||||||
uni.setStorageSync("userInfo", options.referrerInfo.extraData.userInfo);
|
uni.setStorageSync("userInfo", options.referrerInfo.extraData.userInfo);
|
||||||
//getApp({allowDefault: true}).globalData.apiHost = options.referrerInfo.extraData.apiHost;
|
//getApp({allowDefault: true}).globalData.apiHost = options.referrerInfo.extraData.apiHost;
|
||||||
}
|
}
|
||||||
// if (
|
if (
|
||||||
// options &&
|
options &&
|
||||||
// options.referrerInfo.extraData &&
|
options.referrerInfo.extraData &&
|
||||||
// options.referrerInfo.extraData.targetPath
|
options.referrerInfo.extraData.targetPath
|
||||||
// ) {
|
) {
|
||||||
// uni.navigateTo({
|
uni.navigateTo({
|
||||||
// url: options.referrerInfo.extraData.targetPath,
|
url: options.referrerInfo.extraData.targetPath,
|
||||||
// });
|
});
|
||||||
// }
|
}
|
||||||
|
|
||||||
console.log("app传递登录信息onLaunch-------------------");
|
console.log("app传递登录信息onLaunch-------------------");
|
||||||
try {
|
try {
|
||||||
// #ifdef APP
|
// #ifdef APP
|
||||||
// uni.onNativeEventReceive((event, data) => {
|
uni.onNativeEventReceive((event, data) => {
|
||||||
// console.log("app传递登录信息-------------------");
|
console.log("event", event);
|
||||||
// console.log("event数据");
|
console.log("data", data);
|
||||||
// console.log(event);
|
if (event.indexOf("clearToken") > -1) {
|
||||||
// console.log("data数据");
|
uni.setStorageSync("AUTH_TOKEN_App", "");
|
||||||
// console.log(data);
|
plus.runtime.quit();
|
||||||
// if (event.indexOf("loginInfo") > -1) {
|
}
|
||||||
// uni.setStorageSync("DEV_AUTH_TOKEN_App", data.token);
|
if(event.indexOf("goPage") > -1){
|
||||||
// uni.setStorageSync("userInfo", data.userInfo);
|
uni.navigateTo({
|
||||||
// console.log("获取token数据");
|
url: data,
|
||||||
// console.log(uni.getStorageSync("DEV_AUTH_TOKEN_App"));
|
});
|
||||||
// }
|
}
|
||||||
// });
|
});
|
||||||
// #endif
|
// #endif
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log("app传递登录信息error-------------------");
|
console.log("app传递登录信息error-------------------");
|
||||||
@ -117,19 +117,7 @@ export default {
|
|||||||
// }
|
// }
|
||||||
// }, 1000)
|
// }, 1000)
|
||||||
|
|
||||||
uni.onNativeEventReceive((event, data) => {
|
|
||||||
console.log("event", event);
|
|
||||||
console.log("data", data);
|
|
||||||
if (event.indexOf("clearToken") > -1) {
|
|
||||||
uni.setStorageSync("AUTH_TOKEN_App", "");
|
|
||||||
plus.runtime.quit();
|
|
||||||
}
|
|
||||||
if(event.indexOf("goPage") > -1){
|
|
||||||
uni.navigateTo({
|
|
||||||
url: data,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
let main = plus.android.runtimeMainActivity();
|
let main = plus.android.runtimeMainActivity();
|
||||||
//为了防止快速点按返回键导致程序退出重写quit方法改为隐藏至后台
|
//为了防止快速点按返回键导致程序退出重写quit方法改为隐藏至后台
|
||||||
plus.runtime.quit = function () {
|
plus.runtime.quit = function () {
|
||||||
|
|||||||
@ -398,17 +398,27 @@ const viewGuideline = (cell) => {
|
|||||||
console.log(downloadTasks.value);
|
console.log(downloadTasks.value);
|
||||||
downloadTasks.value.forEach(item => {
|
downloadTasks.value.forEach(item => {
|
||||||
if(item.id == cell.uuid) {
|
if(item.id == cell.uuid) {
|
||||||
uni.openDocument({
|
plus.runtime.openFile(item.localPath, function(e) {
|
||||||
filePath: item.localPath,
|
console.log('打开成功');
|
||||||
fileType: 'pdf',
|
}, function(e) {
|
||||||
success: () => console.log('打开成功'),
|
|
||||||
fail: (err) => {
|
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: err,
|
title: '打开失败:' + e.message,
|
||||||
icon: "none",
|
icon: "none",
|
||||||
|
duration: 2000,
|
||||||
});
|
});
|
||||||
}
|
console.log('打开失败:' + e.message);
|
||||||
});
|
});
|
||||||
|
// uni.openDocument({
|
||||||
|
// filePath: item.localPath,
|
||||||
|
// fileType: 'pdf',
|
||||||
|
// success: () => console.log('打开成功'),
|
||||||
|
// fail: (err) => {
|
||||||
|
// uni.showToast({
|
||||||
|
// title: err,
|
||||||
|
// icon: "none",
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
// });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -458,15 +458,10 @@ const viewGuideline = (cell) => {
|
|||||||
plus.runtime.openFile(item.localPath, function(e) {
|
plus.runtime.openFile(item.localPath, function(e) {
|
||||||
console.log('打开成功');
|
console.log('打开成功');
|
||||||
}, function(e) {
|
}, function(e) {
|
||||||
uni.showModal({
|
uni.showToast({
|
||||||
title: '提示',
|
title: '打开失败:' + e.message,
|
||||||
content: JSON.stringify(e),
|
icon: "none",
|
||||||
showCancel: false,
|
duration: 2000,
|
||||||
confirmText: '确定',
|
|
||||||
success: (res) => {
|
|
||||||
if(res.confirm){
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
console.log('打开失败:' + e.message);
|
console.log('打开失败:' + e.message);
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user