From a0e1babc46d5054ef0657f84e951361b552065ba Mon Sep 17 00:00:00 2001 From: mk <2403457699@qq.com> Date: Wed, 8 Nov 2023 09:19:27 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=9E=E6=BB=9A=E9=9C=80=E6=B1=82=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dissatisfied/demandCheck/demandCheck.js | 36 ++----------------- .../dissatisfied/demandCheck/demandCheck.wxml | 2 -- utils/api.js | 9 ++--- 3 files changed, 5 insertions(+), 42 deletions(-) diff --git a/subpages/demandCheck/pages/dissatisfied/demandCheck/demandCheck.js b/subpages/demandCheck/pages/dissatisfied/demandCheck/demandCheck.js index b074633..3c20b44 100644 --- a/subpages/demandCheck/pages/dissatisfied/demandCheck/demandCheck.js +++ b/subpages/demandCheck/pages/dissatisfied/demandCheck/demandCheck.js @@ -59,7 +59,7 @@ Page({ hasPlay: false, playUrl: "", - defaultFieldNames: { label: 'name', value: 'id',children:"children"}, + // defaultFieldNames: { label: 'agencyName', value: 'agencyId', children: 'subAgencyList' }, angencyVisible: false, measureList:[], @@ -122,10 +122,10 @@ Page({ }, getDemandoption(){ api.getDemandoption().then(res=>{ + console.log(res); this.setData({ - measureList:res.data, + measureList:res.data }) - }).catch(err=>{ console.log(err); }) @@ -1227,12 +1227,6 @@ Page({ this.setData({ measureVisible:true }) - let e = { - detail:{ - value:[this.data.measureList[0].id] - } - } - this.handleChangeMeasureValue(e) }, showReportTypePicker(){ this.setData({ @@ -1256,28 +1250,4 @@ Page({ second = second >= 10 ? second : '0' + second return min + ':' + second }, - getDemandoption2: async function(id){ - const {data,code,msg} = await api.getDemandoption2(id) - if(code == 0){ - console.log(data); - return data - }else{ - console.log(msg); - } - }, - handleChangeMeasureValue: async function (e){ - console.log(e); - let id = e.detail.value.join(''); - let childrenData = await this.getDemandoption2(id); - let list = this.data.measureList.map(item => { - if(item.id == id){ - return {...item, children:childrenData}; - } else { - return item; - } - }); - this.setData({ - measureList: list - }); - } }) \ No newline at end of file diff --git a/subpages/demandCheck/pages/dissatisfied/demandCheck/demandCheck.wxml b/subpages/demandCheck/pages/dissatisfied/demandCheck/demandCheck.wxml index 8280c68..49fc886 100644 --- a/subpages/demandCheck/pages/dissatisfied/demandCheck/demandCheck.wxml +++ b/subpages/demandCheck/pages/dissatisfied/demandCheck/demandCheck.wxml @@ -241,12 +241,10 @@ options="{{ measureList }}" value="{{ measureValue }}" visible="{{measureVisible}}" - defaultFieldNames="{{defaultFieldNames}}" cols="2" controlled cascade bind:cancel="hidePickerMeasure" bind:confirm="onConfirmMeasure" - bind:valueChange="handleChangeMeasureValue" > \ No newline at end of file diff --git a/utils/api.js b/utils/api.js index 4a507f5..d2bdb7e 100644 --- a/utils/api.js +++ b/utils/api.js @@ -44,8 +44,7 @@ module.exports = { clockRecords, clearOneMessage, getPubKey, - changePassword, - getDemandoption2 + changePassword } // 获取公钥 @@ -214,12 +213,8 @@ function getResidentBaseInfoPage (parm) { } // 获取需求分类树 function getDemandoption (parm) { - return fly.get(`governance/commonServiceType/selectList/0`,parm) + return fly.post(`governance/icresidemanddict/demandoption`,parm) } -function getDemandoption2 (id) { - return fly.get(`governance/commonServiceType/selectList/${id}`) -} - // 上报诉求 function addMeasure(parm) { return fly.post(`governance/userdemand/add`,parm)