feat: 优化

This commit is contained in:
2026-07-23 13:59:35 +08:00
parent 268207b01b
commit 3f335074ea
13 changed files with 614 additions and 580 deletions
@@ -2,25 +2,27 @@
<view class="authentication_warp">
<Header :leftTitle="$t('authentication.title')" left-path-type="switchTab" left-path="/pages/mine/mine">
</Header>
<view class="data_common_warp">
<view class="data_msg">请填写用户本人得相关信息</view>
<view class="'add_form_item add_form_item_but'" v-for="item in formList" :key="item.id">
<view class="add_form_title">{{ item.title }}</view>
<up-input :placeholder="item.placeholder" border="surround" v-model="form[item.formName]"
:customStyle="inputCss" :type="item.type"></up-input>
</view>
<view class="add_form_item">
<view class="add_form_title">证件类型</view>
<view class="cert_" @click="certShowCheck(true)">
<view class="cert_title">{{ form.certName || '请选择' }}</view>
<up-image src="/static/common/right.png" width="16" height="16" bgColor="#f1f6ff00"></up-image>
<view class="content_warp">
<view class="data_common_warp">
<view class="data_msg">请填写用户本人得相关信息</view>
<view class="'add_form_item add_form_item_but'" v-for="item in formList" :key="item.id">
<view class="add_form_title">{{ item.title }}</view>
<up-input :placeholder="item.placeholder" border="surround" v-model="form[item.formName]"
:customStyle="inputCss" :type="item.type"></up-input>
</view>
<view class="add_form_item">
<view class="add_form_title">证件类型</view>
<view class="cert_" @click="certShowCheck(true)">
<view class="cert_title">{{ form.certName || '请选择' }}</view>
<up-image src="/static/common/right.png" width="16" height="16" bgColor="#f1f6ff00"></up-image>
</view>
</view>
</view>
<!-- 证件照 -->
<CommonCard @valueFunc="getValue" :Fimg="form.certFimg" :Bimg="form.certBimg" />
</view>
<!-- 证件照 -->
<CommonCard @valueFunc="getValue" :Fimg="form.certFimg" :Bimg="form.certBimg" />
<view class="add_but" @click="addAuthentication">
{{userInfo && userInfo.certStatus ? '重新提交' : '提交'}}
{{ userInfo && userInfo.certStatus ? '重新提交' : '提交' }}
</view>
<up-picker :show="certShow" :columns="[CERT_OPTION]" keyName="value" itemHeight="34" @confirm="certConfirm"
@cancel="certShow = false" @close="certShow = false"></up-picker>
@@ -31,7 +33,7 @@
<script>
import CommonCard from '@/components/common_card.vue';
import Header from '@/components/header.vue';
import { realNameAuthentication,getUserInfo } from '@/api/auth.js';
import { realNameAuthentication, getUserInfo } from '@/api/auth.js';
import { CERT_OPTION } from '@/utils/enumUtils.js';
export default {
@@ -96,15 +98,15 @@ export default {
],
certShow: false,
certOption: [],
userInfo:null
userInfo: null
}
},
onLoad(){
onLoad() {
this.init();
},
methods: {
init(){
init() {
this.getUserInfo();
},
async getUserInfo() {
@@ -113,14 +115,14 @@ export default {
const data = result.data;
this.userInfo = result.data || {};
this.form = {
name:this.userInfo.name,
certNo:this.userInfo.certNo,
certType:this.userInfo.certType != null ? this.userInfo.certType : 1,
certName: this.userInfo.certType == 2? '护照' :'居民身份证',
certFimg:this.userInfo.certFimg,
certBimg:this.userInfo.certBimg,
}
name: this.userInfo.name,
certNo: this.userInfo.certNo,
certType: this.userInfo.certType != null ? this.userInfo.certType : 1,
certName: this.userInfo.certType == 2 ? '护照' : '居民身份证',
certFimg: this.userInfo.certFimg,
certBimg: this.userInfo.certBimg,
}
}
},
async addAuthentication() {
@@ -134,7 +136,7 @@ export default {
});
return;
}
if (!params.certType) {
this.$refs.uToastRef.show({
type: 'error',
@@ -149,7 +151,7 @@ export default {
});
return;
}
if(!/(^\d{15}$)|(^\d{17}(\d|X|x)$)/.test(params.certNo)){
if (!/(^\d{15}$)|(^\d{17}(\d|X|x)$)/.test(params.certNo)) {
this.$refs.uToastRef.show({
type: 'error',
message: "请输入正确的证件号码",
@@ -208,9 +210,17 @@ export default {
<style lang="scss" scoped>
.authentication_warp {
height: calc(100vh - 58rpx);
height: 100%;
// height: calc(100vh - 158rpx);
background-color: $app-bj;
padding: 30rpx;
padding: 0 30rpx;
display: flex;
flex-direction: column;
.content_warp {
flex: 1;
overflow-y: scroll;
}
}
.cert_ {
@@ -223,4 +233,9 @@ export default {
color: #9e9e9ec7
}
}
.add_but {
position: relative;
width: 100%;
}
</style>