| | |
| | | }, |
| | | ], |
| | | }, |
| | | newValue: '' |
| | | }, |
| | | |
| | | |
| | |
| | | * 生命周期函数--监听页面加载 |
| | | */ |
| | | onLoad(options) { |
| | | |
| | | console.log(this.data.multipleSelect.options.length, '44444'); |
| | | // this.setData({ |
| | | // 'product.value': '*', |
| | | // }); |
| | |
| | | }) |
| | | |
| | | |
| | | watch.setWatcher(this); |
| | | let that = this; |
| | | setTimeout(function () { |
| | | that.data.name = "测试watch变化了" |
| | | }, 5000) |
| | | // watch.setWatcher(this); |
| | | // let that = this; |
| | | // setTimeout(function () { |
| | | // that.data.name = "测试watch变化了" |
| | | // }, 5000) |
| | | // |
| | | }, |
| | | watch: { |
| | |
| | | // debugger |
| | | this.bookExhibitionGet() |
| | | |
| | | // this.keyProjectsGet(this.data.newPrice) |
| | | this.keyProjectsGet(this.data.newPrice) |
| | | |
| | | |
| | | }, |
| | |
| | | onReachBottom() { |
| | | |
| | | if (this.data.page.size >= this.data.total) { |
| | | |
| | | Toast({ |
| | | context: this, |
| | | selector: '#t-toast', |
| | |
| | | preventScrollThrough: true, |
| | | icon: 'poweroff', |
| | | }); |
| | | |
| | | |
| | | |
| | | |
| | | } else { |
| | | // const currentPage = this.data.page.start + 1; // 获取当前页数并加1 |
| | | const newSize = this.data.page.size + 10; // 原来的基础上加10 |
| | |
| | | 'page.size': newSize |
| | | }); |
| | | // this.bookExhibitionGet(); // 调用方法加载更多数据 |
| | | |
| | | |
| | | |
| | | } |
| | | }, |
| | | |
| | |
| | | |
| | | app.MG.store.getProductList({ |
| | | storeInfo: 'jsek_bookFair', |
| | | path: newValue, |
| | | path: this.data.newValue, |
| | | queryType: '*', |
| | | fields: { |
| | | jsek_link: [], |
| | |
| | | |
| | | }, |
| | | //重点项目接口 |
| | | keyProjectsGet(newPrice) { |
| | | keyProjectsGet() { |
| | | // debugger |
| | | if (this.data.multipleSelect.options.length !== 0) { |
| | | console.log('张一鸣'); |
| | | this.setData({ |
| | | 'multipleSelect.options': [], |
| | | }); |
| | | } |
| | | //骨架屏 |
| | | this.setData({ |
| | | loading: true, |
| | | hidden: true, |
| | | }) |
| | | |
| | | // 参数 |
| | | let parms = { |
| | | refCodes: ['bookClassification'] |
| | | } |
| | | //请求数据 |
| | | app.MG.store.getProductTypeField(parms).then(res => { |
| | | |
| | | // 格式化数据 |
| | | const checkData = JSON.parse(res[0].config) |
| | | console.log(checkData); |
| | | |
| | | // 循环然后判断相匹配的数据赋值给filteredItems |
| | | checkData.option.forEach(item => { |
| | | if (newPrice == item.value) { |
| | | if (this.data.newPrice == item.value) { |
| | | |
| | | if (this.data.filteredItems.length !== 0) { |
| | | this.setData({ |
| | | filteredItems: [] // 如果存在子项则赋值,否则赋值为空数组 |
| | | }); |
| | | } |
| | | |
| | | |
| | | this.setData({ |
| | | filteredItems: item.child || [] // 如果存在子项则赋值,否则赋值为空数组 |
| | | }); |
| | | } |
| | | }) |
| | | |
| | | this.setData({ |
| | | 'multipleSelect.options': [], |
| | | }); |
| | | |
| | | const singleSelectOptions = [] |
| | | console.log(this.data.multipleSelect.options, 'multipleSelect.options'); |
| | | console.log(singleSelectOptions, 'singleSelectOptions'); |
| | | // 单列选择器选项 |
| | | const singleSelectOptions = this.data.filteredItems.map(item => ({ |
| | | label: item.name, |
| | | value: item.value, |
| | | })) |
| | | // 单列选择器选项 |
| | | this.data.filteredItems.forEach(item => { |
| | | singleSelectOptions.push({ |
| | | label: item.name, |
| | | value: item.value, |
| | | }); |
| | | }); |
| | | |
| | | |
| | | |
| | | if (singleSelectOptions.length === 0) { |
| | | singleSelectOptions.push({ |
| | | label: '暂无数据', |
| | | |
| | | }); |
| | | |
| | | } |
| | | |
| | | // 更新数据 |
| | | this.setData({ |
| | | 'multipleSelect.options': singleSelectOptions, |
| | | }); |
| | | |
| | | // 取消骨架屏 |
| | | this.setData({ |
| | | loading: false, |
| | | hidden: false, |
| | | }) |
| | | }) |
| | | if (newPrice) { |
| | | this.setData({ |
| | | keynoteDisabled: false |
| | | }) |
| | | } |
| | | if (!newPrice) { |
| | | this.setData({ |
| | | keynoteDisabled: true |
| | | }) |
| | | } |
| | | // if (newPrice) { |
| | | // this.setData({ |
| | | // keynoteDisabled: false |
| | | // }) |
| | | // } |
| | | // if (!newPrice) { |
| | | // this.setData({ |
| | | // keynoteDisabled: true |
| | | // }) |
| | | // } |
| | | }, |
| | | |
| | | |
| | |
| | | // 总分类 |
| | | onChange(e) { |
| | | |
| | | |
| | | |
| | | // this.data.page.size = 16 //更改显示的值 |
| | | this.setData({ |
| | | 'multipleSelect.options': [], |
| | | }); |
| | | console.log(this.data.multipleSelect.options); |
| | | const newValue = e.detail.value; |
| | | |
| | | console.log(newValue); |
| | | this.setData({ |
| | | 'product.value': newValue, |
| | | |
| | | newValue: newValue |
| | | }); |
| | | |
| | | |
| | | // debugger |
| | | // let newPrice = '' |
| | | |
| | | |
| | | |
| | | |
| | | if (newValue == 'jsek_bFHigherEducation') { |
| | | |
| | | this.setData({ |
| | | newPrice: 'jsek_higherEducation' |
| | | }) |
| | |
| | | newPrice: 'jsek_teacherEducation' |
| | | }) |
| | | } |
| | | this.bookExhibitionGet(newValue); |
| | | |
| | | this.keyProjectsGet(this.data.newPrice) |
| | | |
| | | |
| | | |
| | | |
| | | this.bookExhibitionGet(newValue); |
| | | if (this.data.keynoteValue) { |
| | | //如果有数据就清空并刷新页面 |
| | | this.data.keynoteValue = [] |
| | | this.bookExhibitionGet(newValue) |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | this.onLoad() |
| | | }, |
| | | |
| | | // 重点项目 |
| | |
| | | |
| | | |
| | | handleReset(e) { |
| | | |
| | | // 重置操作的处理逻辑 |
| | | this.data.keynoteValue = [] |
| | | this.bookExhibitionGet() |