增加组件接口
This commit is contained in:
@@ -181,6 +181,9 @@ api = {
|
||||
appSignConf: "app/sign/conf", //签到配置信息
|
||||
appUserConf: "app/sign/userConf", //用户签到配置信息
|
||||
appSign: "app/sign", //用户签到
|
||||
|
||||
|
||||
appSeriesMbrand: "app/series/mbrand" //获取车系品牌
|
||||
}
|
||||
|
||||
//远程图片存储地址
|
||||
|
||||
@@ -1053,4 +1053,10 @@ apiQuery.putAppCusorderStatus = function (params) {
|
||||
HttpRequest(true, Config.api.appCusorderStatus, 2, params, "PUT", resolve, reject)
|
||||
})
|
||||
}
|
||||
|
||||
apiQuery.getMbrand = function (params) {
|
||||
return new Promise(function (resolve, reject) {
|
||||
HttpRequest(false, Config.api.appSeriesMbrand, 2, params, "GET", resolve, reject)
|
||||
})
|
||||
}
|
||||
export default apiQuery;
|
||||
@@ -35,7 +35,7 @@ Component({
|
||||
overlayStyle: {
|
||||
type: String,
|
||||
value: 'background-color: rgba(0, 0, 0, 0.7)'
|
||||
},
|
||||
},
|
||||
},
|
||||
attached(){
|
||||
debouncetimer = null
|
||||
@@ -56,26 +56,26 @@ Component({
|
||||
*/
|
||||
data: {
|
||||
show_page: false,
|
||||
// list: [],
|
||||
list: [{
|
||||
id: 1,
|
||||
name: '宝马'
|
||||
},{
|
||||
id: 1,
|
||||
name: '宝马'
|
||||
},{
|
||||
id: 1,
|
||||
name: '宝马'
|
||||
},{
|
||||
id: 1,
|
||||
name: '宝马'
|
||||
},{
|
||||
id: 1,
|
||||
name: '宝马'
|
||||
},{
|
||||
id: 1,
|
||||
name: '宝马'
|
||||
}],
|
||||
list: [],
|
||||
// list: [{
|
||||
// id: 1,
|
||||
// name: '宝马'
|
||||
// },{
|
||||
// id: 1,
|
||||
// name: '宝马'
|
||||
// },{
|
||||
// id: 1,
|
||||
// name: '宝马'
|
||||
// },{
|
||||
// id: 1,
|
||||
// name: '宝马'
|
||||
// },{
|
||||
// id: 1,
|
||||
// name: '宝马'
|
||||
// },{
|
||||
// id: 1,
|
||||
// name: '宝马'
|
||||
// }],
|
||||
cur: -1,
|
||||
keyword: '',
|
||||
item: {}
|
||||
@@ -119,16 +119,21 @@ Component({
|
||||
let that = this
|
||||
that.debounce(function(){
|
||||
that.setData({
|
||||
keyword: e.detail.value
|
||||
keyword: e.detail.value,
|
||||
cur: -1,
|
||||
item: {}
|
||||
})
|
||||
console.log(1)
|
||||
},200)
|
||||
if(e.detail.value){
|
||||
that.apiGetMbrand(e.detail.value)
|
||||
}
|
||||
},500)
|
||||
},
|
||||
bindSelectIndex(e){
|
||||
console.log(e)
|
||||
this.setData({
|
||||
cur: e.currentTarget.dataset.index
|
||||
})
|
||||
|
||||
},
|
||||
/**
|
||||
* 函数防抖
|
||||
@@ -150,5 +155,14 @@ Component({
|
||||
}, gapTime)
|
||||
})()
|
||||
},
|
||||
|
||||
//app/series/mbrand
|
||||
apiGetMbrand(keyword){
|
||||
_.apiQuery.getMbrand({keyword}).then(res => {
|
||||
this.setData({
|
||||
list: res.data.list
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -39,8 +39,8 @@
|
||||
</view>
|
||||
-->
|
||||
</view>
|
||||
<button bindtap="bindShowBrand">1111</button>
|
||||
<brandSelect show="{{brand_page_show}}"></brandSelect>
|
||||
<!-- <button bindtap="bindShowBrand">1111</button>
|
||||
<brandSelect show="{{brand_page_show}}"></brandSelect> -->
|
||||
</view>
|
||||
<lcb-footer></lcb-footer>
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@ Page({
|
||||
isShowSelectCustomer: false,
|
||||
|
||||
brand_id: '', //品牌
|
||||
brand_name: '', //品牌名称
|
||||
brandIndex: -1, //车辆品牌索引
|
||||
series_id: '', //车系id
|
||||
modelIndex: -1, //车系车型索引
|
||||
@@ -85,6 +86,7 @@ Page({
|
||||
color: res.data.color,
|
||||
in_color: res.data.in_color,
|
||||
brand_id: res.data.brand_id,
|
||||
brand_name: res.data.brand_name,
|
||||
series_id: res.data.series_id,
|
||||
car_id: res.data.car_id,
|
||||
firstPayIndex: res.data.downpayment_type - 1,
|
||||
@@ -585,6 +587,25 @@ Page({
|
||||
this.setData({
|
||||
brand_page_show: true
|
||||
})
|
||||
},
|
||||
|
||||
//获取品牌信息
|
||||
getBrandData(e){
|
||||
// console.log(e.detail)
|
||||
if(e.detail.index>-1&&e.detail.item){
|
||||
this.setData({
|
||||
brand_id: e.detail.item.id,
|
||||
brand_name: e.detail.item.name,
|
||||
brandIndex: e.detail.index,
|
||||
series_id: '', //车系id
|
||||
car_id: '', //车系id
|
||||
modelIndex: -1, //车系车型索引
|
||||
levelArray: [], //车辆版本列表
|
||||
levelIndex: -1, //车辆版本索引
|
||||
business_type: 0,
|
||||
})
|
||||
this.getAppSeries()
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
@@ -20,8 +20,8 @@
|
||||
<text wx:else>{{brandArray[brandIndex]}}</text>
|
||||
<i class="iconfont ml5 icon-gengduo"></i>
|
||||
</picker> -->
|
||||
<text class="color-ccc" wx:if="{{1}}">请选择</text>
|
||||
<!-- <text wx:else>{{brandArray[brandIndex]}}</text> -->
|
||||
<text wx:if="{{brand_name}}}">{{brand_name}}</text>
|
||||
<text class="color-ccc" wx:else>请选择</text>
|
||||
<i class="iconfont ml5 icon-gengduo"></i>
|
||||
</view>
|
||||
</view>
|
||||
@@ -238,7 +238,7 @@
|
||||
</view>
|
||||
<!-- <lcb-footer></lcb-footer> -->
|
||||
<!-- <lcb-backChannel></lcb-backChannel> -->
|
||||
<brandSelect show="{{brand_page_show}}"></brandSelect>
|
||||
<brandSelect show="{{brand_page_show}}" bindleave="getBrandData"></brandSelect>
|
||||
|
||||
<lcb-msg isShow="{{isShowSelectCustomer}}" isHasClose="{{true}}">
|
||||
<view slot="content">
|
||||
|
||||
@@ -20,6 +20,7 @@ Page({
|
||||
mobile: '', //手机号
|
||||
cardid: '', //身份证
|
||||
brand_id: '', //品牌
|
||||
brand_name: '', //品牌名称
|
||||
series_id: '', //车系id
|
||||
car_id: '', //车辆版本id
|
||||
brandIndex: -1, //车辆品牌索引
|
||||
@@ -520,5 +521,23 @@ Page({
|
||||
this.setData({
|
||||
brand_page_show: true
|
||||
})
|
||||
},
|
||||
|
||||
//获取品牌信息
|
||||
getBrandData(e){
|
||||
// console.log(e.detail)
|
||||
if(e.detail.index>-1&&e.detail.item){
|
||||
this.setData({
|
||||
brand_id: e.detail.item.id,
|
||||
brand_name: e.detail.item.name,
|
||||
brandIndex: e.detail.index,
|
||||
series_id: '', //车系id
|
||||
car_id: '',
|
||||
modelIndex: -1, //车系车型索引
|
||||
carIndex: -1, //车辆版本索引
|
||||
business_type: 0,
|
||||
})
|
||||
this.getAppSeries()
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -83,9 +83,9 @@
|
||||
<text wx:else>{{brandArray[brandIndex]}}</text>
|
||||
<i class="iconfont ml5 icon-gengduo"></i>
|
||||
</picker> -->
|
||||
<text class="color-ccc" wx:if="{{1}}">请选择</text>
|
||||
<!-- <text wx:else>{{brandArray[brandIndex]}}</text> -->
|
||||
<i class="iconfont ml5 icon-gengduo"></i>
|
||||
<text wx:if="{{brand_name}}}">{{brand_name||'请选择'}}</text>
|
||||
<text class="color-ccc" wx:else>请选择</text>
|
||||
<i class="iconfont ml5 icon-gengduo"></i>
|
||||
</view>
|
||||
</view>
|
||||
<view class="relative bbs-1-eb pl190 last-b-none" wx:if="{{brandIndex != -1}}">
|
||||
@@ -330,6 +330,8 @@
|
||||
|
||||
</view>
|
||||
|
||||
<brandSelect show="{{brand_page_show}}" bindleave="getBrandData"></brandSelect>
|
||||
|
||||
<lcb-msg isShow="{{isShowcheck}}">
|
||||
<view slot="content">
|
||||
<view class="inner40 pt60 pb60 line-height-16 font-34 color-666">
|
||||
|
||||
Reference in New Issue
Block a user