From 92d404c3e68b3716729e19916bbc6b9f129bf4b5 Mon Sep 17 00:00:00 2001
From: Enzo <1284707383@qq.com>
Date: Wed, 15 Sep 2021 17:37:01 +0800
Subject: [PATCH] =?UTF-8?q?=E5=8F=91=E7=8E=B0=E8=AF=84=E8=AE=BA=E7=9B=B8?=
=?UTF-8?q?=E5=85=B3=E4=BC=98=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pages/discover/discover.vue | 54 +++++++-----------
pages/discover/discoverdetails.vue | 14 +++--
pages/user/my/my.vue | 88 +++++++++++++++++++++++++++++-
3 files changed, 114 insertions(+), 42 deletions(-)
diff --git a/pages/discover/discover.vue b/pages/discover/discover.vue
index 706ac5c..3792559 100644
--- a/pages/discover/discover.vue
+++ b/pages/discover/discover.vue
@@ -78,9 +78,9 @@
}
return {
tab_list: [
- {name: '最新',type: 'created_at',list:[]},
- {name: '最热',type: 'view_count',list:[]},
- {name: '已关注',type: 'view_count',list:[]}
+ {name: '最新',type: 'created_at',list:[],..._public},
+ {name: '最热',type: 'view_count',list:[],..._public},
+ {name: '已关注',type: 'view_count',list:[],..._public}
],
tab_current: 0,
scrollH: 0,
@@ -140,7 +140,7 @@
});
});
},
- getMyAttention() {
+ getMyAttention(options = {}) {
let tab_item = this.tab_list[this.tab_current];
this.$http
.get({
@@ -150,31 +150,22 @@
},
})
.then(res => {
- console.log(res)
if (res.data.code == 200) {
- if (res.data.status) {
- let isPage = res.data.next_page_url == null?false:true;
- tab_item.isPage = isPage;
- if(!isPage) {
- tab_item.loadingClass = false;
- tab_item.loadingText = '没有更多数据啦~';
- }
- if(options.type == 'pageRefresh') {
- uni.stopPullDownRefresh();
- }else if(options.type == 'scrollRefresh') {
- this.isRefresher = false;
- }
- if(tab_item.page == 1) {
- tab_item.list = res.data.data.data;
- }else {
- tab_item.list.push(...res.data.data.data);
- }
- console.log('发现列表',tab_item.list)
- } else {
- wx.showModal({
- content: res.data.message || '请下拉页面刷新重试',
- showCancel: false
- });
+ let isPage = res.data.data.next_page_url == null?false:true;
+ tab_item.isPage = isPage;
+ if(!isPage) {
+ tab_item.loadingClass = false;
+ tab_item.loadingText = '没有更多数据啦~';
+ }
+ if(options.type == 'pageRefresh') {
+ uni.stopPullDownRefresh();
+ }else if(options.type == 'scrollRefresh') {
+ this.isRefresher = false;
+ }
+ if(tab_item.page == 1) {
+ tab_item.list = res.data.data.data;
+ }else {
+ tab_item.list.push(...res.data.data.data);
}
} else {
wx.showModal({
@@ -186,10 +177,7 @@
})
.catch(() => {
wx.hideLoading();
- wx.showModal({
- content: '请求失败',
- showCancel: false
- });
+
});
},
// 页面触底,加载下一页
@@ -256,7 +244,7 @@
page_size: this.pageSize,
data:{
order: discover_type,
- user_id: 1
+ user_id: this.$cookieStorage.get('user_info').id
}
})
.then(res => {
diff --git a/pages/discover/discoverdetails.vue b/pages/discover/discoverdetails.vue
index 8e4e2d9..36cde03 100644
--- a/pages/discover/discoverdetails.vue
+++ b/pages/discover/discoverdetails.vue
@@ -3,7 +3,7 @@
-
+
V
@@ -40,10 +40,10 @@