订单登记

This commit is contained in:
老叶
2021-10-29 17:46:50 +08:00
parent 3c3b33c7a8
commit a3098e2577
4 changed files with 140 additions and 64 deletions
+1
View File
@@ -82,6 +82,7 @@ api = {
appCustomersDefeats: 'app/customers/defeats', //战败客户列表 /战败/再战申请
appServices:'app/services', //获取代办服务列表
appFine:'app/fine', //获取精品赠送列表
}
+7
View File
@@ -537,4 +537,11 @@ apiQuery.getAppServices = function (params) {
})
}
//获取精品赠送列表
apiQuery.getAppFine = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appFine, 2, params, "GET", resolve, reject)
})
}
export default apiQuery;
+98 -54
View File
@@ -16,7 +16,7 @@ Page({
step:3,
},
],
step:3,
step:1,
name:'',//姓名
mobile:'',//手机号
address:'',//地址
@@ -36,8 +36,6 @@ Page({
colorArray:[],//车型颜色列表
levelArray:[],//车型级别列表
interiorArray:[],//内饰颜色
packArray:[],//代办包
packIndex:-1,//代办包索引
colorIndex:-1,//车型颜色索引
levelIndex:-1,//车型级别索引
interiorIndex:-1,//内饰颜色索引
@@ -76,8 +74,11 @@ Page({
disc_money:'',//优惠金额
srv_total:0,//代办费用
srv_ids:[],//代办数组
agencyList:[],
srv_ids:[],//代办选择数组
agencyList:[],//代办数组
fine_total:0,//精品费用
fine_ids:[],//精品选择数组
fineList:[],//精品数组
},
//生命周期函数--监听页面加载
@@ -91,6 +92,7 @@ Page({
this.getAppCustomersList()
this.getAppSeriesBrands()
this.getUserInfo()
this.getAppFine()
},
@@ -207,12 +209,6 @@ Page({
icon: 'none'
})
}
// else if(this.data.packIndex == -1 ){
// wx.showToast({
// title: '请选择代办包',
// icon: 'none'
// })
// }
// else if(this.data.mainIndex == -1 ){
// wx.showToast({
// title: '请选择购车主体',
@@ -407,27 +403,6 @@ Page({
});
},
//获取代办包
getAppServicesPackage(){
let params = {};
params['page'] = 1;
params['type'] = this.data.paymentIndex==0?'1':'2';
params['size'] = 100;
_.apiQuery.getAppServicesPackage(params).then(res => {
if(res.data.list.length>0){
let packArray = []
res.data.list.forEach(item => {
packArray.push(item.title)
})
this.setData({
packArray:packArray,
packList:res.data.list,
packIndex:-1,
})
}
});
},
//选择品牌
changeBrand(e) {
if(this.data.brandIndex != e.detail.value && e.detail.value >= 0){
@@ -521,25 +496,12 @@ Page({
}
},
//代办包
changePack(e) {
let pack_id = ''
if(e.detail.value >= 0){
pack_id = this.data.packList[e.detail.value].id
}
this.setData({
pack_id:pack_id,
packIndex:e.detail.value,
})
},
//付款方式
changePayment(e) {
if(this.data.paymentIndex != e.detail.value && e.detail.value >= 0){
this.setData({
paymentIndex:e.detail.value,
})
//this.getAppServicesPackage()
if(e.detail.value==1){
this.getAppFinance()
}else{
@@ -595,8 +557,16 @@ Page({
params['color_id'] = this.data.color_id;
params['incolor_id'] = this.data.incolor_id;
_.apiQuery.getAppSeriesInfo(params).then(res => {
let fineList = this.data.fineList
fineList.forEach(item => {
item.checked = false
})
this.setData({
priceinfo:res.data,
disc_money:'',
fineList:fineList,
fine_ids:[],
fine_total:0,
})
});
}
@@ -620,6 +590,17 @@ Page({
}
},
//获取精品赠送列表
getAppFine(){
let params = {};
params['car_id'] = this.data.car_id;
_.apiQuery.getAppFine(params).then(res => {
this.setData({
fineList:res.data.list,
})
});
},
//建卡时间
delryTime(e){
this.setData({
@@ -667,7 +648,6 @@ Page({
params['price'] = that.data.priceinfo.price;
params['deposit'] = that.data.priceinfo.deposit;
params['payway'] = that.data.paymentIndex==0?'1':'0';
//params['pack_id'] = that.data.pack_id;
//params['main_type'] = that.data.mainIndex==0?'0':'1';
params['ifentrust'] = that.data.entrustIndex==0?'1':'0';
params['delry_time'] = that.data.delry_time;
@@ -692,6 +672,9 @@ Page({
if(this.data.srv_ids.length>0){
params['srv_ids'] = this.data.srv_ids;
}
if(this.data.fine_ids.length>0){
params['fine_ids'] = this.data.fine_ids;
}
_.apiQuery.postAppCusorder(params).then(res => {
//刷新列表页
@@ -910,13 +893,6 @@ Page({
}
},
//到店试驾
checkPicker(e){
this.setData({
['agencyList['+e.currentTarget.dataset.index+'].check']:!this.data.agencyList[e.currentTarget.dataset.index].check,
})
},
//代办相关
changeAgency(e) {
@@ -928,7 +904,7 @@ Page({
values.forEach(item2 => {
if(item1.id == item2){
item1.checked = true
srv_total = srv_total + item1.price
srv_total = srv_total + parseFloat(item1.price)
}
})
})
@@ -940,5 +916,73 @@ Page({
})
},
//精品相关
changeFine(e) {
//判断是否选中
if(this.data.fineList[e.currentTarget.dataset.index].checked){
let fine_ids = this.data.fine_ids
let idsindex = fine_ids.indexOf(this.data.fineList[e.currentTarget.dataset.index].id);
fine_ids.splice(idsindex, 1)
this.setData({
['fineList['+e.currentTarget.dataset.index+'].checked']:false,
fine_ids,
})
let fine_total = 0
this.data.fineList.forEach(item => {
if(item.checked == true){
fine_total = fine_total + parseFloat(item.price)
}
})
this.setData({
fine_total,
})
}else{
//判断是否超过最大可优惠价格
if(parseFloat(this.data.disc_money!=''?this.data.disc_money:'0')+this.data.fine_total+parseFloat(this.data.fineList[e.currentTarget.dataset.index].price)>parseFloat(this.data.priceinfo.dis_money)){
wx.showToast({
title: '已超过最大可优惠价格',
icon: 'none'
})
this.setData({
['fineList['+e.currentTarget.dataset.index+'].checked']:false,
})
}else{
let fine_ids = this.data.fine_ids
fine_ids.push(this.data.fineList[e.currentTarget.dataset.index].id)
this.setData({
['fineList['+e.currentTarget.dataset.index+'].checked']:true,
fine_ids,
})
let fine_total = 0
this.data.fineList.forEach(item => {
if(item.checked == true){
fine_total = fine_total + parseFloat(item.price)
}
})
this.setData({
fine_total,
})
}
}
},
//输入车身优惠
inputDisc(e) {
if(parseFloat(e.detail.value)+this.data.fine_total>parseFloat(this.data.priceinfo.dis_money)){
wx.showToast({
title: '已超过最大可优惠价格',
icon: 'none'
})
this.setData({
[e.currentTarget.dataset.key]: ''
})
}else{
this.setData({
[e.currentTarget.dataset.key]: parseFloat(e.detail.value)
})
}
},
})
+34 -10
View File
@@ -137,13 +137,13 @@
</view>
<view class="relative bbs-1-eb last-b-none pl180 font-28" wx:if="{{priceinfo.price}}">
<view class="absolute left-0 box-middle color-333">车辆合同售价</view>
<view class="pt30 pb30 text-right font-28 color-666" style="height:38rpx;">
<view class="pt30 pb30 text-right font-28 color-666" style="min-height:38rpx;">
<text>{{priceinfo.price}}元</text>
</view>
</view>
<view class="relative bbs-1-eb last-b-none pl180 font-28" wx:if="{{priceinfo.deposit}}">
<view class="absolute left-0 box-middle color-333">定金</view>
<view class="pt30 pb30 text-right font-28 color-666" style="height:38rpx;">
<view class="pt30 pb30 text-right font-28 color-666" style="min-height:38rpx;">
<text>{{priceinfo.deposit}}元</text>
</view>
</view>
@@ -190,16 +190,16 @@
</picker>
</view>
</view>
<view class="relative bbs-1-eb last-b-none pl180 font-28">
<view class="relative bbs-1-eb last-b-none pl180 font-28" wx:if="{{priceinfo.dis_money}}">
<view class="absolute left-0 box-middle">车身优惠</view>
<view class="relative pr40">
<input class="wp100 height-100 text-right font-28" placeholder-class="color-ccc" type="text" placeholder="请输入车身优惠金额" model:value="{{disc_money}}" />
<input class="wp100 height-100 text-right font-28" placeholder-class="color-ccc" type="text" placeholder="请输入车身优惠金额" bindinput='inputDisc' data-key="disc_money" name='disc_money' value="{{disc_money}}" />
<view class="absolute right-0 box-middle font-28 color-666">元</view>
</view>
</view>
<view class="bbs-1-eb last-b-none">
<view class="relative pl190">
<view class="absolute left-0 box-middle font-28 color-333">代办相关</view>
<view class="absolute left-0 box-middle font-28 color-333">代办相关<text class="color-f9394d" wx:if="{{userInfo.biz_type != 3}}">*</text></view>
<view class="pt30 pb30 text-right font-28 color-666">
当前代办费用:<text class="color-f9394d">{{srv_total}}</text>元
</view>
@@ -215,6 +215,22 @@
</checkbox-group>
</view>
</view>
<view class="bbs-1-eb last-b-none" wx:if="{{priceinfo.dis_money}}">
<view class="relative pl190">
<view class="absolute left-0 box-middle font-28 color-333">精品赠送</view>
<view class="pt30 pb30 text-right font-28 color-666">
精品价值:<text class="color-f9394d">{{fine_total}}</text>元
</view>
</view>
<view class="pb10">
<block wx:for="{{fineList}}" wx:key='index'>
<view class="block mb20 relative inner30 bg-f6 font-28 ulib-r10" bindtap="changeFine" data-index="{{index}}">
<text>{{item.title}}</text>
<checkbox class="absolute right-0 box-middle mr15" value="{{item.id}}" checked="{{item.checked}}"/>
</view>
</block>
</view>
</view>
</view>
</view>
@@ -254,7 +270,7 @@
</view>
<view class="relative bbs-1-eb last-b-none pl180 font-28" wx:if="{{inten_money}}">
<view class="absolute left-0 box-middle color-333">意向金</view>
<view class="pt30 pb30 text-right font-28 color-666" style="height:38rpx;">
<view class="pt30 pb30 text-right font-28 color-666" style="min-height:38rpx;">
<text>{{inten_money}}元</text>
</view>
</view>
@@ -299,13 +315,13 @@
</view>
<view class="relative bbs-1-eb last-b-none pl180 font-28" wx:if="{{priceinfo.price}}">
<view class="absolute left-0 box-middle color-333">车辆合同售价</view>
<view class="pt30 pb30 text-right font-28 color-666" style="height:38rpx;">
<view class="pt30 pb30 text-right font-28 color-666" style="min-height:38rpx;">
<text>{{priceinfo.price}}元</text>
</view>
</view>
<view class="relative bbs-1-eb last-b-none pl180 font-28" wx:if="{{priceinfo.deposit}}">
<view class="absolute left-0 box-middle color-333">定金</view>
<view class="pt30 pb30 text-right font-28 color-666" style="height:38rpx;">
<view class="pt30 pb30 text-right font-28 color-666" style="min-height:38rpx;">
<text>{{priceinfo.deposit}}元</text>
</view>
</view>
@@ -328,16 +344,24 @@
</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" style="height:38rpx;">{{disc_money != ''?disc_money:'0'}}</view>
<view class="pt30 pb30 text-right font-28 color-666" style="min-height:38rpx;">{{disc_money != ''?disc_money:'0'}}</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" style="height:38rpx;">
<view class="pt30 pb30 text-right font-28 color-666" style="min-height:38rpx;">
<block wx:for="{{agencyList}}" wx:key='index'>
<text class="pl10" wx:if="{{item.checked}}">{{item.title}}</text>
</block>
</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" style="min-height:38rpx;">
<block wx:for="{{fineList}}" wx:key='index'>
<text class="pl10" wx:if="{{item.checked}}">{{item.title}}</text>
</block>
</view>
</view>
<view class="fixed left-0 right-0 bottom-0 bg-fff-op90 inner40 fn-flex safe-pb">
<button class="wp100 bds-2-36afa2 bg-fff mr20 pt10 pb10 text-center font-32 color-36afa2 ulib-r750" hover-class="btn-36afa2-hover" bindtap="optPreview">重新编辑</button>
<button class="wp100 btn-36afa2 ml20 pt10 pb10 text-center font-32 color-fff ulib-r750" hover-class="btn-36afa2-hover" disabled="{{submitFlag}}" bindtap="postAppCusorder">确认登记</button>