| | |
| | | value: [], |
| | | options: [], |
| | | }, |
| | | navBarHeight: '', |
| | | barHeight: '' |
| | | |
| | | }, |
| | | |
| | | |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面加载 |
| | | */ |
| | | onLoad(options) { |
| | | // console.log(this.data.filteredItems, 88888); |
| | | const systInfo = wx.getSystemInfoSync(); |
| | | const menu = wx.getMenuButtonBoundingClientRect(); // 胶囊信息 |
| | | const navBarHeight = (menu.top - systInfo.statusBarHeight) * 2 + menu.height; // 导航栏高度 |
| | | this.setData({ |
| | | navBarHeight: navBarHeight, |
| | | barHeight: systInfo.statusBarHeight, |
| | | }) |
| | | |
| | | // 单列选择器选项 |
| | | const singleSelectOptions = this.data.filteredItems.map(item => ({ |
| | | label: item.name, |
| | | value: item.value, |
| | | disabled: false, |
| | | })) |
| | | |
| | | if (this.data.filteredItems = []) { |
| | | console.log(11111); |
| | | singleSelectOptions.push({ |
| | | label: '禁用选项', |
| | | value: 'disabled', |
| | | disabled: true, |
| | | }); |
| | | } |
| | | |
| | | // singleSelectOptions.push({ |
| | | // label: '禁用选项', |
| | | // value: 'disabled', |
| | | // disabled: true, |
| | | // }); |
| | | |
| | | |
| | | // 更新数据 |
| | | this.setData({ |
| | | 'multipleSelect.options': singleSelectOptions, |
| | | }); |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面初次渲染完成 |
| | |
| | | this.setData({ |
| | | bookExhibitionList: list |
| | | }) |
| | | |
| | | //取消 |
| | | wx.hideLoading() |
| | | // console.log(this.data.bookExhibitionList, '数据'); |
| | |
| | | }, |
| | | |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面加载 |
| | | */ |
| | | onLoad(options) { |
| | | // console.log(this.data.filteredItems, 88888); |
| | | |
| | | // 单列选择器选项 |
| | | const singleSelectOptions = this.data.filteredItems.map(item => ({ |
| | | label: item.name, |
| | | value: item.value, |
| | | disabled: false, |
| | | })) |
| | | |
| | | if (this.data.filteredItems = []) { |
| | | console.log(11111); |
| | | singleSelectOptions.push({ |
| | | label: '禁用选项', |
| | | value: 'disabled', |
| | | disabled: true, |
| | | }); |
| | | } |
| | | |
| | | // singleSelectOptions.push({ |
| | | // label: '禁用选项', |
| | | // value: 'disabled', |
| | | // disabled: true, |
| | | // }); |
| | | |
| | | |
| | | // 更新数据 |
| | | this.setData({ |
| | | 'multipleSelect.options': singleSelectOptions, |
| | | }); |
| | | |
| | | }, |
| | | |
| | | |
| | | // 总分类 |
| | |
| | | const item = event.currentTarget.dataset.item; |
| | | console.log(item); |
| | | wx.navigateTo({ |
| | | url: '/pages/bookExhibitionDetails/index?id=' + item.id // 假设跳转到详情页面,并传递了id参数 |
| | | url: '/pages/bookExhibitionDetails/index?id=' + item.id + '&bookName=' + item.name // 假设跳转到详情页面,并传递了id参数 |
| | | }); |
| | | }, |
| | | // 搜索框 |
| | |
| | | }) |
| | | console.log(this.data.keyword, 'keyword'); |
| | | this.bookExhibitionGet() |
| | | } |
| | | }, |
| | | goBack() { |
| | | wx.navigateBack(); |
| | | }, |
| | | }) |