姜永辉 1 anno fa
parent
commit
f174c230cb
1 ha cambiato i file con 19 aggiunte e 0 eliminazioni
  1. 19 0
      app.js

+ 19 - 0
app.js

@@ -140,6 +140,25 @@ App({
     this.checkHasUpdate();
   },
 
+  /**
+   *  检测是否有新版本-手动更新
+   */
+  checkHasManualUpdate: function () {
+    var _this = this;
+    updateManager.onCheckForUpdate(function (res) {
+
+      if (res.hasUpdate ) {
+        //有新版本,并且没下载过,才下载。不然会重复提示
+        _this.downLoadApp();
+      } else{
+        wx.showModal({
+          title: '提示',
+          content: '当前版本已经最新版本',
+          showCancel: false
+        })
+      }
+    })
+  },
 
   /**
    *  检测是否有新版本