<script>
|
import sfkef from "@/components/sfkef/index.vue";
|
import repayTerm from "@/components/picker/repayTerm.vue";
|
import loanUsage from "@/components/picker/loanUsage.vue";
|
import plan from '@/components/plan'
|
import value from "@/uni_modules/uv-text/components/uv-text/value";
|
import {
|
xinheyuanBankcardDetail,
|
xinheyuanCreditView,
|
xinheyuanGetLoanElement,
|
renpinH5withdrawCheck,
|
xinheyuanLoanQueryByCustomerId, getCustomerInfo
|
} from "@/api/modules/user";
|
import agreement from "@/components/agreement/index.vue";
|
export default {
|
name: "index",
|
components:{agreement, loanUsage, repayTerm,plan,sfkef},
|
computed: {
|
customStyle() {
|
return {
|
height: '100rpx',
|
background: '#4766FE',
|
color: '#fff',
|
borderRadius: '50rpx' ,
|
fontSize:'34rpx'
|
}
|
},
|
inputStyle(){
|
return {
|
fontWeight: 'bold',
|
fontSize: '30rpx',
|
}
|
},
|
},
|
async onLoad() {
|
try {
|
await getCustomerInfo().then(res=>{
|
this.customerInfo = res;
|
uni.setStorageSync('customerZcyId', res.customerZcyId);
|
uni.setStorageSync('customerBankcardId', res.customerBankcardId);
|
})
|
} catch (e) {
|
console.log(e);
|
}
|
|
await xinheyuanBankcardDetail().then(res=>{
|
|
this.bankDetail = res;
|
})
|
await xinheyuanCreditView().then(res=>{
|
this.info = res
|
|
})
|
await xinheyuanGetLoanElement({
|
creditNo: this.bankDetail.orderNo,
|
userId: this.customerInfo.customerZcyId || uni.getStorageSync('customerZcyId'),
|
customerBankcardId:this.customerInfo.customerBankcardId || uni.getStorageSync('customerBankcardId')
|
}).then(res=>{
|
this.BankcarIdList = res;
|
this.BankcarIdList.map(item=>{
|
item.flag = true
|
})
|
})
|
},
|
data() {
|
return {
|
customerInfo:{},
|
bankDetail:{},
|
lstyle:{
|
color:'#8B8D96',
|
fontSize:'30rpx'
|
},
|
protocolChecked: [0],
|
BankcarIdList:[],
|
userInfo: {
|
repayTermStr: "12个月",
|
repayTerm: "12",
|
repayPlanDayStr:`每月${new Date().getDate()}号`,
|
repayPlanDay: new Date().getDate(),
|
repayLoanPurposeStr: "装修",
|
repayLoanPurpose: "DEC",
|
},
|
info:{
|
totalCredit:null
|
},
|
timeoutID:null
|
}
|
},
|
methods: {
|
handleNumber(vla){
|
const chineseDigits = ["一", "二", "三", "四", "五", "六", "七", "八", "九",];
|
return chineseDigits[vla];
|
},
|
openPciker(dom){
|
this.$refs[dom].open()
|
},
|
getValueRepayTerm(e){
|
this.userInfo.repayTermStr = e['value'][0].text;
|
this.userInfo.repayTerm = e['value'][0].value;
|
},
|
getValueLoanUsage(e){
|
this.userInfo.repayLoanPurposeStr = e['value'][0].text
|
this.userInfo.repayLoanPurpose = e
|
},
|
toCode(vla,index){
|
uni.navigateTo({
|
url: `/pages/code/index?queryType=${2}&code=${vla.code}&index=${index}`
|
});
|
},
|
changeFlag(key){
|
this.BankcarIdList.map((item,index)=>{
|
if(index == key){
|
item.flag = false
|
}
|
})
|
},
|
rpwithdrawCheck(){
|
renpinH5withdrawCheck({orderNo:this.customerInfo.orderNo}).then(res=>{
|
if (res.checkStu === 100) {
|
// 审核中
|
uni.showLoading({
|
title: "资金匹配中",
|
mask: true,
|
});
|
this.timeoutID = setTimeout(this.rpwithdrawCheck, 3000);
|
}
|
else if (res.checkStu === 200) {
|
this.getXinheyuanLoanQueryByCustomerId();
|
}
|
else {
|
uni.reLaunch({
|
url: '/pages/result/not'
|
})
|
if(this.timeout){
|
clearTimeout(this.timeoutID)
|
}
|
}
|
})
|
},
|
getXinheyuanLoanQueryByCustomerId(){
|
xinheyuanLoanQueryByCustomerId().then(res=>{
|
if (res === "99") {
|
uni.reLaunch({
|
url: '/pages/loan/index'
|
})
|
if(this.timeout){
|
clearTimeout(this.timeoutID)
|
}
|
}
|
if (res === "04") {
|
|
}
|
if (res === "06") {
|
uni.hideLoading();
|
}
|
})
|
},
|
submit(){
|
if(!this.protocolChecked[0]){uni.showToast({title: '请阅读并同意相关协议', icon: 'none'});return;}
|
if(this.userInfo.repayTerm == ''){uni.showToast({title: '请选择还款期数', icon: 'none'});return;}
|
if(this.userInfo.repayLoanPurpose == ''){uni.showToast({title: '请选择借款用途', icon: 'none'});return;}
|
if (this.bankDetail.bindStatusRepay !== 1 && this.bankDetail.bindStatusRepay) {uni.showToast({icon: "none", title: "请添加还款卡",});return;}
|
// 判断是否所有的 资方都绑定
|
const allBound = this.BankcarIdList.every((item) => item.flag === false);
|
if (!allBound) {
|
uni.showToast({
|
icon: "none",
|
title: "请先绑定收款账户",
|
});
|
return;
|
}
|
uni.showLoading({
|
title: "资金匹配中",
|
mask: true,
|
});
|
this.rpwithdrawCheck();
|
},
|
},
|
|
}
|
</script>
|
|
<template>
|
<view style="background: #F7F7F7;min-height: 100vh">
|
|
<view class="content">
|
<view class="head">
|
<view class="title">借款金额(元)</view>
|
<view class="money">{{info.totalCredit}}
|
<view style="display: flex;justify-content: end"><image class="icon" :src="`${$images}/static/img/details/bi.png`"></image></view></view>
|
<view class="tips">单利利息,年化综合费率16%</view>
|
</view>
|
<view class="form-box" >
|
<uv-form style="padding: 0 38rpx;" :labelStyle='lstyle' labelPosition="left" :model="userInfo" ref="form" labelWidth="100">
|
<uv-form-item class="item" label="还款期数" prop="repayTermStr" borderBottom @click="openPciker('repayTerm')">
|
<uv-input :customStyle="inputStyle" disabled disabledColor="none" inputAlign="right" v-model="userInfo.repayTermStr" border="none" placeholder="请选择"></uv-input>
|
<template v-slot:right>
|
<uv-icon name="arrow-right" size="12"></uv-icon>
|
</template>
|
</uv-form-item>
|
<uv-form-item class="item" label="还款计划" prop="repayPlanDayStr" borderBottom @click="openPciker('plan')">
|
<uv-input :customStyle="inputStyle" disabled disabledColor="none" inputAlign="right" v-model="userInfo.repayPlanDayStr" border="none" placeholder="请选择"></uv-input>
|
<template v-slot:right>
|
<uv-icon name="arrow-right" size="12"></uv-icon>
|
</template>
|
</uv-form-item>
|
<uv-form-item class="item" label="借款用途" prop="repayLoanPurposeStr" @click="openPciker('loanUsage')">
|
<uv-input :customStyle="inputStyle" inputAlign="right" v-model="userInfo.repayLoanPurposeStr" border="none" placeholder="请选择"></uv-input>
|
<template v-slot:right>
|
<uv-icon name="arrow-right" size="12"></uv-icon>
|
</template>
|
</uv-form-item>
|
</uv-form>
|
</view>
|
<view class="notes" >
|
为了确保资金到账,应资方要求,对收款账户进行短信确认
|
</view>
|
|
<view class="code">
|
<view class="li" v-for="(item,index) in BankcarIdList" >
|
<template v-if="item.flag">
|
<uv-icon color="#4766FE" name="plus-circle-fill" size="20"></uv-icon>
|
<view @click="toCode(item,index)" class="writing" >请点击确认收款账户({{handleNumber(index)}})</view>
|
</template>
|
|
<template v-else>
|
<uv-icon color="#4766FE" name="checkmark-circle-fill" size="20"></uv-icon>
|
<view class="writing">已确认</view>
|
</template>
|
</view>
|
|
</view>
|
|
<view >
|
<view style="display: flex;flex-direction: row">
|
<uv-checkbox-group
|
v-model="protocolChecked">
|
<uv-checkbox size="14" :name="1">
|
</uv-checkbox>
|
</uv-checkbox-group>
|
<text class="protocol-text" >
|
我已同意并签署<text style="font-size: 24rpx;" class="link-text" @click="openPciker('agreement')">《相关协议》</text>同意保送贷款相关信息至金融信用信息基础数据库(人行征信系统)
|
</text>
|
</view>
|
|
</view>
|
|
|
<view class="but">
|
<uv-button @click="submit" :customStyle="customStyle" shape="circle" color="#4766FE">提交借款</uv-button>
|
<view class="pack">会员礼包 <uv-icon size="18" name="checkmark-circle" style="margin-left: 32rpx;"></uv-icon></view>
|
</view>
|
</view>
|
|
<repayTerm ref="repayTerm" @confirm="getValueRepayTerm"></repayTerm>
|
|
<loanUsage ref="loanUsage" @confirm="getValueLoanUsage"></loanUsage>
|
|
<agreement ref="agreement"></agreement>
|
|
<uv-popup mode="bottom" round="20" ref="plan" v-if="info.totalCredit">
|
<plan :amount="info.totalCredit"></plan>
|
</uv-popup>
|
<sfkef></sfkef>
|
</view>
|
|
</template>
|
|
<style scoped lang="scss">
|
page{
|
background: #F7F7F7;
|
.p38{
|
padding: 38rpx;
|
}
|
.notes{
|
margin-top: 40rpx;
|
margin-bottom: 20rpx;
|
font-size: 24rpx;
|
color: #666666;
|
}
|
}
|
.content{
|
padding: 40rpx 32rpx;
|
.head{
|
background: url(#{$iconHttps}/static/img/details/cardBack.png) no-repeat;
|
background-size: 100% 100% ;
|
|
color: white;
|
padding: 42rpx 40rpx;
|
display: flex;
|
justify-content: flex-end;
|
.title{
|
font-size: 28rpx;
|
margin-bottom: 18rpx;
|
}
|
.money{
|
font-size: 84rpx;
|
font-weight: bold;
|
margin-bottom: 18rpx;
|
border-bottom: 1rpx solid rgba(255,255,255,0.2);
|
display: flex;
|
flex-direction: row;
|
position: relative;
|
.icon{
|
width: 28rpx;height: 28rpx;
|
display: flex;
|
justify-content: center;
|
margin-left: 16rpx;
|
position: relative;
|
bottom: 18rpx;
|
}
|
}
|
.tips{
|
font-size: 24rpx;
|
opacity: 0.6;
|
}
|
}
|
|
.form-box{
|
margin-top: 20rpx;
|
background: white;
|
border-radius: 16rpx;
|
}
|
|
|
.code{
|
.li{
|
padding: 30rpx 40rpx;
|
background: white;
|
border-radius: 16rpx;
|
font-size: 30rpx;
|
color: #4766FE;
|
display: flex;
|
flex-direction: row;
|
font-weight: 800;
|
margin-bottom: 20rpx;
|
.writing{
|
margin-left: 20rpx;display: flex;justify-content: center;
|
}
|
}
|
}
|
|
.but{
|
padding: 66rpx 20rpx 0 20rpx;
|
.pack{
|
text-align: center;
|
margin-top: 20rpx;
|
font-size: 30rpx;
|
color: #333333;
|
display: flex;
|
flex-direction: row;
|
justify-content: center;
|
}
|
}
|
}
|
.protocol-text {
|
text-align: center;
|
width: calc( 100% - 28rpx);
|
font-size: 24rpx;
|
color: #8B8D96;
|
line-height: 28rpx;
|
}
|
.link-text {
|
color: #207ef5;
|
display: inline;
|
}
|
</style>
|