|
@@ -49,7 +49,7 @@
|
|
</view>
|
|
</view>
|
|
</u-card>
|
|
</u-card>
|
|
<u-button type="primary" @click="exit" style="margin: 20rpx">安全退出</u-button>
|
|
<u-button type="primary" @click="exit" style="margin: 20rpx">安全退出</u-button>
|
|
- <luo-version-upgrade v-if="show_s == true" version="1.0.1" :url="url" :is_force="is_force"></luo-version-upgrade>
|
|
|
|
|
|
+ <luo-version-upgrade v-if="show_s == true" version="1.0.1" :url="url" :is_force="is_force" :describe="Copywriting"></luo-version-upgrade>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -68,7 +68,8 @@
|
|
edition_s: '',
|
|
edition_s: '',
|
|
show_s: false,
|
|
show_s: false,
|
|
url: '',
|
|
url: '',
|
|
- is_force:false,
|
|
|
|
|
|
+ is_force: false,
|
|
|
|
+ Copywriting: ''
|
|
};
|
|
};
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
@@ -78,7 +79,7 @@
|
|
console.log(wgtinfo.version); //版本号
|
|
console.log(wgtinfo.version); //版本号
|
|
this.edition_s = wgtinfo.version
|
|
this.edition_s = wgtinfo.version
|
|
})
|
|
})
|
|
-
|
|
|
|
|
|
+
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
...mapMutations(["logout"]),
|
|
...mapMutations(["logout"]),
|
|
@@ -90,59 +91,155 @@
|
|
});
|
|
});
|
|
},
|
|
},
|
|
edition() {
|
|
edition() {
|
|
|
|
+ uni.getSystemInfo({
|
|
|
|
+ success: res => {
|
|
|
|
+ console.log(res.platform);
|
|
|
|
+ },
|
|
|
|
+ complete: err => {
|
|
|
|
+ if (err.platform == 'android') {
|
|
|
|
+ this.onLaunch_s()
|
|
|
|
+ } else if (err.platform == 'ios') {
|
|
|
|
+ console.log("暂无数据")
|
|
|
|
+ this.iosstartup()
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ iosstartup(){
|
|
|
|
+ request({
|
|
|
|
+ url: '/baseReq/apkUpgrade',
|
|
|
|
+ method: 'get',
|
|
|
|
+ params: {
|
|
|
|
+ osType: 1
|
|
|
|
+ }
|
|
|
|
+ }).then(res => {
|
|
|
|
+ console.log(res)
|
|
|
|
+ console.log(res.data.code)
|
|
|
|
+ console.log(res.data.forceVersion) //最低版本
|
|
|
|
+ console.log(res.data.msg) //更新文案
|
|
|
|
+ console.log(res.data.version) //最新版本
|
|
|
|
+
|
|
|
|
+ plus.runtime.getProperty(plus.runtime.appid, (wgtinfo) => {
|
|
|
|
+ console.log(wgtinfo);
|
|
|
|
+ console.log(wgtinfo.version); //版本号
|
|
|
|
+ if (wgtinfo.version == res.data.version) {
|
|
|
|
+ this.show_s = true
|
|
|
|
+ uni.showToast({
|
|
|
|
+ icon: 'none',
|
|
|
|
+ title: '已是最新版本',
|
|
|
|
+ position: "bottom"
|
|
|
|
+ })
|
|
|
|
+ console.log("已是最新版本")
|
|
|
|
+ } else if (wgtinfo.version != res.data.forceVersion) {
|
|
|
|
+ console.log("强制版本更新")
|
|
|
|
+ uni.showModal({
|
|
|
|
+ title: "发现新版本",
|
|
|
|
+ content: res.data.msg,
|
|
|
|
+ showCancel: false,
|
|
|
|
+ confirmText: "立即去AppStore更新",
|
|
|
|
+ success: function(res) {
|
|
|
|
+ if (res.confirm) {
|
|
|
|
+ console.log('用户点击确定');
|
|
|
|
+ let appleId = 1518555723
|
|
|
|
+ plus.runtime.launchApplication({
|
|
|
|
+ action: `itms-apps://itunes.apple.com/cn/app/id${appleId}?mt=8`
|
|
|
|
+ }, function(e) {
|
|
|
|
+ console.log('Open system default browser failed: ' + e.message);
|
|
|
|
+ });
|
|
|
|
+ } else if (res.cancel) {
|
|
|
|
+ console.log('用户点击取消');
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ } else if (wgtinfo.version == res.data.forceVersion) {
|
|
|
|
+ console.log("最低版本更新")
|
|
|
|
+ uni.showModal({
|
|
|
|
+ title: "发现新版本",
|
|
|
|
+ content: res.data.msg,
|
|
|
|
+ showCancel: true,
|
|
|
|
+ confirmText: "立即去AppStore更新",
|
|
|
|
+ success: function(res) {
|
|
|
|
+ if (res.confirm) {
|
|
|
|
+ console.log('用户点击确定');
|
|
|
|
+ let appleId = 1518555723
|
|
|
|
+ plus.runtime.launchApplication({
|
|
|
|
+ action: `itms-apps://itunes.apple.com/cn/app/id${appleId}?mt=8`
|
|
|
|
+ }, function(e) {
|
|
|
|
+ console.log('Open system default browser failed: ' + e.message);
|
|
|
|
+ });
|
|
|
|
+ } else if (res.cancel) {
|
|
|
|
+ console.log('用户点击取消');
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ }).catch(err => {
|
|
|
|
+ console.log(err)
|
|
|
|
+ })
|
|
|
|
+ .finally(() => {
|
|
|
|
+ // Loading.close()
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ onLaunch_s() {
|
|
//升级调用的接口
|
|
//升级调用的接口
|
|
- if(this.show_s == true){
|
|
|
|
|
|
+ if (this.show_s == true) {
|
|
this.show_s = false
|
|
this.show_s = false
|
|
}
|
|
}
|
|
console.log(this.show_s)
|
|
console.log(this.show_s)
|
|
- request({
|
|
|
|
- url: '/baseReq/apkUpgrade',
|
|
|
|
- method: 'get',
|
|
|
|
- params: {
|
|
|
|
- osType: 0
|
|
|
|
|
|
+ request({
|
|
|
|
+ url: '/baseReq/apkUpgrade',
|
|
|
|
+ method: 'get',
|
|
|
|
+ params: {
|
|
|
|
+ osType: 0
|
|
|
|
+ }
|
|
|
|
+ }).then(res => {
|
|
|
|
+ console.log(res)
|
|
|
|
+ console.log(res.data.forceVersion) //最低版本
|
|
|
|
+ console.log(res.data.msg) //更新文案
|
|
|
|
+ console.log(res.data.url) //下载最新版地址
|
|
|
|
+ console.log(res.data.version) //最新版本
|
|
|
|
+
|
|
|
|
+ plus.runtime.getProperty(plus.runtime.appid, (wgtinfo) => {
|
|
|
|
+ console.log(wgtinfo);
|
|
|
|
+ console.log(wgtinfo.version); //版本号
|
|
|
|
+ if (wgtinfo.version == res.data.version) {
|
|
|
|
+ this.show_s = false
|
|
|
|
+ uni.showToast({
|
|
|
|
+ icon: 'none',
|
|
|
|
+ title: '已经是最新版本了',
|
|
|
|
+ position: "bottom"
|
|
|
|
+ })
|
|
|
|
+ this.closeModal();
|
|
|
|
+ console.log("已经是最新版本了")
|
|
|
|
+ } else if (wgtinfo.version != res.data.forceVersion) {
|
|
|
|
+ console.log("必须强制更新")
|
|
|
|
+ this.Copywriting = res.data.msg
|
|
|
|
+ this.show_s = true
|
|
|
|
+ console.log(res.data.url)
|
|
|
|
+ this.url = res.data.url
|
|
|
|
+ this.is_force = true
|
|
|
|
+ } else if (wgtinfo.version == res.data.forceVersion) {
|
|
|
|
+ console.log("达到最低版本")
|
|
|
|
+ this.Copywriting = res.data.msg
|
|
|
|
+ console.log(this.Copywriting)
|
|
|
|
+ this.is_force = false
|
|
|
|
+ this.show_s = true
|
|
|
|
+ console.log(this.show_s)
|
|
|
|
+ this.url = res.data.url
|
|
}
|
|
}
|
|
- }).then(res => {
|
|
|
|
- console.log(res)
|
|
|
|
- console.log(res.data.forceVersion) //最低版本
|
|
|
|
- console.log(res.data.msg) //更新文案
|
|
|
|
- console.log(res.data.url) //下载最新版地址
|
|
|
|
- console.log(res.data.version) //最新版本
|
|
|
|
-
|
|
|
|
- plus.runtime.getProperty(plus.runtime.appid, (wgtinfo) => {
|
|
|
|
- console.log(wgtinfo);
|
|
|
|
- console.log(wgtinfo.version); //版本号
|
|
|
|
- if (wgtinfo.version == res.data.version) {
|
|
|
|
- this.show_s = false
|
|
|
|
- uni.showToast({
|
|
|
|
- icon: 'none',
|
|
|
|
- title: '已经是最新版本了',
|
|
|
|
- position: "bottom"
|
|
|
|
- })
|
|
|
|
- this.closeModal();
|
|
|
|
- console.log("已经是最新版本了")
|
|
|
|
- } else if (wgtinfo.version != res.data.forceVersion) {
|
|
|
|
- console.log("必须强制更新")
|
|
|
|
- this.show_s = true
|
|
|
|
- console.log(res.data.url)
|
|
|
|
- this.url = res.data.url
|
|
|
|
- this.is_force = true
|
|
|
|
- } else if (wgtinfo.version == res.data.forceVersion) {
|
|
|
|
- console.log("达到最低版本")
|
|
|
|
- this.is_force = false
|
|
|
|
- this.show_s = true
|
|
|
|
- console.log(this.show_s)
|
|
|
|
- this.url = res.data.url
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- })
|
|
|
|
-
|
|
|
|
- }).catch(err => {
|
|
|
|
- console.log(err)
|
|
|
|
- })
|
|
|
|
- .finally(() => {
|
|
|
|
- // Loading.close()
|
|
|
|
|
|
+
|
|
})
|
|
})
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+ }).catch(err => {
|
|
|
|
+ console.log(err)
|
|
|
|
+ })
|
|
|
|
+ .finally(() => {
|
|
|
|
+ // Loading.close()
|
|
|
|
+ })
|
|
|
|
+
|
|
},
|
|
},
|
|
getMyinfo() {
|
|
getMyinfo() {
|
|
request({
|
|
request({
|