WXL
21 小时以前 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
"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: "all",
  setup(__props) {
    const keyword = common_vendor.ref("");
    const currentCategory = common_vendor.ref(0);
    const categories = common_vendor.ref([
      { id: 0, name: "全部" },
      { id: 1, name: "中医特色" },
      { id: 2, name: "跨境医疗" },
      { id: 3, name: "专家门诊" },
      { id: 4, name: "特色科室" }
    ]);
    const featuredList = common_vendor.ref([
      {
        id: 1,
        name: "中医特色诊疗",
        desc: "传承千年中医精华,守护您的健康",
        image: "/static/featured/tcm.jpg",
        tags: ["针灸推拿", "中药调理", "艾灸养生"],
        doctors: 20,
        cases: 1e3,
        rating: 4.9
      },
      {
        id: 2,
        name: "跨境医疗服务",
        desc: "连接全球优质医疗资源",
        image: "/static/featured/cross-border.jpg",
        tags: ["专家会诊", "转诊服务", "康复护理"],
        doctors: 30,
        cases: 500,
        rating: 4.8
      },
      {
        id: 3,
        name: "专家门诊",
        desc: "汇聚顶尖医疗专家",
        image: "/static/featured/expert.jpg",
        tags: ["名医问诊", "远程会诊", "特需门诊"],
        doctors: 50,
        cases: 2e3,
        rating: 4.9
      }
    ]);
    const filter = common_vendor.ref({
      hospital: "",
      priceRange: "",
      sort: "default"
    });
    const hospitals = [
      { value: "jh", label: "镜湖医院" },
      { value: "kd", label: "科大医院" }
    ];
    const priceRanges = [
      { value: "0-500", label: "500以下" },
      { value: "500-1000", label: "500-1000" },
      { value: "1000-2000", label: "1000-2000" },
      { value: "2000+", label: "2000以上" }
    ];
    const sortOptions = [
      { value: "default", label: "综合排序" },
      { value: "rating", label: "评分最高" },
      { value: "cases", label: "案例最多" }
    ];
    const refreshing = common_vendor.ref(false);
    const loadMoreStatus = common_vendor.ref("more");
    const onSearch = (e) => {
      e.detail.value.trim();
    };
    const selectCategory = (category) => {
      currentCategory.value = category.id;
    };
    const viewDetail = (item) => {
      const routes = {
        1: "/pages/featured/tcm",
        2: "/pages/featured/cross-border",
        3: "/pages/featured/expert"
      };
      common_vendor.index.navigateTo({
        url: routes[item.id] || "/pages/featured/project"
      });
    };
    const filterDrawer = common_vendor.ref(null);
    const showFilter = () => {
      filterDrawer.value.open();
    };
    const resetFilter = () => {
      filter.value = {
        hospital: "",
        priceRange: "",
        sort: "default"
      };
    };
    const selectHospital = (value) => {
      filter.value.hospital = value;
    };
    const selectPriceRange = (value) => {
      filter.value.priceRange = 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(categories.value, (item, index, i0) => {
          return {
            a: common_vendor.t(item.name),
            b: index,
            c: currentCategory.value === item.id ? 1 : "",
            d: common_vendor.o(($event) => selectCategory(item), index)
          };
        }),
        e: common_vendor.f(featuredList.value, (item, index, i0) => {
          return {
            a: item.image,
            b: common_vendor.t(item.name),
            c: common_vendor.t(item.desc),
            d: common_vendor.f(item.tags, (tag, idx, i1) => {
              return {
                a: common_vendor.t(tag),
                b: idx
              };
            }),
            e: common_vendor.t(item.doctors),
            f: common_vendor.t(item.cases),
            g: common_vendor.t(item.rating),
            h: index,
            i: common_vendor.o(($event) => viewDetail(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(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)
          };
        }),
        l: common_vendor.f(priceRanges, (item, index, i0) => {
          return {
            a: common_vendor.t(item.label),
            b: index,
            c: filter.value.priceRange === item.value ? 1 : "",
            d: common_vendor.o(($event) => selectPriceRange(item.value), index)
          };
        }),
        m: 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)
          };
        }),
        n: common_vendor.o(applyFilter),
        o: common_vendor.sr(filterDrawer, "04e5d095-1", {
          "k": "filterDrawer"
        }),
        p: common_vendor.p({
          mode: "right"
        }),
        q: common_vendor.gei(_ctx, "")
      };
    };
  }
};
wx.createPage(_sfc_main);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/featured/all.js.map