WXL
19 小时以前 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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
"use strict";
const common_vendor = require("../../common/vendor.js");
if (!Array) {
  const _easycom_uni_load_more2 = common_vendor.resolveComponent("uni-load-more");
  const _easycom_uni_drawer2 = common_vendor.resolveComponent("uni-drawer");
  (_easycom_uni_load_more2 + _easycom_uni_drawer2)();
}
const _easycom_uni_load_more = () => "../../node-modules/@dcloudio/uni-ui/lib/uni-load-more/uni-load-more.js";
const _easycom_uni_drawer = () => "../../node-modules/@dcloudio/uni-ui/lib/uni-drawer/uni-drawer.js";
if (!Math) {
  (_easycom_uni_load_more + _easycom_uni_drawer)();
}
const _sfc_main = {
  __name: "expert",
  setup(__props) {
    const keyword = common_vendor.ref("");
    const currentDepartment = common_vendor.ref(0);
    const departments = common_vendor.ref([
      { id: 0, name: "全部" },
      { id: 1, name: "内科" },
      { id: 2, name: "外科" },
      { id: 3, name: "妇产科" },
      { id: 4, name: "儿科" },
      { id: 5, name: "中医科" }
    ]);
    const experts = common_vendor.ref([
      {
        id: 1,
        name: "张医生",
        title: "主任医师",
        avatar: "/static/doctor/expert1.jpg",
        hospital: "青岛镜湖医院",
        tags: ["专家门诊", "视频问诊"],
        specialty: "冠心病、高血压、心律失常等心血管疾病",
        schedule: {
          date: "今天",
          period: "上午 9:00-11:30",
          price: 500,
          available: true
        }
      },
      {
        id: 2,
        name: "李医生",
        title: "副主任医师",
        avatar: "/static/doctor/expert2.jpg",
        hospital: "青岛科大医院",
        tags: ["专家门诊"],
        specialty: "糖尿病、内分泌疾病",
        schedule: {
          date: "明天",
          period: "下午 14:00-16:30",
          price: 300,
          available: false
        }
      }
    ]);
    const filter = common_vendor.ref({
      title: "",
      hospital: "",
      consultType: "",
      sort: "default"
    });
    const titles = [
      { value: "chief", label: "主任医师" },
      { value: "deputy", label: "副主任医师" },
      { value: "attending", label: "主治医师" }
    ];
    const hospitals = [
      { value: "jh", label: "镜湖医院" },
      { value: "kd", label: "科大医院" }
    ];
    const consultTypes = [
      { value: "expert", label: "专家门诊" },
      { value: "video", label: "视频问诊" },
      { value: "phone", label: "电话问诊" }
    ];
    const sortOptions = [
      { value: "default", label: "综合排序" },
      { value: "rating", label: "评分最高" },
      { value: "price", label: "价格排序" }
    ];
    const refreshing = common_vendor.ref(false);
    const loadMoreStatus = common_vendor.ref("more");
    const onSearch = (e) => {
      e.detail.value.trim();
    };
    const selectDepartment = (department) => {
      currentDepartment.value = department.id;
    };
    const viewDoctor = (doctor) => {
      common_vendor.index.navigateTo({
        url: `/pages/doctor/detail?id=${doctor.id}`
      });
    };
    const filterDrawer = common_vendor.ref(null);
    const showFilter = () => {
      filterDrawer.value.open();
    };
    const resetFilter = () => {
      filter.value = {
        title: "",
        hospital: "",
        consultType: "",
        sort: "default"
      };
    };
    const selectTitle = (value) => {
      filter.value.title = value;
    };
    const selectHospital = (value) => {
      filter.value.hospital = value;
    };
    const selectConsultType = (value) => {
      filter.value.consultType = value;
    };
    const selectSort = (value) => {
      filter.value.sort = value;
    };
    const applyFilter = () => {
      filterDrawer.value.close();
    };
    const onRefresh = () => {
      setTimeout(() => {
        refreshing.value = false;
      }, 1e3);
    };
    const loadMore = () => {
      if (loadMoreStatus.value !== "more")
        return;
      loadMoreStatus.value = "loading";
      setTimeout(() => {
        loadMoreStatus.value = "noMore";
      }, 1e3);
    };
    return (_ctx, _cache) => {
      return {
        a: common_vendor.o([($event) => keyword.value = $event.detail.value, onSearch]),
        b: keyword.value,
        c: common_vendor.o(showFilter),
        d: common_vendor.f(departments.value, (item, index, i0) => {
          return {
            a: common_vendor.t(item.name),
            b: index,
            c: currentDepartment.value === item.id ? 1 : "",
            d: common_vendor.o(($event) => selectDepartment(item), index)
          };
        }),
        e: common_vendor.f(experts.value, (item, index, i0) => {
          return common_vendor.e({
            a: item.avatar,
            b: common_vendor.t(item.name),
            c: common_vendor.t(item.title),
            d: common_vendor.f(item.tags, (tag, idx, i1) => {
              return {
                a: common_vendor.t(tag),
                b: idx
              };
            }),
            e: common_vendor.t(item.hospital),
            f: common_vendor.t(item.specialty),
            g: item.schedule
          }, item.schedule ? {
            h: common_vendor.t(item.schedule.date),
            i: common_vendor.t(item.schedule.period),
            j: common_vendor.t(item.schedule.price),
            k: common_vendor.t(item.schedule.available ? "可预约" : "约满"),
            l: !item.schedule.available ? 1 : ""
          } : {}, {
            m: index,
            n: common_vendor.o(($event) => viewDoctor(item), index)
          });
        }),
        f: common_vendor.p({
          status: loadMoreStatus.value,
          ["content-text"]: {
            contentdown: "上拉加载更多",
            contentrefresh: "加载中...",
            contentnomore: "没有更多了"
          }
        }),
        g: refreshing.value,
        h: common_vendor.o(onRefresh),
        i: common_vendor.o(loadMore),
        j: common_vendor.o(resetFilter),
        k: common_vendor.f(titles, (item, index, i0) => {
          return {
            a: common_vendor.t(item.label),
            b: index,
            c: filter.value.title === item.value ? 1 : "",
            d: common_vendor.o(($event) => selectTitle(item.value), index)
          };
        }),
        l: common_vendor.f(hospitals, (item, index, i0) => {
          return {
            a: common_vendor.t(item.label),
            b: index,
            c: filter.value.hospital === item.value ? 1 : "",
            d: common_vendor.o(($event) => selectHospital(item.value), index)
          };
        }),
        m: common_vendor.f(consultTypes, (item, index, i0) => {
          return {
            a: common_vendor.t(item.label),
            b: index,
            c: filter.value.consultType === item.value ? 1 : "",
            d: common_vendor.o(($event) => selectConsultType(item.value), index)
          };
        }),
        n: common_vendor.f(sortOptions, (item, index, i0) => {
          return {
            a: common_vendor.t(item.label),
            b: index,
            c: filter.value.sort === item.value ? 1 : "",
            d: common_vendor.o(($event) => selectSort(item.value), index)
          };
        }),
        o: common_vendor.o(applyFilter),
        p: common_vendor.sr(filterDrawer, "a3acbd34-1", {
          "k": "filterDrawer"
        }),
        q: common_vendor.p({
          mode: "right"
        }),
        r: common_vendor.gei(_ctx, "")
      };
    };
  }
};
wx.createPage(_sfc_main);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/featured/expert.js.map