WXL
11 小时以前 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
"use strict";
const common_vendor = require("../../common/vendor.js");
const common_assets = require("../../common/assets.js");
const _sfc_main = {
  __name: "cases",
  setup(__props) {
    const currentPage = common_vendor.ref(1);
    const hasMore = common_vendor.ref(true);
    const refreshing = common_vendor.ref(false);
    const caseList = common_vendor.ref([
      {
        id: 1,
        date: "2024-03-25 09:30",
        hospitalName: "青岛镜湖医院",
        hospitalLogo: "/static/hospital/kiang-wu.jpg",
        departmentName: "心内科",
        complaint: "胸闷、气短2天",
        diagnosis: "冠心病、高血压2级",
        treatment: "1. 硝酸甘油片含服\n2. 阿司匹林肠溶片口服\n3. 建议定期复查",
        doctorName: "张医生",
        doctorTitle: "主任医师",
        doctorAvatar: "/static/doctor/doctor1.jpg",
        hasReport: true
      },
      {
        id: 2,
        date: "2024-03-20 15:00",
        hospitalName: "青岛科大医院",
        hospitalLogo: "/static/hospital/must.jpg",
        departmentName: "消化内科",
        complaint: "上腹部不适1周",
        diagnosis: "慢性胃炎",
        treatment: "1. 奥美拉唑胶囊\n2. 多潘立酮片\n3. 注意饮食调理",
        doctorName: "李医生",
        doctorTitle: "副主任医师",
        doctorAvatar: "/static/doctor/doctor2.jpg",
        hasReport: true
      }
      // ... 更多病例数据
    ]);
    const onRefresh = () => {
      refreshing.value = true;
      currentPage.value = 1;
      loadCases();
      setTimeout(() => {
        refreshing.value = false;
      }, 1e3);
    };
    const onLoadMore = () => {
      if (!hasMore.value)
        return;
      currentPage.value++;
      loadCases();
    };
    const loadCases = () => {
      setTimeout(() => {
        if (currentPage.value >= 3) {
          hasMore.value = false;
        }
      }, 1e3);
    };
    const viewDetail = (item) => {
      common_vendor.index.navigateTo({
        url: `/pages/my/case-detail?id=${item.id}`
      });
    };
    const viewReport = (item) => {
      if (item.hasReport) {
        common_vendor.index.navigateTo({
          url: `/pages/records/report?id=${item.id}`
        });
      }
    };
    const bookAgain = (item) => {
      common_vendor.index.navigateTo({
        url: `/pages/appointment/doctor?departmentId=${item.departmentId}&hospitalId=${item.hospitalId}`
      });
    };
    return (_ctx, _cache) => {
      return common_vendor.e({
        a: common_vendor.f(caseList.value, (item, index, i0) => {
          return {
            a: common_vendor.t(item.date.split(" ")[0]),
            b: common_vendor.t(item.date.split(" ")[1]),
            c: item.hospitalLogo,
            d: common_vendor.t(item.hospitalName),
            e: common_vendor.t(item.departmentName),
            f: common_vendor.t(item.complaint),
            g: common_vendor.t(item.diagnosis),
            h: common_vendor.t(item.treatment),
            i: item.doctorAvatar,
            j: common_vendor.t(item.doctorName),
            k: common_vendor.t(item.doctorTitle),
            l: common_vendor.o(($event) => viewReport(item), index),
            m: common_vendor.o(($event) => bookAgain(item), index),
            n: index,
            o: common_vendor.o(($event) => viewDetail(item), index)
          };
        }),
        b: hasMore.value
      }, hasMore.value ? {} : {}, {
        c: !hasMore.value && caseList.value.length > 0
      }, !hasMore.value && caseList.value.length > 0 ? {} : {}, {
        d: caseList.value.length === 0
      }, caseList.value.length === 0 ? {
        e: common_assets._imports_0$4
      } : {}, {
        f: refreshing.value,
        g: common_vendor.o(onRefresh),
        h: common_vendor.o(onLoadMore),
        i: common_vendor.gei(_ctx, "")
      });
    };
  }
};
wx.createPage(_sfc_main);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/my/cases.js.map