WXL
7 天以前 b76de9a566e4435146a970aa22333a58f87b485b
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
"use strict";
const common_vendor = require("../../common/vendor.js");
const common_assets = require("../../common/assets.js");
const stores_user = require("../../stores/user.js");
const _sfc_main = {
  __name: "index",
  setup(__props) {
    const userInfo = common_vendor.ref({
      name: "小毛🥚",
      avatar: "@/static/avatar/default.png",
      cardNo: "1234567890",
      vipLevel: "VIP 99"
    });
    const stats = common_vendor.ref({
      totalCases: 0,
      readCases: 0,
      agreedCases: 0
    });
    const userStore = stores_user.useUserStore();
    common_vendor.ref([
      { label: "待就诊", count: 1, path: "/pages/appointment/record" },
      { label: "待付款", count: 2, path: "/pages/payment/record" },
      { label: "待评价", count: 3, path: "/pages/my/reviews" },
      { label: "优惠券", count: 5, path: "/pages/my/coupons" }
    ]);
    const functionList = common_vendor.ref([
      {
        title: "案例服务",
        items: [
          {
            label: "上报案例",
            icon: "icon-record",
            path: "/pagesSub/case/CaseDetails"
          },
          {
            label: "我的上报",
            icon: "icon-payment",
            path: "/pagesSub/case/index"
          },
          {
            label: "转运登记",
            icon: "icon-medical",
            path: "/pagesSub/case/transfer"
          },
          {
            label: "审查记录",
            icon: "icon-contacts",
            path: "/pagesSub/ethicalReview/index"
          }
        ]
      },
      // {
      //   title: "健康服务",
      //   items: [
      //     {
      //       label: "健康档案",
      //       icon: "icon-health",
      //       path: "/pages/my/health-records",
      //     },
      //     {
      //       label: "检查报告",
      //       icon: "icon-report",
      //       path: "/pages/records/reports",
      //       tag: "新",
      //     },
      //   ],
      // },
      {
        title: "账户设置",
        items: [
          // {
          //   label: "实名认证",
          //   icon: "icon-verify",
          //   path: "/pages/my/verify",
          //   value: "已认证",
          // },
          // {
          //   label: "支付方式",
          //   icon: "icon-wallet",
          //   path: "/pages/my/payment-method",
          // },
          {
            label: "消息通知",
            icon: "icon-notification",
            path: "/pagesSub/my/notification"
          }
        ]
      }
      // {
      //   items: [
      //     {
      //       label: "客服中心",
      //       icon: "icon-service",
      //       path: "/pages/my/service",
      //     },
      //     {
      //       label: "设置",
      //       icon: "icon-settings",
      //       path: "/pages/my/settings",
      //     },
      //   ],
      // },
    ]);
    common_vendor.onLoad(async () => {
      common_vendor.index.__f__("log", "at pages/my/index.vue:203", userStore.userInfo, "userStore.userInfo");
      userInfo.value = userStore.userInfo;
      await donateTotal();
    });
    const navigateTo = (url) => {
      common_vendor.index.navigateTo({
        url,
        fail: (err) => {
          common_vendor.index.__f__("error", "at pages/my/index.vue:212", "导航失败:", err);
          common_vendor.index.redirectTo({
            url,
            fail: (err2) => {
              common_vendor.index.__f__("error", "at pages/my/index.vue:217", "重定向失败:", err2);
            }
          });
        }
      });
    };
    const donateTotal = async () => {
      try {
        const res = await common_vendor.index.$uapi.post("/project/donatebaseinforeport/getTotal");
        if (res.code === 200) {
          stats.value = {
            totalCases: res.data["all"] || 0,
            readCases: res.data["2"] || 0,
            agreedCases: res.data["3"] || 0
          };
        } else {
          throw new Error(res.msg || "获取统计失败");
        }
      } catch (error) {
        common_vendor.index.__f__("error", "at pages/my/index.vue:237", "获取统计数据失败:", error);
      }
    };
    const handleLogout = () => {
      common_vendor.index.showModal({
        title: "提示",
        content: "确定要退出登录吗?",
        success: (res) => {
          if (res.confirm) {
            common_vendor.index.clearStorageSync();
            common_vendor.index.reLaunch({
              url: "/pages/login/Login"
            });
          }
        }
      });
    };
    return (_ctx, _cache) => {
      return common_vendor.e({
        a: userInfo.value.sex == 1
      }, userInfo.value.sex == 1 ? {
        b: common_assets._imports_0$1
      } : {
        c: common_assets._imports_1
      }, {
        d: common_vendor.t(userInfo.value.nickName),
        e: common_vendor.t(userInfo.value.createBy),
        f: userInfo.value.coordinatorName
      }, userInfo.value.coordinatorName ? common_vendor.e({
        g: common_vendor.t(userInfo.value.coordinatorName),
        h: userInfo.value.coordinatorNo
      }, userInfo.value.coordinatorNo ? {
        i: common_vendor.t(userInfo.value.coordinatorNo)
      } : {}) : {}, {
        j: common_vendor.o(($event) => navigateTo("/pagesSub/my/profile")),
        k: common_vendor.t(stats.value.totalCases),
        l: common_vendor.t(stats.value.readCases),
        m: common_vendor.t(stats.value.agreedCases),
        n: common_vendor.f(functionList.value, (section, idx, i0) => {
          return common_vendor.e({
            a: section.title
          }, section.title ? {
            b: common_vendor.t(section.title)
          } : {}, {
            c: common_vendor.f(section.items, (item, index, i1) => {
              return common_vendor.e({
                a: common_vendor.n(item.icon),
                b: common_vendor.t(item.label),
                c: item.value
              }, item.value ? {
                d: common_vendor.t(item.value)
              } : {}, {
                e: item.tag
              }, item.tag ? {
                f: common_vendor.t(item.tag)
              } : {}, {
                g: index,
                h: common_vendor.o(($event) => navigateTo(item.path), index)
              });
            }),
            d: idx
          });
        }),
        o: common_vendor.o(handleLogout),
        p: common_vendor.gei(_ctx, "")
      });
    };
  }
};
wx.createPage(_sfc_main);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/my/index.js.map