|
@@ -918,35 +918,41 @@ export default {
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
checkUpdate() {
|
|
checkUpdate() {
|
|
|
- var that = this;
|
|
|
|
|
- if (typeof(cordova) == "undefined") {
|
|
|
|
|
|
|
+ const that = this;
|
|
|
|
|
+ if (typeof cordova == "undefined") {
|
|
|
return;
|
|
return;
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- axios.get("http://qndownload.shotshock.shop/version?ts=" + Date.parse(new Date())).then(res => {
|
|
|
|
|
- var ver = res.data.version
|
|
|
|
|
- var url = res.data.download
|
|
|
|
|
- console.log(JSON.stringify(res.data))
|
|
|
|
|
- console.log(navigator.platform)
|
|
|
|
|
- cordova.getAppVersion.getVersionNumber().then(version => {
|
|
|
|
|
- console.log("current version: " + version);
|
|
|
|
|
- console.log("remote version: " + ver);
|
|
|
|
|
- if (ver > version) {
|
|
|
|
|
- console.log("current need update !");
|
|
|
|
|
- that.$dialog.confirm({
|
|
|
|
|
- mes: "检查到有新版本,点击确定去下载!",
|
|
|
|
|
- title: "更新提示",
|
|
|
|
|
- opts: () => {
|
|
|
|
|
- cordova.InAppBrowser.open(url, "_system")
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- } else {
|
|
|
|
|
- console.log("current alreay is latest !");
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ axios
|
|
|
|
|
+ .get(
|
|
|
|
|
+ "http://qndownload.shotshock.shop/version?ts=" +
|
|
|
|
|
+ Date.parse(new Date())
|
|
|
|
|
+ )
|
|
|
|
|
+ .then(res => {
|
|
|
|
|
+ var ver = res.data.version;
|
|
|
|
|
+ var url = res.data.download;
|
|
|
|
|
+ console.log(JSON.stringify(res.data));
|
|
|
|
|
+ console.log(navigator.platform);
|
|
|
|
|
+ cordova.getAppVersion.getVersionNumber().then(version => {
|
|
|
|
|
+ console.log("current version: " + version);
|
|
|
|
|
+ console.log("remote version: " + ver);
|
|
|
|
|
+ if (ver > version) {
|
|
|
|
|
+ console.log("current need update !");
|
|
|
|
|
+ that.$dialog.confirm({
|
|
|
|
|
+ mes: "检查到有新版本,点击确定去下载!",
|
|
|
|
|
+ title: "更新提示",
|
|
|
|
|
+ opts: () => {
|
|
|
|
|
+ cordova.InAppBrowser.open(url, "_system");
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ } else {
|
|
|
|
|
+ console.log("current alreay is latest !");
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(err => {
|
|
|
|
|
+ // that.$dialog.error("检查更新失败!")
|
|
|
});
|
|
});
|
|
|
- }).catch(err => {
|
|
|
|
|
- // that.$dialog.error("检查更新失败!")
|
|
|
|
|
- });
|
|
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
updateVIP() {
|
|
updateVIP() {
|