修改购车人信息

This commit is contained in:
老叶
2023-04-07 15:26:24 +08:00
parent 0c259d0119
commit 5020402f10
6 changed files with 236 additions and 3 deletions
+2 -1
View File
@@ -60,7 +60,8 @@
"pages/order/editDeliveryckimg/index",
"pages/order/editQVImg/index",
"pages/order/editVoucherImg/index",
"pages/dataAnalysis/detail/index"
"pages/dataAnalysis/detail/index",
"pages/order/editBuyer/index"
],
"echarts": [
{
+7 -2
View File
@@ -2,8 +2,13 @@
<view>
<view class="pl30 pr30">
<view class="mt20 relative">
<view class="font-32">购车人信息</view>
<view class="absolute right-0 box-middle font-22 color-666">销售顾问:<text class="color-36afa2">{{info.admin_name}}</text></view>
<view class="font-22 color-666">销售顾问:<text class="color-36afa2">{{info.admin_name}}</text></view>
</view>
<view class="mt20 fn-clear">
<view class="fn-fl pt10 font-32">购车人信息</view>
<view class="fn-fr" wx:if="{{(userInfo.uid==1||info.car_id!=33)&&info.edit_status==1&&!info.refund_status}}">
<button bindtap="pushLink" data-url="/pages/order/editBuyer/index?id={{id}}" class="inline-block font-22 color-fff ulib-r10 btn-36afa2" hover-class="btn-36afa2-hover"><i class="iconfont icon-dengji mr10"></i>修改</button>
</view>
</view>
<view class="relative bbs-1-eb pl140 font-28">
<view class="absolute left-0 box-middle font-28 color-333">客户姓名</view>
+169
View File
@@ -0,0 +1,169 @@
import _ from '../../../commons/js/commons'
const app = getApp()
Page({
data: {
name:'',//姓名
mobile:'',//手机号
cardid:'',//身份证
},
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({
name:res.data.name?res.data.name:'',
mobile:res.data.mobile?res.data.mobile:'',
cardid:res.data.cardid?res.data.cardid:'',
})
wx.stopPullDownRefresh()
})
},
//修改订单基本信息
putAppCusorderV2Info() {
this.setData({
mobile:this.trimAll(this.data.mobile),
cardid:this.trimAll(this.data.cardid),
})
if (this.data.name == '' ) {
wx.showToast({
title: '请输入客户姓名',
icon: 'none'
})
}else if (this.data.mobile != this.data.org_mobile && !/^1[3456789]\d{9}$/.test(this.data.mobile)){
wx.showToast({
title: '请输入客户手机号',
icon: 'none'
})
}
else if(this.data.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.cardid)){
wx.showToast({
title: '请填写正确客户身份证',
icon: 'none'
})
}
else{
let that = this
that.setData({
submitFlag: true,
})
let params = {};
params['id'] = that.data.id;
params['name'] = that.data.name;
params['mobile'] = that.data.mobile;
params['cardid'] = that.data.cardid;
_.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,
})
});
}
},
//推送链接
pushLink(e){
if(e.currentTarget.dataset.url){
_.$router.openUrlScheme(e.currentTarget.dataset.url)
}
},
//选择图片
chooseImg(e) {
let that = this
//上传身份证正面-车主身份证
//上传身份证正面-客户身份证
if(e.currentTarget.dataset.type=='customer'){
wx.chooseImage({
count: 1, // 默认9
sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有
sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
success(res) {
wx.showLoading({
title: '识别中',
})
wx.uploadFile({
url:_.config.api.upImg,
filePath:res.tempFilePaths[0],
name: 'img',
formData: {
'app': 'liche'
},
success: (resp) => {
resp.data = JSON.parse(resp.data);
if (resp.data.code == 200) {
let params = {};
params['img'] = resp.data.data.url;
_.apiQuery.getAppIdcardInfo(params).then(res2 => {
wx.hideLoading();
that.setData({
cardid:res2.data.IdNum,
name:res2.data.Name,
})
})
}
},
fail: res => {
wx.hideLoading();
}
})
},
fail: res => {
wx.showToast({
title: '文件选择失败',
icon: 'none',
duration: 2000
})
}
})
}
},
//去除空格
trimAll(ele){
if(typeof ele === 'string'){
return ele.split(' ').join('');
}else{
console.error(`${typeof ele} is not the expected type, but the string type is expected`)
}
},
})
+3
View File
@@ -0,0 +1,3 @@
{
"usingComponents": {}
}
+36
View File
@@ -0,0 +1,36 @@
<view class="container">
<view class="inner30">
<view class="mt10 pt20 pb20 bg-e3f5f3 font-36 text-center ulib-r10">购车人信息</view>
<block>
<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='{{mobile}}' disabled='{{isShowIntenMoney||isShowAddress?true:false}}' always-embed='{{true}}' />
</view>
</view>
<view class="relative bbs-1-eb last-b-none pl180 pr60 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='{{cardid}}' disabled='{{isShowIntenMoney||isShowAddress?true:false}}' always-embed='{{true}}' />
</view>
<view class="absolute right-0 box-middle font-50 iconfont icon-cardid color-666" bindtap="chooseImg" data-type="customer"></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='{{name}}' disabled='{{isShowIntenMoney||isShowAddress?true:false}}' always-embed='{{true}}' />
</view>
</view>
</block>
</view>
<view class="mt40 font-22 color-666 text-center">
<label class="inline-block text-middle statement fn-clear"><checkbox class="fn-fl" value="cb" /><text class="pt3 fn-fl">我已阅读并同意</text></label>
<text class="text-middle color-36afa2" bindtap="pushLink" data-url="/pages/statement/registration/index">《狸车用户注册协议》</text>
<text class="text-middle">和</text>
<text class="text-middle color-36afa2" bindtap="pushLink" data-url="/pages/statement/privacy/index">《狸车用户隐私政策》</text>
</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>
+19
View File
@@ -0,0 +1,19 @@
/*复选框外框样式*/
.statement checkbox .wx-checkbox-input {
width:22rpx;
height:22rpx;
border-color: #999;
background: #f9f9f9;
}
/* 选中后的 背景样式*/
.statement checkbox .wx-checkbox-input.wx-checkbox-input-checked {
border-color: #36afa2;
background: #36afa2;
}
/*复选框选中后内部样式*/
.statement checkbox .wx-checkbox-input.wx-checkbox-input-checked::before {
font-size:18rpx;
color:#fff;
transform:translate(-50%, -50%) scale(1);
-webkit-transform:translate(-50%, -50%) scale(1);
}