Quellcode durchsuchen

切换企业登录时,手机号不可修改

lifanagju_citu vor 11 Monaten
Ursprung
Commit
4a0ea07fd1

+ 3 - 3
src/components/VerificationCode/index.vue

@@ -1,7 +1,7 @@
 <template>
   <div>
     <v-form @submit.prevent ref="phoneForm">
-      <v-text-field v-model="loginData.phone" :placeholder="$t('login.mobileNumberPlaceholder')" color="primary" variant="outlined" density="compact" :rules="phoneRules" validate-on="input">
+      <v-text-field v-model="loginData.phone" :disabled="loginUserPhone" :placeholder="$t('login.mobileNumberPlaceholder')" color="primary" variant="outlined" density="compact" :rules="phoneRules" validate-on="input">
         <template v-slot:prepend-inner>
           <span class="d-flex">
             <v-icon icon="mdi-cellphone" size="20"></v-icon>
@@ -113,9 +113,9 @@ const autoTimer = () => {
   setTime()
 }
 autoTimer()
-
+const loginUserPhone = localStorage.getItem('loginUserPhone') || ''
 const loginData = reactive({
-  phone: '13229740091',
+  phone: loginUserPhone || '13229740091',
   code: '123456'
 })
 

+ 3 - 1
src/store/user.js

@@ -90,6 +90,7 @@ export const useUserStore = defineStore('user',
       },
       // 退出登录
       async userLogout () {
+        const loginUserPhone = this.userInfo?.phone || ''
         await logout()
         removeToken()
         this.userInfo = {}
@@ -97,7 +98,8 @@ export const useUserStore = defineStore('user',
         this.accountInfo = {}
         const companyInfo = localStorage.getItem('companyInfo')
         localStorage.clear()
-        if (companyInfo) localStorage.setItem('companyInfo', companyInfo)
+        localStorage.setItem('companyInfo', companyInfo)
+        localStorage.setItem('loginUserPhone', loginUserPhone)
       }
     }
   },

+ 2 - 3
src/views/enterprise/components/inReview.vue

@@ -4,7 +4,7 @@
       <div style="width: 600px;margin: 80px auto;">
 
         <!-- 提交企业注册以后跳转显示页面 -->
-        <div v-if="!info || !Object.keys(info).length">
+        <div v-if="!info || !(Object.keys(info).length)">
           <span>提交成功,审核时间在1~3个工作日内,申请结果会以短信方式通知到您的手机上,请注意查收</span>
         </div>
 
@@ -36,7 +36,7 @@
         
         <div class="text-center">
           <v-btn class="mt-16" color="warning" to="/">{{ $t('common.toHome') }}</v-btn>
-          <v-btn class="mt-16 ml-12" color="success" to="/enterprise/register">{{ $t('common.resubmit') }}</v-btn>
+          <v-btn class="mt-16 ml-12" color="primary" to="/enterprise/register">{{ $t('common.resubmit') }}</v-btn>
         </div>
       </div>
     </v-card>
@@ -50,7 +50,6 @@ defineOptions({name: 'enterprise-enterpriseRegister-inReview'})
 
 
 const info = JSON.parse(localStorage.getItem('userApplyInfo'))
-console.log('info', info)
 const commitTime = ref(info?.createTime ? timesTampChange(info.createTime) : null) // 创建时间
 const updateTime = ref(info?.createTime ? timesTampChange(info.updateTime) : null) // 更新时间
 const status = ref(info?.status) // 帐号状态(0正常 1停用 2 等待审核 3不通过) // 审核状态

+ 7 - 0
src/views/enterprise/components/register.vue

@@ -145,6 +145,13 @@ const handleCommit = async () => {
   router.push({ path: '/enterprise/inReview' })
 }
 
+// 不通过的企业注册申请 重新发起
+const info = JSON.parse(localStorage.getItem('userApplyInfo'))
+if (info && Object.keys(info).length) {
+  licenseUrl.value = info?.businessLicenseUrl
+  formItems.value.options.forEach(e => { e.value = info[e.key] })
+}
+
 </script>
 <style lang="scss" scoped>
 .CtFormClass {

+ 3 - 2
src/views/login/components/passwordPage.vue

@@ -1,6 +1,6 @@
 <template>
   <v-form ref="passwordForm" @submit.prevent>
-    <v-text-field v-model="loginData.phone" :placeholder="$t('login.mobileNumberPlaceholder')" color="primary" variant="outlined" density="compact" :rules="phoneRules" validate-on="input">
+    <v-text-field v-model="loginData.phone" :disabled="loginUserPhone" :placeholder="$t('login.mobileNumberPlaceholder')" color="primary" variant="outlined" density="compact" :rules="phoneRules" validate-on="input">
       <template v-slot:prepend-inner>
         <span class="d-flex">
           <v-icon icon="mdi-cellphone" size="20"></v-icon>
@@ -63,8 +63,9 @@ const handleChangeCurrentArea = (e) => {
   currentArea.value = e.value
 }
 
+const loginUserPhone = localStorage.getItem('loginUserPhone') || ''
 const loginData = reactive({
-  phone: '13229740091',
+  phone: loginUserPhone || '13229740091',
   password: '1111'
 })