WXL
18 小时以前 05c363fdd7ab04e3bd9a753e2c5d5bfff04d681c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
"use strict";
const common_vendor = require("../../common/vendor.js");
const _sfc_main = {
  __name: "schedule",
  setup(__props) {
    const doctor = common_vendor.ref({
      name: "张医生",
      title: "主任医师",
      avatar: "/static/doctor/doctor1.jpg",
      specialty: "擅长:冠心病、心律失常、高血压等心血管疾病的诊治",
      department: "心内科",
      fee: 100
    });
    const availableDates = [
      { value: "2024-03-21", week: "周四", day: "21", month: "3" },
      { value: "2024-03-22", week: "周五", day: "22", month: "3" },
      { value: "2024-03-23", week: "周六", day: "23", month: "3" },
      { value: "2024-03-24", week: "周日", day: "24", month: "3" },
      { value: "2024-03-25", week: "周一", day: "25", month: "3" }
    ];
    const availableTimes = [
      { value: "0900", label: "09:00", count: 10 },
      { value: "0930", label: "09:30", count: 8 },
      { value: "1000", label: "10:00", count: 5 },
      { value: "1030", label: "10:30", disabled: true },
      { value: "1100", label: "11:00", count: 3 }
    ];
    const patients = [
      { id: 1, name: "张三", idCard: "1234567890", relation: "本人" },
      { id: 2, name: "张小明", idCard: "0987654321", relation: "子女" }
    ];
    const selectedDate = common_vendor.ref("");
    const selectedTime = common_vendor.ref("");
    const selectedPatient = common_vendor.ref(null);
    const canSubmit = common_vendor.computed(() => {
      return selectedDate.value && selectedTime.value && selectedPatient.value;
    });
    const selectDate = (date) => {
      selectedDate.value = date;
    };
    const selectTime = (time) => {
      if (!time.disabled) {
        selectedTime.value = time.value;
      }
    };
    const selectPatient = (patientId) => {
      selectedPatient.value = patientId;
    };
    const addNewPatient = () => {
      common_vendor.index.navigateTo({
        url: "/pages/patient/add"
      });
    };
    const submitAppointment = () => {
      if (!canSubmit.value)
        return;
      common_vendor.index.showLoading({
        title: "提交中..."
      });
      setTimeout(() => {
        common_vendor.index.hideLoading();
        common_vendor.index.showModal({
          title: "预约成功",
          content: "您的挂号预约已提交成功",
          showCancel: false,
          success: () => {
            common_vendor.index.navigateTo({
              url: `/pages/payment/index?orderId=123456`
            });
          }
        });
      }, 1500);
    };
    return (_ctx, _cache) => {
      return {
        a: doctor.value.avatar,
        b: common_vendor.t(doctor.value.name),
        c: common_vendor.t(doctor.value.title),
        d: common_vendor.t(doctor.value.specialty),
        e: common_vendor.t(doctor.value.department),
        f: common_vendor.f(availableDates, (date, index, i0) => {
          return {
            a: common_vendor.t(date.week),
            b: common_vendor.t(date.day),
            c: common_vendor.t(date.month),
            d: index,
            e: selectedDate.value === date.value ? 1 : "",
            f: common_vendor.o(($event) => selectDate(date.value), index)
          };
        }),
        g: common_vendor.f(availableTimes, (time, index, i0) => {
          return common_vendor.e({
            a: common_vendor.t(time.label),
            b: !time.disabled
          }, !time.disabled ? {
            c: common_vendor.t(time.count)
          } : {}, {
            d: index,
            e: selectedTime.value === time.value ? 1 : "",
            f: time.disabled ? 1 : "",
            g: common_vendor.o(($event) => selectTime(time), index)
          });
        }),
        h: common_vendor.f(patients, (patient, index, i0) => {
          return {
            a: common_vendor.t(patient.name),
            b: common_vendor.t(patient.idCard),
            c: common_vendor.t(patient.relation),
            d: index,
            e: selectedPatient.value === patient.id ? 1 : "",
            f: common_vendor.o(($event) => selectPatient(patient.id), index)
          };
        }),
        i: common_vendor.o(addNewPatient),
        j: common_vendor.t(doctor.value.fee),
        k: !canSubmit.value,
        l: common_vendor.o(submitAppointment),
        m: common_vendor.gei(_ctx, "")
      };
    };
  }
};
wx.createPage(_sfc_main);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/appointment/schedule.js.map