Kaynağa Gözat

更新获取app版本地址接口

wmaple 1 yıl önce
ebeveyn
işleme
24f9a40fdb
3 değiştirilmiş dosya ile 18 ekleme ve 11 silme
  1. 2 2
      manifest.json
  2. 3 1
      pages/agreement.vue
  3. 13 8
      pages/down.vue

+ 2 - 2
manifest.json

@@ -2,8 +2,8 @@
     "name" : "宜格分享",
     "appid" : "__UNI__90011BF",
     "description" : "应用描述",
-    "versionName" : "1.0.0",
-    "versionCode" : "100",
+    "versionName" : "1.0.1",
+    "versionCode" : 101,
     "transformPx" : false,
     /* 5+App特有相关 */
     "app-plus" : {

+ 3 - 1
pages/agreement.vue

@@ -35,7 +35,9 @@
     },
     methods: {
       getDetail(code) {
-        this.$http.get(`/protocol/info?code=${code}`).then(res => {
+        this.$http.get(`/protocol/info`, {
+          code: code
+        }).then(res => {
           if (res && res.code == 200) {
             this.detail = res.data
           }

+ 13 - 8
pages/down.vue

@@ -5,11 +5,11 @@
       <image src="/static/login/logo.png" mode="" class="logo"></image>
     </view>
     <view class="btn-row">
-      <button class="btn" @click="downLoad(1)">
+      <button class="btn" @click="downLoad(0)">
         <image src="/static/login/android.png" mode="" class="logo"></image>
         安卓下载
       </button>
-      <button class="btn" @click="downLoad(2)">
+      <button class="btn" @click="downLoad(1)">
         <image src="/static/login/ios.png" mode="" class="logo"></image>
         IOS下载
       </button>
@@ -35,18 +35,23 @@
       };
     },
     onLoad(options) {
-      this.getData();
+      // this.getData();
     },
     methods: {
-      getData() {
-        this.$http.get("/app/config/info").then((res) => {
-          if (res && res.code == 200) {
-            this.appInfo = res.data;
+      getData(type) {
+        this.$http.get("/app/version/newest", {
+          type: type
+        }).then((res) => {
+          if (res && res.data && res.code == 200) {
+            window.location.href = res.data.downloadLink
+          } else {
+            this.$mUtil.toast("暂无下载地址")
           }
         });
       },
       downLoad(type) {
-        window.location.href = type == 1 ? this.appInfo.android_link : this.appInfo.ios_link;
+        this.getData(type)
+        // window.location.href = type == 1 ? this.appInfo.android_link : this.appInfo.ios_link;
       },
     },
   };