Browse Source

卡片交互修复与费用显示统一

ligao 1 month ago
parent
commit
ed5359d414

+ 33 - 27
src/cards/AppointmentSuccessCard.vue

@@ -9,31 +9,15 @@
     <div class="success-subtitle">联调演示</div>
 
     <div class="appt-grid">
-      <div class="appt-cell" v-if="patientName">
-        <div class="lb">患者</div>
-        <div class="vl">{{ patientName }}</div>
+      <div
+        v-for="(item, idx) in gridItems"
+        :key="item.label"
+        :class="['appt-cell', { full: isLastOddCell(idx) }]"
+      >
+        <div class="lb">{{ item.label }}</div>
+        <div :class="['vl', { hl: item.highlight }]">{{ item.value }}</div>
       </div>
-      <div class="appt-cell" v-if="departmentName">
-        <div class="lb">科室</div>
-        <div class="vl">{{ departmentName }}</div>
-      </div>
-      <div class="appt-cell" v-if="doctorDisplay">
-        <div class="lb">医生</div>
-        <div class="vl">{{ doctorDisplay }}</div>
-      </div>
-      <div class="appt-cell" v-if="visitDate">
-        <div class="lb">就诊日期</div>
-        <div class="vl hl">{{ visitDate }}</div>
-      </div>
-      <div class="appt-cell" v-if="visitTime">
-        <div class="lb">时段</div>
-        <div class="vl">{{ visitTime }}</div>
-      </div>
-      <div class="appt-cell" v-if="room">
-        <div class="lb">诊室</div>
-        <div class="vl">{{ room }}</div>
-      </div>
-      <div class="appt-cell full" v-if="queueNo">
+      <div v-if="queueNo" class="appt-cell full">
         <div class="lb">就诊序号</div>
         <div class="vl queue-no">{{ queueNo }}</div>
       </div>
@@ -68,11 +52,33 @@ const doctorDisplay = computed(() => {
   const title = (data.value.doctorTitle as string) || store.selection.doctorTitle || '';
   return name ? (name + (title ? ` ${title}` : '')) : '';
 });
-const visitDate = computed(() => (data.value.visitDate as string) || (data.value.visitTime as string) || '');
+const visitDate = computed(() => (data.value.visitDate as string) || '');
 const visitTime = computed(() => (data.value.timePeriod as string) || store.selection.timePeriod || '');
-const room = computed(() => (data.value.room as string) || '');
-const queueNo = computed(() => (data.value.queueNo as string) || (data.value.appointmentNo as string) || '');
+const room = computed(() => (data.value.room as string) || store.selection.room || '');
+const queueNo = computed(() => (data.value.queueNo as string) || '');
 const appointmentNo = computed(() => (data.value.appointmentNo as string) || (data.value.appointmentNoStr as string) || '');
+
+interface GridItem {
+  label: string;
+  value: string;
+  highlight?: boolean;
+}
+
+const gridItems = computed<GridItem[]>(() => {
+  const items: GridItem[] = [];
+  if (patientName.value) items.push({ label: '患者', value: patientName.value });
+  if (departmentName.value) items.push({ label: '科室', value: departmentName.value });
+  if (doctorDisplay.value) items.push({ label: '医生', value: doctorDisplay.value });
+  if (visitDate.value) items.push({ label: '就诊日期', value: visitDate.value, highlight: true });
+  if (visitTime.value) items.push({ label: '时段', value: visitTime.value });
+  if (room.value) items.push({ label: '诊室', value: room.value });
+  return items;
+});
+
+function isLastOddCell(index: number) {
+  const total = gridItems.value.length;
+  return total % 2 === 1 && index === total - 1;
+}
 </script>
 
 <style scoped>

+ 1 - 1
src/cards/ConfirmAppointmentCard.vue

@@ -64,7 +64,7 @@ const doctorDisplay = computed(() => {
 });
 
 const room = computed(() => store.selection.room || summaryObj.value.room || '');
-const amount = computed(() => summaryObj.value.amount ?? props.card.cardData.amount ?? '25.00');
+const amount = computed(() => summaryObj.value.amount ?? props.card.cardData.amountYuan ?? props.card.cardData.amount ?? '');
 </script>
 
 <style scoped>

+ 1 - 1
src/cards/TimeSlotSelectionCard.vue

@@ -38,7 +38,7 @@ interface SlotOption {
 }
 
 const slots = computed(() => (props.card.cardData.slots as SlotOption[]) ?? []);
-const amount = computed(() => props.card.cardData.amountYuan ?? props.card.cardData.amount ?? '25.00');
+const amount = computed(() => props.card.cardData.amountYuan ?? props.card.cardData.amount ?? '');
 const doctorName = computed(() => store.selection.doctorName || props.card.cardData.doctorName as string || '');
 const room = computed(() => store.selection.room || props.card.cardData.room as string || '');