bayi 1 年之前
父節點
當前提交
7722b6f351
共有 2 個文件被更改,包括 25 次插入8 次删除
  1. 22 5
      pages/userWorks/index.js
  2. 3 3
      utils/request.js

+ 22 - 5
pages/userWorks/index.js

@@ -20,12 +20,28 @@ Page({
     },
     onLoad(options) {
         if (options.type && options.type != 'my') {
+            let type = options.type
+            let emptyText = ''
+            let title = ''
+            if (type == 'follow') {
+                emptyText = '您还没有关注用户哦~'
+                title = '关注作品'
+            } else if (type == 'like') {
+                emptyText = '还没有点赞记录哦~'
+                title = '点赞'
+            } else if (type == 'collect') {
+                emptyText = '快去收藏喜欢的作品吧!'
+                title = '收藏作品'
+            } else if (type == 'comment') {
+                emptyText = '还没有收到评论哦~'
+                title = '作品评论'
+            }
             this.setData({
-                type: options.type,
-                emptyText: options.type == 'follow' ? '您还没有关注用户哦' : '快去收藏喜欢的作品吧!'
+                type,
+                emptyText
             })
             wx.setNavigationBarTitle({
-                title: options.type == 'follow' ? '关注作品' : '收藏作品'
+                title
             })
         }
         if (options.id) {
@@ -48,10 +64,11 @@ Page({
     loadMore() {
         if (this.data.type == 'follow') {
             this.getData(getFollowWorks, {})
-        } else if (this.data.type == 'my') {
-            this.getData(getSelfRead, {})
         } else if (this.data.type == 'collect') {
             this.getData(getFavoritesList, {})
+        } else {
+            console.log('zzz');
+            this.getData(this.getSelfRead, {})
         }
     },
     getSelfRead(data) {

+ 3 - 3
utils/request.js

@@ -6,13 +6,13 @@ const {
         envVersion
     }
 } = wx.getAccountInfoSync();
-if (envVersion == 'develop') {
+/* if (envVersion == 'develop') {
     baseUrl = 'https://reader-api.efunbox.cn/wx'
     oldUrl = 'https://reader-api.efunbox.cn'
-} else {
+} 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 = {