From 22cec03756b7e8eb9fcf7f3e87f8cb706898a787 Mon Sep 17 00:00:00 2001 From: xuxu Date: Wed, 19 Aug 2020 14:24:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=A4=A7=E9=87=8F=E4=B8=80?= =?UTF-8?q?=E6=9C=9F=E9=81=97=E7=95=99=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- models/topic.js | 5 +++-- pages/article/index.js | 14 +++++++------- pages/article/index.json | 2 +- pages/topics/index.js | 33 ++++++++++++++++++++++++-------- pages/user/myActivity/index.js | 4 +++- pages/user/myFavorite/index.json | 1 + pages/user/myFavorite/index.wxss | 8 +++++--- 7 files changed, 45 insertions(+), 22 deletions(-) diff --git a/models/topic.js b/models/topic.js index fbe6ded..7183756 100644 --- a/models/topic.js +++ b/models/topic.js @@ -195,12 +195,13 @@ class TopicModel extends HTTP { } this.request(params) } - getCenterList(success) { + getCenterList(page,success) { let params = { - url: TopicBaseUrl.topic_center_url, + url: TopicBaseUrl.topic_center_url + "?pageNo=" + page, method: Method.POST, data: { typeCode:'sc-fnzx', + pageSize:10 }, success: success } diff --git a/pages/article/index.js b/pages/article/index.js index 8e9b373..63d40dc 100644 --- a/pages/article/index.js +++ b/pages/article/index.js @@ -73,17 +73,17 @@ Page({ this.fetchArticeApi() }, fetchArticeApi () { - wx.showLoading({ - title: '加载中...', - }) + // wx.showLoading({ + // title: '加载中...', + // }) artice.getDetail(this.data.aId, (res) => { //console.log('artice detail') console.log(res) const data = res.result const date = dayjs(data.createTime).format('MM月DD日') - wx.setNavigationBarTitle({ - title: data.title, - }) + // wx.setNavigationBarTitle({ + // title: data.title, + // }) if(data.flag == 0 || data.flag == 1){ var disable = false; @@ -103,7 +103,7 @@ Page({ collectNum: data.collectNum, flag:data.flag }, () => { - wx.hideLoading() + // wx.hideLoading() }) }) }, diff --git a/pages/article/index.json b/pages/article/index.json index c5ae6c5..d8b13cb 100644 --- a/pages/article/index.json +++ b/pages/article/index.json @@ -1,5 +1,5 @@ { - "navigationBarTitleText": "详情", + "navigationBarTitleText": "赋能中心", "usingComponents": { "e-ibutton": "/components/image-button/index" } diff --git a/pages/topics/index.js b/pages/topics/index.js index 460029f..3bd319e 100644 --- a/pages/topics/index.js +++ b/pages/topics/index.js @@ -169,9 +169,8 @@ Page({ //赋能中心 fetchCenterList(){ - topicModel.getCenterList(res => { - console.log('赋能中心') - console.log(res) + let page = this.data.currPage; + topicModel.getCenterList(page,res => { if (res.list.length == 0) { wx.showToast({ title: '暂无数据', @@ -179,11 +178,29 @@ Page({ }) return } - this.setData({ - centerList: res.list - }) - console.log("centerList已更新"); - console.log(this.data.centerList); + + if(page == 1){ + this.setData({ + centerList: res.list + }) + }else{ + if (res.list.length > 0) { + const list = [...this.data.centerList, ...res.list] + this.setData({ + centerList: list + }) + } else { + const page = this.data.currPage - 1 + this.setData({ + currPage: page + }) + wx.showToast({ + title: '已加载全部', + icon: 'none' + }) + } + } + }) }, //金点子 diff --git a/pages/user/myActivity/index.js b/pages/user/myActivity/index.js index 8935aad..29b59af 100644 --- a/pages/user/myActivity/index.js +++ b/pages/user/myActivity/index.js @@ -17,12 +17,14 @@ Page({ * 生命周期函数--监听页面加载1 */ onLoad: function (options) { + + }, + onShow:function(){ this.setData({ currentPage: 1 }) this.fetchDataList() }, - fetchDataList(){ let page = this.data.currentPage userModel.getMyActivityList(page,res=>{ diff --git a/pages/user/myFavorite/index.json b/pages/user/myFavorite/index.json index 2e2a22f..c876db5 100644 --- a/pages/user/myFavorite/index.json +++ b/pages/user/myFavorite/index.json @@ -1,5 +1,6 @@ { "enablePullDownRefresh": true, + "onReachBottomDistance":50, "navigationBarTitleText": "我的收藏", "usingComponents": { "cell": "../myTopics/myParticipant/cell/index", diff --git a/pages/user/myFavorite/index.wxss b/pages/user/myFavorite/index.wxss index 13ec96c..d6aa0a4 100644 --- a/pages/user/myFavorite/index.wxss +++ b/pages/user/myFavorite/index.wxss @@ -17,8 +17,8 @@ page{ display: flex; background-color: White; border-top: 1rpx solid rgba(0, 0, 0, 0.116); - /* position: fixed; */ - /* z-index:999; */ + position: fixed; + z-index:999; /* margin-top:20rpx; */ /* border-bottom: 1rpx solid rgba(0, 0, 0, 0.116); */ } @@ -33,5 +33,7 @@ page{ .content{ width:100%; flex: 1; - overflow: scroll; + margin-top:80rpx; + /* height: calc(100% - 80rpx); */ + /* overflow: scroll; */ } \ No newline at end of file