fix(miniprogram): 修复多角色找茬测试 V3 发现的 8 个问题
1. EmptyState 默认 emoji 📭 → serif 首字圆形图标(影响 23 处使用)
2. 预约页英文副标题 "Appointment" 移除
3. consultation 页技术错误信息直接渲染到 UI → 用户友好提示
4. auth store restore() 增加 fallback:secureGet 失败时读 wx.getStorageSync
5. request.ts 新增 safeGet():token/tenantId 读取容错
6. doctor/consultation useMemo 自引用死循环 → Math.ceil(total/20)
7. doctor/alerts 同样自引用 bug 修复
8. doctor/patients 死代码 totalPages + useMemo import 清理
This commit is contained in:
@@ -90,7 +90,6 @@ export default function AppointmentList() {
|
||||
{/* 页面标题 */}
|
||||
<View className='page-header'>
|
||||
<Text className='page-title'>预约挂号</Text>
|
||||
<Text className='page-subtitle'>Appointment</Text>
|
||||
</View>
|
||||
|
||||
{/* 预约列表 */}
|
||||
|
||||
@@ -52,9 +52,8 @@ export default function Consultation() {
|
||||
}
|
||||
setTotal(resp.total || 0);
|
||||
setPage(pageNum);
|
||||
} catch (e: unknown) {
|
||||
const msg = e instanceof Error ? e.message : '加载失败';
|
||||
setError(msg);
|
||||
} catch {
|
||||
setError('加载失败,请稍后重试');
|
||||
} finally {
|
||||
setLoading(false);
|
||||
loadingRef.current = false;
|
||||
|
||||
@@ -34,7 +34,7 @@ export default function AlertList() {
|
||||
const [total, setTotal] = useState(0);
|
||||
const [page, setPage] = useState(1);
|
||||
|
||||
const totalPages = useMemo(() => totalPages, [total]);
|
||||
const totalPages = useMemo(() => Math.ceil(total / 20), [total]);
|
||||
|
||||
useEffect(() => {
|
||||
loadAlerts();
|
||||
|
||||
@@ -22,7 +22,7 @@ export default function ConsultationList() {
|
||||
const [total, setTotal] = useState(0);
|
||||
const [page, setPage] = useState(1);
|
||||
|
||||
const totalPages = useMemo(() => totalPages, [total]);
|
||||
const totalPages = useMemo(() => Math.ceil(total / 20), [total]);
|
||||
|
||||
useEffect(() => {
|
||||
loadSessions();
|
||||
|
||||
@@ -95,8 +95,6 @@ export default function PatientList() {
|
||||
return `${age}岁`;
|
||||
};
|
||||
|
||||
const totalPages = useMemo(() => Math.ceil(total / 20), [total]);
|
||||
|
||||
if (loading && patients.length === 0) return <Loading />;
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user