|  |  |  | 
|---|
|  |  |  | import Taro from '@tarojs/taro'; | 
|---|
|  |  |  | import { object2query, LocationUtils } from '@12333/utils'; | 
|---|
|  |  |  | import { ParkOrHRStatus, UserCertificationFrontStatus } from '@12333/constants'; | 
|---|
|  |  |  | // import * as userServices from '@12333/services/api/User'; | 
|---|
|  |  |  | import { useQuery } from '@tanstack/vue-query'; | 
|---|
|  |  |  | import { MaybeRef } from 'vue'; | 
|---|
|  |  |  | import { useRefeshDidShow } from '@12333/hooks/infiniteLoading'; | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const { userDetail, userInfo, locationCity } = storeToRefs(userStore); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // function updateUserInfo() { | 
|---|
|  |  |  | //   return userStore.getCurrentUserInfo(); | 
|---|
|  |  |  | // } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // const isCompanyAudited = computed(() => { | 
|---|
|  |  |  | //   return userDetail.value?.openHRSiteStatus === ParkOrHRStatus.Running; | 
|---|
|  |  |  | // }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 是否完善个人信息(企业名称,手机号) | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | // const isCompletePersonalInfo = computed(() => { | 
|---|
|  |  |  | //   return ( | 
|---|
|  |  |  | //     !!userDetail.value?.customerName && | 
|---|
|  |  |  | //     !!userDetail.value?.contacter && | 
|---|
|  |  |  | //     !!userDetail.value?.cityName | 
|---|
|  |  |  | //   ); | 
|---|
|  |  |  | // }); | 
|---|
|  |  |  | function updateUserInfo() { | 
|---|
|  |  |  | return userStore.getCurrentUserInfo(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const isCertified = computed(() => { | 
|---|
|  |  |  | return userDetail.value?.frontStatus === UserCertificationFrontStatus.Certified; | 
|---|
|  |  |  | return userDetail.value?.isReal; | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | return { | 
|---|
|  |  |  | user: userInfo, | 
|---|
|  |  |  | userDetail: userDetail, | 
|---|
|  |  |  | // updateUserInfo, | 
|---|
|  |  |  | // isCompletePersonalInfo, | 
|---|
|  |  |  | // isCompanyAudited, | 
|---|
|  |  |  | updateUserInfo, | 
|---|
|  |  |  | isCertified, | 
|---|
|  |  |  | locationCity, | 
|---|
|  |  |  | }; | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | Taro.useReady(async () => { | 
|---|
|  |  |  | if (isLogin.value && userStore.firstGetUserDetail) { | 
|---|
|  |  |  | // userStore.getCurrentUserInfo(); | 
|---|
|  |  |  | userStore.getCurrentUserInfo(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (needAuth && !isLogin.value) { | 
|---|
|  |  |  | Taro.navigateTo({ | 
|---|