| | |
| | | // pages/bookServices/detail/components/note/note.js |
| | | const app = getApp(); |
| | | import { |
| | | loginInfo |
| | | } from '../../../../../assets/js/login'; |
| | | import moment from 'moment' |
| | | Component({ |
| | | /** |
| | |
| | | }); |
| | | }, |
| | | openDialog() { |
| | | this.setData({ |
| | | submitTitle: this.properties.bookInfo.name, |
| | | showNoteDialog: true, |
| | | }); |
| | | const token = wx.getStorageSync(app.config.tokenKey) |
| | | if (token) { |
| | | this.setData({ |
| | | submitTitle: this.properties.bookInfo.name, |
| | | showNoteDialog: true, |
| | | }); |
| | | } else { |
| | | loginInfo(app, (data) => {}) |
| | | } |
| | | }, |
| | | closeDialog() { |
| | | this.setData({ |
| | |
| | | } |
| | | |
| | | let submitData = { |
| | | bookId: this.properties.bookInfo.id, |
| | | content: this.data.content.replace(/^\s*|\s*$/g, ""), |
| | | name: this.data.userName.replace(/^\s*|\s*$/g, ""), |
| | | email: "", |
| | |
| | | }; |
| | | var data = { |
| | | topicIdOrRefCode: "onlineQuestioning", |
| | | name: "意见反馈", |
| | | name: this.properties.bookInfo.name, |
| | | content: JSON.stringify(submitData), |
| | | type: "ProductComment", |
| | | cmsTypeRefCode: "", |
| | |
| | | this.setData({ |
| | | noList: false, |
| | | }); |
| | | let topicId; |
| | | app.MG.ugc |
| | | .getTopicMessageList({ |
| | | appRefCode: app.config.appRefCode, |
| | |
| | | if (!res.datas.length) { |
| | | return this.setData({ |
| | | loading: false, |
| | | noList: true, |
| | | noteList: res.datas, |
| | | }); |
| | | } |
| | | // notePage.value.total = res.totalSize |
| | | let list = [] |
| | | res.datas.forEach((item) => { |
| | | item.title = JSON.parse(item.content).content; |
| | | item.createDate = moment(item.createDate).format("YYYY-MM-DD HH:mm:ss"); |
| | | item.updateDate = moment(item.updateDate).format("YYYY-MM-DD HH:mm:ss"); |
| | | item.feedBack = item.feedBack ? item.feedBack : '暂未回复' |
| | | if (this.properties.bookInfo.id == JSON.parse(item.content).bookId) { |
| | | list.push(item) |
| | | } |
| | | }); |
| | | this.setData({ |
| | | "pageCount.total": res.totalSize, |
| | | onlineQuestionsList: res.datas, |
| | | "pageCount.total": list.length, |
| | | onlineQuestionsList: list, |
| | | loading: false, |
| | | noList: false, |
| | | noList: list.length ? false : true, |
| | | }); |
| | | console.log(this.data.onlineQuestionsList, 3456) |
| | | }); |