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

外国人身份证开发

parent b7b3bbfc
......@@ -21,7 +21,7 @@
<checkbox-group @change="chooseContactChange">
<view class="bottom-list" v-for="(item,index) of listTotal" :key="item.id">
<label>
<checkbox class="blue" :value="JSON.stringify(item)" :checked="item.ifChoose" color="#3688ff" />
<checkbox class="blue" :value="JSON.stringify(item)" :checked="item.ifChoose" color="#3688ff" :disabled="item.contactVos.length==0" />
<view class="bottom-content">
<view>
{{item.name}}
......@@ -44,7 +44,7 @@
<view @click="goEdit(item)" style="margin-right:30rpx;">
<u-icon name="edit-pen" color="#3688ff" size="56"></u-icon>
</view>
<view @click="clickDele(item.id)">
<view @click="clickDele(item)">
<u-icon name="trash-fill" color="#3688ff" size="56"></u-icon>
</view>
</view>
......@@ -81,8 +81,8 @@ export default {
showPop: false, //控制联系人弹窗显示隐藏
listTotal:[],//所有联系人
showModal: false, //确认弹窗显示隐藏
contactId:'',//删除联系人的Id
contactName:'',//删除联系人的Id
contactopenid:'',//删除联系人的openid
}
},
methods: {
......@@ -126,14 +126,16 @@ export default {
})
},
//---点击删除
clickDele(id) {
clickDele(item) {
this.showModal = true
this.contactId=id
this.contactName=item.name
this.contactopenid=item.openid
},
//---确认删除
confirmDele(){
let data={
id:this.contactId
name:this.contactName,//联系人姓名
openid:this.contactopenid//联系人openid
}
this.$request('wechatUser/contact/deleteContact', data).then((res) => {
if (res.code == '00') {
......
......@@ -17,37 +17,20 @@
<view class="bottomContent">
<view>
<text class="bottom-title">
姓名
姓名
</text>
<input v-model.trim="name" placeholder="请输入姓名,必填" />
</view>
<view @click="showIdType=true" v-if="credentialList.length>1">
<text class="bottom-title">
证件类型
</text>
<text style="flex: 1;" v-if="credentialType==0">身份证</text>
<text style="flex: 1;" v-if="credentialType==1">护照</text>
<text style="flex: 1;" v-if="credentialType==2">港澳通行证</text>
<text style="flex: 1;" v-if="credentialType==3">台胞通行证</text>
<text style="flex: 1;" v-if="credentialType==4">台胞证</text>
<text style="flex: 1;" v-if="credentialType==5">回乡证</text>
<text style="flex: 1;" v-if="credentialType==6">外国人永久居留证</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>
</view>
<view>
<text class="bottom-title">
证件号
身份证:
</text>
<input v-model.trim="credentialNumber" placeholder="请输入证件号码,必填" />
<input v-model.trim="credentialNumber" maxlength="18" placeholder="请输入身份证号码,必填" />
</view>
<view>
<text class="bottom-title">
联系电话
联系电话
</text>
<input type="number" v-model.trim="phone" maxlength="11" placeholder="用于接收行程信息" />
</view>
......@@ -57,35 +40,12 @@
</view>
</view>
</view>
<!-- 证件类型弹窗 -->
<u-popup :show="showIdType" :round="20" @close="showIdType = false" closeable>
<view style="padding: 24rpx;">
<view style="text-align: center;padding-bottom:20rpx;">
证件类型
</view>
<view v-for="(item,index) in credentialList" :key='index' class="idList" @click="chooseCredential(item)">
<text v-if="item==0">身份证</text>
<text v-if="item==1">护照</text>
<text v-if="item==2">港澳通行证</text>
<text v-if="item==3">台胞通行证</text>
<text v-if="item==4">台胞证</text>
<text v-if="item==5">回乡证</text>
<text v-if="item==6">外国人永久居留证</text>
<text v-if="item==7">学生证</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>
</view>
</view>
</u-popup>
</view>
</template>
<script>
export default {
props: ['editContactData','credential'],
props: ['editContactData'],
data() {
return {
showPop: false, //控制组件显示隐藏
......@@ -93,9 +53,6 @@ export default {
credentialNumber: '', //身份证号
phone:'',//手机号码
reviseContactId: '', //被修改人id
showIdType:false,//证件类型弹窗显示隐藏
credentialList:[],//证件类型列表
credentialType:0,//选中的证件类型,默认身份证
}
},
watch: {
......@@ -105,27 +62,12 @@ export default {
this.credentialNumber = newValue.credentialNumber||''
this.reviseContactId = newValue.id||''
this.phone=newValue.phone||''
this.credentialType=newValue.credentialType||0
},
deep: true,
immediate: true
},
credential: {
handler(newValue, oldValue) {
if(newValue){
this.credentialList=newValue.split(',')
}
},
deep: true,
immediate: true
}
},
methods: {
//---选择证件类型
chooseCredential(item){
this.credentialType=item
this.showIdType=false
},
//---保存
keepSave() {
if(!this.name){
......@@ -158,7 +100,7 @@ export default {
merchantType: 1, //商户类型,1.景区,2.酒店,3.餐饮
id: this.reviseContactId, //被修改人id
category: '', //成人或者儿童
credentialType:this.credentialType, //证件类型
credentialsType: '', //证件类型
}
let queryUrl=''
if(this.reviseContactId){
......@@ -181,7 +123,6 @@ export default {
this.name = ''
this.credentialNumber = ''
this.phone=''
this.credentialType=0
}else{
this.$parent.getContactList()
}
......@@ -276,11 +217,4 @@ export default {
background:$theme;
display: inline-block;
}
.idList{
display: flex;
justify-content: space-between;
height: 100rpx;
align-items: center;
border-bottom: 1px solid #f3f3f3;
}
</style>
......@@ -17,20 +17,38 @@
<view class="bottomContent">
<view>
<text class="bottom-title">
姓名
姓名
</text>
<input v-model.trim="name" placeholder="请输入姓名,必填" />
</view>
<view @click="showIdType=true" v-if="credentialList.length>1">
<text class="bottom-title">
证件类型
</text>
<text style="flex: 1;" v-if="credentialType==0">身份证</text>
<text style="flex: 1;" v-if="credentialType==1">护照</text>
<text style="flex: 1;" v-if="credentialType==2">港澳通行证</text>
<text style="flex: 1;" v-if="credentialType==3">台胞通行证</text>
<text style="flex: 1;" v-if="credentialType==4">台胞证</text>
<text style="flex: 1;" v-if="credentialType==5">回乡证</text>
<text style="flex: 1;" v-if="credentialType==6">外国人永久居留证</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>
</view>
<view>
<text class="bottom-title">
身份证:
证件号
</text>
<input v-model.trim="credentialNumber" maxlength="18" placeholder="请输入身份证号码,必填" />
<input v-model.trim="credentialNumber" v-if="credentialList.length==1" :placeholder="placeholderText" />
<input v-model.trim="credentialNumber" v-if="credentialList.length>1" placeholder="请输入证件号码,必填" />
</view>
<view>
<text class="bottom-title">
联系电话
联系电话
</text>
<input type="number" v-model.trim="phone" maxlength="11" placeholder="用于接收行程信息" />
</view>
......@@ -40,12 +58,35 @@
</view>
</view>
</view>
<!-- 证件类型弹窗 -->
<u-popup :show="showIdType" :round="20" @close="showIdType = false" closeable>
<view style="padding: 24rpx;">
<view style="text-align: center;padding-bottom:20rpx;">
证件类型
</view>
<view v-for="(item,index) in credentialList" :key='index' class="idList" @click="chooseCredential(item)">
<text v-if="item==0">身份证</text>
<text v-if="item==1">护照</text>
<text v-if="item==2">港澳通行证</text>
<text v-if="item==3">台胞通行证</text>
<text v-if="item==4">台胞证</text>
<text v-if="item==5">回乡证</text>
<text v-if="item==6">外国人永久居留证</text>
<text v-if="item==7">学生证</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>
</view>
</view>
</u-popup>
</view>
</template>
<script>
export default {
props: ['editContactData'],
props: ['editContactData','credential'],
data() {
return {
showPop: false, //控制组件显示隐藏
......@@ -53,6 +94,10 @@ export default {
credentialNumber: '', //身份证号
phone:'',//手机号码
reviseContactId: '', //被修改人id
showIdType:false,//证件类型弹窗显示隐藏
credentialList:[],//证件类型列表
credentialType:0,//选中的证件类型,默认身份证
placeholderText:'',//提示输入什么证件
}
},
watch: {
......@@ -62,12 +107,40 @@ export default {
this.credentialNumber = newValue.credentialNumber||''
this.reviseContactId = newValue.id||''
this.phone=newValue.phone||''
this.credentialType=newValue.credentialType||0
},
deep: true,
immediate: true
},
credential: {
handler(newValue, oldValue) {
if(newValue){
this.credentialList=newValue.split(',')
if(this.credentialList.length==1){
let type=this.credentialList[0]
if(type=='0'){this.placeholderText='请输入身份证,必填'}
if(type=='1'){this.placeholderText='请输入护照,必填'}
if(type=='2'){this.placeholderText='请输入港澳通行证,必填'}
if(type=='3'){this.placeholderText='请输入台胞通行证,必填'}
if(type=='4'){this.placeholderText='请输入台胞证,必填'}
if(type=='5'){this.placeholderText='请输入回乡证,必填'}
if(type=='6'){this.placeholderText='请输入外国人永久居留证,必填'}
if(type=='7'){this.placeholderText='请输入学生证,必填'}
if(type=='8'){this.placeholderText='请输入军官证,必填'}
if(type=='9'){this.placeholderText='请输入残疾军人证,必填'}
}
}
},
deep: true,
immediate: true
}
},
methods: {
//---选择证件类型
chooseCredential(item){
this.credentialType=item
this.showIdType=false
},
//---保存
keepSave() {
if(!this.name){
......@@ -91,7 +164,15 @@ export default {
})
return
}
let credentialType=''
//当只有一个证件类型时取第一个
if(this.credentialList.length==1){
credentialType=this.credentialList[0]
}
//当有多个证件类型时取选中的那一个
if(this.credentialList.length>1){
credentialType=this.credentialType
}
let data = {
name: this.name, //保存姓名
phone:this.phone, //电话号码
......@@ -100,7 +181,7 @@ export default {
merchantType: 1, //商户类型,1.景区,2.酒店,3.餐饮
id: this.reviseContactId, //被修改人id
category: '', //成人或者儿童
credentialsType: '', //证件类型
credentialType, //证件类型
}
let queryUrl=''
if(this.reviseContactId){
......@@ -123,6 +204,7 @@ export default {
this.name = ''
this.credentialNumber = ''
this.phone=''
this.credentialType=0
}else{
this.$parent.getContactList()
}
......@@ -217,4 +299,11 @@ export default {
background:$theme;
display: inline-block;
}
.idList{
display: flex;
justify-content: space-between;
height: 100rpx;
align-items: center;
border-bottom: 1px solid #f3f3f3;
}
</style>
......@@ -247,6 +247,7 @@
:key="index"
>
{{ item.name }}
<text v-if="item.contactVos.length==0" style="font-size: 20rpx;color: #ff0000;">请补充证件</text>
<view v-if="item.ifChoose" class="date-icon">
<u-icon name="checkmark" color="#ffffff"></u-icon>
</view>
......@@ -874,6 +875,12 @@ export default {
visitorChoose(i) {
//直接传入item,会造成item.ifChoose值变,但是this.contactTotal[i].ifChoose没变,故选择传入下标
let item = this.contactTotal[i]
if(!item.contactVos||item.contactVos.length==0){
//证件信息不全时,补充证件信息
this.$refs.editContacts.showPop=true
this.editContactData = item
return
}
item.ifChoose = !item.ifChoose
if (item.ifChoose) {
if (this.chooseContact.length == this.contactNum) {
......@@ -954,11 +961,20 @@ export default {
//---初始化联系人列表
getContactList() {
let data = {
openid:this.openid
openid:this.openid,
credentialTypes:this.productIfo.credential.split(',')
}
this.$request('wechatUser/contact/findContactList', data).then(res => {
if (res.code == '00') {
this.contactTotal = res.data
this.contactTotal = res.data||[]
//由于数据结构变化,重新组装数据
this.contactTotal.forEach(item=>{
if(item.contactVos.length>0){
item.id=item.contactVos[0].id
item.credentialNumber=item.contactVos[0].credentialNumber
item.credentialType=item.contactVos[0].credentialType
}
})
this.contactTotal.forEach(item => {
//用于判断是否被选中
item.ifChoose = false
......@@ -991,11 +1007,20 @@ export default {
//---添加并选中联系人--用于添加联系人之后直接从联系人列表选出需要填写的几位联系人
addChoose() {
let data = {
openid:this.openid
openid:this.openid,
credentialTypes:this.productIfo.credential.split(',')
}
this.$request('wechatUser/contact/findContactList', data).then(res => {
if (res.code == '00') {
this.contactTotal = res.data||[]
//由于数据结构变化,重新组装数据
this.contactTotal.forEach(item=>{
if(item.contactVos.length>0){
item.id=item.contactVos[0].id
item.credentialNumber=item.contactVos[0].credentialNumber
item.credentialType=item.contactVos[0].credentialType
}
})
for (let i = 0; i < this.contactNum; i++) {
let item = this.contactTotal[i] || null
if (item) {
......
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