Sfoglia il codice sorgente

注册企业进度查询

lifanagju_citu 3 mesi fa
parent
commit
342c2f402e

+ 11 - 1
App.vue

@@ -1,5 +1,5 @@
 <script>
-// import { onShareAppMessage, onShareTimeline } from '@dcloudio/uni-app'
+	// import { onShareAppMessage, onShareTimeline } from '@dcloudio/uni-app'
 	export default {
 		onLaunch: function() {
 			// wx.showShareMenu({
@@ -22,6 +22,16 @@
 			// })
 			console.log('App Launch')
 			uni.setStorageSync('firstOpen', true)
+			
+			// 检查是否是个人令牌
+			if (uni.getStorageSync('token') && uni.getStorageSync('isPersonalToken')) {
+				try {
+					const url = uni.getStorageSync('entRegisterData') ? '/pages/register/review?hasData=true' : '/pages/register/index'
+					uni.redirectTo({ url }) // redirectTo: 关闭当前页面,跳转(不可返回); reLaunch: 关闭所有页面,重新打开(完全重置导航栈)
+				} catch (e) {
+					console.error('Navigation error:', e)
+				}
+			}
 
 			const updateManager = uni.getUpdateManager();
 			updateManager.onCheckForUpdate(function(res){});

+ 4 - 8
layout/components/authModal/login/index.vue

@@ -105,7 +105,7 @@ import { mobile, password, code, emailRequired } from '@/utils/validate'
 import { getSmsCode, getSmsTimer } from '@/utils/code'
 import { userStore } from '@/store/user'
 import { closeAuthModal } from '@/hooks/useModal'
-import { getUserRegisterEnterpriseApply, getEnterpriseRegisterApply } from '@/api/enterprise'
+import { getEnterpriseRegisterApply } from '@/api/enterprise'
 
 const useUserStore = userStore()
 const accountLoginRef = ref()
@@ -197,18 +197,14 @@ async function handleRegister () {
       icon: 'none',
       duration: 2000
     })
-
-    const { data } = await getUserRegisterEnterpriseApply()
-
+    // 查看用户是否有在申请中的数据
+    const { code } =  await useUserStore.getPersonalApplyingData()
     changeType.value = 'login'
-    const hasData = data && Object.keys(data).length > 0 && data.status !== '1'
-    console.log(data, '查看用户是否有在申请中的数据')
 
     uni.navigateTo({
-      url: hasData ? '/pages/register/review' : '/pages/register/index'
+      url: code ? '/pages/register/review' : '/pages/register/index'
     })
   } finally {
-
   }
 }
 

+ 1 - 1
pages.json

@@ -9,7 +9,7 @@
 		{
 			"path": "pages/index/loading",
 			"style": {
-				"navigationBarTitleText": ""
+				"navigationBarTitleText": "门墩儿 专注顶尖招聘"
 			}
 		},
 		{

+ 7 - 3
pages/index/loading.vue

@@ -1,6 +1,8 @@
 <template>
   <view class="loading">
+    <view>门墩儿 专注顶尖招聘</view>
     <uni-icons
+      class="icons"
       type="spinner-cycle"
       size="24"
     />
@@ -11,9 +13,11 @@
 </script>
 <style lang="scss" scoped>
 .loading {
-  // height: 60vh;
-  // line-height: 60vh;
-  margin-top: 20px;
+  height: 60vh;
+  line-height: 60vh;
   text-align: center;
+  .icons {
+    margin-top: 20px;
+  }
 }
 </style>

+ 3 - 2
pages/index/search.vue

@@ -49,8 +49,9 @@ const getJobList = async () => {
 }
 
 watch(() => useUserStore.refreshToken, () => {
-	if (!useUserStore.refreshToken) return jobList.value = []
-	getJobList()
+	if (!useUserStore.refreshToken && !uni.getStorageSync('isPersonalToken')) {
+		getJobList()
+	}
 }, { immediate: true })
 
 onShow(() => {

+ 34 - 25
pages/register/review.vue

@@ -1,22 +1,7 @@
 <template>
-	<view style="padding: 15px;">
-		<!-- 提交企业注册以后跳转显示页面 -->
-		<view v-if="!applyInfo || !(Object.keys(applyInfo).length)">
-			<view class="d-flex flex-column align-center">
-				<image src="/static/svg/submit.svg" style="height: 200px; width: "></image>
-			</view>
-      <view><span class="color-primary font-size-20 font-weight-bold">提交成功,</span>已收到您的企业账号申请,审核时间预计在1~3个工作日内,申请结果会以短信方式通知到您的手机上,请注意查收。</view>
-      <view style="width: 100%;">
-        <view class="mt-5 mb-1">如有疑问请长按二维码添加下方企业微信联系我们:</view>
-        <view style="width: 150px; height: 150px; margin: auto;">
-					<image show-menu-by-longpress="true" src="https://minio.menduner.com/dev/menduner/contact.png" style="width: 150px; height: 150px;"></image>
-        </view>
-        <view class="text-center ml-5">潘青海先生(Peter Pan)</view>
-      </view>
-		</view>
-
+	<view v-if="show" style="padding: 15px;">
 		<!-- 等待审核 -->
-		<view v-else-if="applyInfo?.status === '0'">
+		<view v-if="applyInfo?.status === '0'">
 			<view class="d-flex flex-column align-center">
 				<image src="/static/svg/submit.svg" style="height: 200px; width: "></image>
 			</view>
@@ -56,10 +41,26 @@
         <view class="text-center ml-5">潘青海先生(Peter Pan)</view>
       </view>
 		</view>
+		
+		<!-- 提交企业注册以后跳转显示页面 -->
+		<view v-else>
+			<view class="d-flex flex-column align-center">
+				<image src="/static/svg/submit.svg" style="height: 200px; width: "></image>
+			</view>
+			<view style="text-align: center;"><span class="color-primary font-size-20 font-weight-bold">您的企业注册申请已提交</span></view>
+      <view class="mt-5">审核时间预计在1~3个工作日内,申请结果会以短信方式通知到您的手机上,请注意查收。</view>
+      <view style="width: 100%;">
+        <view class="mt-5 mb-1">如有疑问请长按二维码添加下方企业微信联系我们:</view>
+        <view style="width: 150px; height: 150px; margin: auto;">
+					<image show-menu-by-longpress="true" src="https://minio.menduner.com/dev/menduner/contact.png" style="width: 150px; height: 150px;"></image>
+        </view>
+        <view class="text-center ml-5">潘青海先生(Peter Pan)</view>
+      </view>
+		</view>
 
-		<view class="d-flex">
-			<button :class="{'second-button': applyInfo.status === '2', 'send-button': applyInfo.status !== '2'}" @tap="handleToHome">回到首页</button>
-			<button v-if="applyInfo.status === '2'" class="second-button" @tap="handleConfirm">重新提交</button>
+		<view class="d-flex align-center">
+			<!-- <button :class="{'second-button': applyInfo.status === '2', 'send-button': applyInfo.status !== '2'}" @tap="handleToHome">回到首页</button> -->
+			<button v-if="applyInfo.status === '2'" class="recomm-button" @tap="handleConfirm">重新提交</button>
 		</view>
 	</view>
 </template>
@@ -73,16 +74,17 @@ import { userStore } from '@/store/user'
 
 const user = userStore()
 const applyInfo = ref({})
+const show = ref(false)
 
 // 查看用户是否有在申请中的数据
-const getApplyInfo = async (hasData) => {
+const getApplyInfo = async () => {
 	// 已经有数据说明已经申请过了
 	let result = {}
-	if (hasData) {
+	if (hasData && uni.getStorageSync('entRegisterData')) {
 		result = JSON.parse(uni.getStorageSync('entRegisterData'))
 	} else {
 		const { data } = await getUserRegisterEnterpriseApply()
-		result = data
+		result = data || {}
 		uni.setStorageSync('applyInfo', JSON.stringify(result))
 	}
 	
@@ -95,13 +97,16 @@ const getApplyInfo = async (hasData) => {
     remark: result.remark // 备注
   }
   console.log(result, 'review----查看是否有申请中的数据', applyInfo.value)
-  
+	show.value = true
 }
 
+let hasData = false
 onLoad((options) => {
-	getApplyInfo(options?.hasData)
+	hasData = options?.hasData ? true : false
+	getApplyInfo()
 })
 
+
 // 回到首页时需将当前个人登录状态及缓存中的数据清除
 const handleToHome = async () => {
 	await user.handleUserLogout()
@@ -111,6 +116,10 @@ const handleToHome = async () => {
 }
 
 const handleConfirm = () => {
+	if (uni.getStorageSync('token') && uni.getStorageSync('isPersonalToken')) {
+		uni.navigateTo({ url: '/pages/register/index' })
+		return
+	}
 	uni.reLaunch({
 		url: `/pages/register/phoneValidate?phone=${applyInfo.value?.phone}`
 	})

+ 14 - 1
store/user.js

@@ -5,6 +5,7 @@ import { closeAuthModal, showAuthModal } from '@/hooks/useModal'
 import { timesTampChange } from '@/utils/date'
 import { getBaseInfoDictOfName } from '@/utils/getText'
 import { userLogout } from '@/api/common';
+import { getUserRegisterEnterpriseApply } from '@/api/enterprise'
 
 // 默认账户信息
 const defaultAccountInfo = {
@@ -18,7 +19,6 @@ const defaultAccountInfo = {
 export const userStore = defineStore('user', {
   state: () => {
     const userLocal = uni.getStorageSync('user')
-
     const userInfo = userLocal ? JSON.parse(userLocal) : {}
     return {
       phone: null,
@@ -46,7 +46,10 @@ export const userStore = defineStore('user', {
           title: '登录成功'
         })
       }
+      this.isPersonal = false
       this.accountInfo = data
+      uni.removeStorageSync('isPersonalToken') // 注册企业时个人登录
+      uni.removeStorageSync('entRegisterData') // 企业注册申请中的数据
 
       // 企业注册-审核被拒绝-重新提交-效验手机号不需要获取用户信息
       if (!isGetData) return
@@ -63,7 +66,9 @@ export const userStore = defineStore('user', {
           title: '手机号验证成功'
         })
       }
+      this.isPersonal = true
       this.accountInfo = data
+      uni.setStorageSync('isPersonalToken', true); // 注册企业时个人登录
       closeAuthModal()
     },
     // 获取用户信息
@@ -84,6 +89,14 @@ export const userStore = defineStore('user', {
       this.userAccountInfo = data;
       return Promise.resolve(data);
     },
+    // 查看用户是否有在申请中的数据
+    async getPersonalApplyingData () {
+      const { data } = await getUserRegisterEnterpriseApply()
+      const bool = data && Object.keys(data).length > 0 && data.status !== '1'
+      uni.setStorageSync('entRegisterData', bool ? JSON.stringify(data) : "") // 企业注册申请中的数据
+      return Promise.resolve({ code: bool ? 1 : 0 , data: bool ? JSON.stringify(data) : "" });
+    },
+
     // 设置 token
     setToken(token = '', refreshToken = '') {
       if (token === '') {