update:登录相关修改

master
guoshuang 3 years ago
parent 921a2435d3
commit 61b1508274

@ -152,43 +152,48 @@ export default class LoginPage extends BasePage {
} }
Version = '1.0.1'; Version = '1.0.1';
async update() { async update() {
await session.QueryVersion(); try {
if (this.Version < session.Version) { await session.QueryVersion();
// if (this.Version < session.Version) {
uni.showModal({ //
content: this.$t('message.Tip1') as string, uni.showModal({
confirmText: this.$t('message.workArea_Confirm') as string, content: this.$t('message.Tip1') as string,
cancelText: this.$t('message.Cancel') as string, confirmText: this.$t('message.workArea_Confirm') as string,
showCancel: false, cancelText: this.$t('message.Cancel') as string,
success: (res) => { showCancel: false,
if (res.confirm) { success: (res) => {
// if (res.confirm) {
let downloadApkUrl = session.url; //
uni.showLoading({ let downloadApkUrl = session.url;
title: vm.$t('message.uploading') as string, uni.showLoading({
//title: '..........', title: vm.$t('message.uploading') as string,
}); //title: '..........',
////////////////uni, });
uni.downloadFile({ ////////////////uni,
url: downloadApkUrl, uni.downloadFile({
success: (downloadResult) => { url: downloadApkUrl,
uni.hideLoading(); success: (downloadResult) => {
if (downloadResult.statusCode == 200) { uni.hideLoading();
// if (downloadResult.statusCode == 200) {
plus.runtime.install(downloadResult.tempFilePath as any, { force: true }, function () { //
//uni.showToast(''); plus.runtime.install(downloadResult.tempFilePath as any, { force: true }, function () {
plus.runtime.restart(); //uni.showToast('');
}); plus.runtime.restart();
} });
}, }
}); },
} else if (res.cancel) { });
this.go(); } else if (res.cancel) {
} this.go();
}, }
}); },
return; });
return;
}
} catch (e) {
console.log('error', e);
} }
this.go(); this.go();
} }
///////////////// /////////////////

Loading…
Cancel
Save