车型联动

This commit is contained in:
老叶
2021-09-27 15:53:57 +08:00
parent f1b1b15bfb
commit 85f0bd91be
5 changed files with 163 additions and 123 deletions
+32 -26
View File
@@ -75,29 +75,12 @@ Page({
});
},
//获取车型属性 /颜色 /车型级别
getAppSeriesAttrs(){
let params1 = {};
params1['id'] = this.data.car_id;
params1['type'] = 0;
_.apiQuery.getAppSeriesAttrs(params1).then(res => {
if(res.data.total>0){
let colorArray = []
res.data.list.forEach(item => {
colorArray.push(item.title)
})
this.setData({
colorArray:colorArray,
colorList:res.data.list,
colorIndex:-1,
})
}
});
let params2 = {};
params2['id'] = this.data.car_id;
params2['type'] = 1;
_.apiQuery.getAppSeriesAttrs(params2).then(res => {
//获取车型级别
getAppSeriesAttrslevel(){
let params = {};
params['id'] = this.data.car_id;
params['type'] = 0;
_.apiQuery.getAppSeriesAttrs(params).then(res => {
if(res.data.total>0){
let levelArray = []
res.data.list.forEach(item => {
@@ -112,6 +95,27 @@ Page({
});
},
//获取车型颜色
getAppSeriesAttrscolor(){
let params = {};
params['id'] = this.data.car_id;
params['type'] = 1;
params['v_id'] = this.data.v_id;
_.apiQuery.getAppSeriesAttrs(params).then(res => {
if(res.data.total>0){
let colorArray = []
res.data.list.forEach(item => {
colorArray.push(item.title)
})
this.setData({
colorArray:colorArray,
colorList:res.data.list,
colorIndex:-1,
})
}
});
},
//获取列表筛选条件-时间
getAppCustomersFilter(){
_.apiQuery.getAppCustomersFilter().then(res => {
@@ -154,7 +158,6 @@ Page({
colorIndex:-1,//车型颜色索引
levelIndex:-1,//车型级别索引
interiorIndex:-1,//内饰颜色索引
priceinfo:'',
})
this.getAppSeries()
}
@@ -177,9 +180,8 @@ Page({
colorIndex:-1,//车型颜色索引
levelIndex:-1,//车型级别索引
interiorIndex:-1,//内饰颜色索引
priceinfo:'',
})
this.getAppSeriesAttrs()
this.getAppSeriesAttrslevel()
}
},
@@ -189,7 +191,11 @@ Page({
this.setData({
v_id:this.data.levelList[e.detail.value].id,
levelIndex:e.detail.value,
color_id:'',//车型颜色id
colorArray:[],//车型颜色列表
colorIndex:-1,//车型颜色索引
})
this.getAppSeriesAttrscolor()
}
},
+1 -1
View File
@@ -43,7 +43,7 @@
</picker>
</view>
</view>
<view class="relative bbs-1-eb pl190 last-b-none" wx:if="{{modelIndex != -1}}">
<view class="relative bbs-1-eb pl190 last-b-none" wx:if="{{levelIndex != -1}}">
<view class="absolute left-0 box-middle font-28 color-333">车型颜色</view>
<view class="pt30 pb30 text-right font-28 color-666">
<picker bindchange="changeColor" value="{{colorIndex}}" range="{{colorArray}}">
+62 -44
View File
@@ -549,7 +549,7 @@ Page({
})
//匹配颜色 车型级别
this.getAppSeriesAttrsedit()
this.getAppSeriesAttrsleveledit()
}
@@ -575,40 +575,13 @@ Page({
});
},
//获取车型属性 /颜色 /车型级别 ---编辑匹配信息
getAppSeriesAttrsedit(){
let params1 = {};
params1['id'] = this.data.modelList[this.data.modelIndex].id;
params1['type'] = 0;
_.apiQuery.getAppSeriesAttrs(params1).then(res => {
if(res.data.total>0){
let colorArray = []
res.data.list.forEach(item => {
colorArray.push(item.title)
})
this.setData({
colorArray:colorArray,
colorList:res.data.list,
colorIndex:-1,
})
//获取车型级别 ---编辑匹配信息
getAppSeriesAttrsleveledit(){
if(this.data.baseinfo.color_id.value != ''){
res.data.list.forEach((item,index) => {
if(item.id == this.data.baseinfo.color_id.value){
this.setData({
colorIndex:index,
})
}
})
}
}
});
let params2 = {};
params2['id'] = this.data.modelList[this.data.modelIndex].id;
params2['type'] = 1;
_.apiQuery.getAppSeriesAttrs(params2).then(res => {
let params = {};
params['id'] = this.data.modelList[this.data.modelIndex].id;
params['type'] = 0;
_.apiQuery.getAppSeriesAttrs(params).then(res => {
if(res.data.total>0){
let levelArray = []
res.data.list.forEach(item => {
@@ -624,22 +597,26 @@ Page({
res.data.list.forEach((item,index) => {
if(item.id == this.data.baseinfo.v_id.value){
this.setData({
v_id:this.data.baseinfo.v_id.value,
levelIndex:index,
})
}
})
}
this.getAppSeriesAttrscoloredit()
}
});
},
//获取车型属性 /颜色 /车型级别
getAppSeriesAttrs(){
let params1 = {};
params1['id'] = this.data.car_id;
params1['type'] = 0;
_.apiQuery.getAppSeriesAttrs(params1).then(res => {
//获取车型颜色 ---编辑匹配信息
getAppSeriesAttrscoloredit(){
let params = {};
params['id'] = this.data.modelList[this.data.modelIndex].id;
params['type'] = 1;
params['v_id'] = this.data.v_id;
_.apiQuery.getAppSeriesAttrs(params).then(res => {
if(res.data.total>0){
let colorArray = []
res.data.list.forEach(item => {
@@ -650,13 +627,29 @@ Page({
colorList:res.data.list,
colorIndex:-1,
})
if(this.data.baseinfo.color_id.value != ''){
res.data.list.forEach((item,index) => {
if(item.id == this.data.baseinfo.color_id.value){
this.setData({
color_id:this.data.baseinfo.color_id.value,
colorIndex:index,
})
}
})
}
}
});
},
let params2 = {};
params2['id'] = this.data.car_id;
params2['type'] = 1;
_.apiQuery.getAppSeriesAttrs(params2).then(res => {
//获取车型级别
getAppSeriesAttrslevel(){
let params = {};
params['id'] = this.data.car_id;
params['type'] = 0;
_.apiQuery.getAppSeriesAttrs(params).then(res => {
if(res.data.total>0){
let levelArray = []
res.data.list.forEach(item => {
@@ -671,6 +664,27 @@ Page({
});
},
//获取车型颜色
getAppSeriesAttrscolor(){
let params = {};
params['id'] = this.data.car_id;
params['type'] = 1;
params['v_id'] = this.data.v_id;
_.apiQuery.getAppSeriesAttrs(params).then(res => {
if(res.data.total>0){
let colorArray = []
res.data.list.forEach(item => {
colorArray.push(item.title)
})
this.setData({
colorArray:colorArray,
colorList:res.data.list,
colorIndex:-1,
})
}
});
},
//获取列表筛选条件-时间
getAppCustomersFilter(){
_.apiQuery.getAppCustomersFilter().then(res => {
@@ -761,8 +775,12 @@ Page({
this.setData({
v_id:this.data.levelList[e.detail.value].id,
levelIndex:e.detail.value,
color_id:'',//车型颜色id
colorArray:[],//车型颜色列表
colorIndex:-1,//车型颜色索引
})
this.putAppCustomerData()
this.getAppSeriesAttrscolor()
}
},
+5 -5
View File
@@ -52,21 +52,21 @@
<view>
<view class="relative bbs-1-eb last-b-none pl140 font-28">
<view class="absolute left-0 box-middle">客户姓名</view>
<view class="pt30 pb30 text-right font-28 color-666">
<view class="pt30 pb30 text-right font-28 color-666" style="min-height:38rpx">
{{name}}
<!-- <input class="wp100 height-100 text-right font-28" placeholder-class="color-ccc" type="text" placeholder="请输入客户姓名" bindinput='inputTx' bindblur='putAppCustomerData' bindconfirm='putAppCustomerData' data-key="name" name='name' value='{{name}}' /> -->
</view>
</view>
<view class="relative bbs-1-eb last-b-none pl140 font-28">
<view class="absolute left-0 box-middle">手机号码</view>
<view class="pt30 pb30 text-right font-28 color-666">
<view class="pt30 pb30 text-right font-28 color-666" style="min-height:38rpx">
{{mobile}}
<!-- <input class="wp100 height-100 text-right font-28" placeholder-class="color-ccc" type="number" placeholder="请输入客户手机号" bindinput='inputTx' bindblur='putAppCustomerData' bindconfirm='putAppCustomerData' data-key="mobile" name='mobile' value='{{mobile}}' /> -->
</view>
</view>
<view class="relative bbs-1-eb pl190 last-b-none">
<view class="absolute left-0 box-middle font-28 color-333">车辆品牌</view>
<view class="pt30 pb30 text-right font-28 color-666">
<view class="pt30 pb30 text-right font-28 color-666" style="min-height:38rpx">
{{brandArray[brandIndex]}}
<!-- <picker bindchange="changeBrand" value="{{brandIndex}}" range="{{brandArray}}">
<text class="color-ccc" wx:if="{{brandIndex == -1}}">请选择</text>
@@ -77,7 +77,7 @@
</view>
<view class="relative bbs-1-eb pl190 last-b-none">
<view class="absolute left-0 box-middle font-28 color-333">车型车系</view>
<view class="pt30 pb30 text-right font-28 color-666">
<view class="pt30 pb30 text-right font-28 color-666" style="min-height:38rpx">
{{modelArray[modelIndex]}}
<!-- <picker bindchange="changeModel" value="{{modelIndex}}" range="{{modelArray}}">
<text class="color-ccc" wx:if="{{modelIndex == -1}}">请选择</text>
@@ -88,7 +88,7 @@
</view>
<view class="relative bbs-1-eb pl190 last-b-none">
<view class="absolute left-0 box-middle font-28 color-333">车型级别</view>
<view class="pt30 pb30 text-right font-28 color-666">
<view class="pt30 pb30 text-right font-28 color-666" style="min-height:38rpx">
{{levelArray[levelIndex]}}
<!-- <picker bindchange="changeLevel" value="{{levelIndex}}" range="{{levelArray}}">
<text class="color-ccc" wx:if="{{levelIndex == -1}}">{{colorArray.length == 0?'请先选择车型车系':'请选择'}}</text>
+63 -47
View File
@@ -125,7 +125,7 @@ Page({
})
//匹配颜色 车型级别
this.getAppSeriesAttrsedit()
this.getAppSeriesAttrsleveledit()
}
@@ -151,12 +151,48 @@ Page({
});
},
//获取车型属性 /颜色 /车型级别 ---编辑匹配信息
getAppSeriesAttrsedit(){
let params1 = {};
params1['id'] = this.data.modelList[this.data.modelIndex].id;
params1['type'] = 0;
_.apiQuery.getAppSeriesAttrs(params1).then(res => {
//获取车型级别 ---编辑匹配信息
getAppSeriesAttrsleveledit(){
let params = {};
params['id'] = this.data.modelList[this.data.modelIndex].id;
params['type'] = 0;
_.apiQuery.getAppSeriesAttrs(params).then(res => {
if(res.data.total>0){
let levelArray = []
res.data.list.forEach(item => {
levelArray.push(item.title)
})
this.setData({
levelArray:levelArray,
levelList:res.data.list,
levelIndex:-1,
})
if(this.data.baseinfo.v_id.value != ''){
res.data.list.forEach((item,index) => {
if(item.id == this.data.baseinfo.v_id.value){
this.setData({
v_id:this.data.baseinfo.v_id.value,
levelIndex:index,
})
}
})
}
this.getAppSeriesAttrscoloredit()
}
});
},
//获取车型颜色 ---编辑匹配信息
getAppSeriesAttrscoloredit(){
let params = {};
params['id'] = this.data.modelList[this.data.modelIndex].id;
params['type'] = 1;
params['v_id'] = this.data.v_id;
_.apiQuery.getAppSeriesAttrs(params).then(res => {
if(res.data.total>0){
let colorArray = []
res.data.list.forEach(item => {
@@ -181,11 +217,15 @@ Page({
}
});
},
let params2 = {};
params2['id'] = this.data.modelList[this.data.modelIndex].id;
params2['type'] = 1;
_.apiQuery.getAppSeriesAttrs(params2).then(res => {
//获取车型级别
getAppSeriesAttrslevel(){
let params = {};
params['id'] = this.data.car_id;
params['type'] = 0;
_.apiQuery.getAppSeriesAttrs(params).then(res => {
if(res.data.total>0){
let levelArray = []
res.data.list.forEach(item => {
@@ -196,28 +236,17 @@ Page({
levelList:res.data.list,
levelIndex:-1,
})
if(this.data.baseinfo.v_id.value != ''){
res.data.list.forEach((item,index) => {
if(item.id == this.data.baseinfo.v_id.value){
this.setData({
v_id:this.data.baseinfo.v_id.value,
levelIndex:index,
})
}
})
}
}
});
},
//获取车型属性 /颜色 /车型级别
getAppSeriesAttrs(){
let params1 = {};
params1['id'] = this.data.car_id;
params1['type'] = 0;
_.apiQuery.getAppSeriesAttrs(params1).then(res => {
//获取车型颜色
getAppSeriesAttrscolor(){
let params = {};
params['id'] = this.data.car_id;
params['type'] = 1;
params['v_id'] = this.data.v_id;
_.apiQuery.getAppSeriesAttrs(params).then(res => {
if(res.data.total>0){
let colorArray = []
res.data.list.forEach(item => {
@@ -230,23 +259,6 @@ Page({
})
}
});
let params2 = {};
params2['id'] = this.data.car_id;
params2['type'] = 1;
_.apiQuery.getAppSeriesAttrs(params2).then(res => {
if(res.data.total>0){
let levelArray = []
res.data.list.forEach(item => {
levelArray.push(item.title)
})
this.setData({
levelArray:levelArray,
levelList:res.data.list,
levelIndex:-1,
})
}
});
},
//获取列表筛选条件-时间
@@ -324,7 +336,7 @@ Page({
interiorIndex:-1,//内饰颜色索引
priceinfo:'',
})
this.getAppSeriesAttrs()
this.getAppSeriesAttrslevel()
}
},
@@ -334,7 +346,11 @@ Page({
this.setData({
v_id:this.data.levelList[e.detail.value].id,
levelIndex:e.detail.value,
color_id:'',//车型颜色id
colorArray:[],//车型颜色列表
colorIndex:-1,//车型颜色索引
})
this.getAppSeriesAttrscolor()
}
},