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
"use strict";
const common_vendor = require("../../common/vendor.js");
const _sfc_main = {
  __name: "notification",
  setup(__props) {
    const settings = common_vendor.ref({
      system: true,
      appointment: true,
      medical: true,
      payment: true
    });
    const notifyMethods = common_vendor.ref({
      app: true,
      sms: true,
      wechat: true
    });
    const messages = common_vendor.ref([
      {
        id: 1,
        type: "appointment",
        title: "预约提醒",
        content: "您预约的明天上午9:30心内科张医生的门诊即将开始",
        time: "10分钟前",
        read: false
      },
      {
        id: 2,
        type: "payment",
        title: "缴费提醒",
        content: "您有一笔¥360.00的待缴费订单,请及时处理",
        time: "1小时前",
        read: false
      },
      {
        id: 3,
        type: "system",
        title: "系统通知",
        content: "系统将于今晚23:00-次日凌晨2:00进行维护升级",
        time: "2小时前",
        read: true
      },
      {
        id: 4,
        type: "medical",
        title: "取药提醒",
        content: "您的处方药已准备就绪,请到3号窗口取药",
        time: "昨天",
        read: true
      }
    ]);
    const toggleSetting = (key, value) => {
      settings.value[key] = value;
      common_vendor.index.showToast({
        title: value ? "已开启" : "已关闭",
        icon: "success"
      });
    };
    const toggleNotifyMethod = (key, value) => {
      notifyMethods.value[key] = value;
      common_vendor.index.showToast({
        title: value ? "已开启" : "已关闭",
        icon: "success"
      });
    };
    const getIconClass = (type) => {
      const icons = {
        system: "icon-system",
        appointment: "icon-calendar",
        medical: "icon-medical",
        payment: "icon-wallet"
      };
      return icons[type];
    };
    const viewMessage = (message) => {
      message.read = true;
      common_vendor.index.__f__("log", "at pages/my/notification.vue:213", "查看消息:", message);
    };
    const clearMessages = () => {
      common_vendor.index.showModal({
        title: "提示",
        content: "确定要清空所有消息吗?",
        success: (res) => {
          if (res.confirm) {
            messages.value = [];
            common_vendor.index.showToast({
              title: "已清空",
              icon: "success"
            });
          }
        }
      });
    };
    return (_ctx, _cache) => {
      return {
        a: settings.value.system,
        b: common_vendor.o((e) => toggleSetting("system", e.detail.value)),
        c: settings.value.appointment,
        d: common_vendor.o((e) => toggleSetting("appointment", e.detail.value)),
        e: settings.value.medical,
        f: common_vendor.o((e) => toggleSetting("medical", e.detail.value)),
        g: settings.value.payment,
        h: common_vendor.o((e) => toggleSetting("payment", e.detail.value)),
        i: common_vendor.o(clearMessages),
        j: common_vendor.f(messages.value, (message, index, i0) => {
          return common_vendor.e({
            a: common_vendor.n(getIconClass(message.type)),
            b: common_vendor.n(message.type),
            c: common_vendor.t(message.title),
            d: common_vendor.t(message.time),
            e: common_vendor.t(message.content),
            f: !message.read
          }, !message.read ? {} : {}, {
            g: index,
            h: !message.read ? 1 : "",
            i: common_vendor.o(($event) => viewMessage(message), index)
          });
        }),
        k: notifyMethods.value.app,
        l: common_vendor.o((e) => toggleNotifyMethod("app", e.detail.value)),
        m: notifyMethods.value.sms,
        n: common_vendor.o((e) => toggleNotifyMethod("sms", e.detail.value)),
        o: notifyMethods.value.wechat,
        p: common_vendor.o((e) => toggleNotifyMethod("wechat", e.detail.value)),
        q: common_vendor.gei(_ctx, "")
      };
    };
  }
};
wx.createPage(_sfc_main);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/my/notification.js.map