金融
This commit is contained in:
@@ -1,66 +1,135 @@
|
||||
// pages/order/editFinance/index.js
|
||||
import _ from '../../../commons/js/commons'
|
||||
const app = getApp()
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function (options) {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage: function () {
|
||||
|
||||
data: {
|
||||
o_id:'',//订单id
|
||||
finance_id:'',//金融产品id
|
||||
notify_file:'',//按揭通知函文件地址
|
||||
price_loan:'',//贷款金额
|
||||
submitFlag:false,
|
||||
},
|
||||
onLoad: function (options) {
|
||||
for (let key in options) {
|
||||
this.setData({
|
||||
[key]: options[key]
|
||||
})
|
||||
}
|
||||
|
||||
this.getAppCusorderV2()
|
||||
|
||||
},
|
||||
onShow: function () {
|
||||
|
||||
},
|
||||
|
||||
//获取订单详情
|
||||
getAppCusorderV2(){
|
||||
let params = {};
|
||||
params['id'] = this.data.id;
|
||||
_.apiQuery.getAppCusorderV2(params).then(res=>{
|
||||
this.setData({
|
||||
main_type:res.data.main_type,
|
||||
owner_name:res.data.owner_name?res.data.owner_name:'',
|
||||
owner_mobile:res.data.owner_mobile?res.data.owner_mobile:'',
|
||||
owner_cardid:res.data.owner_cardid?res.data.owner_cardid:'',
|
||||
address:res.data.address?res.data.address:'',
|
||||
company:res.data.company?res.data.company:'',
|
||||
credit:res.data.credit?res.data.credit:'',
|
||||
})
|
||||
|
||||
wx.stopPullDownRefresh()
|
||||
|
||||
})
|
||||
},
|
||||
|
||||
//修改订单基本信息
|
||||
putAppCusorderV2Info() {
|
||||
if(this.data.main_type == 0&&this.data.owner_name == ''){
|
||||
wx.showToast({
|
||||
title: '请填写车主姓名',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
else if(this.data.main_type == 0&&!/^1[3456789]\d{9}$/.test(this.data.owner_mobile)){
|
||||
wx.showToast({
|
||||
title: '请填写车主手机号',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
else if(this.data.main_type == 0&&(this.data.owner_cardid == ''|| !/^\d{6}(18|19|20)?\d{2}(0[1-9]|1[012])(0[1-9]|[12]\d|3[01])\d{3}(\d|[xX])$/.test(this.data.owner_cardid))){
|
||||
wx.showToast({
|
||||
title: '请填写正确车主身份证',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
else if(this.data.main_type == 0&&this.data.address == ''){
|
||||
wx.showToast({
|
||||
title: '请填写车主地址',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
else if(this.data.main_type == 1&&this.data.company == ''){
|
||||
wx.showToast({
|
||||
title: '请填写企业名称',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
else if(this.data.main_type == 1&&this.data.credit == ''){
|
||||
wx.showToast({
|
||||
title: '请填写企业信用代码',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
else{
|
||||
let that = this
|
||||
that.setData({
|
||||
submitFlag: true,
|
||||
})
|
||||
let params = {};
|
||||
params['id'] = this.data.id;
|
||||
if(that.data.owner_name != ''){
|
||||
params['owner_name'] = that.data.owner_name;
|
||||
}
|
||||
if(that.data.owner_mobile != ''){
|
||||
params['owner_mobile'] = that.data.owner_mobile;
|
||||
}
|
||||
if(that.data.owner_cardid != ''){
|
||||
params['owner_cardid'] = that.data.owner_cardid;
|
||||
}
|
||||
if(that.data.company != ''){
|
||||
params['company'] = that.data.company;
|
||||
}
|
||||
if(that.data.credit != ''){
|
||||
params['credit'] = that.data.credit;
|
||||
}
|
||||
_.apiQuery.putAppCusorderV2Info(params).then(res => {
|
||||
|
||||
//刷新详情页
|
||||
let pages = getCurrentPages();
|
||||
let prevPage = null; //上一个页面
|
||||
if (pages.length >= 2) {
|
||||
prevPage = pages[pages.length - 2]; //上一个页面
|
||||
if(prevPage.route == 'pages/order/detail/index2'){
|
||||
prevPage.onPullDownRefresh()
|
||||
}
|
||||
}
|
||||
wx.showToast({
|
||||
title: '编辑成功',
|
||||
icon: 'success',
|
||||
duration: 2000
|
||||
})
|
||||
setTimeout(function () {
|
||||
wx.navigateBack({
|
||||
delta: 1
|
||||
})
|
||||
}, 500)
|
||||
|
||||
}).catch(res=>{
|
||||
that.setData({
|
||||
submitFlag: false,
|
||||
})
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
})
|
||||
@@ -1,3 +1,4 @@
|
||||
{
|
||||
"navigationBarTitleText": "金融产品",
|
||||
"usingComponents": {}
|
||||
}
|
||||
@@ -1,2 +1,32 @@
|
||||
<!--pages/order/editFinance/index.wxml-->
|
||||
<text>pages/order/editFinance/index.wxml</text>
|
||||
<view class="container">
|
||||
<view class="inner30">
|
||||
<view class="relative bbs-1-eb last-b-none pl180 font-28">
|
||||
<view class="absolute left-0 box-middle">车主姓名<text class="color-f9394d">*</text></view>
|
||||
<view>
|
||||
<input class="wp100 height-100 text-right font-28" placeholder-class="color-ccc" type="text" placeholder="请输入客户姓名" model:value='{{owner_name}}' disabled='{{isShowSelectCustomer||isShowRemarks?true:false}}' />
|
||||
</view>
|
||||
</view>
|
||||
<view class="relative bbs-1-eb last-b-none pl180 font-28">
|
||||
<view class="absolute left-0 box-middle">车主手机号码<text class="color-f9394d">*</text></view>
|
||||
<view>
|
||||
<input class="wp100 height-100 text-right font-28" placeholder-class="color-ccc" type="number" placeholder="请输入客户手机号码" model:value='{{owner_mobile}}' disabled='{{isShowSelectCustomer||isShowRemarks?true:false}}' />
|
||||
</view>
|
||||
</view>
|
||||
<view class="relative bbs-1-eb last-b-none pl180 font-28">
|
||||
<view class="absolute left-0 box-middle">车主身份证<text class="color-f9394d">*</text></view>
|
||||
<view>
|
||||
<input class="wp100 height-100 text-right font-28" placeholder-class="color-ccc" type="idcard" placeholder="请输入客户身份证" model:value='{{owner_cardid}}' disabled='{{isShowSelectCustomer||isShowRemarks?true:false}}' />
|
||||
</view>
|
||||
</view>
|
||||
<view class="relative bbs-1-eb last-b-none pl180 font-28">
|
||||
<view class="absolute left-0 box-middle">车主地址<text class="color-f9394d">*</text></view>
|
||||
<view>
|
||||
<input class="wp100 height-100 text-right font-28" placeholder-class="color-ccc" type="text" placeholder="请输入车主地址" model:value='{{address}}' disabled='{{isShowSelectCustomer||isShowRemarks?true:false}}' />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="fixed left-0 right-0 bottom-0 bg-fff-op90 inner40 fn-flex safe-pb">
|
||||
<button class="wp100 btn-36afa2 pt10 pb10 text-center font-32 color-fff ulib-r750" hover-class="btn-36afa2-hover" disabled="{{submitFlag}}" bindtap="putAppCusorderV2Info">确认编辑</button>
|
||||
</view>
|
||||
Reference in New Issue
Block a user