|
|
@ -11,6 +11,7 @@ import { |
|
|
} from 'react-native'; |
|
|
} from 'react-native'; |
|
|
import { SafeAreaView } from 'react-native-safe-area-context'; |
|
|
import { SafeAreaView } from 'react-native-safe-area-context'; |
|
|
import { useEnterpriseOverview } from '../../src/hooks'; |
|
|
import { useEnterpriseOverview } from '../../src/hooks'; |
|
|
|
|
|
import { useRole } from '../../src/context/RoleContext'; |
|
|
import { colors, headerGradient } from '../../src/theme'; |
|
|
import { colors, headerGradient } from '../../src/theme'; |
|
|
import type { EnterpriseOverview, EnterpriseQuickAction, EnterpriseStat, JobEvaluationSummary, MenuItem } from '../../src/types'; |
|
|
import type { EnterpriseOverview, EnterpriseQuickAction, EnterpriseStat, JobEvaluationSummary, MenuItem } from '../../src/types'; |
|
|
|
|
|
|
|
|
@ -223,6 +224,36 @@ function MenuList({ items }: { items: MenuItem[] }) { |
|
|
); |
|
|
); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/* ===================== 子组件:切换到求职端卡片 ===================== */ |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 企业端「我的」页回切求职端,与求职端「切换到企业端」卡片对称, |
|
|
|
|
|
* 避免经「设置→身份切换」进入企业端后返回栈为空、回不去求职端。 |
|
|
|
|
|
*/ |
|
|
|
|
|
function CandidateEntryCard() { |
|
|
|
|
|
const router = useRouter(); |
|
|
|
|
|
const { setRole } = useRole(); |
|
|
|
|
|
return ( |
|
|
|
|
|
<Pressable |
|
|
|
|
|
style={styles.candidateCard} |
|
|
|
|
|
onPress={() => { |
|
|
|
|
|
setRole('candidate'); |
|
|
|
|
|
router.replace('/(tabs)/jobs'); |
|
|
|
|
|
}} |
|
|
|
|
|
hitSlop={4} |
|
|
|
|
|
> |
|
|
|
|
|
<View style={styles.candidateIconWrap}> |
|
|
|
|
|
<Ionicons name="person-outline" size={22} color={colors.primary} /> |
|
|
|
|
|
</View> |
|
|
|
|
|
<View style={styles.candidateText}> |
|
|
|
|
|
<Text style={styles.candidateTitle}>切换到求职端</Text> |
|
|
|
|
|
<Text style={styles.candidateDesc}>返回求职者端,浏览岗位与你的竞争力数据</Text> |
|
|
|
|
|
</View> |
|
|
|
|
|
<Text style={styles.candidateAction}>去求职端 →</Text> |
|
|
|
|
|
</Pressable> |
|
|
|
|
|
); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/* ===================== 页面主组件 ===================== */ |
|
|
/* ===================== 页面主组件 ===================== */ |
|
|
|
|
|
|
|
|
export default function EnterpriseOverviewScreen() { |
|
|
export default function EnterpriseOverviewScreen() { |
|
|
@ -254,6 +285,7 @@ export default function EnterpriseOverviewScreen() { |
|
|
</SafeAreaView> |
|
|
</SafeAreaView> |
|
|
</LinearGradient> |
|
|
</LinearGradient> |
|
|
<ScrollView style={styles.scroll} contentContainerStyle={styles.scrollContent}> |
|
|
<ScrollView style={styles.scroll} contentContainerStyle={styles.scrollContent}> |
|
|
|
|
|
<CandidateEntryCard /> |
|
|
<StatGrid stats={overview.stats} /> |
|
|
<StatGrid stats={overview.stats} /> |
|
|
<QuickActions actions={overview.quickActions} /> |
|
|
<QuickActions actions={overview.quickActions} /> |
|
|
<JobEvaluationList jobs={overview.jobEvaluations} /> |
|
|
<JobEvaluationList jobs={overview.jobEvaluations} /> |
|
|
@ -520,4 +552,45 @@ const styles = StyleSheet.create({ |
|
|
fontWeight: '500', |
|
|
fontWeight: '500', |
|
|
color: colors.textPrimary, |
|
|
color: colors.textPrimary, |
|
|
}, |
|
|
}, |
|
|
|
|
|
candidateCard: { |
|
|
|
|
|
flexDirection: 'row', |
|
|
|
|
|
alignItems: 'center', |
|
|
|
|
|
backgroundColor: colors.white, |
|
|
|
|
|
borderRadius: 16, |
|
|
|
|
|
padding: 16, |
|
|
|
|
|
marginBottom: 16, |
|
|
|
|
|
shadowColor: colors.shadow, |
|
|
|
|
|
shadowOffset: { width: 0, height: 2 }, |
|
|
|
|
|
shadowOpacity: 0.04, |
|
|
|
|
|
shadowRadius: 6, |
|
|
|
|
|
elevation: 2, |
|
|
|
|
|
}, |
|
|
|
|
|
candidateIconWrap: { |
|
|
|
|
|
width: 44, |
|
|
|
|
|
height: 44, |
|
|
|
|
|
borderRadius: 12, |
|
|
|
|
|
backgroundColor: colors.primaryLight, |
|
|
|
|
|
justifyContent: 'center', |
|
|
|
|
|
alignItems: 'center', |
|
|
|
|
|
marginRight: 12, |
|
|
|
|
|
}, |
|
|
|
|
|
candidateText: { |
|
|
|
|
|
flex: 1, |
|
|
|
|
|
}, |
|
|
|
|
|
candidateTitle: { |
|
|
|
|
|
fontSize: 15, |
|
|
|
|
|
fontWeight: '600', |
|
|
|
|
|
color: colors.textPrimary, |
|
|
|
|
|
marginBottom: 2, |
|
|
|
|
|
}, |
|
|
|
|
|
candidateDesc: { |
|
|
|
|
|
fontSize: 12, |
|
|
|
|
|
color: colors.textSecondary, |
|
|
|
|
|
}, |
|
|
|
|
|
candidateAction: { |
|
|
|
|
|
fontSize: 13, |
|
|
|
|
|
fontWeight: '600', |
|
|
|
|
|
color: colors.primary, |
|
|
|
|
|
marginLeft: 8, |
|
|
|
|
|
}, |
|
|
}); |
|
|
}); |
|
|
|