| | |
| | | * 页面的初始数据 |
| | | */ |
| | | data: { |
| | | keynoteDisabled: true, |
| | | value: '', |
| | | keyword: '', |
| | | nameSort: null, |
| | |
| | | price: 'jsek_teacherEducation', |
| | | label: '教师教育', |
| | | }, |
| | | |
| | | ], |
| | | |
| | | }, |
| | | multipleSelect: { |
| | | value: [], |
| | |
| | | * 生命周期函数--监听页面加载 |
| | | */ |
| | | onLoad(options) { |
| | | // 获取屏幕高度 |
| | | wx.getSystemInfo({ |
| | | success: function (res) { |
| | | // this.setData({ |
| | | // windowHeight: res.windowHeight |
| | | // }) |
| | | |
| | | // 获取节点的类名 |
| | | var query = wx.createSelectorQuery(); |
| | | query.select('.assembleContent').boundingClientRect(); |
| | | query.exec(function (res) { |
| | | |
| | | // console.log(res, 'res'); |
| | | let node = res[0]; |
| | | node.setStyle({ |
| | | backgroundColor: '#0256b9', |
| | | }) |
| | | // // 修改节点样式 |
| | | // if (node) { |
| | | // node.setStyle({ |
| | | // backgroundColor: 'red', |
| | | // color: 'white' |
| | | // }); |
| | | // } |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | // console.log(this.data.filteredItems, 88888); |
| | | const systInfo = wx.getSystemInfoSync(); |
| | |
| | | |
| | | if (this.data.filteredItems = []) { |
| | | console.log(11111); |
| | | singleSelectOptions.push({ |
| | | label: '禁用选项', |
| | | value: 'disabled', |
| | | disabled: true, |
| | | }); |
| | | // singleSelectOptions.push({ |
| | | // label: '暂无数据', |
| | | // value: 'disabled', |
| | | // disabled: true, |
| | | // }); |
| | | } else { |
| | | console.log(7889); |
| | | } |
| | | |
| | | // singleSelectOptions.push({ |
| | | // label: '禁用选项', |
| | | // value: 'disabled', |
| | | // disabled: true, |
| | | // }); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | // 更新数据 |
| | |
| | | const newValue = e.detail.value; |
| | | const selectedOption = this.data.product.options.find(option => option.value === newValue); |
| | | const newPrice = selectedOption ? selectedOption.price : null; |
| | | console.log(newValue, 'newValue'); |
| | | console.log(newPrice, 'newPrice'); |
| | | if (newPrice) { |
| | | this.setData({ |
| | | keynoteDisabled: false |
| | | }) |
| | | |
| | | } else { |
| | | this.setData({ |
| | | keynoteDisabled: true |
| | | }) |
| | | } |
| | | this.setData({ |
| | | 'product.value': newValue, |
| | | 'product.price': newPrice, // 将选中的 price 值保存在数据中 |
| | |
| | | }); |
| | | }, |
| | | handleConfirm(event) { |
| | | |
| | | const { value } = event.detail; |
| | | // 确认操作的处理逻辑 |
| | | |
| | |
| | | this.data.nameSort = 'Desc' |
| | | // console.log('sssssss'); |
| | | this.bookExhibitionGet() |
| | | |
| | | |
| | | }, |
| | | onBookExhibitionDetails: function (event) { |
| | | const item = event.currentTarget.dataset.item; |