From 558845242a07b68f42fa1802c45ab2769395d8b8 Mon Sep 17 00:00:00 2001 From: 闫增涛 <1829501689@qq.com> Date: 星期一, 29 四月 2024 14:31:30 +0800 Subject: [PATCH] 合并代码 --- pages/bookExhibitionList/index.js | 74 +++++++++++++++--------------------- 1 files changed, 31 insertions(+), 43 deletions(-) diff --git a/pages/bookExhibitionList/index.js b/pages/bookExhibitionList/index.js index 2731d08..cdbed47 100644 --- a/pages/bookExhibitionList/index.js +++ b/pages/bookExhibitionList/index.js @@ -87,7 +87,7 @@ * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍔犺浇 */ onLoad(options) { - console.log(this.data.multipleSelect.options.length, '44444'); + // this.setData({ // 'product.value': '*', // }); @@ -104,8 +104,8 @@ // let that = this; // setTimeout(function () { // that.data.name = "娴嬭瘯watch鍙樺寲浜�" - // }, 5000) - // + // }, 500) + // console.log(11111); }, watch: { name: function (newVal, oldVal) { @@ -127,12 +127,8 @@ * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鏄剧ず */ onShow() { - // debugger this.bookExhibitionGet() - this.keyProjectsGet(this.data.newPrice) - - }, /** @@ -309,14 +305,11 @@ }, //閲嶇偣椤圭洰鎺ュ彛 - keyProjectsGet() { - // debugger - if (this.data.multipleSelect.options.length !== 0) { - console.log('寮犱竴楦�'); - this.setData({ - 'multipleSelect.options': [], - }); - } + keyProjectsGet(newPrice) { + this.setData({ + filteredItems: [] // 濡傛灉瀛樺湪瀛愰」鍒欒祴鍊硷紝鍚﹀垯璧嬪�间负绌烘暟缁� + }); + //楠ㄦ灦灞� this.setData({ loading: true, @@ -336,13 +329,8 @@ // 寰幆鐒跺悗鍒ゆ柇鐩稿尮閰嶇殑鏁版嵁璧嬪�肩粰filteredItems checkData.option.forEach(item => { - if (this.data.newPrice == item.value) { + if (newPrice == item.value) { - if (this.data.filteredItems.length !== 0) { - this.setData({ - filteredItems: [] // 濡傛灉瀛樺湪瀛愰」鍒欒祴鍊硷紝鍚﹀垯璧嬪�间负绌烘暟缁� - }); - } this.setData({ @@ -351,13 +339,8 @@ } }) - this.setData({ - 'multipleSelect.options': [], - }); + let singleSelectOptions = [] - const singleSelectOptions = [] - console.log(this.data.multipleSelect.options, 'multipleSelect.options'); - console.log(singleSelectOptions, 'singleSelectOptions'); // 鍗曞垪閫夋嫨鍣ㄩ�夐」 // 鍗曞垪閫夋嫨鍣ㄩ�夐」 this.data.filteredItems.forEach(item => { @@ -381,6 +364,7 @@ this.setData({ 'multipleSelect.options': singleSelectOptions, }); + // 鍙栨秷楠ㄦ灦灞� this.setData({ @@ -407,33 +391,36 @@ // 鎬诲垎绫� onChange(e) { - 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 }); - // let newPrice = '' + let newPrice = '' if (newValue == 'jsek_bFHigherEducation') { - this.setData({ - newPrice: 'jsek_higherEducation' - }) + newPrice = 'jsek_higherEducation' + // this.setData({ + // newPrice: 'jsek_higherEducation' + // }) } else if (newValue == 'jsek_bFVocationalEducation') { - this.setData({ - newPrice: 'jsek_vocationalEducation' - }) + // this.setData({ + // newPrice: 'jsek_vocationalEducation' + // }) + newPrice = 'jsek_vocationalEducation' } else if (newValue == 'jsek_bFTeacherEducation') { - this.setData({ - newPrice: 'jsek_teacherEducation' - }) + // this.setData({ + // newPrice: 'jsek_teacherEducation' + // }) + newPrice = 'jsek_teacherEducation' + } else { + newPrice = '' } - this.keyProjectsGet(this.data.newPrice) + this.keyProjectsGet(newPrice) this.bookExhibitionGet(newValue); if (this.data.keynoteValue) { //濡傛灉鏈夋暟鎹氨娓呯┖骞跺埛鏂伴〉闈� @@ -441,6 +428,7 @@ this.bookExhibitionGet(newValue) } this.onLoad() + }, // 閲嶇偣椤圭洰 -- Gitblit v1.9.1