|
@@ -2,7 +2,6 @@ import React, { useEffect } from 'react'
|
|
|
import { View, Text, ScrollView } from '@tarojs/components'
|
|
import { View, Text, ScrollView } from '@tarojs/components'
|
|
|
import Taro from '@tarojs/taro'
|
|
import Taro from '@tarojs/taro'
|
|
|
import { useQuery } from '@tanstack/react-query'
|
|
import { useQuery } from '@tanstack/react-query'
|
|
|
-import { YongrenTabBarLayout } from '@d8d/yongren-shared-ui/components/YongrenTabBarLayout'
|
|
|
|
|
import { PageContainer } from '@d8d/mini-shared-ui-components/components/page-container'
|
|
import { PageContainer } from '@d8d/mini-shared-ui-components/components/page-container'
|
|
|
import { Navbar } from '@d8d/mini-shared-ui-components/components/navbar'
|
|
import { Navbar } from '@d8d/mini-shared-ui-components/components/navbar'
|
|
|
import { enterpriseDisabilityClient } from '../../api'
|
|
import { enterpriseDisabilityClient } from '../../api'
|
|
@@ -14,17 +13,14 @@ export interface TalentDetailProps {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 从RPC客户端推断类型
|
|
// 从RPC客户端推断类型
|
|
|
-type TalentDetailResponse = InferResponseType<typeof enterpriseDisabilityClient[':id']['$get'], 200>
|
|
|
|
|
type WorkHistoryResponse = InferResponseType<typeof enterpriseDisabilityClient[':id']['work-history']['$get'], 200>
|
|
type WorkHistoryResponse = InferResponseType<typeof enterpriseDisabilityClient[':id']['work-history']['$get'], 200>
|
|
|
type SalaryHistoryResponse = InferResponseType<typeof enterpriseDisabilityClient[':id']['salary-history']['$get'], 200>
|
|
type SalaryHistoryResponse = InferResponseType<typeof enterpriseDisabilityClient[':id']['salary-history']['$get'], 200>
|
|
|
type CreditInfoResponse = InferResponseType<typeof enterpriseDisabilityClient[':id']['credit-info']['$get'], 200>
|
|
type CreditInfoResponse = InferResponseType<typeof enterpriseDisabilityClient[':id']['credit-info']['$get'], 200>
|
|
|
-type VideoResponse = InferResponseType<typeof enterpriseDisabilityClient[':id']['videos']['$get'], 200>
|
|
|
|
|
|
|
|
|
|
// 提取数组元素类型
|
|
// 提取数组元素类型
|
|
|
type WorkHistoryItem = WorkHistoryResponse['工作历史'][number]
|
|
type WorkHistoryItem = WorkHistoryResponse['工作历史'][number]
|
|
|
type SalaryHistoryItem = SalaryHistoryResponse['薪资历史'][number]
|
|
type SalaryHistoryItem = SalaryHistoryResponse['薪资历史'][number]
|
|
|
type CreditInfoItem = CreditInfoResponse['征信信息'][number]
|
|
type CreditInfoItem = CreditInfoResponse['征信信息'][number]
|
|
|
-type VideoItem = VideoResponse['视频列表'][number]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const TalentDetail: React.FC<TalentDetailProps> = () => {
|
|
const TalentDetail: React.FC<TalentDetailProps> = () => {
|
|
@@ -54,7 +50,7 @@ const TalentDetail: React.FC<TalentDetailProps> = () => {
|
|
|
// 兼容字段映射 - 使用实际存在的字段
|
|
// 兼容字段映射 - 使用实际存在的字段
|
|
|
salary: 0, // 薪资字段不存在,使用默认值0
|
|
salary: 0, // 薪资字段不存在,使用默认值0
|
|
|
joinDate: undefined, // 入职日期字段不存在
|
|
joinDate: undefined, // 入职日期字段不存在
|
|
|
- disabilityId: data.disabilityId || '未提供', // 使用后端返回的残疾证号
|
|
|
|
|
|
|
+ disabilityId: data.disabilityType || data.disabilityLevel || '未提供', // 使用残疾类型或等级
|
|
|
idAddress: '未提供', // 地址字段不存在
|
|
idAddress: '未提供', // 地址字段不存在
|
|
|
phone: data.phone || '未提供'
|
|
phone: data.phone || '未提供'
|
|
|
}
|
|
}
|
|
@@ -271,13 +267,6 @@ const TalentDetail: React.FC<TalentDetailProps> = () => {
|
|
|
return `¥${amount.toLocaleString()}`
|
|
return `¥${amount.toLocaleString()}`
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // 脱敏身份证号
|
|
|
|
|
- const maskIdCard = (idCard?: string) => {
|
|
|
|
|
- if (!idCard) return '未提供'
|
|
|
|
|
- if (idCard.length !== 18) return idCard
|
|
|
|
|
- return idCard.replace(/(\d{6})(\d{10})(\d{2})/, '$1********$3')
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
return (
|
|
return (
|
|
|
<PageContainer padding={false} className="pb-0">
|
|
<PageContainer padding={false} className="pb-0">
|
|
|
<ScrollView
|
|
<ScrollView
|
|
@@ -371,7 +360,7 @@ const TalentDetail: React.FC<TalentDetailProps> = () => {
|
|
|
</View>
|
|
</View>
|
|
|
<View className="flex flex-col">
|
|
<View className="flex flex-col">
|
|
|
<Text className="text-gray-500">身份证号</Text>
|
|
<Text className="text-gray-500">身份证号</Text>
|
|
|
- <Text className="text-gray-800">{maskIdCard(talentDetail.idCard)}</Text>
|
|
|
|
|
|
|
+ <Text className="text-gray-800">{talentDetail.idCard || '未提供'}</Text>
|
|
|
</View>
|
|
</View>
|
|
|
<View className="flex flex-col">
|
|
<View className="flex flex-col">
|
|
|
<Text className="text-gray-500">残疾证号</Text>
|
|
<Text className="text-gray-500">残疾证号</Text>
|