修改身份信息和社保信息

This commit is contained in:
dengxin
2024-03-28 21:03:22 +08:00
parent 880396f213
commit 56998e84c2
2 changed files with 384 additions and 352 deletions

View File

@@ -5,8 +5,8 @@
<view class="headuser">
<image src="@/static/img/head.svg" class="headuserImg" mode=""></image>
<view v-if="auth.realNameState" class="name">
<view class="userName">{{authInfo.realName}}</view>
<view class="userInfo">{{idNumberFilter(authInfo.idNumber)}}</view>
<view class="userName">{{ authInfo.realName }}</view>
<view class="userInfo">{{ idNumberFilter(authInfo.idNumber) }}</view>
</view>
<view v-else class="name">
<view class="userName">姓名</view>
@@ -88,26 +88,28 @@
<image src="@/static/img/right.svg" mode=""></image>
</view>
</view> -->
<view class="list">
<view class="name">
姓名
</view>
<text v-if="auth.realNameState" style="color: #1b66ff;">{{auth.authInfo.realName}}</text>
<input v-else type="text" value="" placeholder="请输入真实姓名" @input="setName" placeholder-style="color:#cccccc;" />
<text v-if="auth.realNameState" style="color: #1b66ff;">{{ auth.authInfo.realName }}</text>
<input v-else type="text" value="" placeholder="请输入真实姓名" @input="setName"
placeholder-style="color:#cccccc;" />
</view>
<view>
<view class="list">
<view class="name">
身份证号
</view>
<text v-if="auth.realNameState" style="color: #1b66ff;">{{idNumberFilter(auth.authInfo.idNumber)}}</text>
<input v-else type="idcard" value="" placeholder="请输入身份证号" @input="setCard" style="text-transform:uppercase"
placeholder-style="color:#cccccc;" />
<text v-if="auth.realNameState" style="color: #1b66ff;">{{ idNumberFilter(auth.authInfo.idNumber)
}}</text>
<input v-else type="idcard" value="" placeholder="请输入身份证号" @input="setCard"
style="text-transform:uppercase" placeholder-style="color:#cccccc;" />
</view>
<view v-if="error" class="error">身份证填写有误</view>
</view>
<picker :range="identityList" @change="identityChange" :value="index">
<picker :range="identityList" @change="identityChange" :value="indexId">
<view class="list">
<view class="listLeft">
<view class="name">
@@ -134,7 +136,9 @@
</view>
<view class="listRight">
<view class="listRightContent">
<view class="" v-if="auth.insureState">{{insureList[indexBao]}}</view>
<view class="" v-if="auth.insureState">{{ insureList[indexBao] ? insureList[indexBao] :
authInfo.politics
}}</view>
<view class="" v-else>未选择</view>
</view>
<image src="@/static/img/right.svg" mode=""></image>
@@ -178,370 +182,398 @@
</template>
<script>
import textdata from '@/common/textdata.js'
import {
mapGetters
} from 'vuex'
import {
idNumberFilter
} from '@/untils/format.js'
import {
check18IdCardNo,
validatenull
} from '@/untils/validate.js'
import textdata from '@/common/textdata.js'
import {
setInfo
} from '@/api/federation.js'
import {
mapGetters
} from 'vuex'
import {
idNumberFilter
} from '@/untils/format.js'
export default {
data() {
return {
laborType: textdata.laborType,
index: 0,
insureType: textdata.insureType,
name: '',
card: '',
loading: false,
error: false,
identityList: textdata.laborType,
insureList: textdata.insureType,
realIndex: 0,
};
},
onLoad() {
// this.$store.dispatch('setAutograph')
},
computed: {
...mapGetters(['auth', 'authInfo', 'autograph']),
indexbao() {
if (this.auth.insureState) {
return this.authInfo.bakValue - 1
} else {
return 0
}
},
...mapGetters(['auth', 'authInfo']),
check() {
return check18IdCardNo(this.card) && !validatenull(this.name)
},
indexBao() {
if (this.auth.insureState) {
return this.authInfo.bakValue - 1
} else {
return 0
import {
check18IdCardNo,
validatenull
} from '@/untils/validate.js'
export default {
data() {
return {
laborType: textdata.laborType,
index: 0,
insureType: textdata.insureType,
name: '',
card: '',
loading: false,
error: false,
identityList: textdata.laborType,
insureList: textdata.insureType,
realIndex: 0,
subIdentity: "",
subSocial: "",
};
},
onLoad() {
// this.$store.dispatch('setAutograph')
},
computed: {
...mapGetters(['auth', 'authInfo', 'autograph']),
indexId() {
if (this.index > 0) {
return this.index
} else if (this.authInfo.nation) {
if (this.identityList.findIndex(item => item === this.authInfo.nation) >= 0) {
return this.identityList.findIndex(item => item === this.authInfo.nation)
}
return 0;
} {
return 0
}
},
methods: {
setSeal(){
if (this.auth.realNameState) {
uni.navigateTo({
url: '/pageMy/setUserBase/seal/index'
})
} else {
uni.showToast({
title: '请先完成实名认证',
icon: 'none'
})
...mapGetters(['auth', 'authInfo']),
check() {
return check18IdCardNo(this.card) && !validatenull(this.name)
},
indexBao() {
if (this.auth.insureState && this.authInfo.bakValue >= 0) {
return this.authInfo.bakValue - 1
} else if (this.authInfo.politics) {
if (this.insureList.findIndex(item => item === this.authInfo.politics) >= 0) {
return this.insureList.findIndex(item => item === this.authInfo.politics)
}
},
setIcCard: function() {
if (this.auth.realNameState) {
uni.navigateTo({
url: '/pageMy/setUserBase/icCard/index'
})
} else {
uni.showToast({
title: '请先完成实名认证',
icon: 'none'
})
}
},
goRealName: function() {
uni.navigateTo({
url: '/pageMy/setUserBase/realName'
})
},
bindPickerChangeBao: function(e) {
uni.showLoading()
this.$store.dispatch('authInsure', e.target.value * 1 + 1).then(resp => {
uni.hideLoading()
}).catch(() => {
uni.hideLoading()
})
},
bindPickerChange: function(e) {
uni.showLoading()
this.$store.dispatch('authLabor').then(resp => {
this.index = e.target.value;
uni.hideLoading()
}).catch(() => {
uni.hideLoading()
})
},
idNumberFilter,
setName: function(e) {
this.name = e.detail.value;
},
setCard: function(e) {
this.card = e.detail.value.toUpperCase();
this.error = !check18IdCardNo(this.card)
return e.detail.value.toUpperCase()
},
goSet: function() {
this.loading = true
this.$store.dispatch('authRealName', {
name: this.name,
idNumber: this.card
})
.then(() => {
this.loading = false
uni.navigateBack()
}).catch(() => {
this.loading = false
})
},
idNumberFilter,
identityChange(val) {
console.log("val",val);
uni.showLoading();
this.$store.dispatch('authLabor').then(() => {
this.realIndex = val.detail.value;
uni.hideLoading();
}).catch(() => {
uni.hideLoading();
})
},
insureChange(val) {
uni.showLoading();
this.$store.dispatch('authInsure', val.detail.value * 1 + 1).then(() => {
uni.hideLoading();
}).catch(()=>{
uni.hideLoading();
})
},
return 0;
} else {
return 0
}
}
};
},
methods: {
setSeal() {
if (this.auth.realNameState) {
uni.navigateTo({
url: '/pageMy/setUserBase/seal/index'
})
} else {
uni.showToast({
title: '请先完成实名认证',
icon: 'none'
})
}
},
setIcCard: function () {
if (this.auth.realNameState) {
uni.navigateTo({
url: '/pageMy/setUserBase/icCard/index'
})
} else {
uni.showToast({
title: '请先完成实名认证',
icon: 'none'
})
}
},
goRealName: function () {
uni.navigateTo({
url: '/pageMy/setUserBase/realName'
})
},
bindPickerChangeBao: function (e) {
uni.showLoading()
this.$store.dispatch('authInsure', e.target.value * 1 + 1).then(resp => {
uni.hideLoading()
}).catch(() => {
uni.hideLoading()
})
},
bindPickerChange: function (e) {
uni.showLoading()
this.$store.dispatch('authLabor').then(resp => {
this.index = e.target.value;
uni.hideLoading()
}).catch(() => {
uni.hideLoading()
})
},
idNumberFilter,
setName: function (e) {
this.name = e.detail.value;
},
setCard: function (e) {
this.card = e.detail.value.toUpperCase();
this.error = !check18IdCardNo(this.card)
return e.detail.value.toUpperCase()
},
goSet: function () {
this.loading = true
this.$store.dispatch('authRealName', {
name: this.name,
idNumber: this.card
})
.then(() => {
this.loading = false
uni.navigateBack()
}).catch(() => {
this.loading = false
})
},
idNumberFilter,
async identityChange(val) {
const value = this.identityList.filter((item, index) => index === val.detail.value)
this.subIdentity = value.join('')
// await setInfo({ nation: this.subIdentity, politics: this.subSocial })
await setInfo({ nation: value.join(''), politics: "" })
console.log(value.join(''), '00000000000000');
uni.showLoading();
this.$store.dispatch('authLabor').then(() => {
this.realIndex = val.detail.value;
uni.hideLoading();
}).catch(() => {
uni.hideLoading();
})
},
async insureChange(val) {
console.log("", val, '-----');
const value = this.insureList.filter((item, index) => index === val.detail.value)
this.subSocial = value.join('')
// await setInfo({ nation: this.subIdentity, politics: this.subSocial })
await setInfo({ nation: "", politics: value.join('') })
uni.showLoading();
this.$store.dispatch('authInsure', val.detail.value * 1 + 1).then(() => {
uni.hideLoading();
}).catch(() => {
uni.hideLoading();
})
},
}
};
</script>
<style>
.nochoose {
color: #1b66ff;
}
.nochoose {
color: #1b66ff;
}
.listRight {
display: flex;
align-items: center;
justify-content: space-between;
font-family: PingFangSC-Regular;
font-size: 28rpx;
color: #999999;
}
.listRight {
display: flex;
align-items: center;
justify-content: space-between;
font-family: PingFangSC-Regular;
font-size: 28rpx;
color: #999999;
}
.listRight image {
width: 40rpx;
height: 40rpx;
margin-left: 15rpx;
}
.listRight image {
width: 40rpx;
height: 40rpx;
margin-left: 15rpx;
}
.listContent {
font-family: PingFangSC-Regular;
font-size: 28rpx;
color: #666666;
}
.listContent {
font-family: PingFangSC-Regular;
font-size: 28rpx;
color: #666666;
}
.list {
display: flex;
align-items: center;
justify-content: space-between;
font-family: PingFangSC-Regular;
font-size: 32rpx;
color: #333333;
padding: 30rpx;
line-height: 50rpx;
}
.list {
display: flex;
align-items: center;
justify-content: space-between;
font-family: PingFangSC-Regular;
font-size: 32rpx;
color: #333333;
padding: 30rpx;
line-height: 50rpx;
}
.border {
margin-left: 30rpx;
width: 720rpx;
height: 2rpx;
background-color: #f2f2f2;
/* border-bottom: 1rpx solid #dddddd; */
}
.border {
margin-left: 30rpx;
width: 720rpx;
height: 2rpx;
background-color: #f2f2f2;
/* border-bottom: 1rpx solid #dddddd; */
}
.tx image {
width: 32rpx;
height: 32rpx;
margin-right: 10rpx;
}
.tx image {
width: 32rpx;
height: 32rpx;
margin-right: 10rpx;
}
.tx {
font-family: PingFangSC-Regular;
font-size: 24rpx;
color: #ffffff;
padding: 30rpx;
padding-top: 0;
display: flex;
align-items: center;
justify-content: flex-start;
}
.tx {
font-family: PingFangSC-Regular;
font-size: 24rpx;
color: #ffffff;
padding: 30rpx;
padding-top: 0;
display: flex;
align-items: center;
justify-content: flex-start;
}
.userInfo {
font-family: PingFangSC-Regular;
font-size: 26rpx;
color: #ffffff;
font-weight: normal;
}
.userInfo {
font-family: PingFangSC-Regular;
font-size: 26rpx;
color: #ffffff;
font-weight: normal;
}
.name {
margin-left: 20rpx;
font-family: PingFangSC-Medium;
font-size: 36rpx;
color: #ffffff;
font-weight: bold;
line-height: 50rpx;
}
.name {
margin-left: 20rpx;
font-family: PingFangSC-Medium;
font-size: 36rpx;
color: #ffffff;
font-weight: bold;
line-height: 50rpx;
}
.headuserImg {
width: 100rpx;
height: 100rpx;
}
.headuserImg {
width: 100rpx;
height: 100rpx;
}
.headuser {
padding: 30rpx;
display: flex;
align-items: center;
justify-content: flex-start;
}
.headuser {
padding: 30rpx;
display: flex;
align-items: center;
justify-content: flex-start;
}
.stamp {
position: absolute;
top: 30rpx;
right: 30rpx;
/* opacity: 0.6; */
width: 200rpx;
height: 200rpx;
}
.stamp {
position: absolute;
top: 30rpx;
right: 30rpx;
/* opacity: 0.6; */
width: 200rpx;
height: 200rpx;
}
.logo {
position: absolute;
bottom: 0;
left: 0;
opacity: 0.1;
width: 200rpx;
height: 200rpx;
}
.logo {
position: absolute;
bottom: 0;
left: 0;
opacity: 0.1;
width: 200rpx;
height: 200rpx;
}
.head {
width: 690rpx;
height: 250rpx;
padding-top: 30rpx;
margin: 30rpx;
margin-top: 0;
border-radius: 15rpx;
position: relative;
background: #1b66ff;
box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.3);
}
.head {
width: 690rpx;
height: 250rpx;
padding-top: 30rpx;
margin: 30rpx;
margin-top: 0;
border-radius: 15rpx;
position: relative;
background: #1b66ff;
box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.3);
}
.body {
background-color: #fefefe;
padding-top: 30rpx;
}
.body {
background-color: #fefefe;
padding-top: 30rpx;
}
page {
background-color: #f6f6f6;
}
.bottombtn {
background-color: #1B66FF;
color: #fff;
text-align: center;
border-radius: 10rpx;
font-family: PingFangSC-Medium;
font-size: 32rpx;
height: 90rpx;
line-height: 90rpx;
}
.btn {
background-color: #fefefe;
width: 690rpx;
padding: 30rpx;
padding-bottom: 80rpx;
position: fixed;
bottom: 0;
left: 0;
}
.name {
font-family: PingFangSC-Regular;
font-size: 32rpx;
color: #333333;
width: 200rpx;
}
.error {
font-family: PingFangSC-Regular;
font-size: 26rpx;
color: red;
margin: 5px 0 0 200rpx;
padding-bottom: 5px;
}
.list {
padding: 20rpx;
padding-left: 0;
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 1rpx solid #f2f2f2;
font-size: 28rpx;
}
.pickerList {
padding: 20rpx;
padding-left: 0;
border-bottom: 1rpx solid #f2f2f2;
}
.listRight {
display: flex;
align-items: center;
justify-content: space-between;
font-family: PingFangSC-Regular;
font-size: 28rpx;
color: #999999;
}
.listRightContent {
color: #1b66ff;
}
.listRight image {
width: 40rpx;
height: 40rpx;
margin-left: 15rpx;
}
.listContent {
color: #999;
font-size: 28rpx;
}
.body {
background-color: #fefefe;
padding-left: 20rpx;
margin-top: 20rpx;
}
.nocheck {
opacity: 0.3;
}
page {
background-color: #f6f6f6;
}
page {
background-color: #f6f6f6;
}
.bottombtn {
background-color: #1B66FF;
color: #fff;
text-align: center;
border-radius: 10rpx;
font-family: PingFangSC-Medium;
font-size: 32rpx;
height: 90rpx;
line-height: 90rpx;
}
.btn {
background-color: #fefefe;
width: 690rpx;
padding: 30rpx;
padding-bottom: 80rpx;
position: fixed;
bottom: 0;
left: 0;
}
.name {
font-family: PingFangSC-Regular;
font-size: 32rpx;
color: #333333;
width: 200rpx;
}
.error {
font-family: PingFangSC-Regular;
font-size: 26rpx;
color: red;
margin: 5px 0 0 200rpx;
padding-bottom: 5px;
}
.list {
padding: 20rpx;
padding-left: 0;
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 1rpx solid #f2f2f2;
font-size: 28rpx;
}
.pickerList {
padding: 20rpx;
padding-left: 0;
border-bottom: 1rpx solid #f2f2f2;
}
.listRight {
display: flex;
align-items: center;
justify-content: space-between;
font-family: PingFangSC-Regular;
font-size: 28rpx;
color: #999999;
}
.listRightContent {
color: #1b66ff;
}
.listRight image {
width: 40rpx;
height: 40rpx;
margin-left: 15rpx;
}
.listContent {
color: #999;
font-size: 28rpx;
}
.body {
background-color: #fefefe;
padding-left: 20rpx;
margin-top: 20rpx;
}
.nocheck {
opacity: 0.3;
}
page {
background-color: #f6f6f6;
}
</style>