bayi преди 1 година
родител
ревизия
b5dfd90dbd
променени са 5 файла, в които са добавени 74 реда и са изтрити 77 реда
  1. 3 3
      app.json
  2. 58 61
      custom-tab-bar/index.js
  3. 5 5
      pages/index/index.js
  4. 1 1
      pages/message/index.js
  5. 7 7
      utils/request.js

+ 3 - 3
app.json

@@ -31,15 +31,15 @@
     "tabBar": {
         "custom": true,
         "list": [{
-            "pagePath": "pages/index/index",
-            "text": "推荐"
-        }, {
             "pagePath": "pages/activity/index",
             "text": "活动"
         }, {
             "pagePath": "pages/works/index",
             "text": "作品"
         }, {
+            "pagePath": "pages/index/index",
+            "text": "推荐"
+        }, {
             "pagePath": "pages/message/index",
             "text": "消息"
         }, {

+ 58 - 61
custom-tab-bar/index.js

@@ -1,70 +1,67 @@
 import {
-  storeBindingsBehavior
+    storeBindingsBehavior
 } from 'mobx-miniprogram-bindings'
 import {
-  store
+    store
 } from '~/store/index'
 Component({
-  behaviors: [storeBindingsBehavior],
-  storeBindings: {
-    store,
-    fields: {
-      userInfo: 'userInfo'
+    behaviors: [storeBindingsBehavior],
+    storeBindings: {
+        store,
+        fields: {
+            userInfo: 'userInfo'
+        },
+    },
+    /**
+     * 组件的属性列表
+     */
+    properties: {},
+    /**
+     * 组件的初始数据
+     */
+    data: {
+        selected: 2,
+        color: "#999999",
+        selectedColor: "#32CA69",
+        mask: false,
+        listTab: [{
+            "pagePath": "/pages/message/index",
+            "text": "消息",
+            "iconPath": "/static/message.png",
+            "selectedIconPath": "/static/message2.png"
+        }, {
+            "pagePath": "/pages/activity/index",
+            "text": "活动",
+            "iconPath": "/static/activity.png",
+            "selectedIconPath": "/static/activity2.png"
+        }, {
+            "pagePath": "/pages/works/index",
+            "text": "作品",
+            "iconPath": "/static/zp.png",
+            "selectedIconPath": "/static/zp2.png"
+        }, {
+            "pagePath": "/pages/index/index",
+            "text": "推荐",
+            "iconPath": "/static/tj.png",
+            "selectedIconPath": "/static/tj2.png"
+        }, {
+            "pagePath": "/pages/my/index",
+            "text": "我的",
+            "iconPath": "/static/my.png",
+            "selectedIconPath": "/static/my2.png"
+        }]
     },
-  },
-  /**
-   * 组件的属性列表
-   */
-  properties: {
-
-  },
-
-  /**
-   * 组件的初始数据
-   */
-  data: {
-    selected: 0,
-    color: "#999999",
-    selectedColor: "#32CA69",
-    mask:false,
-    listTab: [{
-      "pagePath": "/pages/index/index",
-      "text": "推荐",
-      "iconPath": "/static/tj.png",
-      "selectedIconPath": "/static/tj2.png"
-    }, {
-      "pagePath": "/pages/activity/index",
-      "text": "活动",
-      "iconPath": "/static/activity.png",
-      "selectedIconPath": "/static/activity2.png"
-    }, {
-      "pagePath": "/pages/works/index",
-      "text": "作品",
-      "iconPath": "/static/zp.png",
-      "selectedIconPath": "/static/zp2.png"
-    }, {
-      "pagePath": "/pages/message/index",
-      "text": "消息",
-      "iconPath": "/static/message.png",
-      "selectedIconPath": "/static/message2.png"
-    }, {
-      "pagePath": "/pages/my/index",
-      "text": "我的",
-      "iconPath": "/static/my.png",
-      "selectedIconPath": "/static/my2.png"
-    }]
-  },
 
-  /**
-   * 组件的方法列表
-   */
-  methods: {
-    switchTab(e) {
-      const data = e.currentTarget.dataset;
-      const url = data.path;
-      wx.switchTab({
-        url
-      });
+    /**
+     * 组件的方法列表
+     */
+    methods: {
+        switchTab(e) {
+            const data = e.currentTarget.dataset;
+            const url = data.path;
+            wx.switchTab({
+                url
+            });
+        }
     }
-  }
 })

+ 5 - 5
pages/index/index.js

@@ -54,11 +54,11 @@ Page({
         }
     },
     onShow() {
-        /*  if (typeof this.getTabBar === 'function') {
-           this.getTabBar().setData({
-             selected: 0
-           })
-         } */
+        if (typeof this.getTabBar === 'function') {
+            this.getTabBar().setData({
+                selected: 3
+            })
+        }
     },
     onUnload() {
         this.storeBindings.destroyStoreBindings()

+ 1 - 1
pages/message/index.js

@@ -43,7 +43,7 @@ Page({
   async onShow() {
     if (typeof this.getTabBar === 'function') {
       this.getTabBar().setData({
-        selected: 3
+        selected: 0
       })
     }
     this.getAuthorityMsg()

+ 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, intercept = true) {
     let header = {