li.shaoyi il y a 3 semaines
Parent
commit
675282b1e3

+ 17 - 1
src/constants/account.ts

@@ -61,7 +61,6 @@ export function getAQCertificateTypeListName(value: number) {
     return getEnumTypeName(enums, value)
 }
 
-
 /**
  * 获取对应的证件类型列表
  * @returns 
@@ -120,4 +119,21 @@ export function getTHJProfitRoleTypeList() {
 export function getTHJProfitRoleTypeName(value: number) {
     const enums = getTHJProfitRoleTypeList()
     return getEnumTypeName(enums, value)
+}
+
+/**
+ * 获取变更状态列表
+ * @returns 
+ */
+export function getModifyStatusList() {
+    return getEnumTypeList('modifystatus')
+}
+
+/**
+ * 获取变更状态名称
+ * @returns 
+ */
+export function getModifyStatusName(value: number) {
+    const enums = getModifyStatusList()
+    return getEnumTypeName(enums, value)
 }

+ 19 - 18
src/packages/digital/views/account/certification/index.vue

@@ -2,29 +2,29 @@
 <template>
     <app-view class="g-form account-certification">
         <template #header>
-            <app-navbar :title="$t('user.authentication.title')" />
+            <app-navbar :title="t('user.authentication.title')" />
         </template>
         <Form ref="formRef" class="g-form__container" @submit="onSubmit">
             <CellGroup title="信息填写" inset>
-                <Field v-model="formData.username" name="username" :label="$t('user.authentication.customername')"
-                    :placeholder="$t('user.authentication.pleaseentertheusername')" :rules="formRules.username" />
-                <Field name="cardtype" :label="$t('user.authentication.cardtype')" :rules="formRules.cardtype" is-link>
+                <Field v-model="formData.username" name="username" :label="t('user.authentication.customername')"
+                    :placeholder="t('user.authentication.pleaseentertheusername')" :rules="formRules.username" />
+                <Field name="cardtype" :label="t('user.authentication.cardtype')" :rules="formRules.cardtype" is-link>
                     <template #input>
                         <app-select v-model="formData.cardtype"
-                            :placeholder="$t('user.authentication.pleaseselectthecardtype')"
-                            :options="cerTypePersonList" @confirm="formRef?.validate('cardtype')" />
+                            :placeholder="t('user.authentication.pleaseselectthecardtype')" :options="cerTypePersonList"
+                            @confirm="formRef?.validate('cardtype')" />
                     </template>
                 </Field>
-                <Field v-model="formData.cardnum" name="cardnum" :label="$t('user.authentication.cardnum')"
-                    :placeholder="$t('user.authentication.pleaseenterthecardnum')" :rules="formRules.cardnum"
+                <Field v-model="formData.cardnum" name="cardnum" :label="t('user.authentication.cardnum')"
+                    :placeholder="t('user.authentication.pleaseenterthecardnum')" :rules="formRules.cardnum"
                     v-if="formData.cardtype !== undefined" />
-                <Field name="cardfrontphotourl" :label="$t('user.authentication.cardfrontphoto')"
+                <Field name="cardfrontphotourl" :label="t('user.authentication.cardfrontphoto')"
                     :rules="formRules.cardfrontphotourl">
                     <template #input>
                         <app-uploader @success="b_afterRead" />
                     </template>
                 </Field>
-                <Field name="cardbackphotourl" v-if="showCardBackPhoto" :label="$t('user.authentication.cardbackphoto')"
+                <Field name="cardbackphotourl" v-if="showCardBackPhoto" :label="t('user.authentication.cardbackphoto')"
                     :rules="formRules.cardbackphotourl">
                     <template #input>
                         <app-uploader @success="f_afterRead" />
@@ -36,13 +36,11 @@
                         <app-uploader @success="h_afterRead" />
                     </template>
                 </Field>
-                <Field v-if="modifyremark != ''" v-model="modifyremark" readonly name="modifyremark"
-                    :label="$t('user.authentication.modifyremark')" />
             </CellGroup>
         </Form>
         <div class="g-form__footer inset">
             <Button type="primary" @click="formRef?.submit" round block>
-                {{ $t('user.authentication.submit') }}
+                {{ t('user.authentication.submit') }}
             </Button>
         </div>
     </app-view>
@@ -57,12 +55,13 @@ import { getCerTypePersonList } from "@/constants/account"
 import { useNavigation } from '@mobile/router/navigation'
 import { useRequest } from '@/hooks/request'
 import { getWskhOpenAccountConfigs } from '@/services/api/account'
-import { i18n } from '@/stores'
+import { i18n, useUserStore } from '@/stores'
 import AppUploader from '@mobile/components/modules/uploader/index.vue'
 import AppSelect from '@mobile/components/base/select/index.vue'
 
+const userStore = useUserStore()
 const formRef = shallowRef<FormInstance>()
-const { formData, formSubmit, modifyremark } = addAuthReq()
+const { formData, formSubmit } = addAuthReq()
 const { router } = useNavigation()
 const { global: { t } } = i18n
 
@@ -138,9 +137,11 @@ const onSubmit = () => {
         formSubmit().then((res) => {
             /// 失败
             if (res.code.toString() === '0') {
-                hideLoading()
-                dialog(t("user.authentication.opensuccess")).then(() => {
-                    router.back()
+                userStore.getUserData().finally(() => {
+                    hideLoading()
+                    dialog(t("user.authentication.opensuccess")).then(() => {
+                        router.back()
+                    })
                 })
             } else {
                 showFailToast(res.message)

+ 17 - 17
src/packages/mobile/views/account/authresult/Index.vue

@@ -1,32 +1,34 @@
 <template>
     <app-view class="g-layout">
         <template #header>
-            <app-navbar :title="$t('user.authentication.title')" />
+            <app-navbar :title="t('user.authentication.title')" />
         </template>
         <template v-if="userInfo && !loading">
             <CellGroup :title="t('user.authentication.subtitle')" inset>
-                <Cell :title="$t('user.authentication.customername')" :value="userInfo.customername" />
-                <Cell :title="$t('user.authentication.cardtype')"
+                <Cell :title="t('user.authentication.customername')" :value="userInfo.customername" />
+                <Cell :title="t('user.authentication.cardtype')"
                     :value="getCertificateTypeCodeName(userInfo.cardtypeid)" />
-                <Cell :title="$t('user.authentication.cardnum')" :value="userInfo.cardnum" />
-                <Cell :title="$t('banksign.mobilephone')" :value="userInfo.mobile2" v-if="userInfo.mobile2" />
-                <Cell :title="$t('banksign.bankname1')" :value="userInfo.bankbankname" v-if="userInfo.bankbankname" />
-                <Cell :title="$t('banksign.bankno')" :value="userInfo.bankaccount" v-if="userInfo.bankaccount" />
-                <Cell v-if="userInfo.userinfotype === 1" :title="$t('user.authentication.cardfrontphoto')">
+                <Cell :title="t('user.authentication.cardnum')" :value="userInfo.cardnum" />
+                <Cell :title="t('banksign.mobilephone')" :value="userInfo.mobile2" v-if="userInfo.mobile2" />
+                <Cell :title="t('banksign.bankname1')" :value="userInfo.bankbankname" v-if="userInfo.bankbankname" />
+                <Cell :title="t('banksign.bankno')" :value="userInfo.bankaccount" v-if="userInfo.bankaccount" />
+                <Cell v-if="userInfo.userinfotype === 1" :title="t('user.authentication.cardfrontphoto')">
                     <Image fit="contain" :src="getFileUrl(userInfo.cardfrontphotourl)" width="100" height="100" />
                 </Cell>
-                <Cell v-if="userInfo.userinfotype === 2" :title="$t('user.authentication.cardfrontphoto1')">
+                <Cell v-if="userInfo.userinfotype === 2" :title="t('user.authentication.cardfrontphoto1')">
                     <Image fit="contain" :src="getFileUrl(userInfo.cardfrontphotourl)" width="100" height="100" />
                 </Cell>
-                <Cell :title="$t('user.authentication.cardbackphoto')"
+                <Cell :title="t('user.authentication.cardbackphoto')"
                     v-if="showCardBackPhoto && userInfo.userinfotype === 1">
                     <Image fit="contain" :src="getFileUrl(userInfo.cardbackphotourl)" width="100" height="100" />
                 </Cell>
                 <Cell :title="halfBodyPhotoTitle" v-if="showHalfBodyPhoto && userInfo.userinfotype === 1">
                     <Image fit="contain" :src="getFileUrl(userInfo.halfbodyphotourl)" width="100" height="100" />
                 </Cell>
-                <Cell :title="$t('user.authentication.authstatus')"
-                    :value="getAuthStatusName(userStore.userAccount.hasauth)" />
+                <Cell :title="t('user.authentication.authstatus')"
+                    :value="userStore.userAccount.modifystatus !== 1 ? getModifyStatusName(userStore.userAccount.modifystatus) : getAuthStatusName(userStore.userAccount.hasauth)" />
+                <Cell :title="t('user.authentication.modifyremark')" :value="userStore.userAccount.modifyremark"
+                    v-if="userStore.userAccount.hasauth === AuthStatus.Rejected && userStore.userAccount.modifyremark" />
             </CellGroup>
             <div class="g-layout-block g-layout-block--inset"
                 v-if="userStore.userAccount.hasauth === AuthStatus.Rejected && userStore.userAccount.modifystatus === 1">
@@ -38,9 +40,9 @@
 
 <script lang="ts" setup>
 import { shallowRef, onActivated, computed } from 'vue'
-import { Button, CellGroup, Cell, Image,  showLoadingToast } from 'vant'
+import { Button, CellGroup, Cell, Image, showLoadingToast } from 'vant'
 import { useNavigation } from '@mobile/router/navigation'
-import { AuthStatus, getAuthStatusName } from '@/constants/account'
+import { AuthStatus, getAuthStatusName, getModifyStatusName } from '@/constants/account'
 import { queryWrDraftUserInfo } from '@/services/api/account'
 import { useRequest } from '@/hooks/request'
 import { getCertificateTypeCodeName } from '@/constants/account'
@@ -65,9 +67,7 @@ const { data, loading, run } = useRequest(queryWrDraftUserInfo, {
         data.value = res.data[0]
     },
     onFinally: () => {
-        userStore.getUserData().finally(() => {
-            toast.close()
-        })
+        toast.close()
     }
 })