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. 27
      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)
}
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
}

14
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()
})
})
},

2
pages/article/index.json

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

27
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
}
if(page == 1){
this.setData({
centerList: res.list
})
console.log("centerList已更新");
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
*/
onLoad: function (options) {
},
onShow:function(){
this.setData({
currentPage: 1
})
this.fetchDataList()
},
fetchDataList(){
let page = this.data.currentPage
userModel.getMyActivityList(page,res=>{

1
pages/user/myFavorite/index.json

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

8
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; */
}
Loading…
Cancel
Save