fix(health): 修复患者端咨询权限+聊天页UI+SVG模板警告
- consultation_handler: create_message/mark_session_read 从 .manage 降为 .list, 患者端只有 list 权限,导致发送消息和标记已读 403 - consultation.ts: 同步后端 DTO doctor_name/patient_name 等缺失字段 - messages/index.tsx: 咨询卡片显示医生姓名替代 consultation_type - consultation/index.tsx: 同步显示 doctor_name - pkg-consultation/detail: 按原型重写聊天页(医生头像+在线状态+非对称气泡+药丸输入栏) - ProgressRing: SVG 替换为 conic-gradient 纯 CSS,消除 tmpl_0_svg 模板警告 - usePageData: stopPullDownRefresh 加 try-catch 防止 DevTools fd race
This commit is contained in:
@@ -4,9 +4,30 @@
|
||||
position: relative;
|
||||
flex-shrink: 0;
|
||||
|
||||
&__center {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
&--sm {
|
||||
width: 64px;
|
||||
height: 64px;
|
||||
}
|
||||
|
||||
&--lg {
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
}
|
||||
|
||||
&__track {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
&__inner {
|
||||
width: calc(100% - 8px);
|
||||
height: calc(100% - 8px);
|
||||
border-radius: 50%;
|
||||
background: $card;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
@@ -15,39 +15,24 @@ const ProgressRing: React.FC<ProgressRingProps> = ({
|
||||
label,
|
||||
className = '',
|
||||
}) => {
|
||||
const px = size === 'sm' ? 64 : 80;
|
||||
const r = (px / 2) - 4;
|
||||
const circumference = 2 * Math.PI * r;
|
||||
const offset = circumference * (1 - Math.min(progress, 1));
|
||||
const pct = Math.round(Math.min(progress, 1) * 100);
|
||||
const deg = (pct / 100) * 360;
|
||||
|
||||
const cls = ['progress-ring', `progress-ring--${size}`, className].filter(Boolean).join(' ');
|
||||
|
||||
return (
|
||||
<View className={cls} style={{ width: px, height: px }}>
|
||||
<svg width={px} height={px} viewBox={`0 0 ${px} ${px}`}>
|
||||
<circle
|
||||
cx={px / 2} cy={px / 2} r={r}
|
||||
fill='none'
|
||||
stroke='var(--tk-pri-l, #E8E2DC)'
|
||||
strokeWidth={4}
|
||||
/>
|
||||
<circle
|
||||
cx={px / 2} cy={px / 2} r={r}
|
||||
fill='none'
|
||||
stroke='var(--tk-pri)'
|
||||
strokeWidth={4}
|
||||
strokeDasharray={circumference}
|
||||
strokeDashoffset={offset}
|
||||
strokeLinecap='round'
|
||||
transform={`rotate(-90 ${px / 2} ${px / 2})`}
|
||||
/>
|
||||
</svg>
|
||||
<View className='progress-ring__center'>
|
||||
{label ? (
|
||||
<Text className='progress-ring__label'>{label}</Text>
|
||||
) : (
|
||||
<Text className='progress-ring__pct'>{Math.round(progress * 100)}%</Text>
|
||||
)}
|
||||
<View className={cls}>
|
||||
<View
|
||||
className='progress-ring__track'
|
||||
style={{ background: `conic-gradient(var(--tk-pri) ${deg}deg, var(--tk-pri-l, #E8E2DC) ${deg}deg)` }}
|
||||
>
|
||||
<View className='progress-ring__inner'>
|
||||
{label ? (
|
||||
<Text className='progress-ring__label'>{label}</Text>
|
||||
) : (
|
||||
<Text className='progress-ring__pct'>{pct}%</Text>
|
||||
)}
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user