| | |
| | | */ |
| | | data: { |
| | | active: 0, |
| | | activeName: "proposition", |
| | | activeName: "bookOpinion", |
| | | tabList: [ |
| | | { |
| | | label: '图书建议', |
| | | key: 0, |
| | | value: 'proposition' |
| | | value: 'bookOpinion' |
| | | }, |
| | | { |
| | | label: '意见反馈', |
| | |
| | | value: "feedback" |
| | | } |
| | | ], |
| | | list: [ |
| | | { |
| | | name: "ceshi", |
| | | } |
| | | ], |
| | | list: [], |
| | | //分页 |
| | | page: 1, |
| | | limit: 10, |
| | |
| | | isBackTop: false, |
| | | setScrollValue: 0, |
| | | skeletonLoding: true, |
| | | |
| | | topicIdOrRefCode: 'bookOpinion' |
| | | }, |
| | | |
| | | /** |
| | |
| | | */ |
| | | onLoad(options) { |
| | | console.log(options); |
| | | // if (this.data.activeName == "proposition") { |
| | | // this.getDataList("bookOpinion", false); |
| | | // } else { |
| | | // this.getDataList("feedback", false); |
| | | // } |
| | | this.getDataList(false); |
| | | }, |
| | | |
| | | /** |
| | |
| | | skeletonLoding: true, |
| | | active: item.detail.value, |
| | | activeName: info.value, |
| | | topicIdOrRefCode: info.value, |
| | | list: [], |
| | | page: 1, |
| | | bottomLoading: false, |
| | | isMoreData: false, |
| | | }) |
| | | if (info.value == "proposition") { |
| | | that.getDataList("bookOpinion", false); |
| | | } else { |
| | | that.getDataList("feedback", false); |
| | | } |
| | | that.getDataList(false); |
| | | }, |
| | | |
| | | getDataList(code, isReachBottom) { |
| | | getDataList(isReachBottom) { |
| | | app.MG.ugc.getTopicMessageList({ |
| | | appRefCode: app.config.appRefCode, |
| | | topicIdOrRefCode: code, |
| | | topicIdOrRefCode: this.data.topicIdOrRefCode, |
| | | start: this.data.page * this.data.limit - this.data.limit, |
| | | size: this.data.limit, |
| | | sort: { |
| | |
| | | .then(res => { |
| | | try { |
| | | if (res.datas.length > 0) { |
| | | // res.datas.forEach((item) => { |
| | | // item.title = JSON.parse(item.content).content; |
| | | // item.createDate = moment(item.createDate).format("YYYY-MM-DD"); |
| | | // item.updateDate = moment(item.updateDate).format("YYYY-MM-DD");; |
| | | // item.feedBack = item.feedBack ? item.feedBack : "-"; |
| | | // }); |
| | | res.datas.forEach((item) => { |
| | | item.content = JSON.parse(item.content); |
| | | item.createDate = moment(item.createDate).format("YYYY-MM-DD"); |
| | | item.updateDate = moment(item.updateDate).format("YYYY-MM-DD"); |
| | | item.feedBack = item.feedBack ? item.feedBack : "-"; |
| | | }); |
| | | let dataList = res.datas; |
| | | //触底加载新数据并保留老数据 |
| | | if (isReachBottom) { |
| | |
| | | isMoreData: dataList.length > 0 ? false : true, |
| | | skeletonLoding: false, |
| | | }) |
| | | console.log(this.data.list, 333) |
| | | console.log(this.data.list, 123) |
| | | } else { |
| | | this.setData({ |
| | | skeletonLoding: false, |
| | |
| | | this.setData({ |
| | | triggered: false, |
| | | }) |
| | | if (this.data.activeName == "proposition") { |
| | | this.getDataList("bookOpinion", false); |
| | | } else { |
| | | this.getDataList("feedback", false); |
| | | } |
| | | this.getDataList(false); |
| | | this._freshing = false |
| | | }, |
| | | |
| | |
| | | }, 100) |
| | | return false; |
| | | } |
| | | if (this.data.activeName == "proposition") { |
| | | this.getDataList("bookOpinion", bool); |
| | | } else { |
| | | this.getDataList("feedback", bool); |
| | | } |
| | | this.getDataList(bool); |
| | | }, |
| | | |
| | | // 监听滚动距离 |