分期产品

This commit is contained in:
老叶
2021-09-09 19:27:00 +08:00
parent 38fb6c0ac9
commit d6d9ea1441
5 changed files with 188 additions and 10 deletions
+3
View File
@@ -53,6 +53,9 @@ api = {
appUserTel: "app/user/tel", //编辑拨打电话
appFinance: "app/finance", //获取金融产品列表
appFinanceNums: "app/finance/nums", //获取金融分期期数
}
+13
View File
@@ -355,5 +355,18 @@ apiQuery.putAppUserTel = function (params) {
})
}
//获取金融产品列表
apiQuery.getAppFinance = function(params){
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appFinance, 2, params, "GET", resolve, reject)
})
}
//获取金融分期期数
apiQuery.getAppFinanceNums = function(params){
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appFinanceNums, 2, params, "GET", resolve, reject)
})
}
export default apiQuery;
+5 -5
View File
@@ -52,8 +52,8 @@
</view>
</view>
</view>
<!--分期信息修改-->
<view class="pl30 pr30" wx:if="{{info.loan_status == 1}}">
<!--分期信息修改--><!--210909不显示-->
<view class="pl30 pr30" wx:if="{{info.loan_status == -10000}}">
<view class="mt40 font-32">分期信息</view>
<view class="relative bbs-1-eb pl190">
<view class="absolute left-0 box-middle font-28 color-333">分期产品</view>
@@ -87,8 +87,8 @@
<view class="pt30 pb30 text-right font-28 color-666" style="min-height:38rpx;">{{loanSource.first_price}}元</view>
</view>
</view>
<!--分期信息展示-->
<view class="pl30 pr30" wx:elif="{{info.loan_status == 2}}">
<!--分期信息展示--><!--210909不显示-->
<view class="pl30 pr30" wx:elif="{{info.loan_status == -20000}}">
<view class="mt40 font-32">分期信息</view>
<view class="relative bbs-1-eb pl140 font-28">
<view class="absolute left-0 box-middle font-28 color-333">分期产品</view>
@@ -135,7 +135,7 @@
<view class="mt20" wx:if="{{info.bill_data.bill_img}}"><image bindtap="previewImage" class='wp100' lazy-load="{{true}}" mode="widthFix" src="{{info.bill_data.bill_img}}"></image></view>
</view>
<view class="mt60 pl60 pr60" wx:if="{{info.loan_status == 1}}">
<view class="mt60 pl60 pr60" wx:if="{{info.loan_status == -10000}}"><!--210909不显示-->
<button class="wp100 btn-36afa2 pt10 pb10 text-center font-32 color-fff ulib-r750" hover-class="btn-36afa2-hover" disabled="{{submitFlag}}" bindtap="{{info.loan_data.id?'putAppLoan':'postAppLoan'}}">{{info.loan_data.id?'修改信息':'保存信息'}}</button>
</view>
<view class="mt60 pl60 pr60" wx:elif="{{info.bill_status == 1}}">
+125 -3
View File
@@ -13,6 +13,8 @@ Page({
color_id:'',//车型颜色id
incolor_id:'',//内饰颜色id
b_s_id:'',//备选车型id
finance_id:'',//金融产品id
fin_nums_id:'',//金融分期期数id
buy_time:'',//预计购车时间
brandIndex:-1,//车辆品牌索引
modelIndex:-1,//车型车系索引
@@ -25,6 +27,10 @@ Page({
colorIndex:-1,//车型颜色索引
levelIndex:-1,//车型级别索引
interiorIndex:-1,//内饰颜色索引
financeArray:[],//金融产品
financeIndex:-1,//金融产品索引
financeNumsArray:[],//金融分期期数
financeNumsIndex:-1,//金融分期期数索引
priceinfo:'',//车辆价格
delry_time:'',//期望交付时间
submitFlag:false,
@@ -246,6 +252,7 @@ Page({
priceinfo:'',
})
this.getAppSeries()
this.getAppFinanceNums()
}
},
@@ -269,6 +276,7 @@ Page({
priceinfo:'',
})
this.getAppSeriesAttrs()
this.getAppFinanceNums()
}
},
@@ -280,6 +288,7 @@ Page({
levelIndex:e.detail.value,
})
this.getAppSeriesInfo()
this.getAppFinanceNums()
}
},
@@ -291,6 +300,7 @@ Page({
colorIndex:e.detail.value,
})
this.getAppSeriesInfo()
this.getAppFinanceNums()
}
},
@@ -302,6 +312,7 @@ Page({
interiorIndex:e.detail.value,
})
this.getAppSeriesInfo()
this.getAppFinanceNums()
}
},
@@ -319,10 +330,50 @@ Page({
//付款方式
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{
this.setData({
financeArray:[],
financeList:[],
finance_id:'',
financeIndex:-1,
})
}
this.getAppFinanceNums()
}
},
//获取金融产品列表
changeFinance(e) {
if(this.data.financeIndex != e.detail.value && e.detail.value >= 0){
let finance_id = ''
if(e.detail.value >= 0){
finance_id = this.data.financeList[e.detail.value].id
}
this.setData({
finance_id:finance_id,
financeIndex:e.detail.value,
})
this.getAppFinanceNums()
}
},
//获取金融产品列表
changeFinanceNums(e) {
let fin_nums_id = ''
if(e.detail.value >= 0){
fin_nums_id = this.data.financeNumsList[e.detail.value].id
}
this.setData({
paymentIndex:e.detail.value,
fin_nums_id:fin_nums_id,
financeNumsIndex:e.detail.value,
})
this.getAppServicesPackage()
},
//购车主体
@@ -364,6 +415,61 @@ Page({
})
},
//获取金融产品列表
getAppFinance(){
let params = {};
params['page'] = 1;
params['size'] = 100;
_.apiQuery.getAppFinance(params).then(res => {
if(res.data.list.length>0){
let financeArray = []
res.data.list.forEach(item => {
financeArray.push(item.title)
})
this.setData({
financeArray:financeArray,
financeList:res.data.list,
finance_id:'',
financeIndex:-1,
})
}
});
},
//获取金融分期期数
getAppFinanceNums(){
this.setData({
financeNumsArray:[],
financeNumsList:[],
fin_nums_id:'',
financeNumsIndex:-1,
})
if(this.data.car_id != ''&&this.data.v_id != ''&&this.data.color_id != ''&&this.data.incolor_id != ''&&this.data.finance_id != ''){
let params = {};
params['page'] = 1;
params['size'] = 100;
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;
params['finance_id'] = this.data.finance_id;
_.apiQuery.getAppFinanceNums(params).then(res => {
if(res.data.list.length>0){
let financeNumsArray = []
res.data.list.forEach(item => {
financeNumsArray.push(item.num)
})
this.setData({
financeNumsArray:financeNumsArray,
financeNumsList:res.data.list,
fin_nums_id:'',
financeNumsIndex:-1,
})
}
});
}
},
//新建订单预览
previewCusorder(){
let that = this
@@ -417,7 +523,20 @@ Page({
title: '请选择付款方式',
icon: 'none'
})
}else if(that.data.packIndex == -1 ){
}
else if(that.data.paymentIndex == 1 && that.data.finance_id == ''){
wx.showToast({
title: '请选择金融产品',
icon: 'none'
})
}
else if(that.data.paymentIndex == 1 && that.data.finance_id != ''&& that.data.fin_nums_id == ''){
wx.showToast({
title: '请选择分期期数',
icon: 'none'
})
}
else if(that.data.packIndex == -1 ){
wx.showToast({
title: '请选择代办包',
icon: 'none'
@@ -511,6 +630,9 @@ Page({
if(this.data.entrust_idcard != ''){
params['entrust_idcard'] = this.data.entrust_idcard;
}
if(this.data.fin_nums_id != ''){
params['fin_nums_id'] = this.data.fin_nums_id;
}
_.apiQuery.postAppCusorder(params).then(res => {
//刷新列表页
+42 -2
View File
@@ -111,11 +111,37 @@
</picker>
</view>
</view>
<view class="relative bbs-1-eb pl190 last-b-none">
<view class="relative bbs-1-eb pl190 last-b-none" wx:if="{{financeArray.length>0}}">
<view class="absolute left-0 box-middle font-28 color-333">金融产品</view>
<view class="pt30 pb30 text-right font-28 color-666">
<picker bindchange="changeFinance" value="{{financeIndex}}" range="{{financeArray}}">
<text class="color-ccc" wx:if="{{financeIndex == -1}}">请选择</text>
<text wx:else>{{financeArray[financeIndex]}}</text>
<i class="iconfont ml5 icon-gengduo"></i>
</picker>
</view>
</view>
<view class="relative bbs-1-eb pl190 last-b-none" wx:if="{{financeNumsArray.length>0}}">
<view class="absolute left-0 box-middle font-28 color-333">分期期数</view>
<view class="pt30 pb30 text-right font-28 color-666">
<picker bindchange="changeFinanceNums" value="{{financeNumsIndex}}" range="{{financeNumsArray}}">
<text class="color-ccc" wx:if="{{financeNumsIndex == -1}}">请选择</text>
<text wx:else>{{financeNumsArray[financeNumsIndex]}}</text>
<i class="iconfont ml5 icon-gengduo"></i>
</picker>
</view>
</view>
<view class="relative bbs-1-eb last-b-none pl180 font-28" wx:if="{{financeNumsArray.length>0&&financeNumsIndex != -1}}">
<view class="absolute left-0 box-middle color-333">贷款金额</view>
<view class="pt30 pb30 text-right font-28 color-666" style="height:38rpx;">
<text>{{financeNumsList[financeNumsIndex].loan_money}}元</text>
</view>
</view>
<view class="relative bbs-1-eb pl190 last-b-none" wx:if="{{packArray.length>0}}">
<view class="absolute left-0 box-middle font-28 color-333">代办包</view>
<view class="pt30 pb30 text-right font-28 color-666">
<picker bindchange="changePack" value="{{packIndex}}" range="{{packArray}}">
<text class="color-ccc" wx:if="{{packIndex == -1}}">{{paymentIndex == -1?'请先选择付款方式':'请选择'}}</text>
<text class="color-ccc" wx:if="{{packIndex == -1}}">请选择</text>
<text wx:else>{{packArray[packIndex]}}</text>
<i class="iconfont ml5 icon-gengduo"></i>
</picker>
@@ -231,6 +257,20 @@
<view class="absolute left-0 box-middle font-28 color-333">付款方式</view>
<view class="pt30 pb30 text-right font-28 color-666">{{payment[paymentIndex]}}</view>
</view>
<view class="relative bbs-1-eb pl190 last-b-none" wx:if="{{financeArray.length>0}}">
<view class="absolute left-0 box-middle font-28 color-333">金融产品</view>
<view class="pt30 pb30 text-right font-28 color-666">{{financeArray[financeIndex]}}</view>
</view>
<view class="relative bbs-1-eb pl190 last-b-none" wx:if="{{financeNumsArray.length>0}}">
<view class="absolute left-0 box-middle font-28 color-333">分期期数</view>
<view class="pt30 pb30 text-right font-28 color-666">{{financeNumsArray[financeNumsIndex]}}</view>
</view>
<view class="relative bbs-1-eb last-b-none pl180 font-28" wx:if="{{financeNumsArray.length>0&&financeNumsIndex != -1}}">
<view class="absolute left-0 box-middle color-333">贷款金额</view>
<view class="pt30 pb30 text-right font-28 color-666" style="height:38rpx;">
<text>{{financeNumsList[financeNumsIndex].loan_money}}元</text>
</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">{{packArray[packIndex]}}</view>