|
|
@ -34,7 +34,7 @@
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<view class="astyle">
|
|
|
|
<view class="astyle">
|
|
|
|
<view @click="checkupdate"> 检查更新 </view>
|
|
|
|
<view @click="checkupdate()"> 检查更新 </view>
|
|
|
|
<!-- <u-button
|
|
|
|
<!-- <u-button
|
|
|
|
@click.native="
|
|
|
|
@click.native="
|
|
|
|
uni.navigateTo({
|
|
|
|
uni.navigateTo({
|
|
|
@ -64,7 +64,7 @@ export default class RawHome extends BasePage {
|
|
|
|
model = model;
|
|
|
|
model = model;
|
|
|
|
src: 'http://pic2.sc.chinaz.com/Files/pic/pic9/202002/hpic2119_s.jpg';
|
|
|
|
src: 'http://pic2.sc.chinaz.com/Files/pic/pic9/202002/hpic2119_s.jpg';
|
|
|
|
today = dayjs().format('YYYY-MM-DD dddd');
|
|
|
|
today = dayjs().format('YYYY-MM-DD dddd');
|
|
|
|
version: '0.01';
|
|
|
|
version = '0.0.0';
|
|
|
|
checkversion: any = {};
|
|
|
|
checkversion: any = {};
|
|
|
|
onLoad() {
|
|
|
|
onLoad() {
|
|
|
|
// this.model.getMenuList();
|
|
|
|
// this.model.getMenuList();
|
|
|
@ -94,18 +94,18 @@ export default class RawHome extends BasePage {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
async checkupdate() {
|
|
|
|
async checkupdate() {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
this.checkversion = await model.checkupdate();
|
|
|
|
await this.model.checkupdate();
|
|
|
|
const queryversion = this.checkversion.Version.match(/\d+\.\d+\.\d+/)[0];
|
|
|
|
const queryversion = this.model.checkversion.version;
|
|
|
|
let versionNumber = this.compareVersion(this.version, queryversion);
|
|
|
|
//const queryversion = this.checkversion.Version.match(/\d+\.\d+\.\d+/)[0];
|
|
|
|
versionNumber = 1;
|
|
|
|
let versionNumber = this.compareVersion(this.version, queryversion); //this.version, queryversion
|
|
|
|
if (versionNumber == -1) {
|
|
|
|
if (versionNumber == -1) {
|
|
|
|
// 版本更新提示
|
|
|
|
// 版本更新提示
|
|
|
|
uni.showModal({
|
|
|
|
uni.showModal({
|
|
|
|
content: '新版本为:' + this.checkversion.Version + ',' + '是否更新?',
|
|
|
|
content: '新版本为:' + this.model.checkversion.version + ',' + '是否更新?',
|
|
|
|
success: (res) => {
|
|
|
|
success: (res) => {
|
|
|
|
if (res.confirm) {
|
|
|
|
if (res.confirm) {
|
|
|
|
//确定执行下载
|
|
|
|
//确定执行下载
|
|
|
|
let downloadApkUrl = this.checkversion.url;
|
|
|
|
let downloadApkUrl = this.checkversion.fileAddress;
|
|
|
|
uni.showLoading({
|
|
|
|
uni.showLoading({
|
|
|
|
title: '下载中',
|
|
|
|
title: '下载中',
|
|
|
|
});
|
|
|
|
});
|
|
|
|