编辑-车辆选装包
This commit is contained in:
@@ -74,6 +74,10 @@ Page({
|
||||
fineArr:[],//精品选装
|
||||
finedIndex:-1,//精品选装索引
|
||||
|
||||
packageList:[],//车辆选装包
|
||||
options_ids:[],//选装包id数组
|
||||
options_total:0,//选装包费用
|
||||
|
||||
},
|
||||
//生命周期函数--监听页面加载
|
||||
onLoad: function (options) {
|
||||
@@ -102,6 +106,8 @@ Page({
|
||||
sa:res.data.sa?res.data.sa:'',
|
||||
//if_fine:res.data.if_fine==1?true:false,
|
||||
if_local_bill:res.data.if_local_bill==1?1:0,
|
||||
brand_id:res.data.brand_id,
|
||||
car_id:res.data.car_id,
|
||||
})
|
||||
|
||||
/*匹配车辆信息*/
|
||||
@@ -340,6 +346,38 @@ Page({
|
||||
}
|
||||
/*end匹配精品赠送*/
|
||||
|
||||
//匹配车辆选装包
|
||||
if(res.data.option_ids&&res.data.option_ids.length>0){
|
||||
let optionparams = {};
|
||||
optionparams['id'] = res.data.car_id;
|
||||
_.apiQuery.getAppOptions(optionparams).then(res11 => {
|
||||
if(res11.data.list.length>0){
|
||||
let packageList = res11.data.list
|
||||
let options_ids = res.data.option_ids
|
||||
let options_total = 0
|
||||
packageList.forEach(itemA => {
|
||||
itemA.checked = false
|
||||
options_ids.forEach(itemB => {
|
||||
if(itemA.id === itemB){
|
||||
itemA.checked = true
|
||||
if(parseFloat(itemA.price)>0){
|
||||
options_total = options_total + parseFloat(itemA.price)
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
this.setData({
|
||||
packageList,
|
||||
options_ids,
|
||||
options_total,
|
||||
})
|
||||
}
|
||||
});
|
||||
}else{
|
||||
//获取车辆选装包
|
||||
this.getAppOptions()
|
||||
}
|
||||
|
||||
})
|
||||
},
|
||||
|
||||
@@ -628,6 +666,9 @@ Page({
|
||||
brand_id:this.data.brandList[e.detail.value].id,
|
||||
brandIndex:e.detail.value,
|
||||
car_id:'',//车系id
|
||||
packageList:[],//车辆选装包
|
||||
options_ids:[],//选装包id数组
|
||||
options_total:0,//选装包费用
|
||||
v_id:'',//车辆版本id
|
||||
color_id:'',//车身颜色id
|
||||
incolor_id:'',//内饰颜色id
|
||||
@@ -666,8 +707,12 @@ Page({
|
||||
interiorIndex:-1,//内饰颜色索引
|
||||
priceinfo:'',
|
||||
business_type:0,
|
||||
options_ids:[],//选装包id数组
|
||||
options_total:0,//选装包费用
|
||||
})
|
||||
this.getAppSeriesAttrslevel()
|
||||
//获取车辆选装包
|
||||
this.getAppOptions()
|
||||
}
|
||||
},
|
||||
|
||||
@@ -829,6 +874,9 @@ Page({
|
||||
params['v_id'] = that.data.v_id;
|
||||
params['color_id'] = that.data.color_id;
|
||||
params['incolor_id'] = that.data.incolor_id;
|
||||
if(that.data.options_ids.length>0){
|
||||
params['options_ids'] = that.data.options_ids;
|
||||
}
|
||||
params['price'] = that.data.priceinfo.price;
|
||||
params['deposit'] = that.data.priceinfo.sdeposit;
|
||||
params['payway'] = that.data.paymentIndex==0?'1':'0';
|
||||
@@ -1277,4 +1325,45 @@ Page({
|
||||
}
|
||||
},
|
||||
|
||||
//获取车辆选装包
|
||||
getAppOptions(){
|
||||
let params = {};
|
||||
params['id'] = this.data.car_id;
|
||||
_.apiQuery.getAppOptions(params).then(res => {
|
||||
if(res.data.list.length>0){
|
||||
let packageList = res.data.list
|
||||
packageList.forEach(item => {
|
||||
item.checked = false
|
||||
})
|
||||
this.setData({
|
||||
packageList,
|
||||
})
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
//选择车辆选装包
|
||||
choosePackage(e) {
|
||||
let packageList = this.data.packageList
|
||||
let options_ids = e.detail.value
|
||||
let options_total = 0
|
||||
packageList.forEach(itemA => {
|
||||
itemA.checked = false
|
||||
options_ids.forEach(itemB => {
|
||||
if(itemA.id === itemB){
|
||||
itemA.checked = true
|
||||
if(parseFloat(itemA.price)>0){
|
||||
options_total = options_total + parseFloat(itemA.price)
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
this.setData({
|
||||
packageList,
|
||||
options_ids,
|
||||
options_total,
|
||||
})
|
||||
},
|
||||
|
||||
})
|
||||
@@ -62,6 +62,26 @@
|
||||
</picker>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!--选装-->
|
||||
<block wx:if="{{packageList.length>0&&interiorIndex != -1}}">
|
||||
<view class="pt30 pb30 font-32">选装包</view>
|
||||
<checkbox-group bindchange="choosePackage">
|
||||
<block wx:for='{{packageList}}' wx:key='index' wx:key="index">
|
||||
<label class="block inner40 pb5 relative ulib-r10 box-shadow-000-10-10 mb30 overflowhidden">
|
||||
<view class="relative pr100">
|
||||
<view class="font-30">{{item.title}}</view>
|
||||
<checkbox class="absolute top-0 right-0 font-30" value="{{item.id}}" checked="{{item.checked}}"/>
|
||||
</view>
|
||||
<view class="mt15 text-middle font-28 color-666">¥{{item.price}}</view>
|
||||
<view class="mt15 font-24 color-666 text-break line-height-18" >
|
||||
<rich-text nodes="{{item.descrip}}"></rich-text>
|
||||
</view>
|
||||
</label>
|
||||
</block>
|
||||
</checkbox-group>
|
||||
</block>
|
||||
|
||||
</view>
|
||||
|
||||
<view wx:if="{{step == 3}}">
|
||||
@@ -104,7 +124,7 @@
|
||||
</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="min-height:38rpx;"><text class="mr10 color-f9394d">{{priceinfo.price+priceinfo.price_color+priceinfo.price_coplus-(priceinfo.sdisc_money>0?priceinfo.sdisc_money:0)}}</text>元</view>
|
||||
<view class="pt30 pb30 text-right font-28 color-666" style="min-height:38rpx;"><text class="mr10 color-f9394d">{{options_total+priceinfo.price+priceinfo.price_color+priceinfo.price_coplus-(priceinfo.sdisc_money>0?priceinfo.sdisc_money:0)}}</text>元</view>
|
||||
</view>
|
||||
</block>
|
||||
<block wx:else>
|
||||
@@ -308,6 +328,20 @@
|
||||
<view class="absolute left-0 box-middle font-28 color-333">内饰颜色</view>
|
||||
<view class="pt30 pb30 text-right font-28 color-666">{{interiorArray[interiorIndex]}}</view>
|
||||
</view>
|
||||
<block wx:if="{{options_ids.length>0}}">
|
||||
<view class="relative bbs-1-eb last-b-none pl180 font-28">
|
||||
<view class="absolute left-0 box-middle color-333">选装包</view>
|
||||
<view class="pt30 pb30 text-right font-28 color-666" style="height:38rpx;"><text class="mr10 color-f9394d">{{options_total}}</text>元</view>
|
||||
</view>
|
||||
<block wx:for="{{packageList}}" wx:key='index'>
|
||||
<view class="relative ml40 bbs-1-eb pl140 font-22 color-666" wx:if="{{item.checked}}">
|
||||
<view class="absolute left-0 box-middle"><i class="iconfont ml5 mr10 icon-gengduo"></i>{{item.title}}</view>
|
||||
<view class="pt25 pb25 text-right" style="min-height:30rpx">
|
||||
<block wx:if="{{item.price>0}}"><text class="mr10 color-f9394d">{{item.price}}</text>元</block>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</block>
|
||||
<view class="mt40 font-32">其他信息</view>
|
||||
<view class="relative bbs-1-eb pl190 last-b-none">
|
||||
<view class="absolute left-0 box-middle font-28 color-333">付款方式</view>
|
||||
@@ -335,7 +369,7 @@
|
||||
</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="min-height:38rpx;"><text class="mr10 color-f9394d">{{priceinfo.price+priceinfo.price_color+priceinfo.price_coplus-(priceinfo.sdisc_money>0?priceinfo.sdisc_money:0)}}</text>元</view>
|
||||
<view class="pt30 pb30 text-right font-28 color-666" style="min-height:38rpx;"><text class="mr10 color-f9394d">{{options_total+priceinfo.price+priceinfo.price_color+priceinfo.price_coplus-(priceinfo.sdisc_money>0?priceinfo.sdisc_money:0)}}</text>元</view>
|
||||
</view>
|
||||
<view class="relative ml40 bbs-1-eb pl140 font-22 color-666" wx:if="{{!!priceinfo.sdisc_money&&priceinfo.sdisc_money != ''}}">
|
||||
<view class="absolute left-0 box-middle"><i class="iconfont ml5 mr10 icon-gengduo"></i>优惠</view>
|
||||
|
||||
@@ -503,7 +503,7 @@
|
||||
</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="min-height:38rpx;"><text class="mr10 color-f9394d">{{priceinfo.price+priceinfo.price_color+priceinfo.price_coplus-(priceinfo.sdisc_money>0?priceinfo.sdisc_money:0)}}</text>元</view>
|
||||
<view class="pt30 pb30 text-right font-28 color-666" style="min-height:38rpx;"><text class="mr10 color-f9394d">{{options_total+priceinfo.price+priceinfo.price_color+priceinfo.price_coplus-(priceinfo.sdisc_money>0?priceinfo.sdisc_money:0)}}</text>元</view>
|
||||
</view>
|
||||
<view class="relative ml40 bbs-1-eb pl140 font-22 color-666" wx:if="{{!!priceinfo.sdisc_money&&priceinfo.sdisc_money != ''}}">
|
||||
<view class="absolute left-0 box-middle"><i class="iconfont ml5 mr10 icon-gengduo"></i>优惠</view>
|
||||
|
||||
Reference in New Issue
Block a user