diff --git a/commons/js/config.js b/commons/js/config.js index 14586f9..15257ee 100644 --- a/commons/js/config.js +++ b/commons/js/config.js @@ -1,4 +1,4 @@ -const env = "p"; +const env = "d"; const version = 1, @@ -47,6 +47,7 @@ api = { appCustomerData: "app/customers/data", //修改客户基本信息 appServicesPackage: "app/services/package", //获取代办包 appSeriesInfo: "app/series/info", //获取车辆价格 + appBusiness: "app/business", //获取商务政策 appSeriesBrands: "app/series/brands", //获取车型品牌 appSeries: "app/series", //获取车系车型 diff --git a/commons/js/utils/apiQuery.js b/commons/js/utils/apiQuery.js index d28423c..0115062 100644 --- a/commons/js/utils/apiQuery.js +++ b/commons/js/utils/apiQuery.js @@ -307,6 +307,13 @@ apiQuery.getAppSeriesInfo = function(params){ }) } +//获取商务政策 +apiQuery.getAppBusiness = function(params){ + return new Promise(function (resolve, reject) { + HttpRequest(false, Config.api.appBusiness, 2, params, "GET", resolve, reject) + }) +} + //获取车型品牌 apiQuery.getAppSeriesBrands = function(params){ return new Promise(function (resolve, reject) { diff --git a/pages/order/edit/index2.js b/pages/order/edit/index2.js index 2a07ac4..0f7e6c4 100644 --- a/pages/order/edit/index2.js +++ b/pages/order/edit/index2.js @@ -73,6 +73,8 @@ Page({ }, ],//精品赠送 + business_type:0,//0未执行到商务政策 1商务政策执行中 2商务政策成功 3商务政策失败 + }, //生命周期函数--监听页面加载 onLoad: function (options) { @@ -211,19 +213,27 @@ Page({ }) //获取车辆价格 + this.setData({ + business_type:1, + }) let priceparams = {}; - priceparams['sversion'] = '2'; + priceparams['main_type'] = res.data.main_type; priceparams['car_id'] = res.data.car_id; priceparams['v_id'] = res.data.v_id; priceparams['color_id'] = res.data.color_id; priceparams['incolor_id'] = res.data.incolor_id; - _.apiQuery.getAppSeriesInfo(priceparams).then(res10 => { + _.apiQuery.getAppBusiness(priceparams).then(res10 => { this.setData({ + business_type:2, priceinfo:res10.data, 'priceinfo.sdeposit':res.data.deposit?res.data.deposit:'', 'priceinfo.sdisc_money':res.data.disc_money?res.data.disc_money:'', 'priceinfo.sdisc_fine_money':res.data.disc_fine_money?res.data.disc_fine_money:'', }) + }).catch(res => { + this.setData({ + business_type:3, + }) }); } }); @@ -337,7 +347,7 @@ Page({ } //匹配精品赠送 - if(res.data.fines.length>0){ + if(res.data.fines&&res.data.fines.length>0){ let fine_total = 0 res.data.fines.forEach(item => { if(parseFloat(item.price)>0){ @@ -653,6 +663,7 @@ Page({ levelIndex:-1,//车辆版本索引 interiorIndex:-1,//内饰颜色索引 priceinfo:'', + business_type:0, }) this.getAppSeries() } @@ -676,6 +687,7 @@ Page({ levelIndex:-1,//车辆版本索引 interiorIndex:-1,//内饰颜色索引 priceinfo:'', + business_type:0, }) this.getAppSeriesAttrslevel() } @@ -694,6 +706,7 @@ Page({ colorIndex:-1,//车身颜色索引 interiorIndex:-1,//内饰颜色索引 priceinfo:'', + business_type:0, }) this.getAppSeriesAttrscolor() //代办列表 @@ -711,6 +724,7 @@ Page({ interiorArray:[],//内饰颜色 interiorIndex:-1,//内饰颜色索引 priceinfo:'', + business_type:0, }) this.getAppSeriesAttrsinterior() } @@ -722,8 +736,9 @@ Page({ this.setData({ incolor_id:this.data.interiorList[e.detail.value].id, interiorIndex:e.detail.value, + business_type:0, }) - this.getAppSeriesInfo() + this.getAppBusiness() } }, @@ -770,18 +785,26 @@ Page({ }, //获取车辆价格 - getAppSeriesInfo(){ + getAppBusiness(){ if(this.data.car_id != ''&&this.data.v_id != ''&&this.data.color_id != ''&&this.data.incolor_id != ''){ + this.setData({ + business_type:1, + }) let params = {}; - params['sversion'] = '2'; + params['main_type'] = this.data.info.main_type; params['car_id'] = this.data.car_id; params['v_id'] = this.data.v_id; params['color_id'] = this.data.color_id; params['incolor_id'] = this.data.incolor_id; - _.apiQuery.getAppSeriesInfo(params).then(res => { + _.apiQuery.getAppBusiness(params).then(res => { this.setData({ + business_type:2, priceinfo:res.data, }) + }).catch(res => { + this.setData({ + business_type:3, + }) }); } }, @@ -861,6 +884,7 @@ Page({ params['deposit'] = that.data.priceinfo.sdeposit; params['payway'] = that.data.paymentIndex==0?'1':'0'; params['delry_time'] = that.data.delry_time; + params['business_id'] = that.data.priceinfo.id; if(that.data.finance_id!= ''){ params['finance_id'] = that.data.finance_id; } diff --git a/pages/order/edit/index2.wxml b/pages/order/edit/index2.wxml index e3e3ab9..6fbdf14 100644 --- a/pages/order/edit/index2.wxml +++ b/pages/order/edit/index2.wxml @@ -99,6 +99,14 @@ 平台售价 {{priceinfo.price}} + + 颜色加价 + {{priceinfo.price_color}} + + + 公司加价 + {{priceinfo.price_coplus}} + 定金 @@ -106,7 +114,7 @@ 最终售价 - {{priceinfo.price-(priceinfo.sdisc_money>0?priceinfo.sdisc_money:0)}} + {{priceinfo.price+priceinfo.price_color+priceinfo.price_coplus-(priceinfo.sdisc_money>0?priceinfo.sdisc_money:0)}} @@ -256,10 +264,15 @@ - - - - + + + + + + + + + @@ -302,13 +315,21 @@ 平台售价 {{priceinfo.price}} + + 颜色加价 + {{priceinfo.price_color}} + + + 公司加价 + {{priceinfo.price_coplus}} + 定金 {{priceinfo.sdeposit}} 最终售价 - {{priceinfo.price-(priceinfo.sdisc_money>0?priceinfo.sdisc_money:0)}} + {{priceinfo.price+priceinfo.price_color+priceinfo.price_coplus-(priceinfo.sdisc_money>0?priceinfo.sdisc_money:0)}} 优惠 diff --git a/pages/order/register/index.js b/pages/order/register/index.js index 773c4ae..1b719fa 100644 --- a/pages/order/register/index.js +++ b/pages/order/register/index.js @@ -95,6 +95,8 @@ Page({ }, ],//精品赠送 + business_type:0,//0未执行到商务政策 1商务政策执行中 2商务政策成功 3商务政策失败 + }, //生命周期函数--监听页面加载 onLoad: function (options) { @@ -438,6 +440,7 @@ Page({ levelIndex:-1,//车辆版本索引 interiorIndex:-1,//内饰颜色索引 priceinfo:'', + business_type:0, }) this.getAppSeries() } @@ -461,6 +464,7 @@ Page({ levelIndex:-1,//车辆版本索引 interiorIndex:-1,//内饰颜色索引 priceinfo:'', + business_type:0, }) this.getAppSeriesAttrslevel() } @@ -479,6 +483,7 @@ Page({ colorIndex:-1,//车身颜色索引 interiorIndex:-1,//内饰颜色索引 priceinfo:'', + business_type:0, }) this.getAppSeriesAttrscolor() //代办列表 @@ -496,6 +501,7 @@ Page({ interiorArray:[],//内饰颜色 interiorIndex:-1,//内饰颜色索引 priceinfo:'', + business_type:0, }) this.getAppSeriesAttrsinterior() } @@ -507,8 +513,9 @@ Page({ this.setData({ incolor_id:this.data.interiorList[e.detail.value].id, interiorIndex:e.detail.value, + business_type:0, }) - this.getAppSeriesInfo() + this.getAppBusiness() } }, @@ -561,18 +568,26 @@ Page({ }, //获取车辆价格 - getAppSeriesInfo(){ + getAppBusiness(){ if(this.data.car_id != ''&&this.data.v_id != ''&&this.data.color_id != ''&&this.data.incolor_id != ''){ + this.setData({ + business_type:1, + }) let params = {}; - params['sversion'] = '2'; + params['main_type'] = this.data.main_type; params['car_id'] = this.data.car_id; params['v_id'] = this.data.v_id; params['color_id'] = this.data.color_id; params['incolor_id'] = this.data.incolor_id; - _.apiQuery.getAppSeriesInfo(params).then(res => { + _.apiQuery.getAppBusiness(params).then(res => { this.setData({ + business_type:2, priceinfo:res.data, }) + }).catch(res => { + this.setData({ + business_type:3, + }) }); } }, @@ -669,6 +684,7 @@ Page({ params['deposit'] = that.data.priceinfo.sdeposit; params['payway'] = that.data.paymentIndex==0?'1':'0'; params['delry_time'] = that.data.delry_time; + params['business_id'] = that.data.priceinfo.id; if(that.data.finance_id!= ''){ params['finance_id'] = that.data.finance_id; } diff --git a/pages/order/register/index.wxml b/pages/order/register/index.wxml index 5574f56..4191b9d 100644 --- a/pages/order/register/index.wxml +++ b/pages/order/register/index.wxml @@ -203,6 +203,14 @@ 平台售价 {{priceinfo.price}} + + 颜色加价 + {{priceinfo.price_color}} + + + 公司加价 + {{priceinfo.price_coplus}} + 定金* @@ -303,6 +311,25 @@ + + + + + + + + + + + + + + + + + + + + @@ -411,6 +439,14 @@ 平台售价 {{priceinfo.price}} + + 颜色加价 + {{priceinfo.price_color}} + + + 公司加价 + {{priceinfo.price_coplus}} + 意向金 {{inten_money}} @@ -421,7 +457,7 @@ 最终售价 - {{priceinfo.price-(priceinfo.sdisc_money>0?priceinfo.sdisc_money:0)}} + {{priceinfo.price+priceinfo.price_color+priceinfo.price_coplus-(priceinfo.sdisc_money>0?priceinfo.sdisc_money:0)}} 优惠