feat: AI评估、个人中心、开始训练页面

This commit is contained in:
王天骄
2026-06-08 16:39:10 +08:00
parent 23550c3828
commit 2bfd15ba5e
50 changed files with 4038 additions and 981 deletions
+837
View File
@@ -0,0 +1,837 @@
<template>
<view class="analysis-page">
<view class="analysis-shell">
<header class="top-bar">
<button class="icon-button" aria-label="返回" @click="goBack">
<view class="back-icon"></view>
</button>
<text class="page-title">智能分析</text>
<button class="icon-button" aria-label="分享" @click="showToast('分享功能即将开放')">
<view class="share-icon"></view>
</button>
</header>
<scroll-view class="analysis-scroll" scroll-y>
<view class="analysis-main">
<view class="fade-section" :class="{ visible: fadeVisible }">
<view class="summary-card">
<view class="summary-copy">
<view class="summary-head">
<text class="summary-label">当前能力评分</text>
<view class="trend-chip">
<view class="trend-icon"></view>
<text>+12%</text>
</view>
</view>
<text class="summary-score">84.5</text>
<text class="summary-desc">相较于上周您的临床推理能力有显著提升</text>
</view>
</view>
</view>
<view class="fade-section" :class="{ visible: fadeVisible }">
<view class="chart-card">
<view class="section-head">
<text class="section-title">近期分数趋势</text>
<view class="section-icon">
<view class="chart-icon"></view>
</view>
</view>
<view class="bar-chart">
<view
v-for="item in trendItems"
:key="item.label"
class="bar-column"
>
<view class="bar-track">
<view
class="bar-fill"
:class="{ highlighted: item.highlight }"
:style="{ height: item.height }"
></view>
</view>
<text class="bar-label" :class="{ active: item.highlight }">{{ item.label }}</text>
</view>
</view>
</view>
</view>
<view class="fade-section" :class="{ visible: fadeVisible }">
<view class="chart-card">
<view class="section-head">
<text class="section-title">临床胜任力雷达图</text>
<view class="section-icon">
<view class="radar-icon"></view>
</view>
</view>
<view class="radar-wrap">
<view class="radar-background">
<view class="radar-ring ring-one"></view>
<view class="radar-ring ring-two"></view>
<view class="radar-ring ring-three"></view>
<view class="radar-ring ring-four"></view>
<view class="radar-axis axis-vertical"></view>
<view class="radar-axis axis-diagonal-one"></view>
<view class="radar-axis axis-diagonal-two"></view>
<view class="radar-axis axis-diagonal-three"></view>
<view class="radar-axis axis-diagonal-four"></view>
</view>
<view class="radar-label label-top">病史采集</view>
<view class="radar-label label-right-top">体格检查</view>
<view class="radar-label label-right-bottom">诊断能力</view>
<view class="radar-label label-bottom">治疗决策</view>
<view class="radar-label label-left-bottom">沟通技巧</view>
<view class="radar-label label-left-top">临床推理</view>
<svg class="radar-svg" viewBox="0 0 100 100">
<polygon
class="radar-polygon"
points="50,15 85,35 80,75 50,85 25,70 20,40"
></polygon>
<circle cx="50" cy="15" r="3"></circle>
<circle cx="85" cy="35" r="3"></circle>
<circle cx="80" cy="75" r="3"></circle>
<circle cx="50" cy="85" r="3"></circle>
<circle cx="25" cy="70" r="3"></circle>
<circle cx="20" cy="40" r="3"></circle>
</svg>
</view>
<view class="analysis-note">
<text>您的</text>
<text class="strong-text">诊断能力</text>
<text></text>
<text class="strong-text">治疗决策</text>
<text>表现突出</text>
<text class="secondary-text">病史采集</text>
<text>仍有提升空间建议增加相关模拟训练</text>
</view>
</view>
</view>
<view class="fade-section" :class="{ visible: fadeVisible }">
<text class="mini-title">分项提升建议</text>
<view class="suggestion-list">
<view class="suggestion-card" @click="showToast('重点回顾内容即将开放')">
<view class="suggestion-icon-wrap secondary-tone">
<view class="book-icon"></view>
</view>
<view class="suggestion-copy">
<text class="suggestion-title">重点回顾心血管查体</text>
<text class="suggestion-desc">基于您最近在心衰案例中的表现</text>
</view>
<view class="chevron-icon"></view>
</view>
<view class="suggestion-card" @click="showToast('专项挑战即将开放')">
<view class="suggestion-icon-wrap tertiary-tone">
<view class="brain-icon"></view>
</view>
<view class="suggestion-copy">
<text class="suggestion-title">临床思维专项挑战</text>
<text class="suggestion-desc">推荐参与难度等级高级</text>
</view>
<view class="chevron-icon"></view>
</view>
</view>
</view>
<view class="fade-section mentor-section" :class="{ visible: fadeVisible }">
<view class="mentor-card">
<view class="mentor-head">
<image class="mentor-avatar" src="/static/config-doctor.png" mode="aspectFill"></image>
<view>
<text class="mentor-name">王主任的建议</text>
<text class="mentor-role">Director's Mentorship</text>
</view>
</view>
<view class="mentor-bubble">
<text>“你的进步非常扎实。今天休息一下,明天我们来挑战一个更复杂的病例如何?”</text>
</view>
</view>
</view>
</view>
</scroll-view>
</view>
</view>
</template>
<script setup lang="ts">
import { onMounted, onUnmounted, ref } from 'vue'
const trendItems = [
{ label: '周一', height: '60%', highlight: false },
{ label: '周二', height: '70%', highlight: false },
{ label: '周三', height: '65%', highlight: false },
{ label: '周四', height: '80%', highlight: false },
{ label: '周五', height: '85%', highlight: true },
{ label: '周六', height: '90%', highlight: false },
{ label: '周日', height: '95%', highlight: false }
]
const fadeVisible = ref(false)
const toastMessage = ref('')
const toastVisible = ref(false)
let fadeTimer: ReturnType<typeof setTimeout> | null = null
let toastTimer: ReturnType<typeof setTimeout> | null = null
function goBack() {
if (typeof getCurrentPages === 'function' && getCurrentPages().length > 1) {
uni.navigateBack()
return
}
uni.reLaunch({
url: '/pages/profile/profile'
})
}
function showToast(message: string) {
if (toastTimer) clearTimeout(toastTimer)
toastMessage.value = message
toastVisible.value = true
uni.showToast({
title: message,
icon: 'none'
})
toastTimer = setTimeout(() => {
toastVisible.value = false
}, 2200)
}
onMounted(() => {
fadeTimer = setTimeout(() => {
fadeVisible.value = true
}, 60)
})
onUnmounted(() => {
if (fadeTimer) clearTimeout(fadeTimer)
if (toastTimer) clearTimeout(toastTimer)
})
</script>
<style scoped>
page {
min-height: 100%;
background: #f9f9ff;
}
.analysis-page {
min-height: 100vh;
background: #f9f9ff;
color: #191c21;
font-family: Inter, -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
-webkit-tap-highlight-color: transparent;
}
.analysis-shell {
position: relative;
width: 380px;
max-width: 100vw;
min-height: 922px;
margin: 0 auto;
background: #f9f9ff;
overflow: hidden;
display: flex;
flex-direction: column;
}
.analysis-page view,
.analysis-page text,
.analysis-page button,
.analysis-page scroll-view {
box-sizing: border-box;
}
.analysis-page ::-webkit-scrollbar {
width: 0;
height: 0;
background: transparent;
}
.top-bar {
position: sticky;
top: 0;
z-index: 50;
height: 56px;
padding: 0 16px;
border-bottom: 1px solid rgba(194, 198, 212, 0.3);
background: rgba(249, 249, 255, 0.82);
backdrop-filter: blur(12px);
-webkit-backdrop-filter: blur(12px);
display: flex;
align-items: center;
justify-content: space-between;
flex: 0 0 auto;
}
.page-title {
color: #00478d;
font-size: 20px;
line-height: 28px;
font-weight: 600;
letter-spacing: 0;
}
.icon-button {
width: 40px;
height: 40px;
padding: 0;
border: 0;
border-radius: 50%;
background: transparent;
display: flex;
align-items: center;
justify-content: center;
}
.icon-button::after {
border: 0;
}
.icon-button:active {
background: rgba(225, 226, 234, 0.5);
}
.back-icon,
.share-icon,
.trend-icon,
.chart-icon,
.radar-icon,
.book-icon,
.brain-icon,
.chevron-icon {
background: #00478d;
-webkit-mask-position: center;
-webkit-mask-repeat: no-repeat;
-webkit-mask-size: contain;
mask-position: center;
mask-repeat: no-repeat;
mask-size: contain;
}
.back-icon {
width: 24px;
height: 24px;
-webkit-mask-image: url("data:image/svg+xml,%3Csvg%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3E%3Cpath%20d='M20%2011H7.83l5.59-5.59L12%204l-8%208%208%208%201.42-1.41L7.83%2013H20v-2z'/%3E%3C/svg%3E");
mask-image: url("data:image/svg+xml,%3Csvg%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3E%3Cpath%20d='M20%2011H7.83l5.59-5.59L12%204l-8%208%208%208%201.42-1.41L7.83%2013H20v-2z'/%3E%3C/svg%3E");
}
.share-icon {
width: 22px;
height: 22px;
-webkit-mask-image: url("data:image/svg+xml,%3Csvg%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3E%3Cpath%20d='M18%2016.08c-.76%200-1.44.3-1.96.77L8.91%2012.7c.05-.23.09-.46.09-.7s-.04-.47-.09-.7l7.05-4.11A2.99%202.99%200%201%200%2015%205c0%20.24.04.47.09.7L8.04%209.81A3%203%200%201%200%208.04%2014l7.12%204.18c-.05.21-.08.43-.08.65a2.92%202.92%200%201%200%202.92-2.75z'/%3E%3C/svg%3E");
mask-image: url("data:image/svg+xml,%3Csvg%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3E%3Cpath%20d='M18%2016.08c-.76%200-1.44.3-1.96.77L8.91%2012.7c.05-.23.09-.46.09-.7s-.04-.47-.09-.7l7.05-4.11A2.99%202.99%200%201%200%2015%205c0%20.24.04.47.09.7L8.04%209.81A3%203%200%201%200%208.04%2014l7.12%204.18c-.05.21-.08.43-.08.65a2.92%202.92%200%201%200%202.92-2.75z'/%3E%3C/svg%3E");
}
.analysis-scroll {
flex: 1 1 auto;
min-height: 0;
}
.analysis-main {
max-width: 390px;
margin: 0 auto;
padding: 24px 16px 96px;
display: flex;
flex-direction: column;
gap: 24px;
}
.fade-section {
opacity: 0;
transform: translateY(10px);
transition: 0.4s ease-out;
}
.fade-section.visible {
opacity: 1;
transform: translateY(0);
}
.summary-card,
.chart-card,
.mentor-card {
border: 1px solid rgba(194, 198, 212, 0.3);
border-radius: 8px;
background: #ffffff;
box-shadow: 0 1px 4px rgba(25, 28, 33, 0.04);
}
.summary-card {
padding: 24px;
background: #005eb8;
color: #c8daff;
}
.summary-head {
display: flex;
align-items: flex-start;
justify-content: space-between;
margin-bottom: 4px;
}
.summary-label {
font-size: 12px;
line-height: 16px;
font-weight: 500;
}
.summary-score {
display: block;
font-size: 32px;
line-height: 40px;
font-weight: 700;
color: #ffffff;
}
.summary-desc {
color: rgba(255, 255, 255, 0.8);
font-size: 14px;
line-height: 20px;
}
.trend-chip {
min-height: 24px;
padding: 0 8px;
border-radius: 8px;
background: #00478d;
color: #ffffff;
font-size: 12px;
line-height: 16px;
font-weight: 500;
display: flex;
align-items: center;
gap: 4px;
}
.trend-icon {
width: 16px;
height: 16px;
background: #ffffff;
-webkit-mask-image: url("data:image/svg+xml,%3Csvg%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3E%3Cpath%20d='M16%206l2.29%202.29-4.88%204.88-4-4L2%2016.59%203.41%2018l6-6%204%204%206.3-6.29L22%2012V6h-6z'/%3E%3C/svg%3E");
mask-image: url("data:image/svg+xml,%3Csvg%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3E%3Cpath%20d='M16%206l2.29%202.29-4.88%204.88-4-4L2%2016.59%203.41%2018l6-6%204%204%206.3-6.29L22%2012V6h-6z'/%3E%3C/svg%3E");
}
.section-head {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 16px;
}
.section-title {
color: #191c21;
font-size: 20px;
line-height: 28px;
font-weight: 600;
letter-spacing: 0;
}
.section-icon {
width: 24px;
height: 24px;
display: flex;
align-items: center;
justify-content: center;
}
.chart-icon {
width: 18px;
height: 18px;
-webkit-mask-image: url("data:image/svg+xml,%3Csvg%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3E%3Cpath%20d='M3%203h2v18H3V3zm16%207h2v11h-2V10zM8%2013h2v8H8v-8zm5-6h2v14h-2V7z'/%3E%3C/svg%3E");
mask-image: url("data:image/svg+xml,%3Csvg%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3E%3Cpath%20d='M3%203h2v18H3V3zm16%207h2v11h-2V10zM8%2013h2v8H8v-8zm5-6h2v14h-2V7z'/%3E%3C/svg%3E");
}
.radar-icon {
width: 18px;
height: 18px;
-webkit-mask-image: url("data:image/svg+xml,%3Csvg%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3E%3Cpath%20d='M12%202a10%2010%200%201%200%200%2020%2010%2010%200%200%200%200-20zm4.9%203.1l1.4%201.4-3.1%203.1-2.2-2.2 3.9-2.3zm-9.8%200l3.9%202.3-2.2%202.2-3.1-3.1%201.4-1.4zM12%207a5%205%200%201%201%200%2010%205%205%200%200%201%200-10zm6.9%202.1l.1%201.9-4.2.3-.2-3.1%204.3.9zM5.1%209.1l4.3-.9-.2%203.1-4.2-.3.1-1.9zM7.2%2016.8l2.2-2.2%203.1%203.1-1.9%201.1-3.4-2zM16.8%2016.8l-3.4%202-1.9-1.1%203.1-3.1%202.2%202.2z'/%3E%3C/svg%3E");
mask-image: url("data:image/svg+xml,%3Csvg%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3E%3Cpath%20d='M12%202a10%2010%200%201%200%200%2020%2010%2010%200%200%200%200-20zm4.9%203.1l1.4%201.4-3.1%203.1-2.2-2.2 3.9-2.3zm-9.8%200l3.9%202.3-2.2%202.2-3.1-3.1%201.4-1.4zM12%207a5%205%200%201%201%200%2010%205%205%200%200%201%200-10zm6.9%202.1l.1%201.9-4.2.3-.2-3.1%204.3.9zM5.1%209.1l4.3-.9-.2%203.1-4.2-.3.1-1.9zM7.2%2016.8l2.2-2.2%203.1%203.1-1.9%201.1-3.4-2zM16.8%2016.8l-3.4%202-1.9-1.1%203.1-3.1%202.2%202.2z'/%3E%3C/svg%3E");
}
.chart-card,
.mentor-card {
padding: 20px;
}
.bar-chart {
height: 200px;
display: flex;
align-items: flex-end;
gap: 8px;
}
.bar-column {
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
gap: 8px;
}
.bar-track {
width: 100%;
height: 160px;
display: flex;
align-items: flex-end;
}
.bar-fill {
width: 100%;
border-radius: 8px 8px 0 0;
background: #d6e3ff;
transition: height 0.6s ease;
}
.bar-fill.highlighted {
background: #00478d;
box-shadow: 0 0 0 2px rgba(0, 71, 141, 0.08);
}
.bar-label {
color: #424752;
font-size: 12px;
line-height: 16px;
font-weight: 500;
}
.bar-label.active {
color: #00478d;
font-weight: 700;
}
.radar-wrap {
position: relative;
height: 300px;
}
.radar-background {
position: absolute;
inset: 0;
display: flex;
align-items: center;
justify-content: center;
}
.radar-ring {
position: absolute;
border: 1px solid rgba(194, 198, 212, 0.2);
border-radius: 50%;
}
.ring-one {
width: 240px;
height: 240px;
}
.ring-two {
width: 160px;
height: 160px;
}
.ring-three {
width: 80px;
height: 80px;
}
.ring-four {
width: 40px;
height: 40px;
}
.radar-axis {
position: absolute;
width: 1px;
height: 240px;
background: rgba(194, 198, 212, 0.2);
}
.axis-vertical {
transform: rotate(0deg);
}
.axis-diagonal-one {
transform: rotate(60deg);
}
.axis-diagonal-two {
transform: rotate(120deg);
}
.axis-diagonal-three {
transform: rotate(180deg);
}
.axis-diagonal-four {
transform: rotate(240deg);
}
.radar-label {
position: absolute;
color: #424752;
font-size: 16px;
line-height: 24px;
font-weight: 500;
letter-spacing: 0;
}
.label-top {
top: -2px;
left: 50%;
transform: translateX(-50%);
}
.label-right-top {
top: 78px;
right: 0;
}
.label-right-bottom {
top: 186px;
right: 6px;
}
.label-bottom {
bottom: 0;
left: 50%;
transform: translateX(-50%);
}
.label-left-bottom {
top: 186px;
left: 12px;
}
.label-left-top {
top: 78px;
left: 0;
}
.radar-svg {
position: absolute;
left: 50%;
top: 50%;
width: 240px;
height: 240px;
transform: translate(-50%, -50%);
}
.radar-svg polygon {
fill: rgba(0, 71, 141, 0.15);
stroke: #00478d;
stroke-width: 2;
}
.radar-svg circle {
fill: #00478d;
}
.analysis-note {
margin-top: 16px;
padding-top: 16px;
border-top: 1px solid rgba(194, 198, 212, 0.3);
color: #424752;
font-size: 14px;
line-height: 22px;
}
.strong-text {
color: #00478d;
font-weight: 700;
}
.secondary-text {
color: #006970;
font-weight: 700;
}
.mini-title {
display: block;
margin-bottom: 12px;
color: #727783;
font-size: 12px;
line-height: 16px;
font-weight: 500;
letter-spacing: 0;
}
.suggestion-list {
display: flex;
flex-direction: column;
gap: 12px;
}
.suggestion-card {
padding: 16px;
border: 1px solid #c2c6d4;
border-radius: 8px;
background: #ffffff;
display: flex;
align-items: center;
gap: 16px;
}
.suggestion-card:active {
transform: scale(0.99);
}
.suggestion-icon-wrap {
width: 48px;
height: 48px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
flex: 0 0 auto;
}
.secondary-tone {
background: #7af1fc;
color: #006970;
}
.tertiary-tone {
background: #ffdbcb;
color: #793100;
}
.book-icon,
.brain-icon {
width: 22px;
height: 22px;
}
.book-icon {
background: #006970;
-webkit-mask-image: url("data:image/svg+xml,%3Csvg%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3E%3Cpath%20d='M18%202H6a2%202%200%200%200-2%202v14a2%202%200%200%200%202%202h12a2%202%200%200%200%202-2V4a2%202%200%200%200-2-2zM8%206h8v2H8V6zm0%204h8v2H8v-2zm0%204h5v2H8v-2z'/%3E%3C/svg%3E");
mask-image: url("data:image/svg+xml,%3Csvg%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3E%3Cpath%20d='M18%202H6a2%202%200%200%200-2%202v14a2%202%200%200%200%202%202h12a2%202%200%200%200%202-2V4a2%202%200%200%200-2-2zM8%206h8v2H8V6zm0%204h8v2H8v-2zm0%204h5v2H8v-2z'/%3E%3C/svg%3E");
}
.brain-icon {
background: #793100;
-webkit-mask-image: url("data:image/svg+xml,%3Csvg%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3E%3Cpath%20d='M10 3a4 4 0 0 0-4 4v1H5a3 3 0 0 0 0 6h1v1a4 4 0 0 0 4 4h1V3h-1zm4 0v16h1a4 4 0 0 0 4-4v-1h1a3 3 0 0 0 0-6h-1V7a4 4 0 0 0-4-4h-1z'/%3E%3C/svg%3E");
mask-image: url("data:image/svg+xml,%3Csvg%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3E%3Cpath%20d='M10 3a4 4 0 0 0-4 4v1H5a3 3 0 0 0 0 6h1v1a4 4 0 0 0 4 4h1V3h-1zm4 0v16h1a4 4 0 0 0 4-4v-1h1a3 3 0 0 0 0-6h-1V7a4 4 0 0 0-4-4h-1z'/%3E%3C/svg%3E");
}
.suggestion-copy {
flex: 1;
display: flex;
flex-direction: column;
gap: 4px;
}
.suggestion-title {
color: #191c21;
font-size: 14px;
line-height: 20px;
font-weight: 600;
}
.suggestion-desc {
color: #424752;
font-size: 13px;
line-height: 18px;
}
.chevron-icon {
width: 24px;
height: 24px;
background: #424752;
-webkit-mask-image: url("data:image/svg+xml,%3Csvg%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3E%3Cpath%20d='M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6-6-6z'/%3E%3C/svg%3E");
mask-image: url("data:image/svg+xml,%3Csvg%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3E%3Cpath%20d='M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6-6-6z'/%3E%3C/svg%3E");
}
.mentor-section {
padding: 0;
border: 0;
box-shadow: none;
background: transparent;
}
.mentor-card {
padding: 16px;
background: #e7e8f0;
}
.mentor-head {
margin-bottom: 12px;
display: flex;
align-items: center;
gap: 12px;
}
.mentor-avatar {
width: 56px;
height: 56px;
border: 2px solid #ffffff;
border-radius: 50%;
box-shadow: 0 1px 4px rgba(25, 28, 33, 0.12);
}
.mentor-name {
display: block;
color: #00478d;
font-size: 14px;
line-height: 20px;
font-weight: 700;
}
.mentor-role {
color: #424752;
font-size: 10px;
line-height: 14px;
}
.mentor-bubble {
position: relative;
padding: 16px;
border: 1px solid rgba(0, 71, 141, 0.05);
border-radius: 8px;
background: #ffffff;
box-shadow: 0 1px 4px rgba(25, 28, 33, 0.04);
color: #191c21;
font-size: 14px;
line-height: 22px;
font-style: italic;
}
.mentor-bubble::before {
content: '';
position: absolute;
left: 24px;
top: -7px;
width: 12px;
height: 12px;
border-left: 1px solid rgba(0, 71, 141, 0.05);
border-top: 1px solid rgba(0, 71, 141, 0.05);
background: #ffffff;
transform: rotate(45deg);
}
.analysis-page .analysis-main .fade-section {
opacity: 1;
transform: translateY(0);
}
.analysis-page .analysis-main .fade-section:first-child {
padding-top: 0;
}
@media (min-width: 768px) {
.analysis-page {
display: flex;
justify-content: center;
background: #d8dae2;
}
.analysis-shell {
box-shadow: 0 24px 64px rgba(25, 28, 33, 0.18);
border-left: 1px solid #c2c6d4;
border-right: 1px solid #c2c6d4;
}
}
</style>
+591
View File
@@ -0,0 +1,591 @@
<template>
<view class="records-page">
<view class="records-shell">
<header class="top-bar">
<button class="icon-button" aria-label="返回" @click="goBack">
<view class="back-icon"></view>
</button>
<text class="page-title">学习记录</text>
<button class="icon-button muted" aria-label="设置" @click="showToast('记录筛选设置即将开放')">
<view class="settings-icon"></view>
</button>
</header>
<scroll-view class="records-scroll" scroll-y>
<main class="records-main">
<section class="stats-grid">
<view
v-for="stat in stats"
:key="stat.label"
class="stat-card"
>
<text class="stat-label">{{ stat.label }}</text>
<text class="stat-value" :class="{ secondary: stat.secondary }">{{ stat.value }}</text>
</view>
</section>
<section class="search-section">
<view class="search-field">
<view class="search-icon"></view>
<input
v-model="keyword"
class="search-input"
placeholder="搜索病例标题或科室..."
placeholder-class="search-placeholder"
type="text"
/>
</view>
</section>
<section class="history-section">
<text class="section-title">最近训练</text>
<view class="record-list">
<view
v-for="record in filteredRecords"
:key="record.title"
class="record-card"
:class="{ dimmed: record.dimmed }"
@click="openReport"
>
<view class="case-icon-wrap" :class="record.tone">
<text class="case-icon-text">{{ record.abbr }}</text>
</view>
<view class="case-copy">
<text class="case-title">{{ record.title }}</text>
<view class="case-meta">
<text>{{ record.department }}</text>
<text class="dot"></text>
<text>{{ record.date }}</text>
</view>
</view>
<view class="score-block">
<view class="score-row">
<text class="score-value">{{ record.score }}</text>
<text class="score-unit"></text>
</view>
<button class="report-button" @click.stop="openReport">
<text>查看报告</text>
<view class="small-chevron"></view>
</button>
</view>
</view>
<view v-if="filteredRecords.length === 0" class="empty-state">
<text>没有找到匹配的训练记录</text>
</view>
</view>
</section>
<view class="bottom-hint">
<text>已经到底啦</text>
</view>
</main>
</scroll-view>
<view class="toast" :class="{ visible: toastVisible }">{{ toastMessage }}</view>
</view>
</view>
</template>
<script setup lang="ts">
import { computed, onUnmounted, ref } from 'vue'
const keyword = ref('')
const toastMessage = ref('')
const toastVisible = ref(false)
let toastTimer: ReturnType<typeof setTimeout> | null = null
const stats = [
{ label: '总病例', value: '12' },
{ label: '总时长', value: '128h' },
{ label: '平均正确率', value: '92%', secondary: true }
]
const records = [
{
title: '急性心肌梗死',
department: '心内科',
date: '2023-11-20',
score: '98',
abbr: '心',
tone: 'primary'
},
{
title: '缺血性脑卒中',
department: '神经内科',
date: '2023-11-18',
score: '85',
abbr: '神',
tone: 'secondary'
},
{
title: '重症肺炎伴呼吸衰竭',
department: '呼吸科',
date: '2023-11-15',
score: '92',
abbr: '肺',
tone: 'tertiary'
},
{
title: '急性胰腺炎',
department: '消化内科',
date: '2023-11-12',
score: '78',
abbr: '消',
tone: 'primary',
dimmed: true
},
{
title: '糖尿病肾病五期',
department: '肾内科',
date: '2023-11-10',
score: '95',
abbr: '肾',
tone: 'secondary',
dimmed: true
}
]
const filteredRecords = computed(() => {
const query = keyword.value.trim()
if (!query) return records
return records.filter(record => {
return [record.title, record.department, record.date].some(value => value.includes(query))
})
})
function goBack() {
if (typeof getCurrentPages === 'function' && getCurrentPages().length > 1) {
uni.navigateBack()
return
}
uni.reLaunch({
url: '/pages/profile/profile'
})
}
function openReport() {
uni.navigateTo({
url: '/pages/assessment/assessment'
})
}
function showToast(message: string) {
if (toastTimer) clearTimeout(toastTimer)
toastMessage.value = message
toastVisible.value = true
uni.showToast({
title: message,
icon: 'none'
})
toastTimer = setTimeout(() => {
toastVisible.value = false
}, 2200)
}
onUnmounted(() => {
if (toastTimer) clearTimeout(toastTimer)
})
</script>
<style scoped>
page {
min-height: 100%;
background: #f9f9ff;
}
.records-page {
min-height: 100vh;
background: #f9f9ff;
color: #191c21;
font-family: Inter, -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
-webkit-tap-highlight-color: transparent;
}
.records-shell {
position: relative;
width: 390px;
max-width: 100vw;
min-height: 884px;
margin: 0 auto;
background: #f9f9ff;
overflow: hidden;
display: flex;
flex-direction: column;
}
.records-page view,
.records-page text,
.records-page button,
.records-page input,
.records-page scroll-view {
box-sizing: border-box;
}
.records-page ::-webkit-scrollbar {
width: 0;
height: 0;
background: transparent;
}
.top-bar {
position: sticky;
top: 0;
z-index: 50;
height: 64px;
padding: 0 20px;
border-bottom: 1px solid #c2c6d4;
background: #f9f9ff;
box-shadow: 0 1px 4px rgba(25, 28, 33, 0.04);
display: flex;
align-items: center;
justify-content: space-between;
flex: 0 0 auto;
}
.page-title {
color: #00478d;
font-size: 20px;
line-height: 28px;
font-weight: 600;
letter-spacing: 0;
}
.icon-button,
.report-button {
padding: 0;
border: 0;
background: transparent;
}
.icon-button::after,
.report-button::after {
border: 0;
}
.icon-button {
width: 40px;
height: 40px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 50%;
}
.icon-button:active,
.record-card:active {
transform: scale(0.98);
}
.back-icon,
.settings-icon,
.search-icon,
.small-chevron {
background: #00478d;
-webkit-mask-position: center;
-webkit-mask-repeat: no-repeat;
-webkit-mask-size: contain;
mask-position: center;
mask-repeat: no-repeat;
mask-size: contain;
}
.back-icon {
width: 24px;
height: 24px;
-webkit-mask-image: url("data:image/svg+xml,%3Csvg%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3E%3Cpath%20d='M20%2011H7.83l5.59-5.59L12%204l-8%208%208%208%201.42-1.41L7.83%2013H20v-2z'/%3E%3C/svg%3E");
mask-image: url("data:image/svg+xml,%3Csvg%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3E%3Cpath%20d='M20%2011H7.83l5.59-5.59L12%204l-8%208%208%208%201.42-1.41L7.83%2013H20v-2z'/%3E%3C/svg%3E");
}
.settings-icon {
width: 24px;
height: 24px;
background: #424752;
-webkit-mask-image: url("data:image/svg+xml,%3Csvg%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3E%3Cpath%20d='M19.43%2012.98c.04-.32.07-.65.07-.98s-.02-.66-.07-.98l2.11-1.65c.19-.15.24-.42.12-.64l-2-3.46a.5.5%200%200%200-.61-.22l-2.49%201a7.28%207.28%200%200%200-1.69-.98L14.5%202.42A.49.49%200%200%200%2014%202h-4a.49.49%200%200%200-.49.42L9.13%205.07c-.61.23-1.18.55-1.69.98l-2.49-1a.5.5%200%200%200-.61.22l-2%203.46c-.13.22-.07.49.12.64l2.11%201.65c-.04.32-.08.65-.08.98s.03.66.08.98l-2.11%201.65c-.19.15-.24.42-.12.64l2%203.46c.14.22.4.31.61.22l2.49-1c.51.4%201.08.73%201.69.98l.38%202.65c.04.24.25.42.49.42h4c.24%200%20.45-.18.49-.42l.38-2.65c.61-.25%201.18-.58%201.69-.98l2.49%201c.22.08.48%200%20.61-.22l2-3.46a.5.5%200%200%200-.12-.64l-2.11-1.65zM12%2015.5A3.5%203.5%200%201%201%2012%208a3.5%203.5%200%200%201%200%207.5z'/%3E%3C/svg%3E");
mask-image: url("data:image/svg+xml,%3Csvg%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3E%3Cpath%20d='M19.43%2012.98c.04-.32.07-.65.07-.98s-.02-.66-.07-.98l2.11-1.65c.19-.15.24-.42.12-.64l-2-3.46a.5.5%200%200%200-.61-.22l-2.49%201a7.28%207.28%200%200%200-1.69-.98L14.5%202.42A.49.49%200%200%200%2014%202h-4a.49.49%200%200%200-.49.42L9.13%205.07c-.61.23-1.18.55-1.69.98l-2.49-1a.5.5%200%200%200-.61.22l-2%203.46c-.13.22-.07.49.12.64l2.11%201.65c-.04.32-.08.65-.08.98s.03.66.08.98l-2.11%201.65c-.19.15-.24.42-.12.64l2%203.46c.14.22.4.31.61.22l2.49-1c.51.4%201.08.73%201.69.98l.38%202.65c.04.24.25.42.49.42h4c.24%200%20.45-.18.49-.42l.38-2.65c.61-.25%201.18-.58%201.69-.98l2.49%201c.22.08.48%200%20.61-.22l2-3.46a.5.5%200%200%200-.12-.64l-2.11-1.65zM12%2015.5A3.5%203.5%200%201%201%2012%208a3.5%203.5%200%200%201%200%207.5z'/%3E%3C/svg%3E");
}
.records-scroll {
flex: 1 1 auto;
min-height: 0;
}
.records-main {
padding: 20px 20px 32px;
display: flex;
flex-direction: column;
gap: 24px;
}
.stats-grid {
display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr));
gap: 12px;
}
.stat-card {
min-height: 96px;
padding: 16px 8px;
border: 1px solid #c2c6d4;
border-radius: 8px;
background: #ffffff;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
text-align: center;
}
.stat-label {
margin-bottom: 8px;
color: #424752;
font-size: 12px;
line-height: 16px;
font-weight: 500;
}
.stat-value {
color: #00478d;
font-size: 20px;
line-height: 28px;
font-weight: 600;
}
.stat-value.secondary {
color: #006970;
}
.search-field {
position: relative;
min-height: 48px;
display: flex;
align-items: center;
}
.search-icon {
position: absolute;
left: 16px;
z-index: 1;
width: 22px;
height: 22px;
background: #727783;
-webkit-mask-image: url("data:image/svg+xml,%3Csvg%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3E%3Cpath%20d='M9.5%203A6.5%206.5%200%200%200%209.5%2016a6.47%206.47%200%200%200%204.03-1.39l4.43%204.43%201.41-1.41-4.43-4.43A6.47%206.47%200%200%200%2016%209.5%206.5%206.5%200%200%200%209.5%203zm0%202A4.5%204.5%200%201%201%209.5%2014%204.5%204.5%200%200%201%209.5%205z'/%3E%3C/svg%3E");
mask-image: url("data:image/svg+xml,%3Csvg%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3E%3Cpath%20d='M9.5%203A6.5%206.5%200%200%200%209.5%2016a6.47%206.47%200%200%200%204.03-1.39l4.43%204.43%201.41-1.41-4.43-4.43A6.47%206.47%200%200%200%2016%209.5%206.5%206.5%200%200%200%209.5%203zm0%202A4.5%204.5%200%201%201%209.5%2014%204.5%204.5%200%200%201%209.5%205z'/%3E%3C/svg%3E");
}
.search-input {
width: 100%;
height: 48px;
padding: 0 16px 0 48px;
border: 1px solid #c2c6d4;
border-radius: 24px;
background: #f2f3fb;
color: #191c21;
font-size: 16px;
line-height: 24px;
}
.search-placeholder {
color: #727783;
}
.history-section {
display: flex;
flex-direction: column;
gap: 16px;
}
.section-title {
padding: 0 4px;
color: #424752;
font-size: 14px;
line-height: 20px;
font-weight: 600;
letter-spacing: 0;
}
.record-list {
display: flex;
flex-direction: column;
gap: 16px;
}
.record-card {
min-height: 80px;
padding: 16px;
border: 1px solid #c2c6d4;
border-radius: 8px;
background: #ffffff;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
display: flex;
align-items: center;
gap: 16px;
transition: transform 0.15s ease, opacity 0.15s ease;
}
.record-card.dimmed {
opacity: 0.88;
}
.case-icon-wrap {
width: 48px;
height: 48px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
flex: 0 0 auto;
}
.case-icon-wrap.primary {
background: #005eb8;
color: #c8daff;
}
.case-icon-wrap.secondary {
background: #7af1fc;
color: #006e75;
}
.case-icon-wrap.tertiary {
background: #ffdbcb;
color: #793100;
}
.case-icon-text {
font-size: 18px;
line-height: 24px;
font-weight: 700;
}
.case-copy {
min-width: 0;
flex: 1 1 auto;
display: flex;
flex-direction: column;
gap: 4px;
}
.case-title {
max-width: 132px;
color: #191c21;
font-size: 14px;
line-height: 20px;
font-weight: 600;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.case-meta {
display: flex;
align-items: center;
gap: 8px;
min-width: 0;
color: #424752;
font-size: 12px;
line-height: 16px;
font-weight: 500;
}
.dot {
font-size: 10px;
opacity: 0.4;
}
.score-block {
flex: 0 0 auto;
display: flex;
flex-direction: column;
align-items: flex-end;
gap: 4px;
}
.score-row {
display: flex;
align-items: baseline;
gap: 4px;
}
.score-value {
color: #00478d;
font-size: 20px;
line-height: 28px;
font-weight: 600;
}
.score-unit {
color: #424752;
font-size: 12px;
line-height: 16px;
font-weight: 500;
}
.report-button {
color: #00478d;
display: flex;
align-items: center;
font-size: 12px;
line-height: 16px;
font-weight: 500;
}
.small-chevron {
width: 16px;
height: 16px;
margin-left: 4px;
-webkit-mask-image: url("data:image/svg+xml,%3Csvg%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3E%3Cpath%20d='M10%206L8.59%207.41%2013.17%2012l-4.58%204.59L10%2018l6-6-6-6z'/%3E%3C/svg%3E");
mask-image: url("data:image/svg+xml,%3Csvg%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3E%3Cpath%20d='M10%206L8.59%207.41%2013.17%2012l-4.58%204.59L10%2018l6-6-6-6z'/%3E%3C/svg%3E");
}
.empty-state {
min-height: 96px;
border: 1px dashed #c2c6d4;
border-radius: 8px;
background: #f2f3fb;
color: #727783;
font-size: 14px;
line-height: 20px;
display: flex;
align-items: center;
justify-content: center;
}
.bottom-hint {
padding: 16px 0 4px;
color: #727783;
font-size: 12px;
line-height: 16px;
font-weight: 500;
text-align: center;
}
.toast {
position: absolute;
left: 50%;
bottom: 24px;
z-index: 80;
max-width: 300px;
padding: 8px 12px;
border-radius: 12px;
background: rgba(46, 48, 55, 0.9);
color: #eff0f8;
font-size: 12px;
line-height: 16px;
opacity: 0;
pointer-events: none;
transform: translate(-50%, 8px);
transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.visible {
opacity: 1;
transform: translate(-50%, 0);
}
</style>
+739 -590
View File
File diff suppressed because it is too large Load Diff