Browse Source

修复大量一期遗留的bug

master
xuxu 5 years ago
parent
commit
22cec03756
  1. 5
      models/topic.js
  2. 14
      pages/article/index.js
  3. 2
      pages/article/index.json
  4. 33
      pages/topics/index.js
  5. 4
      pages/user/myActivity/index.js
  6. 1
      pages/user/myFavorite/index.json
  7. 8
      pages/user/myFavorite/index.wxss

5
models/topic.js

@ -195,12 +195,13 @@ class TopicModel extends HTTP {
} }
this.request(params) this.request(params)
} }
getCenterList(success) { getCenterList(page,success) {
let params = { let params = {
url: TopicBaseUrl.topic_center_url, url: TopicBaseUrl.topic_center_url + "?pageNo=" + page,
method: Method.POST, method: Method.POST,
data: { data: {
typeCode:'sc-fnzx', typeCode:'sc-fnzx',
pageSize:10
}, },
success: success success: success
} }

14
pages/article/index.js

@ -73,17 +73,17 @@ Page({
this.fetchArticeApi() this.fetchArticeApi()
}, },
fetchArticeApi () { fetchArticeApi () {
wx.showLoading({ // wx.showLoading({
title: '加载中...', // title: '加载中...',
}) // })
artice.getDetail(this.data.aId, (res) => { artice.getDetail(this.data.aId, (res) => {
//console.log('artice detail') //console.log('artice detail')
console.log(res) console.log(res)
const data = res.result const data = res.result
const date = dayjs(data.createTime).format('MM月DD日') const date = dayjs(data.createTime).format('MM月DD日')
wx.setNavigationBarTitle({ // wx.setNavigationBarTitle({
title: data.title, // title: data.title,
}) // })
if(data.flag == 0 || data.flag == 1){ if(data.flag == 0 || data.flag == 1){
var disable = false; var disable = false;
@ -103,7 +103,7 @@ Page({
collectNum: data.collectNum, collectNum: data.collectNum,
flag:data.flag flag:data.flag
}, () => { }, () => {
wx.hideLoading() // wx.hideLoading()
}) })
}) })
}, },

2
pages/article/index.json

@ -1,5 +1,5 @@
{ {
"navigationBarTitleText": "详情", "navigationBarTitleText": "赋能中心",
"usingComponents": { "usingComponents": {
"e-ibutton": "/components/image-button/index" "e-ibutton": "/components/image-button/index"
} }

33
pages/topics/index.js

@ -169,9 +169,8 @@ Page({
//赋能中心 //赋能中心
fetchCenterList(){ fetchCenterList(){
topicModel.getCenterList(res => { let page = this.data.currPage;
console.log('赋能中心') topicModel.getCenterList(page,res => {
console.log(res)
if (res.list.length == 0) { if (res.list.length == 0) {
wx.showToast({ wx.showToast({
title: '暂无数据', title: '暂无数据',
@ -179,11 +178,29 @@ Page({
}) })
return return
} }
this.setData({
centerList: res.list if(page == 1){
}) this.setData({
console.log("centerList已更新"); centerList: res.list
console.log(this.data.centerList); })
}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'
})
}
}
}) })
}, },
//金点子 //金点子

4
pages/user/myActivity/index.js

@ -17,12 +17,14 @@ Page({
* 生命周期函数--监听页面加载1 * 生命周期函数--监听页面加载1
*/ */
onLoad: function (options) { onLoad: function (options) {
},
onShow:function(){
this.setData({ this.setData({
currentPage: 1 currentPage: 1
}) })
this.fetchDataList() this.fetchDataList()
}, },
fetchDataList(){ fetchDataList(){
let page = this.data.currentPage let page = this.data.currentPage
userModel.getMyActivityList(page,res=>{ userModel.getMyActivityList(page,res=>{

1
pages/user/myFavorite/index.json

@ -1,5 +1,6 @@
{ {
"enablePullDownRefresh": true, "enablePullDownRefresh": true,
"onReachBottomDistance":50,
"navigationBarTitleText": "我的收藏", "navigationBarTitleText": "我的收藏",
"usingComponents": { "usingComponents": {
"cell": "../myTopics/myParticipant/cell/index", "cell": "../myTopics/myParticipant/cell/index",

8
pages/user/myFavorite/index.wxss

@ -17,8 +17,8 @@ page{
display: flex; display: flex;
background-color: White; background-color: White;
border-top: 1rpx solid rgba(0, 0, 0, 0.116); border-top: 1rpx solid rgba(0, 0, 0, 0.116);
/* position: fixed; */ position: fixed;
/* z-index:999; */ z-index:999;
/* margin-top:20rpx; */ /* margin-top:20rpx; */
/* border-bottom: 1rpx solid rgba(0, 0, 0, 0.116); */ /* border-bottom: 1rpx solid rgba(0, 0, 0, 0.116); */
} }
@ -33,5 +33,7 @@ page{
.content{ .content{
width:100%; width:100%;
flex: 1; flex: 1;
overflow: scroll; margin-top:80rpx;
/* height: calc(100% - 80rpx); */
/* overflow: scroll; */
} }
Loading…
Cancel
Save