| | |
| | | * 页面的初始数据 |
| | | */ |
| | | data: { |
| | | loading: true, |
| | | hidden: true, |
| | | bookName: '', |
| | | bookBeginDate: '', |
| | | bookCreator: '', |
| | | bookContent: '', |
| | | bookImage: '', |
| | | bookExhibitionList: [] |
| | | bookExhibitionList: [], |
| | | navBarHeight: '', |
| | | barHeight: '', |
| | | subtitleName: '', |
| | | }, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面加载 |
| | | */ |
| | | onLoad(options) { |
| | | const systInfo = wx.getSystemInfoSync(); |
| | | const menu = wx.getMenuButtonBoundingClientRect(); // 胶囊信息 |
| | | const navBarHeight = (menu.top - systInfo.statusBarHeight) * 2 + menu.height; // 导航栏高度 |
| | | this.setData({ |
| | | navBarHeight: navBarHeight, |
| | | barHeight: systInfo.statusBarHeight, |
| | | }) |
| | | console.log(); |
| | | |
| | | |
| | | this.setData({ |
| | | bookName: options.bookName, |
| | | subtitleName: options.subtitleName |
| | | }) |
| | | |
| | | const passId = options.id |
| | | |
| | |
| | | }, |
| | | |
| | | bookExhibitionGet(passId) { |
| | | this.setData({ |
| | | loading: true, |
| | | hidden: true, |
| | | }) |
| | | wx.showLoading({ |
| | | title: '加载中...', |
| | | }) |
| | |
| | | bookImage: res.datas.icon |
| | | }); |
| | | wx.hideLoading() |
| | | this.setData({ |
| | | loading: false, |
| | | hidden: false, |
| | | }) |
| | | }) |
| | | }, |
| | | //书展详情接口 |
| | | getBookExhibitionDetails(passId) { |
| | | this.setData({ |
| | | loading: true, |
| | | hidden: true, |
| | | }) |
| | | app.MG.store.getProductList({ |
| | | path: '*', |
| | | storeInfo: 'jsek_bookFair', |
| | |
| | | this.setData({ |
| | | bookExhibitionList: res.datas |
| | | }) |
| | | console.log(this.data.bookExhibitionList, 88888); |
| | | console.log(this.data.bookExhibitionList, 'bookExhibitionList'); |
| | | this.setData({ |
| | | loading: false, |
| | | hidden: false, |
| | | }) |
| | | }) |
| | | }, |
| | | onBookDetails(event) { |
| | | const item = event.currentTarget.dataset.item; |
| | | console.log(item, 'item'); |
| | | // wx.navigateTo({ |
| | | // url: '/pages/bookExhibitionDetails/index?id?name=' + item.id + item.name // 假设跳转到详情页面,并传递了id参数 |
| | | // }); |
| | | } |
| | | wx.navigateTo({ |
| | | url: '/packageBookService/pages/bookServices/detail/index?id=' + item.id + '&name=' + item.name |
| | | }); |
| | | }, |
| | | goBack() { |
| | | wx.navigateBack(); |
| | | }, |
| | | |
| | | }) |