# Conflicts:
#	src/pages/login/login/index.vue
master
hou 3 years ago
commit 8ca7100119

@ -150,45 +150,50 @@ export default class LoginPage extends BasePage {
console.log('image', this.image); console.log('image', this.image);
console.log('Version////', this.Version); console.log('Version////', this.Version);
} }
Version = '1.0.0'; Version = '1.0.2';
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