WXL
13 小时以前 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
"use strict";
const common_vendor = require("../../common/vendor.js");
if (!Array) {
  const _easycom_uni_load_more2 = common_vendor.resolveComponent("uni-load-more");
  _easycom_uni_load_more2();
}
const _easycom_uni_load_more = () => "../../node-modules/@dcloudio/uni-ui/lib/uni-load-more/uni-load-more.js";
if (!Math) {
  _easycom_uni_load_more();
}
const _sfc_main = {
  __name: "list",
  setup(__props) {
    const categories = [
      { value: "all", name: "全部" },
      { value: "notice", name: "通知公告" },
      { value: "health", name: "健康科普" },
      { value: "service", name: "就医服务" },
      { value: "special", name: "专科介绍" },
      { value: "expert", name: "专家风采" }
    ];
    const currentCategory = common_vendor.ref("all");
    const newsList = common_vendor.ref([
      {
        id: 1,
        type: "large",
        title: "青岛镜湖医院引进最新达芬奇手术机器人,提升微创手术水平",
        image: "/static/news/news1.jpg",
        tag: "医院动态",
        time: "2024-03-25",
        views: 1580
      },
      {
        id: 2,
        title: "春季养生指南:中医专家教你调理身体",
        description: "春季养生重在养肝,专家建议从饮食、运动等多方面入手,助您轻松养生。",
        image: "/static/news/news2.jpg",
        tag: "健康科普",
        time: "2024-03-24",
        views: 2360
      },
      {
        id: 3,
        type: "large",
        title: '医院举办"世界睡眠日"主题义诊活动',
        image: "/static/news/news3.jpg",
        tag: "活动资讯",
        time: "2024-03-23",
        views: 986
      }
    ]);
    const refreshing = common_vendor.ref(false);
    const loadMoreStatus = common_vendor.ref("more");
    const selectCategory = (category) => {
      currentCategory.value = category;
      refreshing.value = true;
      setTimeout(() => {
        refreshing.value = false;
      }, 1e3);
    };
    const onRefresh = () => {
      setTimeout(() => {
        refreshing.value = false;
      }, 1e3);
    };
    const loadMore = () => {
      if (loadMoreStatus.value !== "more")
        return;
      loadMoreStatus.value = "loading";
      setTimeout(() => {
        loadMoreStatus.value = "noMore";
      }, 1e3);
    };
    const viewNews = (news) => {
      common_vendor.index.navigateTo({
        url: `/pages/news/detail?id=${news.id}`
      });
    };
    return (_ctx, _cache) => {
      return {
        a: common_vendor.f(categories, (item, index, i0) => {
          return {
            a: common_vendor.t(item.name),
            b: index,
            c: currentCategory.value === item.value ? 1 : "",
            d: common_vendor.o(($event) => selectCategory(item.value), index)
          };
        }),
        b: common_vendor.f(newsList.value, (item, index, i0) => {
          return common_vendor.e({
            a: item.type === "large"
          }, item.type === "large" ? common_vendor.e({
            b: item.image,
            c: common_vendor.t(item.title),
            d: item.tag
          }, item.tag ? {
            e: common_vendor.t(item.tag)
          } : {}, {
            f: common_vendor.t(item.time),
            g: common_vendor.t(item.views)
          }) : common_vendor.e({
            h: common_vendor.t(item.title),
            i: common_vendor.t(item.description),
            j: item.tag
          }, item.tag ? {
            k: common_vendor.t(item.tag)
          } : {}, {
            l: common_vendor.t(item.time),
            m: common_vendor.t(item.views),
            n: item.image
          }), {
            o: index,
            p: common_vendor.o(($event) => viewNews(item), index)
          });
        }),
        c: common_vendor.p({
          status: loadMoreStatus.value,
          ["content-text"]: {
            contentdown: "上拉加载更多",
            contentrefresh: "加载中...",
            contentnomore: "没有更多了"
          }
        }),
        d: refreshing.value,
        e: common_vendor.o(onRefresh),
        f: common_vendor.o(loadMore),
        g: common_vendor.gei(_ctx, "")
      };
    };
  }
};
wx.createPage(_sfc_main);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/news/list.js.map