import { Linking, Pressable, StyleSheet, Text, View } from 'react-native'; import { colors } from '../../../src/theme'; import { SUPERVISION_PHONE, SUPPORT_HOTLINE } from '../../../src/constants'; /** * 合规页脚:服务热线 / 举报监督电话。 * * 原先是三行纯文本,没号码也没点击反馈(P1 与 P2Q 各复制一份)。 * 这里改为读常量:**号码未配置时整块不渲染** —— 号码属于真实主体信息, * 编一个摆上去就是假数据。填入 `SUPPORT_HOTLINE` / `SUPERVISION_PHONE` 后 * 页脚自动出现并支持点击拨号。 */ export function SupportFooter() { const items = [ { key: 'hotline', label: '服务热线', phone: SUPPORT_HOTLINE }, { key: 'supervision', label: '举报监督电话', phone: SUPERVISION_PHONE }, ].filter((item) => item.phone !== ''); if (items.length === 0) return null; /** 设备不支持 tel:(如平板 / 模拟器)时 openURL 会 reject,不弹未捕获异常 */ const call = (phone: string) => { void Linking.openURL(`tel:${phone}`).catch(() => undefined); }; return ( {items.map((item) => ( call(item.phone)} hitSlop={6}> {item.label} {item.phone} ))} ); } const styles = StyleSheet.create({ // 两串「标签 + 11 位号码」在窄屏上会挤,允许换行 row: { flexDirection: 'row', flexWrap: 'wrap', justifyContent: 'center', gap: 18 }, item: { fontSize: 12, color: colors.textHint }, });