|
@@ -50,12 +50,12 @@ const TalentDetail: React.FC<TalentDetailProps> = () => {
|
|
|
status: data.jobStatus, // 映射status字段
|
|
status: data.jobStatus, // 映射status字段
|
|
|
// 计算年龄
|
|
// 计算年龄
|
|
|
age: data.birthDate ? Math.floor((Date.now() - new Date(data.birthDate).getTime()) / (1000 * 60 * 60 * 24 * 365.25)) : undefined,
|
|
age: data.birthDate ? Math.floor((Date.now() - new Date(data.birthDate).getTime()) / (1000 * 60 * 60 * 24 * 365.25)) : undefined,
|
|
|
- // 兼容字段映射
|
|
|
|
|
- salary: data.salary || data.monthlySalary || data.currentSalary,
|
|
|
|
|
- joinDate: data.joinDate || data.employmentDate || data.hireDate,
|
|
|
|
|
- disabilityId: data.disabilityId || data.disabilityCardNumber,
|
|
|
|
|
- idAddress: data.idAddress || data.address || data.residentialAddress,
|
|
|
|
|
- phone: data.phone || data.mobile || data.contactPhone
|
|
|
|
|
|
|
+ // 兼容字段映射 - 使用实际存在的字段
|
|
|
|
|
+ salary: 0, // 薪资字段不存在,使用默认值0
|
|
|
|
|
+ joinDate: undefined, // 入职日期字段不存在
|
|
|
|
|
+ disabilityId: data.disabilityType || data.disabilityLevel || '未提供', // 使用残疾类型或等级
|
|
|
|
|
+ idAddress: '未提供', // 地址字段不存在
|
|
|
|
|
+ phone: data.phone || '未提供'
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
enabled: isLoggedIn && talentId > 0
|
|
enabled: isLoggedIn && talentId > 0
|
|
@@ -229,13 +229,13 @@ const TalentDetail: React.FC<TalentDetailProps> = () => {
|
|
|
const videoList = data?.视频列表 || []
|
|
const videoList = data?.视频列表 || []
|
|
|
// 转换为VideoData数组
|
|
// 转换为VideoData数组
|
|
|
return videoList.map((item) => ({
|
|
return videoList.map((item) => ({
|
|
|
- id: item.视频ID || '',
|
|
|
|
|
- title: item.视频标题 || '未命名视频',
|
|
|
|
|
- url: item.视频URL || undefined,
|
|
|
|
|
- type: item.视频类型 || undefined,
|
|
|
|
|
|
|
+ id: item.文件ID || '',
|
|
|
|
|
+ title: item.视频类型 || '未命名视频',
|
|
|
|
|
+ url: item.文件URL || undefined,
|
|
|
|
|
+ type: item.文件类型 || undefined,
|
|
|
uploadTime: item.上传时间 || undefined,
|
|
uploadTime: item.上传时间 || undefined,
|
|
|
- size: item.文件大小 || undefined,
|
|
|
|
|
- category: (item.分类 as '个税视频' | '工资视频' | '工作视频' | '其他') || '其他'
|
|
|
|
|
|
|
+ size: undefined, // 文件大小字段不存在
|
|
|
|
|
+ category: (item.视频类型 as '个税视频' | '工资视频' | '工作视频' | '其他') || '其他'
|
|
|
}))
|
|
}))
|
|
|
},
|
|
},
|
|
|
enabled: isLoggedIn && talentId > 0
|
|
enabled: isLoggedIn && talentId > 0
|
|
@@ -322,12 +322,12 @@ const TalentDetail: React.FC<TalentDetailProps> = () => {
|
|
|
</View>
|
|
</View>
|
|
|
<View className="mt-4 flex justify-between">
|
|
<View className="mt-4 flex justify-between">
|
|
|
<View className="text-center">
|
|
<View className="text-center">
|
|
|
- <Text className="text-2xl font-bold">{formatCurrency(talentDetail.salary)}</Text>
|
|
|
|
|
|
|
+ <Text className="text-2xl font-bold">{formatCurrency(salaryInfo?.amount || 0)}</Text>
|
|
|
<Text className="text-xs opacity-80">当前薪资</Text>
|
|
<Text className="text-xs opacity-80">当前薪资</Text>
|
|
|
</View>
|
|
</View>
|
|
|
<View className="text-center">
|
|
<View className="text-center">
|
|
|
<Text className="text-2xl font-bold">
|
|
<Text className="text-2xl font-bold">
|
|
|
- {talentDetail.joinDate ? Math.floor((Date.now() - new Date(talentDetail.joinDate).getTime()) / (1000 * 60 * 60 * 24)) : 0}
|
|
|
|
|
|
|
+ {workInfo?.startDate ? Math.floor((Date.now() - new Date(workInfo.startDate).getTime()) / (1000 * 60 * 60 * 24)) : 0}
|
|
|
</Text>
|
|
</Text>
|
|
|
<Text className="text-xs opacity-80">在职天数</Text>
|
|
<Text className="text-xs opacity-80">在职天数</Text>
|
|
|
</View>
|
|
</View>
|
|
@@ -364,10 +364,6 @@ const TalentDetail: React.FC<TalentDetailProps> = () => {
|
|
|
<Text className="text-gray-500">联系地址</Text>
|
|
<Text className="text-gray-500">联系地址</Text>
|
|
|
<Text className="text-gray-800">{talentDetail.idAddress || '未提供'}</Text>
|
|
<Text className="text-gray-800">{talentDetail.idAddress || '未提供'}</Text>
|
|
|
</View>
|
|
</View>
|
|
|
- <View className="col-span-2">
|
|
|
|
|
- <Text className="text-gray-500">联系电话</Text>
|
|
|
|
|
- <Text className="text-gray-800">{talentDetail.phone || '未提供'}</Text>
|
|
|
|
|
- </View>
|
|
|
|
|
</View>
|
|
</View>
|
|
|
</View>
|
|
</View>
|
|
|
|
|
|
|
@@ -391,36 +387,38 @@ const TalentDetail: React.FC<TalentDetailProps> = () => {
|
|
|
{talentDetail.status || '未知'}
|
|
{talentDetail.status || '未知'}
|
|
|
</Text>
|
|
</Text>
|
|
|
</View>
|
|
</View>
|
|
|
- <View className="flex justify-between">
|
|
|
|
|
- <Text className="text-gray-500">岗位类型</Text>
|
|
|
|
|
- <Text className="text-gray-800">{workInfo?.position || '未指定'}</Text>
|
|
|
|
|
- </View>
|
|
|
|
|
<View className="flex justify-between">
|
|
<View className="flex justify-between">
|
|
|
<Text className="text-gray-500">所属订单</Text>
|
|
<Text className="text-gray-500">所属订单</Text>
|
|
|
<Text className="text-gray-800">{workInfo?.orderId ? `订单 #${workInfo.orderId}` : '无'}</Text>
|
|
<Text className="text-gray-800">{workInfo?.orderId ? `订单 #${workInfo.orderId}` : '无'}</Text>
|
|
|
</View>
|
|
</View>
|
|
|
|
|
+ <View className="flex justify-between">
|
|
|
|
|
+ <Text className="text-gray-500">岗位类型</Text>
|
|
|
|
|
+ <Text className="text-gray-800">{workInfo?.position || '未指定'}</Text>
|
|
|
|
|
+ </View>
|
|
|
</View>
|
|
</View>
|
|
|
</View>
|
|
</View>
|
|
|
|
|
|
|
|
- {/* 薪资信息卡片 */}
|
|
|
|
|
|
|
+ {/* 薪资信息卡片 - 按原型简化:当前月薪和薪资历史按钮 */}
|
|
|
<View className="card bg-white p-4 mb-4">
|
|
<View className="card bg-white p-4 mb-4">
|
|
|
<Text className="font-semibold text-gray-700 mb-3">薪资信息</Text>
|
|
<Text className="font-semibold text-gray-700 mb-3">薪资信息</Text>
|
|
|
- <View className="space-y-3 text-sm">
|
|
|
|
|
- <View className="flex justify-between">
|
|
|
|
|
- <Text className="text-gray-500">当前薪资</Text>
|
|
|
|
|
- <Text className="text-gray-800 font-semibold">{formatCurrency(talentDetail.salary)}</Text>
|
|
|
|
|
- </View>
|
|
|
|
|
- <View className="flex justify-between">
|
|
|
|
|
- <Text className="text-gray-500">薪资结构</Text>
|
|
|
|
|
- <Text className="text-gray-800">{salaryInfo?.type || '月薪'}</Text>
|
|
|
|
|
- </View>
|
|
|
|
|
- <View className="flex justify-between">
|
|
|
|
|
- <Text className="text-gray-500">发薪日</Text>
|
|
|
|
|
- <Text className="text-gray-800">{salaryInfo?.paymentDate ? formatDate(salaryInfo.paymentDate) : '每月底'}</Text>
|
|
|
|
|
|
|
+ <View className="flex justify-between items-center">
|
|
|
|
|
+ <View>
|
|
|
|
|
+ <Text className="text-gray-500">当前月薪</Text>
|
|
|
|
|
+ <Text className="text-2xl font-bold text-blue-600">{formatCurrency(salaryInfo?.amount || 0)}</Text>
|
|
|
</View>
|
|
</View>
|
|
|
- <View className="flex justify-between">
|
|
|
|
|
- <Text className="text-gray-500">薪资周期</Text>
|
|
|
|
|
- <Text className="text-gray-800">{salaryInfo?.period || '月度'}</Text>
|
|
|
|
|
|
|
+ <View
|
|
|
|
|
+ className="text-blue-500 text-sm flex items-center"
|
|
|
|
|
+ onClick={() => {
|
|
|
|
|
+ // 滚动到薪资历史记录卡片
|
|
|
|
|
+ // 可以在薪资历史记录卡片添加data-testid或id来定位
|
|
|
|
|
+ Taro.showToast({
|
|
|
|
|
+ title: '查看薪资历史',
|
|
|
|
|
+ icon: 'none'
|
|
|
|
|
+ });
|
|
|
|
|
+ }}
|
|
|
|
|
+ >
|
|
|
|
|
+ <Text className="i-heroicons-clock-20-solid mr-1" />
|
|
|
|
|
+ <Text>薪资历史</Text>
|
|
|
</View>
|
|
</View>
|
|
|
</View>
|
|
</View>
|
|
|
</View>
|
|
</View>
|
|
@@ -450,9 +448,13 @@ const TalentDetail: React.FC<TalentDetailProps> = () => {
|
|
|
const salary = work.个人薪资 ? `¥${work.个人薪资.toLocaleString()}` : '未指定'
|
|
const salary = work.个人薪资 ? `¥${work.个人薪资.toLocaleString()}` : '未指定'
|
|
|
|
|
|
|
|
return (
|
|
return (
|
|
|
- <View key={work.订单ID || index} className="flex items-start">
|
|
|
|
|
- {/* 时间线圆点 */}
|
|
|
|
|
- <View className={`w-3 h-3 rounded-full mt-1 mr-3 ${isCurrent ? 'bg-blue-500' : 'bg-gray-300'}`} />
|
|
|
|
|
|
|
+ <View key={work.订单ID || index} className="flex">
|
|
|
|
|
+ <View className="flex flex-col items-center mr-3">
|
|
|
|
|
+ <View className={`w-3 h-3 rounded-full ${isCurrent ? 'bg-blue-500' : 'bg-gray-400'}`} />
|
|
|
|
|
+ {index !== workHistoryFull.length - 1 && (
|
|
|
|
|
+ <View className={`w-0.5 h-full mt-1 ${isCurrent ? 'bg-blue-200' : 'bg-gray-200'}`} />
|
|
|
|
|
+ )}
|
|
|
|
|
+ </View>
|
|
|
<View className="flex-1">
|
|
<View className="flex-1">
|
|
|
{/* 公司/订单名称 */}
|
|
{/* 公司/订单名称 */}
|
|
|
<Text className="font-medium text-gray-800 text-sm">
|
|
<Text className="font-medium text-gray-800 text-sm">
|
|
@@ -619,6 +621,45 @@ const TalentDetail: React.FC<TalentDetailProps> = () => {
|
|
|
</View>
|
|
</View>
|
|
|
)}
|
|
)}
|
|
|
</View>
|
|
</View>
|
|
|
|
|
+
|
|
|
|
|
+ {/* 操作按钮 - 原型第831-839行 */}
|
|
|
|
|
+ <View className="flex space-x-3 mt-4">
|
|
|
|
|
+ {/* 联系按钮 */}
|
|
|
|
|
+ <View
|
|
|
|
|
+ className="flex-1 bg-blue-500 text-white py-3 rounded-lg font-medium flex items-center justify-center active:bg-blue-600"
|
|
|
|
|
+ onClick={() => {
|
|
|
|
|
+ // 联系功能:拨打电话或跳转
|
|
|
|
|
+ if (talentDetail.phone) {
|
|
|
|
|
+ Taro.makePhoneCall({
|
|
|
|
|
+ phoneNumber: talentDetail.phone
|
|
|
|
|
+ })
|
|
|
|
|
+ } else {
|
|
|
|
|
+ Taro.showToast({
|
|
|
|
|
+ title: '暂无联系电话',
|
|
|
|
|
+ icon: 'none'
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ }}
|
|
|
|
|
+ >
|
|
|
|
|
+ <Text className="i-heroicons-phone-20-solid mr-2" />
|
|
|
|
|
+ <Text>联系</Text>
|
|
|
|
|
+ </View>
|
|
|
|
|
+
|
|
|
|
|
+ {/* 编辑按钮 */}
|
|
|
|
|
+ <View
|
|
|
|
|
+ className="flex-1 bg-gray-100 text-gray-800 py-3 rounded-lg font-medium flex items-center justify-center active:bg-gray-200"
|
|
|
|
|
+ onClick={() => {
|
|
|
|
|
+ // 编辑功能:跳转编辑页面
|
|
|
|
|
+ Taro.navigateTo({
|
|
|
|
|
+ url: `/pages/yongren/talent/edit?id=${talentId}`
|
|
|
|
|
+ })
|
|
|
|
|
+ }}
|
|
|
|
|
+ >
|
|
|
|
|
+ <Text className="i-heroicons-pencil-square-20-solid mr-2" />
|
|
|
|
|
+ <Text>编辑</Text>
|
|
|
|
|
+ </View>
|
|
|
|
|
+ </View>
|
|
|
|
|
+
|
|
|
</View>
|
|
</View>
|
|
|
</>
|
|
</>
|
|
|
) : (
|
|
) : (
|
|
@@ -630,47 +671,6 @@ const TalentDetail: React.FC<TalentDetailProps> = () => {
|
|
|
)}
|
|
)}
|
|
|
</ScrollView>
|
|
</ScrollView>
|
|
|
|
|
|
|
|
- {/* 底部操作按钮区域 - 原型第831-839行 */}
|
|
|
|
|
- {talentDetail && !isLoading && !hasError && (
|
|
|
|
|
- <View className="fixed bottom-0 left-0 right-0 p-4 bg-white border-t border-gray-200">
|
|
|
|
|
- <View className="flex space-x-3">
|
|
|
|
|
- {/* 联系按钮 */}
|
|
|
|
|
- <View
|
|
|
|
|
- className="flex-1 bg-blue-500 text-white py-3 rounded-lg font-medium flex items-center justify-center active:bg-blue-600"
|
|
|
|
|
- onClick={() => {
|
|
|
|
|
- // 联系功能:拨打电话或跳转
|
|
|
|
|
- if (talentDetail.phone) {
|
|
|
|
|
- Taro.makePhoneCall({
|
|
|
|
|
- phoneNumber: talentDetail.phone
|
|
|
|
|
- })
|
|
|
|
|
- } else {
|
|
|
|
|
- Taro.showToast({
|
|
|
|
|
- title: '暂无联系电话',
|
|
|
|
|
- icon: 'none'
|
|
|
|
|
- })
|
|
|
|
|
- }
|
|
|
|
|
- }}
|
|
|
|
|
- >
|
|
|
|
|
- <Text className="i-heroicons-phone-20-solid mr-2" />
|
|
|
|
|
- <Text>联系</Text>
|
|
|
|
|
- </View>
|
|
|
|
|
-
|
|
|
|
|
- {/* 编辑按钮 */}
|
|
|
|
|
- <View
|
|
|
|
|
- className="flex-1 bg-gray-100 text-gray-800 py-3 rounded-lg font-medium flex items-center justify-center active:bg-gray-200"
|
|
|
|
|
- onClick={() => {
|
|
|
|
|
- // 编辑功能:跳转编辑页面
|
|
|
|
|
- Taro.navigateTo({
|
|
|
|
|
- url: `/pages/yongren/talent/edit?id=${talentId}`
|
|
|
|
|
- })
|
|
|
|
|
- }}
|
|
|
|
|
- >
|
|
|
|
|
- <Text className="i-heroicons-pencil-square-20-solid mr-2" />
|
|
|
|
|
- <Text>编辑</Text>
|
|
|
|
|
- </View>
|
|
|
|
|
- </View>
|
|
|
|
|
- </View>
|
|
|
|
|
- )}
|
|
|
|
|
</PageContainer>
|
|
</PageContainer>
|
|
|
</YongrenTabBarLayout>
|
|
</YongrenTabBarLayout>
|
|
|
)
|
|
)
|