Commit c74814df authored by 潘永坪's avatar 潘永坪

外国人身份证bug处理

parent 9d067769
...@@ -26,16 +26,18 @@ ...@@ -26,16 +26,18 @@
<text class="bottom-title"> <text class="bottom-title">
证件类型 证件类型
</text> </text>
<text style="flex: 1;" v-if="credentialType==0">身份证</text> <!-- 0和空用全等防止为空时出现bug -->
<text style="flex: 1;" v-if="credentialType==1">护照</text> <text style="flex: 1;" v-if="credentialType===''">请选择证件类型</text>
<text style="flex: 1;" v-if="credentialType==2">港澳通行证</text> <text style="flex: 1;" v-if="credentialType===0">身份证</text>
<text style="flex: 1;" v-if="credentialType==3">台胞通行证</text> <text style="flex: 1;" v-if="credentialType=='1'">护照</text>
<text style="flex: 1;" v-if="credentialType==4">台胞证</text> <text style="flex: 1;" v-if="credentialType=='2'">港澳通行证</text>
<text style="flex: 1;" v-if="credentialType==5">回乡证</text> <text style="flex: 1;" v-if="credentialType=='3'">台胞通行证</text>
<text style="flex: 1;" v-if="credentialType==6">外国人永久居留证</text> <text style="flex: 1;" v-if="credentialType=='4'">台胞证</text>
<text style="flex: 1;" v-if="credentialType==7">学生证</text> <text style="flex: 1;" v-if="credentialType=='5'">回乡证</text>
<text style="flex: 1;" v-if="credentialType==8">军官证</text> <text style="flex: 1;" v-if="credentialType=='6'">外国人永久居留证</text>
<text style="flex: 1;" v-if="credentialType==9">残疾军人证</text> <text style="flex: 1;" v-if="credentialType=='7'">学生证</text>
<text style="flex: 1;" v-if="credentialType=='8'">军官证</text>
<text style="flex: 1;" v-if="credentialType=='9'">残疾军人证</text>
<u-icon name="arrow-right" size='26' color='#B4B4B4'></u-icon> <u-icon name="arrow-right" size='26' color='#B4B4B4'></u-icon>
</view> </view>
...@@ -74,16 +76,17 @@ ...@@ -74,16 +76,17 @@
证件类型 证件类型
</view> </view>
<view v-for="(item,index) in credentialList" :key='index' class="idList" @click="chooseCredential(item)"> <view v-for="(item,index) in credentialList" :key='index' class="idList" @click="chooseCredential(item)">
<text v-if="item==0">身份证</text> <!-- 0用全等防止为空时出现bug -->
<text v-if="item==1">护照</text> <text v-if="item===0">身份证</text>
<text v-if="item==2">港澳通行证</text> <text v-if="item=='1'">护照</text>
<text v-if="item==3">台胞通行证</text> <text v-if="item=='2'">港澳通行证</text>
<text v-if="item==4">台胞证</text> <text v-if="item=='3'">台胞通行证</text>
<text v-if="item==5">回乡证</text> <text v-if="item=='4'">台胞证</text>
<text v-if="item==6">外国人永久居留证</text> <text v-if="item=='5'">回乡证</text>
<text v-if="item==7">学生证</text> <text v-if="item=='6'">外国人永久居留证</text>
<text v-if="item==8">军官证</text> <text v-if="item=='7'">学生证</text>
<text v-if="item==9">残疾军人证</text> <text v-if="item=='8'">军官证</text>
<text v-if="item=='9'">残疾军人证</text>
<u-icon name='checkmark' size='48' color='#3688FF' v-if="credentialType==item"></u-icon> <u-icon name='checkmark' size='48' color='#3688FF' v-if="credentialType==item"></u-icon>
</view> </view>
</view> </view>
...@@ -104,28 +107,29 @@ export default { ...@@ -104,28 +107,29 @@ export default {
reviseContactId: '', //被修改人id reviseContactId: '', //被修改人id
showIdType:false,//证件类型弹窗显示隐藏 showIdType:false,//证件类型弹窗显示隐藏
credentialList:[],//证件类型列表 credentialList:[],//证件类型列表
credentialType:0,//选中的证件类型,默认身份证 credentialType:'',//选中的证件类型
placeholderText:'',//提示输入什么证件 placeholderText:'',//提示输入什么证件
} }
}, },
watch: { watch: {
editContactData: { editContactData: { //编辑联系人数据
handler(newValue, oldValue) { handler(newValue, oldValue) {
this.name = newValue.name||'' this.name = newValue.name||''
this.credentialNumber = newValue.credentialNumber||'' this.credentialNumber = newValue.credentialNumber||''
this.reviseContactId = newValue.id||'' this.reviseContactId = newValue.id||''
this.phone=newValue.phone||'' this.phone=newValue.phone||''
this.credentialType=newValue.credentialType||0 this.credentialType=newValue.credentialType||''
}, },
deep: true, deep: true,
immediate: true immediate: true
}, },
credential: { credential: {//该产品对应联系人可以添加的证件类型
handler(newValue, oldValue) { handler(newValue, oldValue) {
if(newValue){ if(newValue){
this.credentialList=newValue.split(',') this.credentialList=newValue.split(',')
if(this.credentialList.length==1){ if(this.credentialList.length==1){
let type=this.credentialList[0] let type=this.credentialList[0]
this.credentialType=type
if(type=='0'){this.placeholderText='请输入身份证,必填'} if(type=='0'){this.placeholderText='请输入身份证,必填'}
if(type=='1'){this.placeholderText='请输入护照,必填'} if(type=='1'){this.placeholderText='请输入护照,必填'}
if(type=='2'){this.placeholderText='请输入港澳通行证,必填'} if(type=='2'){this.placeholderText='请输入港澳通行证,必填'}
...@@ -158,6 +162,13 @@ export default { ...@@ -158,6 +162,13 @@ export default {
}) })
return return
} }
if(this.credentialType===''){
uni.showToast({
title:'请选择证件类型',
icon:'none'
})
return
}
if(!this.credentialNumber){ if(!this.credentialNumber){
uni.showToast({ uni.showToast({
title:'请输入证件号码', title:'请输入证件号码',
...@@ -172,15 +183,6 @@ export default { ...@@ -172,15 +183,6 @@ export default {
}) })
return return
} }
let credentialType=''
//当只有一个证件类型时取第一个
if(this.credentialList.length==1){
credentialType=this.credentialList[0]
}
//当有多个证件类型时取选中的那一个
if(this.credentialList.length>1){
credentialType=this.credentialType
}
let data = { let data = {
name: this.name, //保存姓名 name: this.name, //保存姓名
phone:this.phone, //电话号码 phone:this.phone, //电话号码
...@@ -189,7 +191,7 @@ export default { ...@@ -189,7 +191,7 @@ export default {
merchantType: 1, //商户类型,1.景区,2.酒店,3.餐饮 merchantType: 1, //商户类型,1.景区,2.酒店,3.餐饮
id: this.reviseContactId, //被修改人id id: this.reviseContactId, //被修改人id
category: '', //成人或者儿童 category: '', //成人或者儿童
credentialType, //证件类型 credentialType:this.credentialType, //证件类型
} }
let queryUrl='' let queryUrl=''
if(this.reviseContactId){ if(this.reviseContactId){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment