bayi 2 năm trước cách đây
mục cha
commit
28e075e577
3 tập tin đã thay đổi với 28 bổ sung11 xóa
  1. 20 4
      components/navigationBar/index.js
  2. 1 0
      pages/works/index.js
  3. 7 7
      utils/request.js

+ 20 - 4
components/navigationBar/index.js

@@ -34,17 +34,33 @@ Component({
     isGradeShow: false,
     temporaryGrade: null
   },
-  lifetimes: {
-    attached() {
+  pageLifetimes: {
+    show: function () {
       if (!this.data.userInfo.grade) {
         let timer = setInterval(() => {
-          if (this.data.userInfo.uid && !this.data.userInfo.grade) {
+          if (this.data.userInfo.uid && this.data.userInfo.grade) {
+            clearInterval(timer)
+          } else {
             this.showGrade()
             clearInterval(timer)
           }
         }, 500)
       }
-
+    },
+  },
+  lifetimes: {
+    attached() {
+      // if (!this.data.userInfo.grade) {
+      //   let timer = setInterval(() => {
+      //     console.log(this.data.userInfo.uid, this.data.userInfo.grade);
+      //     if (this.data.userInfo.uid && this.data.userInfo.grade) {
+      //       clearInterval(timer)
+      //     } else {
+      //       this.showGrade()
+      //       clearInterval(timer)
+      //     }
+      //   }, 500)
+      // }
     }
   },
   methods: {

+ 1 - 0
pages/works/index.js

@@ -48,6 +48,7 @@ Page({
       this.setData({
         currentType: target.dataset.type
       })
+      this.selectComponent('#worksList').resetAudio()
       this.resetData()
     }
   },

+ 7 - 7
utils/request.js

@@ -6,13 +6,13 @@ const {
     envVersion
   }
 } = wx.getAccountInfoSync();
-if (envVersion == 'develop') {
-  baseUrl = 'https://reader-api.efunbox.cn/wx'
-  oldUrl = 'https://reader-api.efunbox.cn'
-} else {
-  baseUrl = 'https://reader-api.ai160.com/wx'
-  oldUrl = 'https://reader-api.ai160.com'
-}
+// if (envVersion == 'develop') {
+baseUrl = 'https://reader-api.efunbox.cn/wx'
+oldUrl = 'https://reader-api.efunbox.cn'
+/* } else {
+baseUrl = 'https://reader-api.ai160.com/wx'
+oldUrl = 'https://reader-api.ai160.com'
+} */
 
 function request(url, method, data, oldBaseUrl = false) {
   let header = {