Browse Source

修改样式和内容

master
396316021 1 year ago
parent
commit
6857cc6caf
  1. 42
      pages/toExamine/pages/first/first.js
  2. 17
      pages/toExamine/pages/first/first.wxml
  3. 2
      pages/toExamine/pages/first/first.wxss

42
pages/toExamine/pages/first/first.js

@ -134,13 +134,20 @@ Page({
if (res.code == '200') { if (res.code == '200') {
res.data.brand.map(item => { res.data.brand.map(item => {
that.data.arrModel.push({ 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({ that.setData({
carModel:res.data.model carModel:res.data.model,
}) })
that.getveh(0) that.getveh(0)
} }
@ -148,18 +155,22 @@ Page({
}, },
// 获取车系列表 // 获取车系列表
getveh(index) { getveh(index) {
console.log(1111111111111111)
let that = this 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 => { 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 => { model = model.map(item => {
return { return {
name:item.title, name:item.title,
} }
}); });
console.log(11111111111112222222222)
console.log([that.data.letter, that.data.arrModel, model],111111111111111)
that.setData({ that.setData({
listModel: model, listModel: model,
multiArrayT: [that.data.letter, that.data.arrModel, model] multiArrayT: [that.data.letter, that.data.arrModel, model]
@ -167,7 +178,7 @@ Page({
}, },
// 获取车型列表 // 获取车型列表
getAdd(index) { getAdd(index) {
// let that = this let that = this
// wx.request({ // wx.request({
// url: `/api/car_model`, //仅为示例,并非真实的接口地址 // url: `/api/car_model`, //仅为示例,并非真实的接口地址
// header: { // header: {
@ -208,10 +219,14 @@ Page({
}, },
// 滑动事件 // 滑动事件
bindMultiPickerColumnChange: function (e) { bindMultiPickerColumnChange: function (e) {
console.log(e.detail.column)
let that = this let that = this
let arr = this.data.brr let arr = this.data.brr
if (e.detail.column == 0) { if (e.detail.column == 0) {
arr = arr.filter(item => { 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 return this.data.letter[e.detail.value].name === item.char
}) })
// console.log(arr) // console.log(arr)
@ -220,7 +235,7 @@ Page({
multiIndex: [e.detail.value, 0, 0], multiIndex: [e.detail.value, 0, 0],
multiArrayT: [that.data.letter, that.data.arrModel, that.data.listModel] multiArrayT: [that.data.letter, that.data.arrModel, that.data.listModel]
}) })
that.getveh(0) that.getveh(0)
} else if (e.detail.column == 1) { } else if (e.detail.column == 1) {
this.setData({ this.setData({
multiIndex: [this.data.multiIndex[0], e.detail.value, 0] multiIndex: [this.data.multiIndex[0], e.detail.value, 0]
@ -1422,13 +1437,20 @@ Page({
}) })
this.immediate(); //临时保存 this.immediate(); //临时保存
}, },
bindCarInput(e){ bindCarInput0(e){
let value = e.detail.value; let value = e.detail.value;
this.setData({ this.setData({
'vehicle.car_model.text_center[0]': value 'vehicle.car_model.text_center[0]': value
}) })
this.immediate(); //临时保存 this.immediate(); //临时保存
}, },
bindCarInput1(e){
let value = e.detail.value;
this.setData({
'vehicle.car_model.text_center[1]': value
})
this.immediate(); //临时保存
},
esc_tisp(e) { //双向绑定 esc_tisp(e) { //双向绑定
let name = e.currentTarget.dataset.name; let name = e.currentTarget.dataset.name;
let value = e.currentTarget.dataset.value ? e.currentTarget.dataset.value : e.detail.value; let value = e.currentTarget.dataset.value ? e.currentTarget.dataset.value : e.detail.value;

17
pages/toExamine/pages/first/first.wxml

@ -516,19 +516,20 @@
<!-- <image src="../../../../img/right.png" class="img"></image>--> <!-- <image src="../../../../img/right.png" class="img"></image>-->
<!-- </view>--> <!-- </view>-->
<!-- </picker>--> <!-- </picker>-->
<input placeholder="请输入" placeholder-class="txt_right" value="{{vehicle.car_model.text_center[0]}}" data-name="vehicle.car_model" bindinput="bindCarInput"></input> <input placeholder="请输入" placeholder-class="txt_right" value="{{vehicle.car_model.text_center[0]}}" data-name="vehicle.car_model" bindinput="bindCarInput0"></input>
</view> </view>
<view class="flex_between flex_items mt20"> <view class="flex_between flex_items mt20">
<view class="bold A"> <view class="bold A">
<text class="xin" wx:if="{{vehicle.car_model.require == 1}}">*</text>车型</view> <text class="xin" wx:if="{{vehicle.car_model.require == 1}}">*</text>车型</view>
<picker bindchange="bindPickerChange" value="{{index}}" range="{{vehicleType}}" range-key='name'> <!-- <picker bindchange="bindPickerChange" value="{{index}}" range="{{vehicleType}}" range-key='name'>-->
<view class="flex_start flex_items"> <!-- <view class="flex_start flex_items">-->
<view wx:if="{{vehicle.car_model.text_center[1]}}">{{vehicle.car_model.text_center[1]}}</view> <!-- <view wx:if="{{vehicle.car_model.text_center[1]}}">{{vehicle.car_model.text_center[1]}}</view>-->
<view class="c9" wx:else>请选择</view> <!-- <view class="c9" wx:else>请选择</view>-->
<image src="../../../../img/right.png" class="img"></image> <!-- <image src="../../../../img/right.png" class="img"></image>-->
</view> <!-- </view>-->
</picker> <!-- </picker>-->
<input placeholder="请输入" placeholder-class="txt_right" value="{{vehicle.car_model.text_center[1]}}" data-name="vehicle.car_model" bindinput="bindCarInput1"></input>
</view> </view>
</view> </view>

2
pages/toExamine/pages/first/first.wxss

@ -158,7 +158,7 @@ textarea {
color: #fff; color: #fff;
text-align: center; text-align: center;
border-radius: 10rpx; border-radius: 10rpx;
background: -webkit-linear-gradient(180deg, #fa3534, #ff9a4a); background: linear-gradient(90deg, #dd6161, #fa3534);
} }
input { input {

Loading…
Cancel
Save