| | |
| | | * 页面的初始数据 |
| | | */ |
| | | data: { |
| | | isMore: null, |
| | | tabPanelstyle: 'display:flex;justify-content:center;align-items:center;', |
| | | navBarHeight: '', |
| | | barHeight: '', |
| | |
| | | biblioClassificationData: [],//书展 |
| | | biblioClassificationTotal: 0, |
| | | bookFairData: [],//书目 |
| | | bookFairTotal: 0 |
| | | bookFairTotal: 0, |
| | | pageCount: { |
| | | page: 1, |
| | | total: 0, |
| | | }, |
| | | tabValue: '' |
| | | }, |
| | | |
| | | /** |
| | |
| | | const menu = wx.getMenuButtonBoundingClientRect(); // 胶囊信息 |
| | | const navBarHeight = (menu.top - systInfo.statusBarHeight) * 2 + menu.height; // 导航栏高度 |
| | | this.setData({ |
| | | |
| | | navBarHeight: navBarHeight, |
| | | barHeight: systInfo.statusBarHeight, |
| | | |
| | | searchVal: options.searchVal |
| | | }) |
| | | |
| | | |
| | | this.retrievalPageGet() |
| | | this.bibliographyGet() |
| | | let event = { |
| | | detail: { |
| | | |
| | | value: "0" |
| | | } |
| | | } |
| | | this.onTabsChange(event) |
| | | }, |
| | | |
| | | /** |
| | |
| | | this.retrievalPageGet() |
| | | this.bibliographyGet() |
| | | }, |
| | | |
| | | |
| | | //标签的切换 |
| | | onTabsChange(event) { |
| | | console.log(`Change tab, tab-panel searchVal is ${event.detail.searchVal}.`); |
| | | const value = event.detail.value |
| | | // if (this.data.bookData <= 0 || this.data.courseData <= 0 || this.data.digitalTextbooksData <= 0 || this.data.seminarData <= 0 || this.data.biblioClassificationData <= 0 || this.data.bookFairData <= 0) { |
| | | // this.setData({ |
| | | // isMore: true |
| | | // }) |
| | | // } |
| | | if (value === '0') { |
| | | this.setData({ |
| | | tabValue: value, |
| | | isMore: false |
| | | }) |
| | | |
| | | } else if (value === '1') { |
| | | console.log(value, 'tab'); |
| | | this.setData({ |
| | | tabValue: value, |
| | | isMore: false |
| | | }) |
| | | } else if (value === '2') { |
| | | this.setData({ |
| | | tabValue: value, |
| | | isMore: false |
| | | }) |
| | | } else if (value === '3') { |
| | | this.setData({ |
| | | tabValue: value, |
| | | isMore: false |
| | | }) |
| | | } else if (value === '4') { |
| | | this.setData({ |
| | | tabValue: value, |
| | | isMore: false |
| | | }) |
| | | } else if (value === '5') { |
| | | this.setData({ |
| | | tabValue: value, |
| | | isMore: false |
| | | }) |
| | | } |
| | | |
| | | }, |
| | | |
| | | onTabsClick(event) { |
| | | console.log(`Click tab, tab-panel searchVal is ${event.detail.searchVal}.`); |
| | | }, |
| | | |
| | | |
| | | |
| | | retrievalPageGet() { |
| | |
| | | }, |
| | | PageQuery: { |
| | | Start: 0, |
| | | Size: 999 |
| | | Size: this.data.pageCount.page * 9, |
| | | }, |
| | | SortQuery: [ |
| | | { |
| | |
| | | }, |
| | | PageQuery: { |
| | | Start: 0, |
| | | Size: 999 |
| | | Size: this.data.pageCount.page * 4 |
| | | }, |
| | | SortQuery: [ |
| | | { |
| | |
| | | }, |
| | | PageQuery: { |
| | | Start: 0, |
| | | Size: 999 |
| | | Size: this.data.pageCount.page * 9, |
| | | }, |
| | | SortQuery: [ |
| | | { |
| | |
| | | }, |
| | | PageQuery: { |
| | | Start: 0, |
| | | Size: 999 |
| | | Size: this.data.pageCount.page * 6, |
| | | }, |
| | | SortQuery: [ |
| | | { |
| | |
| | | |
| | | PageQuery: { |
| | | Start: 0, |
| | | Size: 999 |
| | | Size: this.data.pageCount.page * 10 |
| | | }, |
| | | SortQuery: [ |
| | | { |
| | |
| | | method: 'post', |
| | | data: body |
| | | }).then((resp) => { |
| | | // console.log(resp); |
| | | console.log(resp, 'resp'); |
| | | |
| | | //图书 0 |
| | | const data1 = resp[0] |
| | |
| | | }) |
| | | this.setData({ |
| | | bookData: datas1, |
| | | bookTotal: data1.totalCount |
| | | bookTotal: data1.totalCount, |
| | | |
| | | }) |
| | | |
| | | |
| | |
| | | fields |
| | | }) |
| | | |
| | | datas5.forEach((items) => { |
| | | items.subtitleName = items.subtitle + items.name |
| | | }) |
| | | // console.log(datas5, 'sadasd'); |
| | | this.setData({ |
| | | biblioClassificationData: datas5, |
| | | biblioClassificationTotal: data5.totalCount |
| | |
| | | |
| | | |
| | | }) |
| | | wx.stopPullDownRefresh() |
| | | |
| | | |
| | | |
| | | }, |
| | | bibliographyGet() { |
| | |
| | | queryType: '*', |
| | | paging: { |
| | | start: 0, |
| | | size: 999 |
| | | size: this.data.pageCount.page * 9, |
| | | }, |
| | | coverSize: { |
| | | width: 260 |
| | |
| | | }, |
| | | SysType: "CmsItem" |
| | | }).then(res => { |
| | | // console.log(res); |
| | | |
| | | this.setData({ |
| | | bookFairData: res.datas, |
| | | bookFairTotal: res.total |
| | | }) |
| | | |
| | | }) |
| | | wx.stopPullDownRefresh() |
| | | }, |
| | | downloadData(event) { |
| | | console.log(111); |
| | | const item = event.currentTarget.dataset.item; |
| | | // console.log(item.datas.freeFile.searchVal); |
| | | const URL = 'http://182.92.203.7:3001/file/api/ApiDownload?md5=' + item.datas.freeFile.searchVal |
| | | // console.log(item.datas.freeFile.Value); |
| | | const URL = app.config.requestCtx + '/file/api/ApiDownload?md5=' + item.datas.freeFile.Value |
| | | item.determine = false |
| | | |
| | | console.log(URL, 'URL'); |
| | | setTimeout(() => { |
| | | if (URL) { |
| | | item.determine = true |
| | |
| | | console.log(this.data.searchVal); |
| | | this.retrievalPageGet() |
| | | this.bibliographyGet() |
| | | } |
| | | }, |
| | | onBook(e) { |
| | | console.log(e.currentTarget.dataset.item); |
| | | const item = e.currentTarget.dataset.item |
| | | wx.navigateTo({ |
| | | url: '/packageBookService/pages/bookServices/detail/index?id=' + item.id + '&name=' + item.name |
| | | }) |
| | | }, |
| | | onBookExhibitionDetails(e) { |
| | | console.log(e.currentTarget.dataset.item); |
| | | const item = e.currentTarget.dataset.item |
| | | |
| | | wx.navigateTo({ |
| | | url: '/pages/bookExhibitionDetails/index?id=' + item.id + '&bookName=' + item.name // 假设跳转到详情页面,并传递了id参数 |
| | | }); |
| | | }, |
| | | |
| | | //上拉函数 |
| | | onPullDownRefresh() { |
| | | console.log("下拉刷新..."); |
| | | }, |
| | | /** |
| | | * 页面上拉触底事件的处理函数 |
| | | */ |
| | | onReachBottom(e) { |
| | | if (this.data.tabValue == 0) { |
| | | console.log(0); |
| | | if (this.data.bookData.length < this.data.bookTotal) { |
| | | this.setData({ |
| | | isMore: true, |
| | | "pageCount.page": this.data.pageCount.page + 1 |
| | | }) |
| | | this.retrievalPageGet() |
| | | } else { |
| | | this.setData({ |
| | | isMore: true, |
| | | }) |
| | | setTimeout(() => { |
| | | this.setData({ |
| | | isMore: false |
| | | }) |
| | | }, 100) |
| | | |
| | | } |
| | | |
| | | } else if (this.data.tabValue == 1) { |
| | | |
| | | if (this.data.courseData.length < this.data.courseTotal) { |
| | | this.setData({ |
| | | isMore: true, |
| | | "pageCount.page": this.data.pageCount.page + 1 |
| | | }) |
| | | this.retrievalPageGet() |
| | | } else { |
| | | this.setData({ |
| | | isMore: true, |
| | | }) |
| | | setTimeout(() => { |
| | | this.setData({ |
| | | isMore: false |
| | | }) |
| | | }, 100) |
| | | |
| | | } |
| | | console.log(2); |
| | | } else if (this.data.tabValue == 2) { |
| | | |
| | | if (this.data.digitalTextbooksData.length < this.data.digitalTextbooksTotal && this.data.digitalTextbooksData.length > 9) { |
| | | this.setData({ |
| | | isMore: true, |
| | | "pageCount.page": this.data.pageCount.page + 1 |
| | | }) |
| | | this.retrievalPageGet() |
| | | } else { |
| | | this.setData({ |
| | | isMore: true, |
| | | }) |
| | | setTimeout(() => { |
| | | this.setData({ |
| | | isMore: false |
| | | }) |
| | | }, 100) |
| | | |
| | | } |
| | | console.log(2); |
| | | } else if (this.data.tabValue == 3) { |
| | | if (this.data.seminarData.length < this.data.seminarTotal) { |
| | | this.setData({ |
| | | isMore: true, |
| | | "pageCount.page": this.data.pageCount.page + 1 |
| | | }) |
| | | this.retrievalPageGet() |
| | | } else { |
| | | this.setData({ |
| | | isMore: true, |
| | | }) |
| | | setTimeout(() => { |
| | | this.setData({ |
| | | isMore: false |
| | | }) |
| | | }, 100) |
| | | } |
| | | console.log(3); |
| | | } else if (this.data.tabValue == 4) { |
| | | if (this.data.bookFairData.length < this.data.bookFairTotal) { |
| | | this.setData({ |
| | | isMore: true, |
| | | "pageCount.page": this.data.pageCount.page + 1 |
| | | }) |
| | | this.bibliographyGet() |
| | | } else { |
| | | this.setData({ |
| | | isMore: true, |
| | | }) |
| | | setTimeout(() => { |
| | | this.setData({ |
| | | isMore: false |
| | | }) |
| | | }, 100) |
| | | } |
| | | console.log(4); |
| | | } else if (this.data.tabValue == 5) { |
| | | if (this.data.biblioClassificationData.length < this.data.biblioClassificationTotal) { |
| | | this.setData({ |
| | | isMore: true, |
| | | "pageCount.page": this.data.pageCount.page + 1 |
| | | }) |
| | | this.retrievalPageGet() |
| | | } else { |
| | | this.setData({ |
| | | isMore: true, |
| | | }) |
| | | setTimeout(() => { |
| | | this.setData({ |
| | | isMore: false |
| | | }) |
| | | }, 100) |
| | | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | }, |
| | | |
| | | // 下拉函数 |
| | | onPullDownRefresh() { |
| | | |
| | | if (this.data.tabValue == 4) { |
| | | this.setData({ |
| | | "pageCount.page": 1 |
| | | }) |
| | | this.bibliographyGet() |
| | | } else { |
| | | this.setData({ |
| | | "pageCount.page": 1 |
| | | }) |
| | | this.retrievalPageGet() |
| | | } |
| | | |
| | | |
| | | |
| | | }, |
| | | }) |