From 6857cc6caf3973c61484fb8e74fe73fcd6c46cc5 Mon Sep 17 00:00:00 2001 From: 396316021 <396316021@qq.com> Date: Tue, 5 Dec 2023 15:31:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=A0=B7=E5=BC=8F=E5=92=8C?= =?UTF-8?q?=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/toExamine/pages/first/first.js | 42 ++++++++++++++++++++------ pages/toExamine/pages/first/first.wxml | 17 ++++++----- pages/toExamine/pages/first/first.wxss | 2 +- 3 files changed, 42 insertions(+), 19 deletions(-) diff --git a/pages/toExamine/pages/first/first.js b/pages/toExamine/pages/first/first.js index f06b5f4..ac34e39 100644 --- a/pages/toExamine/pages/first/first.js +++ b/pages/toExamine/pages/first/first.js @@ -134,13 +134,20 @@ Page({ if (res.code == '200') { res.data.brand.map(item => { that.data.arrModel.push({ - name: item.title,id:item.id, + name: item.title,id:item.id }) - that.data.brr.push({name: item.title}) + that.data.brr.push({name: item.title,char:item.initials}) }) + + let model = res.data.model.map(item => { + return { + name:item.title, + } + }); + that.setData({ - carModel:res.data.model + carModel:res.data.model, }) that.getveh(0) } @@ -148,18 +155,22 @@ Page({ }, // 获取车系列表 getveh(index) { + console.log(1111111111111111) let that = this - + console.log('that.data.arrModel[index]',index) + console.log('that.data.arrModel[index]',that.data.arrModel) + console.log('that.data.arrModel[index]',that.data.arrModel[index]) let model = that.data.carModel.filter(item => { - return that.data.arrModel[index].id === item.car_brand_id; + return that.data.arrModel[index].id == item.car_brand_id; }) - + console.log(22222222222222222) model = model.map(item => { return { name:item.title, } }); - + console.log(11111111111112222222222) + console.log([that.data.letter, that.data.arrModel, model],111111111111111) that.setData({ listModel: model, multiArrayT: [that.data.letter, that.data.arrModel, model] @@ -167,7 +178,7 @@ Page({ }, // 获取车型列表 getAdd(index) { - // let that = this + let that = this // wx.request({ // url: `/api/car_model`, //仅为示例,并非真实的接口地址 // header: { @@ -208,10 +219,14 @@ Page({ }, // 滑动事件 bindMultiPickerColumnChange: function (e) { + + console.log(e.detail.column) let that = this let arr = this.data.brr if (e.detail.column == 0) { arr = arr.filter(item => { + console.log('this.data.letter[e.detail.value].name',this.data.letter[e.detail.value].name) + console.log('item.char',item.char) return this.data.letter[e.detail.value].name === item.char }) // console.log(arr) @@ -220,7 +235,7 @@ Page({ multiIndex: [e.detail.value, 0, 0], multiArrayT: [that.data.letter, that.data.arrModel, that.data.listModel] }) - that.getveh(0) + that.getveh(0) } else if (e.detail.column == 1) { this.setData({ multiIndex: [this.data.multiIndex[0], e.detail.value, 0] @@ -1422,13 +1437,20 @@ Page({ }) this.immediate(); //临时保存 }, - bindCarInput(e){ + bindCarInput0(e){ let value = e.detail.value; this.setData({ 'vehicle.car_model.text_center[0]': value }) this.immediate(); //临时保存 }, + bindCarInput1(e){ + let value = e.detail.value; + this.setData({ + 'vehicle.car_model.text_center[1]': value + }) + this.immediate(); //临时保存 + }, esc_tisp(e) { //双向绑定 let name = e.currentTarget.dataset.name; let value = e.currentTarget.dataset.value ? e.currentTarget.dataset.value : e.detail.value; diff --git a/pages/toExamine/pages/first/first.wxml b/pages/toExamine/pages/first/first.wxml index b514b19..3c15741 100644 --- a/pages/toExamine/pages/first/first.wxml +++ b/pages/toExamine/pages/first/first.wxml @@ -516,19 +516,20 @@ - + *车型 - - - {{vehicle.car_model.text_center[1]}} - 请选择 - - - + + + + + + + + diff --git a/pages/toExamine/pages/first/first.wxss b/pages/toExamine/pages/first/first.wxss index 5519bc6..49e4274 100644 --- a/pages/toExamine/pages/first/first.wxss +++ b/pages/toExamine/pages/first/first.wxss @@ -158,7 +158,7 @@ textarea { color: #fff; text-align: center; border-radius: 10rpx; - background: -webkit-linear-gradient(180deg, #fa3534, #ff9a4a); + background: linear-gradient(90deg, #dd6161, #fa3534); } input {