Commit 597706d8 authored by Mac's avatar Mac

相亲模块修改

parent c87d1744
......@@ -594,10 +594,12 @@
},{
"path":"personal/peoplescreen"//人物筛选
},{
"path":"persondetails",//人物详情
"path":"oldpersondetails",//之前的人物详情
"style": {
"navigationStyle": "custom"
}
},{
"path":"persondetails"//人物详情
},{
"path":"personal/editmaterial"//资料编辑
},{
......@@ -639,6 +641,8 @@
"path":"editData"//编辑资料
},{
"path":"xqposter"//相亲分享海报
},{
"path":"personal/IDidentification"//身份证验证
}]
},
//韩国馆项目 { "root": "pages/kotra", "pages": [{ "path": "contanctus" },{ "path": "contanctDetail" },{ "path": "compInformation" },{
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
<style lang="scss" scoped>
.IDidentification{
width: 100%;
height: 100vh;
.box{
width: 100%;
padding: 15px;
}
.box-c{
margin-top: 20px;
}
.box-c-item{
width: 100%;
height: 50px;
display: flex;
align-items: center;
border-bottom: 1px solid #e2e2e2;
}
.box-c-item-l{
width: 140rpx;
font-size: 14px;
color: #111111;
font-weight: bold;
}
.box-c-item-r{
width: 1px;
flex: 1;
}
.btn{
width: 100%;
margin-top: 50px;
display: flex;
align-items: center;
justify-content: center;
}
.btn-box{
width: 400rpx;
height: 88rpx;
border-radius: 44rpx;
color: #FFFFFF;
font-size: 16px;
display: flex;
align-items: center;
justify-content: center;
}
}
</style>
<template>
<view class="IDidentification">
<view class="box">
<view style="font-size: 18px;font-weight: bold;">
实名认证
</view>
<view style="font-size: 12px;color: #999999;">确保用户信息真实,承诺保障信息安全。</view>
<view class="box-c">
<view class="box-c-item">
<view class="box-c-item-l">真实姓名</view>
<view class="box-c-item-r">
<input type="text" v-model="addMsg.Name" placeholder="请输入真实姓名">
</view>
</view>
<view class="box-c-item">
<view class="box-c-item-l">身份证号</view>
<view class="box-c-item-r">
<input type="idcard" v-model="addMsg.cardNo" placeholder="请输入身份证号">
</view>
</view>
</view>
<view class="btn">
<view class="btn-box" :style="{background:mainColor}" @click="gorenzheng">
立即认证
</view>
</view>
</view>
</view>
</template>
<script>
export default{
data(){
return{
pageTitle: '身份认证',
mainColor:'',
mall_UserInfo:null,
addMsg:{
Name:'',
cardNo:'',
}
}
},
created() {
this.mainColor = this.$uiConfig.mainColor;
this.mall_UserInfo = uni.getStorageSync("mall_UserInfo")?uni.getStorageSync("mall_UserInfo"):null;
uni.setNavigationBarTitle({
title: this.pageTitle
});
},
methods:{
gorenzheng(){
let regName =/^[\u4e00-\u9fa5]{2,4}$/;
if(!regName.test(this.addMsg.Name)){
uni.showToast({
title:'真实姓名填写有误',
icon:'none'
})
return false;
}
let isIdCard = this.isIdCard(this.addMsg.cardNo)
if(isIdCard==false){
uni.showToast({
title:'身份证号填写有误',
icon:'none'
})
}else{
let birthday = this.getBirthdayFromIdCard(this.addMsg.cardNo)
console.log(birthday)
}
},
getBirthdayFromIdCard(idCard) {
var birthday = "";
if(idCard != null && idCard != ""){
if(idCard.length == 15){
birthday = "19"+idCard.substr(6,6);
} else if(idCard.length == 18){
birthday = idCard.substr(6,8);
}
birthday = birthday.replace(/(.{4})(.{2})/,"$1-$2-");
}
return birthday;
},
isIdCard(idCard) {//身份证号码的验证
// 15位和18位身份证号码的正则表达式
var regIdCard = /^(^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$)|(^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])((\d{4})|\d{3}[Xx])$)$/;
// 如果通过该验证,说明身份证格式正确,但准确性还需计算
if (regIdCard.test(idCard)) {
if (idCard.length == 18) {
var idCardWi = new Array(7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10,
5, 8, 4, 2); // 将前17位加权因子保存在数组里
var idCardY = new Array(1, 0, 10, 9, 8, 7, 6, 5, 4, 3, 2); // 这是除以11后,可能产生的11位余数、验证码,也保存成数组
var idCardWiSum = 0; // 用来保存前17位各自乖以加权因子后的总和
for (var i = 0; i < 17; i++) {
idCardWiSum += idCard.substring(i, i + 1) * idCardWi[i];
}
var idCardMod = idCardWiSum % 11;// 计算出校验码所在数组的位置
var idCardLast = idCard.substring(17);// 得到最后一位身份证号码
// 如果等于2,则说明校验码是10,身份证号码最后一位应该是X
if (idCardMod == 2) {
if (idCardLast == "X" || idCardLast == "x") {
//alert("恭喜通过验证啦!");
return true;
} else {
//alert("身份证号码错误!");
return false;
}
} else {
// 用计算出的验证码与最后一位身份证号码匹配,如果一致,说明通过,否则是无效的身份证号码
if (idCardLast == idCardY[idCardMod]) {
//alert("恭喜通过验证啦!");
return true;
} else {
//alert("身份证号码错误!");
return false;
}
}
}else{
return true;
}
} else {
//alert("身份证格式不正确!");
return false;
}
}
}
}
</script>
This diff is collapsed.
......@@ -297,7 +297,9 @@
controls:false,
isAttestation:0,
showtext:'去认证',
rzshow:false,
rzshow:false,
UserId:0,
mall_User:0
}
},
created() {
......@@ -325,7 +327,7 @@
});
},
onLoad() {
onLoad(options) {
this.u = uni.getStorageSync("mall_UserInfo");
if (!this.u) {
this.u = {
......@@ -333,7 +335,13 @@
avatarUrl: ""
};
this.showAuth = true;
} else {
} else {
this.mall_User = uni.getStorageSync("mall_UserInfo")?uni.getStorageSync("mall_UserInfo").UserId:0;
if(options && options.UserId){
this.UserId = options.UserId
}else{
this.UserId = this.mall_User
}
this.init();
}
......
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