Commit 8fe36f42 by 李伟康

commit 增加车品牌选择

1 parent 72efc9e7
import http from "../request/http";
module.exports = {
search(data) {
search (data) {
return http.post({
method: "scrm.api.carlife.weapp.homeSearch.search",
pageSize: 10,
......@@ -9,14 +9,14 @@ module.exports = {
});
},
// 查询接待素材
findSoureList() {
findSoureList () {
return http.post({
method: "dj.api.smartcarlife.recepiton.soure.findSoureList",
projectName: "boutique",
});
},
// 查询门店支付配置
findPayInfo(data) {
findPayInfo (data) {
return http.post({
method:
"dj.api.smartcarlife.recepiton.pay.findPayInfoConfigListByMerchantId",
......@@ -25,21 +25,21 @@ module.exports = {
});
},
// 查询门店支付配置
saveRecCustomer(data) {
saveRecCustomer (data) {
return http.post({
method: "dj.api.smartcarlife.recepiton.customer.saveRecCustomer",
projectName: "boutique",
...data,
});
},
getToken(data) {
getToken (data) {
return http.post({
method: "dj.api.smartcarlife.recepiton.customer.oss.getToken",
projectName: "boutique",
});
},
/** 查询接待素材详情 */
getFindSoureDetail(data) {
getFindSoureDetail (data) {
return http.post({
method: "dj.api.smartcarlife.recepiton.soure.findSoureDetailList",
projectName: "boutique",
......@@ -47,18 +47,29 @@ module.exports = {
});
},
// 历史订单列表
getQuotationList(data) {
getQuotationList (data) {
return http.post({
method: "dj.api.smartcarlife.vehicle.damage.upgrade.quotation.page",
projectName: "boutique",
...data,
});
},
/** 获取门店主营车品牌 */
getMerchantCarBrandList (merchantIdList) {
return http.post({
method: 'merchants.api.open.merchant.info',
projectName: 'merchants',
merchantIdList,
merchantInfoSwitch: {
brandFlag: true
}
}, false, 'merchant')
},
/**
* 车型
*
*/
getCarBrandsList(data) {
getCarBrandsList (data) {
return http.post(
{
method: "scrm.api.carlife.common.getCarSeriesList",
......@@ -71,7 +82,7 @@ module.exports = {
/**
* 推荐人
*/
getEmployeeList(data) {
getEmployeeList (data) {
return http.post({
method: "dj.api.smartcarlife.employee.getByMerchantId",
projectName: "boutique",
......
......@@ -7,7 +7,7 @@
>
<view
class="tips-wrapper"
:style="{ width: popupW + 'rpx', minHeight: popupH + 'rpx' }"
:style="{ width: popupW + 'rpx', minHeight: popupH + 'rpx',maxHeight: maxHeight + 'rpx' }"
>
<view class="tips-content">
<view class="tips-title"
......@@ -70,6 +70,7 @@ export default {
type: String,
default: "取消",
},
maxHeight:Number
},
methods: {
close() {
......
......@@ -55,10 +55,29 @@
</template>
</view>
<MessageBox
ref="carBrandListVisible"
position="bottom"
:isFooter="false"
title="请选择车品牌"
>
<view class="select-box">
<view
class="select-item"
:class="{ checked:carBrand == item.name }"
@click="selectCar(item)"
v-for="(item, index) in carBrandList"
:key="index"
>
{{ item.name }}
</view>
</view>
</MessageBox>
<MessageBox
ref="carBoxVisible"
position="bottom"
:isFooter="false"
title="请选择车型"
:maxHeight="1000"
>
<view class="select-box">
<view
......@@ -103,6 +122,7 @@ export default {
name: 'Media_1',
data () {
return {
carBrandList: [],
carlist: [],
employeeList: [],
formObject: [
......@@ -117,7 +137,7 @@ export default {
label: '车型',
key: 'carModel',
type: 'select',
popKey: 'carBoxVisible'
popKey: 'carBrandListVisible'
},
{
label: '电话',
......@@ -133,16 +153,24 @@ export default {
popKey: 'employeeBoxVisible'
}
],
customerInfo: this.$store.state.user.customerInfo
customerInfo: this.$store.state.user.customerInfo,
carBrand: ''
}
},
mounted () {
let userInfo = uni.$storage.get('userInfo')
uni.$api.commonApi.getCarBrandsList({
brandId: env.index == 3 ? 2365 : 2978,
childBrandId: env.index == 3 ? 2695 : 3454
}).then(res => {
this.carlist = res
uni.$api.commonApi.getMerchantCarBrandList([userInfo.shopMerchantId]).then(({ data }) => {
console.log(data, '123')
let list = data[0].carBrandList,
carBrandList = []
list.map(e => {
e.childs.map(i => {
i.brandId = e.id
carBrandList.push(i)
})
})
this.carBrandList = carBrandList
})
uni.$api.commonApi.getEmployeeList({
merchantId: userInfo.shopMerchantId,
......@@ -154,12 +182,28 @@ export default {
inputCustomer () {
this.$store.dispatch('setCustomerInfo', this.customerInfo)
},
selectCar (e) {
uni.showLoading()
this.carBrand = e.name
uni.$api.commonApi.getCarBrandsList({
brandId: e.brandId,
childBrandId: e.id
}).then(res => {
uni.hideLoading()
this.carlist = res
this.$refs.carBoxVisible.open()
}).catch(() => uni.hideLoading())
},
handleSelect (item, popkey) {
this.$refs[popkey].close()
if (popkey == 'employeeBoxVisible') {
this.customerInfo.salesUuid = item.uuid
this.customerInfo.staffName = item.staffName
} else this.customerInfo.carModel = item.name
} else {
this.$refs.carBrandListVisible.close()
this.customerInfo.carModel = item.name
}
this.$store.dispatch('setCustomerInfo', this.customerInfo)
},
showPopup (e) {
......@@ -249,7 +293,7 @@ export default {
grid-template-columns: repeat(3, 1fr);
gap: 20rpx;
overflow-y: scroll;
height: 100%;
max-height: 50vh;
padding-bottom: 60rpx;
.select-item {
text-align: center;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!