| | |
| | | }], |
| | | tabIndex: 0, |
| | | specialSubjectList: [], |
| | | |
| | | now: new Date(), // 假设这是当前时间 |
| | | formattedDate: '', // 用于存储格式化后的日期时间字符串 |
| | | batList: [], |
| | | specialDiscussionList: [], |
| | | searchValue: '', |
| | | batListValue: '' |
| | | batListValue: '', |
| | | loading: false |
| | | }, |
| | | |
| | | /** |
| | |
| | | /** |
| | | * 用户点击右上角分享 |
| | | */ |
| | | onShareAppMessage() { |
| | | |
| | | }, |
| | | onShareAppMessage() {}, |
| | | onShareTimeline() {}, |
| | | goBack() { |
| | | wx.navigateBack(); |
| | | }, |
| | |
| | | this.setData({ |
| | | batListValue: value |
| | | }) |
| | | |
| | | this.specialDiscussionGet(this.data.batList[value]) |
| | | |
| | | |
| | | }, |
| | | onTabsTap(event) { |
| | | const index = event.currentTarget.dataset.index |
| | |
| | | this.specialDiscussionGet(this.data.batList[0]) |
| | | |
| | | }, |
| | | // 获取图片文字列表 |
| | | // 获取即将开播列表 |
| | | ceShiList() { |
| | | this.setData({ |
| | | loading: true |
| | | }) |
| | | let searchObj = {} |
| | | if (this.data.searchValue) { |
| | | searchObj = { |
| | | 'Name*': this.data.searchValue.trim() |
| | | // '||subtitle*': searchInputValue.value.trim() |
| | | } |
| | | } |
| | | |
| | | |
| | | app.MG.store |
| | | .getProductList({ |
| | | storeInfo: 'jsek_seminar', |
| | | storeInfo: app.config.seminar, |
| | | path: '*', |
| | | queryType: '*', |
| | | paging: { |
| | | start: 0, |
| | | size: 99 |
| | | }, |
| | | |
| | | fields: { |
| | | content: [], |
| | | subtitle: [], |
| | |
| | | author: [], |
| | | viewCount: [], |
| | | startTime: [], //开播时间 |
| | | // "liveTime>=": [formattedDate.value], //直播时间 |
| | | endTime: [], |
| | | liveTime: [], |
| | | lecturer: [], |
| | | position: [], |
| | |
| | | const specialSubjectList = [] |
| | | res.datas.forEach((item) => { |
| | | item.price = item.price.toFixed(2) |
| | | |
| | | |
| | | const date1 = new Date(this.data.formattedDate) |
| | | const date2 = new Date(item.liveTime) |
| | | |
| | | // 比较两个日期 |
| | | if (date1 > date2) { |
| | | // console.log('直播结束,请看回放') |
| | | } else if (date1 < date2) { |
| | | // console.log('直播还没开始,请看即将开播') |
| | | |
| | | const date2 = new Date(item.endTime) |
| | | if (date1 < date2) { |
| | | specialSubjectList.push(item) |
| | | |
| | | console.log(specialSubjectList); |
| | | } else { |
| | | // console.log('两个时间相同,') |
| | | } |
| | | }) |
| | | this.setData({ |
| | | specialSubjectList, |
| | | |
| | | loading: false, |
| | | "tabList[0].amount": specialSubjectList.length |
| | | }) |
| | | }) |
| | |
| | | }); |
| | | }, |
| | | onLink(e) { |
| | | |
| | | const item = e.currentTarget.dataset.item |
| | | console.log(item.jsek_link); |
| | | wx.navigateTo({ |
| | | url: '/pages/specialDiscussion/webView/index?link=' + item.jsek_link |
| | | }); |
| | | }, |
| | | |
| | | async getCourseTypeListList() { |
| | | |
| | | const quer = { |
| | | path: '*', |
| | | filterList: [{ |
| | |
| | | type: 'Asc', |
| | | field: 'LinkOrder' |
| | | }, |
| | | |
| | | } |
| | | const data = await app.MG.store.getStoreChannelList(quer) |
| | | let dataList = data.datas |
| | | |
| | | // data.datas.forEach(item => { |
| | | // if (item.refCode != "jsek_homepageSeminar") { |
| | | // console.log(item); |
| | | // dataList.push(item) |
| | | // } |
| | | // }) |
| | | let dataList = [] |
| | | data.datas.forEach(item => { |
| | | if (item.refCode != "jsek_homepageSeminar") { |
| | | console.log(item); |
| | | dataList.push(item) |
| | | } |
| | | }) |
| | | this.setData({ |
| | | batList: dataList |
| | | }) |
| | | |
| | | |
| | | this.specialDiscussionGet(data.datas[0]) |
| | | |
| | | |
| | | }, |
| | | |
| | | |
| | | // 获取直播回放 |
| | | specialDiscussionGet(item) { |
| | | let searchObj = {} |
| | | if (this.data.searchValue) { |
| | |
| | | start: 0, |
| | | size: 99 |
| | | }, |
| | | |
| | | fields: { |
| | | content: [], |
| | | subtitle: [], |
| | |
| | | author: [], |
| | | viewCount: [], |
| | | startTime: [], |
| | | endTime: [], |
| | | liveTime: [], |
| | | lecturer: [], |
| | | position: [], |
| | |
| | | }) |
| | | .then((res) => { |
| | | res.datas.forEach((item) => { |
| | | item.price = item.price.toFixed(2) |
| | | const date1 = new Date(this.data.formattedDate) |
| | | const date2 = new Date(item.liveTime) |
| | | |
| | | const date2 = new Date(item.endTime) |
| | | // 比较两个日期 |
| | | if (date1 > date2) { |
| | | // console.log('直播结束,请看回放') |
| | | data.push(item) |
| | | } else if (date1 < date2) { |
| | | // console.log('直播还没开始,请看即将开播') |
| | | } else { |
| | | // console.log('两个时间相同,') |
| | | } |
| | | }) |
| | | |
| | | this.setData({ |
| | | specialDiscussionList: data, |
| | | "tabList[1].amount": data.length |
| | | "tabList[1].amount": data.length, |
| | | }) |
| | | |
| | | console.log(this.data.specialDiscussionList); |
| | | }) |
| | | }, |
| | |
| | | console.log(this.data.searchValue); |
| | | this.ceShiList() |
| | | this.specialDiscussionGet(this.data.batList[this.data.batListValue]) |
| | | |
| | | |
| | | }, |
| | | |
| | | }) |