@tencent-rtc/trtc-agent-skills 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +172 -0
- package/README.zh.md +173 -0
- package/bin/cli.js +434 -0
- package/knowledge-base/index.yaml +454 -0
- package/knowledge-base/platform-slice-template.md +233 -0
- package/knowledge-base/scenario-spec.md +350 -0
- package/knowledge-base/scenarios/conference/base/general-conference.md +365 -0
- package/knowledge-base/scenarios/conference/base/webinar-conference.md +130 -0
- package/knowledge-base/scenarios/conference/medical/1v1-video-consultation.md +145 -0
- package/knowledge-base/scenarios/conference/medical/medical-multidoctor-consultation.md +113 -0
- package/knowledge-base/scenarios/live/entertainment-live-room.md +118 -0
- package/knowledge-base/slice-spec.md +546 -0
- package/knowledge-base/slices/conference/web/ai-tools.md +225 -0
- package/knowledge-base/slices/conference/web/beauty-effects.md +188 -0
- package/knowledge-base/slices/conference/web/device-control.md +338 -0
- package/knowledge-base/slices/conference/web/login-auth.md +261 -0
- package/knowledge-base/slices/conference/web/network-quality.md +190 -0
- package/knowledge-base/slices/conference/web/official-roomkit-api.md +298 -0
- package/knowledge-base/slices/conference/web/official-roomkit-login-ui.md +246 -0
- package/knowledge-base/slices/conference/web/participant-list.md +238 -0
- package/knowledge-base/slices/conference/web/participant-management.md +718 -0
- package/knowledge-base/slices/conference/web/prejoin-check.md +293 -0
- package/knowledge-base/slices/conference/web/room-call.md +213 -0
- package/knowledge-base/slices/conference/web/room-chat.md +426 -0
- package/knowledge-base/slices/conference/web/room-lifecycle.md +534 -0
- package/knowledge-base/slices/conference/web/room-schedule.md +281 -0
- package/knowledge-base/slices/conference/web/screen-share.md +211 -0
- package/knowledge-base/slices/conference/web/video-layout.md +675 -0
- package/knowledge-base/slices/conference/web/virtual-background.md +197 -0
- package/knowledge-base/slices/conference/web/webinar-interaction.md +206 -0
- package/knowledge-base/slices/live/anchor-lifecycle.md +122 -0
- package/knowledge-base/slices/live/anchor-preview.md +90 -0
- package/knowledge-base/slices/live/anchor-room-config.md +104 -0
- package/knowledge-base/slices/live/audience-list.md +86 -0
- package/knowledge-base/slices/live/audience-manage.md +92 -0
- package/knowledge-base/slices/live/audience-watch.md +85 -0
- package/knowledge-base/slices/live/audio.md +116 -0
- package/knowledge-base/slices/live/barrage.md +88 -0
- package/knowledge-base/slices/live/beauty.md +99 -0
- package/knowledge-base/slices/live/coguest-apply.md +105 -0
- package/knowledge-base/slices/live/device-control.md +91 -0
- package/knowledge-base/slices/live/error-codes.md +167 -0
- package/knowledge-base/slices/live/gift.md +84 -0
- package/knowledge-base/slices/live/ios/.gitkeep +0 -0
- package/knowledge-base/slices/live/ios/anchor-lifecycle.md +313 -0
- package/knowledge-base/slices/live/ios/anchor-preview.md +228 -0
- package/knowledge-base/slices/live/ios/anchor-room-config.md +257 -0
- package/knowledge-base/slices/live/ios/audience-list.md +353 -0
- package/knowledge-base/slices/live/ios/audience-manage.md +381 -0
- package/knowledge-base/slices/live/ios/audience-watch.md +286 -0
- package/knowledge-base/slices/live/ios/audio.md +373 -0
- package/knowledge-base/slices/live/ios/barrage.md +285 -0
- package/knowledge-base/slices/live/ios/beauty.md +323 -0
- package/knowledge-base/slices/live/ios/coguest-apply.md +506 -0
- package/knowledge-base/slices/live/ios/device-control.md +286 -0
- package/knowledge-base/slices/live/ios/error-codes.md +270 -0
- package/knowledge-base/slices/live/ios/gift.md +315 -0
- package/knowledge-base/slices/live/ios/live-list.md +269 -0
- package/knowledge-base/slices/live/ios/login-auth.md +247 -0
- package/knowledge-base/slices/live/live-list.md +82 -0
- package/knowledge-base/slices/live/login-auth.md +78 -0
- package/package.json +34 -0
- package/skills/trtc/SKILL.md +326 -0
- package/skills/trtc/room-builder/SKILL.md +138 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/README.md +108 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/docs/backend-contract.zh-CN.md +162 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/docs/integration.zh-CN.md +154 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/docs/theme.zh-CN.md +78 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/index.html +12 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/package.json +28 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/postcss.config.js +5 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/App.vue +25 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/components/ConsultationManagePanel.vue +838 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/components/LanguageSwitch.vue +102 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/components/LoadingSpinner.vue +6 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/components/MedicalAlert.vue +34 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/components/MedicalBusinessPanel.vue +148 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/components/MedicalButton.vue +49 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/components/MedicalConfirmDialog.vue +68 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/components/MedicalDataPanel.vue +196 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/components/MedicalRecordPanel.vue +270 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/components/PrescriptionPanel.vue +363 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/config/basic-info-config.ts +29 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/config/lib-generate-test-usersig-es.min.d.ts +4 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/config/lib-generate-test-usersig-es.min.js +2 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/config/runtime-config.ts +12 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/env.d.ts +32 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/features/consultation/components/ConsultationChatPanel.vue +123 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/features/consultation/components/ConsultationMembersPanel.vue +230 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/features/consultation/components/ConsultationTranscriptionPanel.vue +135 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/features/consultation/components/ConsultationVideoStage.vue +113 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/features/consultation/components/InviteDoctorDialog.vue +132 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/features/consultation/components/KickMemberConfirmDialog.vue +50 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/features/consultation/types.ts +77 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/features/consultation/useConsultationChat.ts +97 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/features/consultation/useConsultationDevices.ts +48 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/features/consultation/useConsultationParticipants.ts +121 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/features/consultation/useConsultationPermissions.ts +25 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/features/consultation/utils.ts +70 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/i18n/en-US/index.ts +553 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/i18n/index.ts +25 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/i18n/medicalTranslate.ts +85 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/i18n/state.ts +49 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/i18n/zh-CN/index.ts +463 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/main.ts +12 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/mock/appointments.ts +96 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/mock/users.ts +79 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/router/index.ts +63 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/services/adapters/index.ts +25 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/services/adapters/integration/appointmentService.ts +77 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/services/adapters/integration/authService.ts +38 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/services/adapters/integration/launchContext.ts +31 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/services/adapters/integration/userService.ts +35 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/services/adapters/mock/appointmentService.ts +43 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/services/adapters/mock/authService.ts +33 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/services/adapters/mock/userService.ts +43 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/services/adapters/types.ts +135 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/shared/icons.ts +53 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/styles/index.css +106 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/styles/tailwind.css +3 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/styles/theme.css +209 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/utils/auth.ts +50 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/utils/format.ts +24 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/utils/navigation.ts +12 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/utils/session.ts +28 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/views/DoctorConsultationView.vue +777 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/views/DoctorDashboardView.vue +678 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/views/LoginView.vue +441 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/views/PatientConsultationFinishedView.vue +185 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/views/PatientConsultationView.vue +1003 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/views/PatientSelectDoctorView.vue +317 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/views/PatientWaitingView.vue +454 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/tsconfig.json +21 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/tsconfig.node.json +8 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/vite.config.ts +17 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation//346/216/245/345/205/245/350/257/264/346/230/216.md +6 -0
- package/skills/trtc/room-builder/tools/render_ai_instructions.py +226 -0
- package/skills/trtc-apply/SKILL.md +97 -0
- package/skills/trtc-apply/guardrails/apply_lib/__init__.py +0 -0
- package/skills/trtc-apply/guardrails/apply_lib/__pycache__/__init__.cpython-313.pyc +0 -0
- package/skills/trtc-apply/guardrails/apply_lib/__pycache__/rule_parser.cpython-313.pyc +0 -0
- package/skills/trtc-apply/guardrails/apply_lib/rule_parser.py +268 -0
- package/skills/trtc-docs/SKILL.md +207 -0
- package/skills/trtc-onboarding/SKILL.md +839 -0
- package/skills/trtc-onboarding/reference/path-a1-demo.md +103 -0
- package/skills/trtc-onboarding/reference/path-a2-integrate.md +693 -0
- package/skills/trtc-onboarding/reference/path-b-troubleshoot.md +115 -0
- package/skills/trtc-onboarding/reference/path-c-expand.md +43 -0
- package/skills/trtc-onboarding/reference/reporting-protocol.md +174 -0
- package/skills/trtc-onboarding/reference/supported-matrix.md +100 -0
- package/skills/trtc-onboarding/reference/usersig-handling.md +140 -0
- package/skills/trtc-search/SKILL.md +221 -0
- package/skills/trtc-topic/SKILL.md +638 -0
- package/skills/trtc-topic/guardrails/__pycache__/gate_slice_read.cpython-313.pyc +0 -0
- package/skills/trtc-topic/guardrails/__pycache__/gate_slice_write.cpython-313.pyc +0 -0
- package/skills/trtc-topic/guardrails/__pycache__/stop_require_apply_evidence.cpython-313.pyc +0 -0
- package/skills/trtc-topic/guardrails/gate_slice_read.py +133 -0
- package/skills/trtc-topic/guardrails/gate_slice_write.py +169 -0
- package/skills/trtc-topic/guardrails/stop_require_apply_evidence.py +97 -0
- package/skills/trtc-topic/references/execution-units.yaml +58 -0
- package/skills/trtc-topic/runtime/README.md +50 -0
- package/skills/trtc-topic/runtime/RUNTIME.md +128 -0
- package/skills/trtc-topic/runtime/lib/__init__.py +0 -0
- package/skills/trtc-topic/runtime/lib/platforms.py +194 -0
- package/skills/trtc-topic/runtime/package-lock.json +1211 -0
- package/skills/trtc-topic/runtime/package.json +13 -0
- package/skills/trtc-topic/runtime/telemetry-bridge.mjs +339 -0
- package/skills/trtc-topic/runtime/telemetry_collector.py +293 -0
- package/skills/trtc-topic/scripts/STATE-MACHINE-GUIDE.md +186 -0
- package/skills/trtc-topic/scripts/__pycache__/apply.cpython-313.pyc +0 -0
- package/skills/trtc-topic/scripts/apply.py +581 -0
- package/skills/trtc-topic/scripts/finalize_session.py +113 -0
- package/skills/trtc-topic/scripts/init_slice_queue.py +96 -0
- package/skills/trtc-topic/scripts/lib/__pycache__/state_machine.cpython-313.pyc +0 -0
- package/skills/trtc-topic/scripts/lib/state_machine.py +328 -0
- package/skills/trtc-topic/scripts/next_slice.py +137 -0
- package/skills/trtc-topic/tests/README.md +70 -0
- package/skills/trtc-topic/tests/__pycache__/conftest.cpython-313-pytest-9.0.2.pyc +0 -0
- package/skills/trtc-topic/tests/__pycache__/conftest.cpython-313-pytest-9.0.3.pyc +0 -0
- package/skills/trtc-topic/tests/__pycache__/test_apply_cli.cpython-313-pytest-9.0.2.pyc +0 -0
- package/skills/trtc-topic/tests/__pycache__/test_apply_cli.cpython-313-pytest-9.0.3.pyc +0 -0
- package/skills/trtc-topic/tests/__pycache__/test_end_to_end.cpython-313-pytest-9.0.2.pyc +0 -0
- package/skills/trtc-topic/tests/__pycache__/test_end_to_end.cpython-313-pytest-9.0.3.pyc +0 -0
- package/skills/trtc-topic/tests/__pycache__/test_finalize_session.cpython-313-pytest-9.0.2.pyc +0 -0
- package/skills/trtc-topic/tests/__pycache__/test_finalize_session.cpython-313-pytest-9.0.3.pyc +0 -0
- package/skills/trtc-topic/tests/__pycache__/test_gates.cpython-313-pytest-9.0.2.pyc +0 -0
- package/skills/trtc-topic/tests/__pycache__/test_gates.cpython-313-pytest-9.0.3.pyc +0 -0
- package/skills/trtc-topic/tests/__pycache__/test_session_resolver.cpython-313-pytest-9.0.2.pyc +0 -0
- package/skills/trtc-topic/tests/__pycache__/test_session_resolver.cpython-313-pytest-9.0.3.pyc +0 -0
- package/skills/trtc-topic/tests/__pycache__/test_state_machine.cpython-313-pytest-9.0.2.pyc +0 -0
- package/skills/trtc-topic/tests/__pycache__/test_state_machine.cpython-313-pytest-9.0.3.pyc +0 -0
- package/skills/trtc-topic/tests/__pycache__/test_stop_require_apply.cpython-313-pytest-9.0.2.pyc +0 -0
- package/skills/trtc-topic/tests/__pycache__/test_stop_require_apply.cpython-313-pytest-9.0.3.pyc +0 -0
- package/skills/trtc-topic/tests/__pycache__/test_topic_skill_invariants.cpython-313-pytest-9.0.2.pyc +0 -0
- package/skills/trtc-topic/tests/__pycache__/test_topic_skill_invariants.cpython-313-pytest-9.0.3.pyc +0 -0
- package/skills/trtc-topic/tests/conftest.py +72 -0
- package/skills/trtc-topic/tests/test_apply_cli.py +480 -0
- package/skills/trtc-topic/tests/test_end_to_end.py +305 -0
- package/skills/trtc-topic/tests/test_finalize_session.py +51 -0
- package/skills/trtc-topic/tests/test_gates.py +316 -0
- package/skills/trtc-topic/tests/test_session_resolver.py +260 -0
- package/skills/trtc-topic/tests/test_state_machine.py +414 -0
- package/skills/trtc-topic/tests/test_stop_require_apply.py +99 -0
- package/skills/trtc-topic/tests/test_topic_skill_invariants.py +130 -0
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, onMounted, ref } from 'vue';
|
|
3
|
+
import { useRouter } from 'vue-router';
|
|
4
|
+
import { useUIKit } from '@tencentcloud/uikit-base-component-vue3';
|
|
5
|
+
import {
|
|
6
|
+
Award,
|
|
7
|
+
Search,
|
|
8
|
+
Star,
|
|
9
|
+
Stethoscope,
|
|
10
|
+
ThumbsUp,
|
|
11
|
+
Video,
|
|
12
|
+
LogOut,
|
|
13
|
+
} from '@/shared/icons';
|
|
14
|
+
import { useLoginState } from 'tuikit-atomicx-vue3';
|
|
15
|
+
import { services } from '@/services/adapters';
|
|
16
|
+
import { clearSession, getSessionUser } from '@/utils/session';
|
|
17
|
+
import MedicalButton from '@/components/MedicalButton.vue';
|
|
18
|
+
import LoadingSpinner from '@/components/LoadingSpinner.vue';
|
|
19
|
+
import LanguageSwitch from '@/components/LanguageSwitch.vue';
|
|
20
|
+
|
|
21
|
+
const router = useRouter();
|
|
22
|
+
const loginState = useLoginState();
|
|
23
|
+
const { t } = useUIKit();
|
|
24
|
+
const patient = computed(() => getSessionUser());
|
|
25
|
+
const searchQuery = ref('');
|
|
26
|
+
const selectingAppointmentId = ref('');
|
|
27
|
+
const loggingOut = ref(false);
|
|
28
|
+
|
|
29
|
+
const avatarGradientMap: Record<string, string> = {
|
|
30
|
+
doctor_li: 'from-[#0D9488] to-[#0F766E]',
|
|
31
|
+
doctor_wang: 'from-[#3B82F6] to-[#2563EB]',
|
|
32
|
+
doctor_zhang: 'from-[#8B5CF6] to-[#7C3AED]',
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const rawCards = computed(() => {
|
|
36
|
+
if (!patient.value) {
|
|
37
|
+
return [];
|
|
38
|
+
}
|
|
39
|
+
return services.appointment
|
|
40
|
+
.getAppointmentsByPatient(patient.value.userId)
|
|
41
|
+
.map(appointment => {
|
|
42
|
+
const doctor = services.user.getDoctorById(appointment.doctorId);
|
|
43
|
+
return {
|
|
44
|
+
appointment,
|
|
45
|
+
doctor,
|
|
46
|
+
status: doctor?.status ?? 'online',
|
|
47
|
+
};
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
const doctorCards = computed(() => {
|
|
52
|
+
const keyword = searchQuery.value.trim().toLowerCase();
|
|
53
|
+
return rawCards.value.filter(item => {
|
|
54
|
+
if (!keyword) {
|
|
55
|
+
return true;
|
|
56
|
+
}
|
|
57
|
+
const haystack = [
|
|
58
|
+
item.doctor?.userName,
|
|
59
|
+
item.doctor?.title,
|
|
60
|
+
item.doctor?.department,
|
|
61
|
+
item.doctor?.hospital,
|
|
62
|
+
...(item.doctor?.tags ?? []),
|
|
63
|
+
]
|
|
64
|
+
.filter(Boolean)
|
|
65
|
+
.join(' ')
|
|
66
|
+
.toLowerCase();
|
|
67
|
+
return haystack.includes(keyword);
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
function formatConsultations(value?: string) {
|
|
72
|
+
if (!value) {
|
|
73
|
+
return '-';
|
|
74
|
+
}
|
|
75
|
+
const raw = Number(value.replace(/,/g, ''));
|
|
76
|
+
if (Number.isNaN(raw)) {
|
|
77
|
+
return value;
|
|
78
|
+
}
|
|
79
|
+
return raw.toLocaleString('en-US');
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
async function selectDoctor(appointmentId: string) {
|
|
83
|
+
if (selectingAppointmentId.value) {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
selectingAppointmentId.value = appointmentId;
|
|
87
|
+
try {
|
|
88
|
+
await router.push(`/patient/waiting/${appointmentId}`);
|
|
89
|
+
} finally {
|
|
90
|
+
selectingAppointmentId.value = '';
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
async function logout() {
|
|
95
|
+
if (loggingOut.value) {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
loggingOut.value = true;
|
|
99
|
+
try {
|
|
100
|
+
await loginState.logout();
|
|
101
|
+
clearSession();
|
|
102
|
+
await router.replace('/login');
|
|
103
|
+
} finally {
|
|
104
|
+
loggingOut.value = false;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
onMounted(() => {
|
|
109
|
+
if (!patient.value || patient.value.role !== 'patient') {
|
|
110
|
+
router.replace('/login');
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
</script>
|
|
114
|
+
|
|
115
|
+
<template>
|
|
116
|
+
<div class="min-h-screen bg-gradient-to-b from-[#F8FAFB] to-[#E0F2F1]">
|
|
117
|
+
<div class="mx-auto w-full max-w-md">
|
|
118
|
+
<div class="bg-gradient-to-r from-[#0D9488] to-[#0F766E] pt-safe">
|
|
119
|
+
<div class="px-4 py-4">
|
|
120
|
+
<div class="flex items-center justify-between gap-3 mb-4">
|
|
121
|
+
<div class="flex items-center gap-3 min-w-0">
|
|
122
|
+
<div class="bg-white/20 backdrop-blur-sm p-2 rounded-xl">
|
|
123
|
+
<Stethoscope class="w-6 h-6 text-white" />
|
|
124
|
+
</div>
|
|
125
|
+
<div class="text-white min-w-0">
|
|
126
|
+
<h1 class="text-lg font-semibold leading-none truncate">
|
|
127
|
+
{{ t('Medical.Common.PlatformName') }}
|
|
128
|
+
</h1>
|
|
129
|
+
<p class="text-xs text-white/80 mt-1">
|
|
130
|
+
{{ t('Medical.PatientSelect.Subtitle') }}
|
|
131
|
+
</p>
|
|
132
|
+
</div>
|
|
133
|
+
</div>
|
|
134
|
+
<div class="flex items-center gap-2 shrink-0">
|
|
135
|
+
<LanguageSwitch />
|
|
136
|
+
<button
|
|
137
|
+
type="button"
|
|
138
|
+
@click="logout"
|
|
139
|
+
:disabled="loggingOut"
|
|
140
|
+
class="w-9 h-9 rounded-xl bg-white/15 text-white hover:bg-white/25 disabled:opacity-60 disabled:cursor-not-allowed inline-flex items-center justify-center transition-colors shrink-0"
|
|
141
|
+
:aria-label="t('Medical.PatientSelect.Logout')"
|
|
142
|
+
>
|
|
143
|
+
<LoadingSpinner v-if="loggingOut" />
|
|
144
|
+
<LogOut v-else class="w-4 h-4" />
|
|
145
|
+
</button>
|
|
146
|
+
</div>
|
|
147
|
+
</div>
|
|
148
|
+
|
|
149
|
+
<div class="relative">
|
|
150
|
+
<Search
|
|
151
|
+
:size="20"
|
|
152
|
+
class="absolute left-3 top-1/2 -translate-y-1/2 text-gray-400"
|
|
153
|
+
/>
|
|
154
|
+
<input
|
|
155
|
+
v-model="searchQuery"
|
|
156
|
+
type="text"
|
|
157
|
+
:placeholder="t('Medical.PatientSelect.SearchPlaceholder')"
|
|
158
|
+
class="w-full h-11 pl-11 pr-4 rounded-xl bg-white border-none shadow-sm text-[15px] text-[#0F172A] placeholder:text-[#94A3B8] focus:outline-none focus:ring-2 focus:ring-white/60"
|
|
159
|
+
/>
|
|
160
|
+
</div>
|
|
161
|
+
</div>
|
|
162
|
+
</div>
|
|
163
|
+
|
|
164
|
+
<div class="px-4 py-4 space-y-3 pb-safe">
|
|
165
|
+
<div
|
|
166
|
+
v-for="item in doctorCards"
|
|
167
|
+
:key="item.appointment.id"
|
|
168
|
+
class="border-none shadow-[0_2px_12px_rgba(0,0,0,0.06)] rounded-2xl overflow-hidden bg-white"
|
|
169
|
+
>
|
|
170
|
+
<div class="p-4">
|
|
171
|
+
<div class="flex items-start gap-3 mb-3">
|
|
172
|
+
<div class="relative shrink-0">
|
|
173
|
+
<div
|
|
174
|
+
:class="[
|
|
175
|
+
'w-16 h-16 rounded-full ring-2 ring-gray-100 bg-gradient-to-br text-white text-xl font-semibold flex items-center justify-center',
|
|
176
|
+
avatarGradientMap[item.doctor?.userId ?? 'doctor_li'],
|
|
177
|
+
]"
|
|
178
|
+
>
|
|
179
|
+
{{ item.doctor?.userName?.charAt(0) }}
|
|
180
|
+
</div>
|
|
181
|
+
<div
|
|
182
|
+
v-if="item.status === 'online'"
|
|
183
|
+
class="absolute -bottom-1 -right-1 w-5 h-5 bg-emerald-500 rounded-full border-2 border-white flex items-center justify-center"
|
|
184
|
+
>
|
|
185
|
+
<div class="w-2 h-2 bg-white rounded-full"></div>
|
|
186
|
+
</div>
|
|
187
|
+
</div>
|
|
188
|
+
|
|
189
|
+
<div class="flex-1 min-w-0">
|
|
190
|
+
<div class="flex items-center gap-2 mb-1">
|
|
191
|
+
<h3 class="font-semibold text-gray-900 text-lg leading-none">
|
|
192
|
+
{{ item.doctor?.userName }}
|
|
193
|
+
</h3>
|
|
194
|
+
<span
|
|
195
|
+
class="bg-[#0D9488]/10 text-[#0D9488] px-2 py-0 h-5 rounded-full text-xs font-medium inline-flex items-center"
|
|
196
|
+
>
|
|
197
|
+
{{
|
|
198
|
+
item.status === 'online'
|
|
199
|
+
? t('Medical.Common.Online')
|
|
200
|
+
: t('Medical.Common.Busy')
|
|
201
|
+
}}
|
|
202
|
+
</span>
|
|
203
|
+
</div>
|
|
204
|
+
<p class="text-sm text-gray-600 mb-1 leading-none">
|
|
205
|
+
{{ item.doctor?.title }} · {{ item.doctor?.department }}
|
|
206
|
+
</p>
|
|
207
|
+
<p class="text-xs text-gray-500 leading-none">
|
|
208
|
+
{{ item.doctor?.hospital }}
|
|
209
|
+
</p>
|
|
210
|
+
</div>
|
|
211
|
+
|
|
212
|
+
<div class="text-right shrink-0">
|
|
213
|
+
<div class="flex items-center justify-end gap-1 mb-1">
|
|
214
|
+
<Star class="w-4 h-4 fill-amber-400 text-amber-400" />
|
|
215
|
+
<span
|
|
216
|
+
class="text-sm leading-none font-semibold text-gray-900"
|
|
217
|
+
>
|
|
218
|
+
{{ item.doctor?.rating }}%
|
|
219
|
+
</span>
|
|
220
|
+
</div>
|
|
221
|
+
<p class="text-xs leading-none text-gray-500">
|
|
222
|
+
{{ t('Medical.PatientSelect.Satisfaction') }}
|
|
223
|
+
</p>
|
|
224
|
+
</div>
|
|
225
|
+
</div>
|
|
226
|
+
|
|
227
|
+
<div class="flex gap-2 mb-3 flex-wrap">
|
|
228
|
+
<span
|
|
229
|
+
v-for="tag in item.doctor?.tags ?? []"
|
|
230
|
+
:key="tag"
|
|
231
|
+
class="px-3 py-1 bg-gray-50 text-gray-700 rounded-full text-xs leading-none"
|
|
232
|
+
>
|
|
233
|
+
{{ tag }}
|
|
234
|
+
</span>
|
|
235
|
+
</div>
|
|
236
|
+
|
|
237
|
+
<div
|
|
238
|
+
class="flex items-center gap-4 mb-4 py-3 px-4 bg-gray-50 rounded-xl"
|
|
239
|
+
>
|
|
240
|
+
<div class="flex items-center gap-2">
|
|
241
|
+
<Award class="w-4 h-4 text-[#0D9488]" />
|
|
242
|
+
<div>
|
|
243
|
+
<p class="text-xs leading-none text-gray-500 mb-1">
|
|
244
|
+
{{ t('Medical.PatientSelect.Experience') }}
|
|
245
|
+
</p>
|
|
246
|
+
<p class="text-sm leading-none font-semibold text-gray-900">
|
|
247
|
+
{{ item.doctor?.experience }}
|
|
248
|
+
</p>
|
|
249
|
+
</div>
|
|
250
|
+
</div>
|
|
251
|
+
<div class="w-px h-8 bg-gray-200"></div>
|
|
252
|
+
<div class="flex items-center gap-2">
|
|
253
|
+
<ThumbsUp class="w-4 h-4 text-[#0D9488]" />
|
|
254
|
+
<div>
|
|
255
|
+
<p class="text-xs leading-none text-gray-500 mb-1">
|
|
256
|
+
{{ t('Medical.PatientSelect.Consultations') }}
|
|
257
|
+
</p>
|
|
258
|
+
<p class="text-sm leading-none font-semibold text-gray-900">
|
|
259
|
+
{{ formatConsultations(item.doctor?.consultations) }}
|
|
260
|
+
</p>
|
|
261
|
+
</div>
|
|
262
|
+
</div>
|
|
263
|
+
</div>
|
|
264
|
+
|
|
265
|
+
<div class="flex items-center justify-between">
|
|
266
|
+
<div>
|
|
267
|
+
<p class="text-xs leading-none text-gray-500 mb-1">
|
|
268
|
+
{{ t('Medical.PatientSelect.VideoConsultation') }}
|
|
269
|
+
</p>
|
|
270
|
+
<div class="flex items-end gap-1">
|
|
271
|
+
<span
|
|
272
|
+
class="text-2xl leading-none font-semibold text-[#0D9488]"
|
|
273
|
+
>
|
|
274
|
+
¥{{ item.doctor?.price }}
|
|
275
|
+
</span>
|
|
276
|
+
<span class="text-xs leading-none text-gray-500 mb-1">
|
|
277
|
+
{{ t('Medical.PatientSelect.PerConsultation') }}
|
|
278
|
+
</span>
|
|
279
|
+
</div>
|
|
280
|
+
</div>
|
|
281
|
+
<MedicalButton
|
|
282
|
+
@click="selectDoctor(item.appointment.id)"
|
|
283
|
+
:disabled="!!selectingAppointmentId"
|
|
284
|
+
:loading="selectingAppointmentId === item.appointment.id"
|
|
285
|
+
class="shadow-lg shadow-teal-500/20"
|
|
286
|
+
>
|
|
287
|
+
<Video
|
|
288
|
+
v-if="selectingAppointmentId !== item.appointment.id"
|
|
289
|
+
class="w-4 h-4"
|
|
290
|
+
/>
|
|
291
|
+
{{
|
|
292
|
+
selectingAppointmentId === item.appointment.id
|
|
293
|
+
? t('Medical.Common.Entering')
|
|
294
|
+
: t('Medical.PatientSelect.StartConsultation')
|
|
295
|
+
}}
|
|
296
|
+
</MedicalButton>
|
|
297
|
+
</div>
|
|
298
|
+
</div>
|
|
299
|
+
</div>
|
|
300
|
+
</div>
|
|
301
|
+
|
|
302
|
+
<div
|
|
303
|
+
class="fixed bottom-0 left-1/2 -translate-x-1/2 w-full max-w-md bg-white border-t border-gray-100 px-4 py-3 pb-safe shadow-[0_-2px_10px_rgba(0,0,0,0.04)]"
|
|
304
|
+
>
|
|
305
|
+
<div
|
|
306
|
+
class="flex items-center justify-center gap-2 text-xs text-gray-500"
|
|
307
|
+
>
|
|
308
|
+
<div class="w-1.5 h-1.5 bg-emerald-500 rounded-full"></div>
|
|
309
|
+
<span
|
|
310
|
+
>{{ t('Medical.Common.SecureLink') }} ·
|
|
311
|
+
{{ t('Medical.Common.SceneTemplate') }}</span
|
|
312
|
+
>
|
|
313
|
+
</div>
|
|
314
|
+
</div>
|
|
315
|
+
</div>
|
|
316
|
+
</div>
|
|
317
|
+
</template>
|