diff --git a/src/pages/login/login/index.vue b/src/pages/login/login/index.vue index 8ca2b8f..336d597 100644 --- a/src/pages/login/login/index.vue +++ b/src/pages/login/login/index.vue @@ -142,7 +142,7 @@ export default class LoginPage extends BasePage { // console.log('Version////', this.Version); } ///********版本号修改区域********** - version = '0.0.62';//正式版本号 + version = '0.0.63'; //正式版本号 //version = '0.0.2';//测试版本号 //***************标志修改区域:是否是测试标志: false 正式版本; true 测试版本**************** //isTest = true; @@ -174,79 +174,78 @@ export default class LoginPage extends BasePage { async checkupdate() { try { await this.model.checkupdate(); - console.log('3333333',this.model.checkversion) - if(this.model.checkversion != undefined){ - const fileName = this.model.checkversion.fileName; - // const isTestUpdate = fileName.includes('test'); // 检查fileName是否包含'test' - const queryversion = this.model.checkversion.version; - //const queryversion = this.checkversion.Version.match(/\d+\.\d+\.\d+/)[0]; - let versionNumber = this.compareVersion(this.version, queryversion); //this.version, queryversion - if (versionNumber == -1) { - //如果 我现在是测试版本test true: 发了一个测试版本更新,isTestUpdate:true走跟新;发了一个正式isTestUpdate:false不走更新 - //如果 我现在是正式版本 test false:发了一个测试版本更新,isTestUpdate:true不走更新;发了一个正式isTestUpdate:false走跟新 - // if (isTestUpdate && !this.isTest) { - // // 测试版本更新,但当前环境是正式环境,不提示更新 - // console.log('Test version update available, but running in production environment.'); - // uni.navigateTo({ - // url: page.shouye, - // }); - // return; - // } else if (!isTestUpdate && this.isTest) { - // // 正式版本更新,但当前环境是测试环境,不提示更新 - // console.log('Production version update available, but running in test environment.'); - // uni.navigateTo({ - // url: page.shouye, - // }); - // return; - // } + console.log('3333333', this.model.checkversion); + if (this.model.checkversion != undefined) { + // const fileName = this.model.checkversion.fileName; + // const isTestUpdate = fileName.includes('test'); // 检查fileName是否包含'test' + const queryversion = this.model.checkversion.version; + //const queryversion = this.checkversion.Version.match(/\d+\.\d+\.\d+/)[0]; + let versionNumber = this.compareVersion(this.version, queryversion); //this.version, queryversion + if (versionNumber == -1) { + //如果 我现在是测试版本test true: 发了一个测试版本更新,isTestUpdate:true走跟新;发了一个正式isTestUpdate:false不走更新 + //如果 我现在是正式版本 test false:发了一个测试版本更新,isTestUpdate:true不走更新;发了一个正式isTestUpdate:false走跟新 + // if (isTestUpdate && !this.isTest) { + // // 测试版本更新,但当前环境是正式环境,不提示更新 + // console.log('Test version update available, but running in production environment.'); + // uni.navigateTo({ + // url: page.shouye, + // }); + // return; + // } else if (!isTestUpdate && this.isTest) { + // // 正式版本更新,但当前环境是测试环境,不提示更新 + // console.log('Production version update available, but running in test environment.'); + // uni.navigateTo({ + // url: page.shouye, + // }); + // return; + // } - // 版本更新提示 - uni.showModal({ - content: '新版本为:' + this.model.checkversion.version + ',' + '是否更新?', - success: (res) => { - if (res.confirm) { - //确定执行下载 - let downloadApkUrl = this.model.checkversion.fileAddress; - uni.showLoading({ - title: '下载中', - }); - ////////////////uni下载方法, - uni.downloadFile({ - url: downloadApkUrl, - success: (downloadResult) => { - uni.hideLoading(); - if (downloadResult.statusCode == 200) { - //安装更新 - plus.runtime.install(downloadResult.tempFilePath as any, { force: true }, function () { - //uni.showToast('更新成功,重启'); - plus.runtime.restart(); - }); - } - }, - }); - } else if (res.cancel) { - console.log(); - uni.navigateTo({ - url: page.shouye, - }); - } - }, - }); - return; + // 版本更新提示 + uni.showModal({ + content: '新版本为:' + this.model.checkversion.version + ',' + '是否更新?', + success: (res) => { + if (res.confirm) { + //确定执行下载 + let downloadApkUrl = this.model.checkversion.fileAddress; + uni.showLoading({ + title: '下载中', + }); + ////////////////uni下载方法, + uni.downloadFile({ + url: downloadApkUrl, + success: (downloadResult) => { + uni.hideLoading(); + if (downloadResult.statusCode == 200) { + //安装更新 + plus.runtime.install(downloadResult.tempFilePath as any, { force: true }, function () { + //uni.showToast('更新成功,重启'); + plus.runtime.restart(); + }); + } + }, + }); + } else if (res.cancel) { + console.log(); + uni.navigateTo({ + url: page.shouye, + }); + } + }, + }); + return; + } else { + uni.navigateTo({ + url: page.shouye, + }); + // uni.showToast({ + // title: '无更新内容', + // icon: 'none', + // }); + } } else { uni.navigateTo({ url: page.shouye, }); - // uni.showToast({ - // title: '无更新内容', - // icon: 'none', - // }); - } - } - else{ - uni.navigateTo({ - url: page.shouye, - }); } } catch (e) { console.log('error', e); diff --git a/src/pages/quality/Materialinspection/index.vue b/src/pages/quality/Materialinspection/index.vue index 6796a9a..afc93f3 100644 --- a/src/pages/quality/Materialinspection/index.vue +++ b/src/pages/quality/Materialinspection/index.vue @@ -242,7 +242,7 @@