@huyooo/ui 1.0.7 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/dist/AuthkitAppSetting-rtYZcSAR.js +2677 -0
  2. package/dist/{Contact-BWuVR9ho.js → Contact-CcWf3UEZ.js} +9 -9
  3. package/dist/{CustomTable-BzGfaAVH.js → CustomTable-HDwqEcmB.js} +1 -1
  4. package/dist/FeedbackModal.vue_vue_type_script_setup_true_lang-DpOmbAg-.js +1491 -0
  5. package/dist/{LegalDocViewer-DM8FYBpf.js → LegalDocViewer-C0tsIbz9.js} +747 -748
  6. package/dist/MessageHandle-BUufez4S.js +1233 -0
  7. package/dist/{MessageList-Ce-_LNTk.js → MessageList-rttvPmxV.js} +4 -4
  8. package/dist/PaySubscriptions-p75aBnHm.js +1331 -0
  9. package/dist/{PricingPlans-CV97ck9p.js → PricingPlans-CQ0qk9Hb.js} +99 -105
  10. package/dist/{ReferrerReferees-DgygiIiE.js → ReferrerReferees-BU9IEQgz.js} +47 -46
  11. package/dist/Upload.vue_vue_type_script_setup_true_lang-bh0NFq9E.js +78 -0
  12. package/dist/{UserMenuInvitationsItem.vue_vue_type_script_setup_true_lang-0Td42Nb3.js → UserMenuInvitationsItem.vue_vue_type_script_setup_true_lang-DG4AuHiO.js} +64 -65
  13. package/dist/WidthContainer-DSE4QbW0.js +717 -0
  14. package/dist/api/billingSubscriptionApi.d.ts +4 -1
  15. package/dist/apiClients-Ctcq8NZs.js +245 -0
  16. package/dist/authkit.js +10 -10
  17. package/dist/common/globalConfig.d.ts +36 -18
  18. package/dist/common.js +2 -2
  19. package/dist/components/Authkit/Auth/AuthkitOauthCallback.vue.d.ts +2 -2
  20. package/dist/components/Authkit/AuthkitProvider.vue.d.ts +0 -5
  21. package/dist/components/Upload/Upload.vue.d.ts +6 -6
  22. package/dist/composables/Authkit/useAuthkitAuth.d.ts +3 -0
  23. package/dist/composables/Billing/usePaymentReturn.d.ts +1 -0
  24. package/dist/composables/uploadFeedbackAttachment.d.ts +2 -1
  25. package/dist/composables/useMessageList.d.ts +2 -1
  26. package/dist/composables.d.ts +2 -2
  27. package/dist/composables.js +46 -46
  28. package/dist/feedback.js +2 -2
  29. package/dist/{fetchAuthPageAboutUs-dzTSwRsB.js → fetchAuthPageAboutUs-DiCqMUX3.js} +4 -4
  30. package/dist/{index-BkLvw1PU.js → index-Cn6LcfZO.js} +1 -1
  31. package/dist/legalDocs/resolveAppId.d.ts +1 -1
  32. package/dist/main.d.ts +4 -3
  33. package/dist/main.js +464 -469
  34. package/dist/message.js +53 -52
  35. package/dist/pay.js +4 -4
  36. package/dist/privateCom.js +1 -1
  37. package/dist/referrer.js +1 -1
  38. package/dist/{useUploadCos-C8BqFPkx.js → runtime-BzCSCUNv.js} +2712 -2609
  39. package/dist/runtime.d.ts +18 -0
  40. package/dist/style.css +1 -1
  41. package/dist/types/api/auth.generated.d.ts +0 -10
  42. package/dist/upload/browserCosTransport.d.ts +25 -0
  43. package/dist/upload/browserUploadService.d.ts +20 -0
  44. package/dist/upload.d.ts +2 -1
  45. package/dist/upload.js +5 -4
  46. package/dist/{useAuthkitAppsAuthPageInfo-CNudJd04.js → useAuthkitAppsAuthPageInfo-DZ1p-P3Q.js} +18 -21
  47. package/dist/useAuthkitAuth-BPTZUSkM.js +272 -0
  48. package/dist/{useAuthkitCreateAndUpdate-BsINsI-E.js → useAuthkitCreateAndUpdate-Bbv7vZZn.js} +1 -1
  49. package/dist/useAuthkitUsersProfile-CW_exa7E.js +39 -0
  50. package/dist/useBillingStatusOptions-Br-iL77Z.js +61 -0
  51. package/dist/{useEnsureAuthenticated-DNkCCy_Y.js → useEnsureAuthenticated-CncOvj2H.js} +2 -2
  52. package/dist/{useLegalDocs-DQP_Yq6B.js → useLegalDocs-D44qU_q0.js} +25 -25
  53. package/dist/useMessageNotifications-D9uikt21.js +80 -0
  54. package/dist/{useRoutePermission-CEiya9AM.js → useRoutePermission-BrQX7NTq.js} +2 -2
  55. package/dist/{useSEO-CDWxbk8B.js → useSEO-_TNouXE_.js} +89 -86
  56. package/dist/useSubscriptionCheckout-BDDCRxSs.js +353 -0
  57. package/dist/user.js +1 -1
  58. package/dist/utils/apiClients.d.ts +20 -12
  59. package/dist/utils/apiMiddlewares.d.ts +9 -23
  60. package/package.json +1 -1
  61. package/dist/AuthkitAppSetting-BN8-xgNq.js +0 -2674
  62. package/dist/FeedbackModal.vue_vue_type_script_setup_true_lang-DrL_XBqf.js +0 -1481
  63. package/dist/MessageHandle-mEkCsv9e.js +0 -1173
  64. package/dist/PaySubscriptions-CXkEjqr2.js +0 -1326
  65. package/dist/Upload.vue_vue_type_script_setup_true_lang-VGh2V4o0.js +0 -76
  66. package/dist/WidthContainer-CFMQRsCy.js +0 -721
  67. package/dist/apiClients-BcXOLuYu.js +0 -272
  68. package/dist/composables/Upload/useUploadCos.d.ts +0 -12
  69. package/dist/useAuthkitAuth-3m0yW6uP.js +0 -267
  70. package/dist/useAuthkitUsersProfile-DJlMsftY.js +0 -40
  71. package/dist/useBillingStatusOptions-CfHQOFNw.js +0 -71
  72. package/dist/useMessageNotifications-CAphguOm.js +0 -75
  73. package/dist/useSubscriptionCheckout-d_M_rKRa.js +0 -368
  74. package/dist/utils/billingFetch.d.ts +0 -1
@@ -0,0 +1,1331 @@
1
+ /* empty css */
2
+ /* empty css */
3
+ /* empty css */
4
+ /* empty css */
5
+ /* empty css */
6
+ import { U as Nt } from "./userMenuModal-D-nDaYqM.js";
7
+ /* empty css */
8
+ /* empty css */
9
+ import { g as S } from "./apiClients-Ctcq8NZs.js";
10
+ import { ref as _, computed as W, onUnmounted as Fe, defineComponent as zt, openBlock as l, createElementBlock as d, Fragment as X, createVNode as c, unref as n, isRef as Tt, withCtx as i, createElementVNode as a, toDisplayString as r, createBlock as K, createTextVNode as g, createCommentVNode as O, renderList as Te, normalizeClass as Ae } from "vue";
11
+ import { Modal as Oe, Button as P, Popconfirm as Z, Tabs as At, TabPane as ee, Spin as de, Empty as We, Progress as Ot, Tooltip as pe, Tag as J, Message as M } from "@arco-design/web-vue";
12
+ import { u as Wt, b as Lt, a as Rt } from "./useBillingStatusOptions-Br-iL77Z.js";
13
+ import { u as Et } from "./useAuthkitCreateAndUpdate-Bbv7vZZn.js";
14
+ import { g as $t } from "./runtime-BzCSCUNv.js";
15
+ import { C as ve } from "./CustomTable-HDwqEcmB.js";
16
+ import { C as Le } from "./index-Cn6LcfZO.js";
17
+ import { _ as Ft } from "./_plugin-vue_export-helper-CHgC5LLL.js";
18
+ function Be() {
19
+ return {
20
+ current: null,
21
+ trial: null,
22
+ entitlement: null,
23
+ features: [],
24
+ quotas: [],
25
+ pointsBalance: null,
26
+ pendingInvoice: null
27
+ };
28
+ }
29
+ const $ = _(Be()), ge = _(!1);
30
+ function Bt() {
31
+ const s = W(() => $.value.current), p = W(() => $.value.trial), y = W(() => $.value.entitlement), m = W(() => $.value.features), w = W(() => $.value.quotas), C = W(() => $.value.pointsBalance), b = W(() => $.value.pendingInvoice);
32
+ async function f() {
33
+ ge.value = !0;
34
+ const {
35
+ data: k,
36
+ error: L
37
+ } = await S().billing.subscriptions.summary.post();
38
+ ge.value = !1, !L && ($.value = k || Be());
39
+ }
40
+ return {
41
+ summary: $,
42
+ current: s,
43
+ trial: p,
44
+ entitlement: y,
45
+ features: m,
46
+ quotas: w,
47
+ pointsBalance: C,
48
+ pendingInvoice: b,
49
+ loading: ge,
50
+ refresh: f
51
+ };
52
+ }
53
+ function Ht(s, p) {
54
+ return (s == null ? void 0 : s.type) === "trial" ? p > 0 ? "升级" : "" : (s == null ? void 0 : s.type) === "subscription" ? p > 0 ? "修改订阅" : "" : p > 0 ? "订阅" : "查看价格方案";
55
+ }
56
+ function xa(s, p, y = !0) {
57
+ return y ? s ? !!Ht(s, p) : !0 : !1;
58
+ }
59
+ function Re(s) {
60
+ return s && s.productName || "未订阅";
61
+ }
62
+ function Ee(s) {
63
+ return (s == null ? void 0 : s.type) === "subscription" ? "当前周期结束" : "权益有效期至";
64
+ }
65
+ function fe(s) {
66
+ return Number(s ?? 0).toLocaleString(void 0, {
67
+ minimumFractionDigits: 2,
68
+ maximumFractionDigits: 2
69
+ });
70
+ }
71
+ function Ut(s) {
72
+ return Number(s ?? 0).toLocaleString();
73
+ }
74
+ function me(s) {
75
+ const p = typeof s == "number" ? s : Number(s);
76
+ return Number.isFinite(p) ? Math.abs(p) > 0 && Math.abs(p) < 0.01 ? p.toLocaleString("zh-CN", {
77
+ minimumFractionDigits: 0,
78
+ maximumFractionDigits: 6
79
+ }) : p.toLocaleString("zh-CN", {
80
+ minimumFractionDigits: 2,
81
+ maximumFractionDigits: 2
82
+ }) : "0.00";
83
+ }
84
+ function Dt(s) {
85
+ const p = typeof s == "number" ? s : Number(s);
86
+ return !Number.isFinite(p) || p === 0 ? me(0) : `${p > 0 ? "+" : "-"}${me(Math.abs(p))}`;
87
+ }
88
+ const Mt = {
89
+ // earn
90
+ recharge: "充值",
91
+ referral: "推荐奖励",
92
+ signup: "注册奖励",
93
+ subscription: "订阅赠送",
94
+ activity: "活动奖励",
95
+ bonus: "奖励",
96
+ rule: "规则奖励",
97
+ trigger: "触发奖励",
98
+ // consume
99
+ consume: "消费",
100
+ ai_usage: "AI 消费",
101
+ service_usage: "服务消费",
102
+ continuous_service_usage: "连续服务消费",
103
+ // reversal / clawback
104
+ consume_reversal: "消费退还",
105
+ earn_clawback: "发放追回",
106
+ service_usage_reversal: "服务消费退还",
107
+ refund: "退款扣除",
108
+ // adjust
109
+ increase: "人工增加",
110
+ decrease: "人工扣减",
111
+ batch_increase: "批量增加",
112
+ batch_decrease: "批量扣减",
113
+ // 其他
114
+ exchange: "兑换",
115
+ adjust: "调整"
116
+ };
117
+ function Yt(s) {
118
+ return s != null && s.trim() ? Mt[s] ?? s : "-";
119
+ }
120
+ const ye = {
121
+ earn: {
122
+ label: "获得",
123
+ tagColor: "green"
124
+ },
125
+ consume: {
126
+ label: "消费",
127
+ tagColor: "red"
128
+ },
129
+ reversal: {
130
+ label: "退还",
131
+ tagColor: "arcoblue"
132
+ },
133
+ clawback: {
134
+ label: "追回",
135
+ tagColor: "orange"
136
+ },
137
+ adjust: {
138
+ label: "调整",
139
+ tagColor: "purple"
140
+ }
141
+ };
142
+ function He(s) {
143
+ return s in ye;
144
+ }
145
+ function Vt(s) {
146
+ return He(s) ? ye[s].label : s || "-";
147
+ }
148
+ function qt(s) {
149
+ return He(s) ? ye[s].tagColor : "gray";
150
+ }
151
+ async function jt(s, p) {
152
+ if (s === "recharge") {
153
+ const {
154
+ data: y,
155
+ error: m
156
+ } = await S().billing.pointsRecharge.verifyPayment.post({
157
+ orderId: p
158
+ });
159
+ if (m || !y)
160
+ return {
161
+ success: !1,
162
+ status: "error",
163
+ message: (m == null ? void 0 : m.message) || "查询充值结果失败",
164
+ error: m
165
+ };
166
+ const w = y;
167
+ return {
168
+ success: !!(w.success || w.status === "paid"),
169
+ status: w.status || "unknown",
170
+ message: w.message,
171
+ pointsAdded: w.pointsAdded
172
+ };
173
+ }
174
+ if (s === "subscription") {
175
+ const {
176
+ data: y,
177
+ error: m
178
+ } = await S().billing.invoices.verifyPayment.post({
179
+ orderId: p
180
+ });
181
+ if (m || !y)
182
+ return {
183
+ success: !1,
184
+ status: "error",
185
+ message: (m == null ? void 0 : m.message) || "查询订阅支付结果失败",
186
+ error: m
187
+ };
188
+ const w = y;
189
+ return {
190
+ success: !!(w.success || w.status === "paid"),
191
+ status: w.status || "unknown",
192
+ message: w.message
193
+ };
194
+ }
195
+ return {
196
+ success: !1,
197
+ status: "unsupported",
198
+ message: "暂不支持的支付场景"
199
+ };
200
+ }
201
+ const Kt = 3e3;
202
+ function Ue() {
203
+ const s = _(!1), p = _("");
204
+ let y = null;
205
+ function m() {
206
+ y && (clearInterval(y), y = null);
207
+ }
208
+ async function w(b, f) {
209
+ s.value = !0;
210
+ const k = await jt(b, f);
211
+ return s.value = !1, k;
212
+ }
213
+ function C(b) {
214
+ m();
215
+ const f = async () => {
216
+ var L, z;
217
+ const k = await w(b.scene, b.orderId);
218
+ if (k.error) {
219
+ m(), (L = b.onError) == null || L.call(b, k.error);
220
+ return;
221
+ }
222
+ if (k.success) {
223
+ m(), b.onSuccess(k);
224
+ return;
225
+ }
226
+ p.value = k.message || "等待支付确认...", (z = b.onWaiting) == null || z.call(b, k);
227
+ };
228
+ f(), y = setInterval(() => {
229
+ f();
230
+ }, Kt);
231
+ }
232
+ return Fe(m), {
233
+ checking: s,
234
+ statusText: p,
235
+ startPolling: C,
236
+ stopPolling: m,
237
+ verifyNow: w
238
+ };
239
+ }
240
+ function Na(s) {
241
+ const p = _("loading"), y = _("正在确认支付结果..."), {
242
+ checking: m,
243
+ statusText: w,
244
+ startPolling: C,
245
+ stopPolling: b,
246
+ verifyNow: f
247
+ } = Ue();
248
+ async function k(L, z) {
249
+ p.value = "loading", y.value = "正在确认支付结果...", C({
250
+ scene: L,
251
+ orderId: z,
252
+ onSuccess: (T) => {
253
+ p.value = "success", y.value = T.message || "支付成功", window.setTimeout(() => {
254
+ window.location.replace(s());
255
+ }, 1200);
256
+ },
257
+ onWaiting: (T) => {
258
+ y.value = T.message || w.value || "等待支付确认...";
259
+ },
260
+ onError: (T) => {
261
+ p.value = "failed", y.value = T instanceof Error ? T.message : "确认支付失败";
262
+ }
263
+ });
264
+ }
265
+ return {
266
+ phase: p,
267
+ message: y,
268
+ checking: m,
269
+ statusText: w,
270
+ confirmPayment: k,
271
+ stopPolling: b,
272
+ verifyNow: f
273
+ };
274
+ }
275
+ function Gt(s) {
276
+ return /^https?:\/\//i.test(s) || s.startsWith("//");
277
+ }
278
+ function Jt() {
279
+ const {
280
+ config: s
281
+ } = $t();
282
+ if (s.openPricing) {
283
+ s.openPricing();
284
+ return;
285
+ }
286
+ const p = s.pricingUrl || "/Pricing";
287
+ if (Gt(p)) {
288
+ window.open(p, "_blank", "noopener,noreferrer");
289
+ return;
290
+ }
291
+ window.location.assign(p);
292
+ }
293
+ const Qt = {
294
+ pending: "退款申请已提交,等待财务审核",
295
+ approved: "财务已审核通过,款项尚未原路退回",
296
+ rejected: "财务未通过该退款申请",
297
+ processing: "退款正在原路处理中,请耐心等待",
298
+ success: "退款已成功原路退回",
299
+ failed: "退款执行失败,请联系客服处理"
300
+ };
301
+ function $e(s) {
302
+ return Qt[s] ?? "";
303
+ }
304
+ const Xt = {
305
+ class: "content"
306
+ }, Zt = {
307
+ key: 0,
308
+ class: "current-subscription-card"
309
+ }, en = {
310
+ class: "subscription-header"
311
+ }, tn = {
312
+ class: "subscription-info"
313
+ }, nn = {
314
+ class: "subscription-actions"
315
+ }, an = {
316
+ class: "subscription-details"
317
+ }, sn = {
318
+ key: 0,
319
+ class: "detail-item"
320
+ }, on = {
321
+ key: 1,
322
+ class: "detail-item"
323
+ }, ln = {
324
+ key: 2,
325
+ class: "detail-item"
326
+ }, rn = {
327
+ key: 3,
328
+ class: "detail-item"
329
+ }, un = {
330
+ class: "label"
331
+ }, cn = {
332
+ key: 4,
333
+ class: "detail-item warning"
334
+ }, dn = {
335
+ key: 5,
336
+ class: "detail-item warning"
337
+ }, pn = {
338
+ key: 6,
339
+ class: "detail-item"
340
+ }, vn = {
341
+ key: 0,
342
+ class: "pending-invoice-alert"
343
+ }, gn = {
344
+ key: 1,
345
+ class: "no-subscription-row"
346
+ }, fn = {
347
+ class: "overview-grid"
348
+ }, mn = {
349
+ class: "overview-card"
350
+ }, yn = {
351
+ class: "overview-card__value"
352
+ }, _n = {
353
+ key: 0,
354
+ class: "overview-card__meta"
355
+ }, bn = {
356
+ class: "overview-card"
357
+ }, wn = {
358
+ class: "overview-card__value"
359
+ }, hn = {
360
+ class: "overview-card"
361
+ }, Pn = {
362
+ class: "overview-card__value"
363
+ }, kn = {
364
+ key: 0,
365
+ class: "quotas-loading"
366
+ }, Sn = {
367
+ key: 1,
368
+ class: "no-quotas"
369
+ }, In = {
370
+ key: 2,
371
+ class: "quotas-grid"
372
+ }, Cn = {
373
+ class: "quota-header"
374
+ }, xn = {
375
+ class: "quota-name"
376
+ }, Nn = {
377
+ class: "quota-period"
378
+ }, zn = {
379
+ class: "quota-progress"
380
+ }, Tn = {
381
+ class: "quota-detail"
382
+ }, An = {
383
+ key: 0
384
+ }, On = {
385
+ key: 1
386
+ }, Wn = {
387
+ key: 2,
388
+ class: "reset-time"
389
+ }, Ln = ["title"], Rn = {
390
+ key: 1
391
+ }, En = {
392
+ key: 0,
393
+ class: "invoice-actions"
394
+ }, $n = {
395
+ key: 1,
396
+ class: "invoice-actions"
397
+ }, Fn = {
398
+ key: 2
399
+ }, Bn = {
400
+ class: "points-panel"
401
+ }, Hn = {
402
+ class: "points-balance-card"
403
+ }, Un = {
404
+ class: "points-balance-value"
405
+ }, Dn = {
406
+ key: 0,
407
+ class: "points-loading"
408
+ }, Mn = {
409
+ key: 1,
410
+ class: "points-empty"
411
+ }, Yn = {
412
+ key: 2,
413
+ class: "points-package-grid"
414
+ }, Vn = ["onClick"], qn = {
415
+ class: "points-package-name"
416
+ }, jn = {
417
+ class: "points-package-value"
418
+ }, Kn = {
419
+ class: "points-package-meta"
420
+ }, Gn = {
421
+ class: "points-package-extra"
422
+ }, Jn = {
423
+ class: "points-pay-row"
424
+ }, Qn = {
425
+ key: 0
426
+ }, Xn = {
427
+ key: 1
428
+ }, Zn = {
429
+ key: 1
430
+ }, ea = {
431
+ key: 0,
432
+ class: "invoice-actions"
433
+ }, ta = {
434
+ key: 1
435
+ }, na = ["title"], aa = {
436
+ key: 1
437
+ }, sa = {
438
+ class: "payment-wait-content"
439
+ }, ia = {
440
+ class: "payment-wait-summary"
441
+ }, oa = {
442
+ class: "payment-wait-icon"
443
+ }, la = {
444
+ class: "payment-wait-tip"
445
+ }, ra = {
446
+ class: "payment-wait-actions"
447
+ }, ua = /* @__PURE__ */ zt({
448
+ __name: "PaySubscriptions",
449
+ emits: ["confirm", "cancel"],
450
+ setup(s, {
451
+ expose: p,
452
+ emit: y
453
+ }) {
454
+ const m = y, {
455
+ changeType: w,
456
+ show: C
457
+ } = Et(m), b = _("overview"), {
458
+ current: f,
459
+ entitlement: k,
460
+ quotas: L,
461
+ pointsBalance: z,
462
+ pendingInvoice: T,
463
+ loading: _e,
464
+ refresh: R
465
+ } = Bt(), x = W(() => k.value), te = Wt(), ne = Lt(), ae = Rt(), be = _([]), se = _(!1), F = _({
466
+ current: 1,
467
+ pageSize: 10,
468
+ total: 0,
469
+ showTotal: !0,
470
+ showPageSize: !0,
471
+ pageSizeOptions: [10, 20, 50, 100]
472
+ }), Y = _([]), B = _(""), ie = _(!1), oe = _(!1), V = _(!1), N = _(null), {
473
+ checking: De,
474
+ statusText: A,
475
+ startPolling: Me,
476
+ stopPolling: le,
477
+ verifyNow: Ye
478
+ } = Ue(), q = _(!1), we = _([]), re = _(!1), H = _({
479
+ current: 1,
480
+ pageSize: 10,
481
+ total: 0,
482
+ showTotal: !0,
483
+ showPageSize: !0,
484
+ pageSizeOptions: [10, 20, 50, 100]
485
+ }), he = _([]), ue = _(!1), U = _({
486
+ current: 1,
487
+ pageSize: 10,
488
+ total: 0,
489
+ showTotal: !0,
490
+ showPageSize: !0,
491
+ pageSizeOptions: [10, 20, 50, 100]
492
+ }), Q = W(() => Y.value.find((e) => e.id === B.value)), Ve = W(() => _e.value), qe = [{
493
+ dataIndex: "id",
494
+ slotName: "id",
495
+ title: "账单 ID",
496
+ minWidth: 280
497
+ }, {
498
+ dataIndex: "productName",
499
+ title: "价格方案",
500
+ minWidth: 180
501
+ }, {
502
+ dataIndex: "billingType",
503
+ slotName: "billingType",
504
+ title: "账单类型",
505
+ minWidth: 120
506
+ }, {
507
+ dataIndex: "total",
508
+ slotName: "total",
509
+ title: "金额",
510
+ minWidth: 110
511
+ }, {
512
+ dataIndex: "status",
513
+ slotName: "status",
514
+ title: "状态",
515
+ minWidth: 110
516
+ }, {
517
+ dataIndex: "refund",
518
+ slotName: "refund",
519
+ title: "退款状态",
520
+ minWidth: 150
521
+ }, {
522
+ dataIndex: "tradeNo",
523
+ title: "交易号",
524
+ minWidth: 320,
525
+ cellClassName: "mono-value"
526
+ }, {
527
+ dataIndex: "periodStart",
528
+ title: "周期开始",
529
+ minWidth: 180
530
+ }, {
531
+ dataIndex: "periodEnd",
532
+ title: "周期结束",
533
+ minWidth: 180
534
+ }, {
535
+ dataIndex: "paidAt",
536
+ title: "支付时间",
537
+ minWidth: 180
538
+ }, {
539
+ dataIndex: "expireAt",
540
+ title: "支付有效期",
541
+ minWidth: 180
542
+ }, {
543
+ dataIndex: "createAt",
544
+ title: "创建时间",
545
+ minWidth: 180
546
+ }, {
547
+ dataIndex: "actions",
548
+ slotName: "actions",
549
+ title: "操作",
550
+ width: 190,
551
+ fixed: "right",
552
+ cellClassName: "invoice-actions-cell"
553
+ }], je = [{
554
+ dataIndex: "packageName",
555
+ title: "套餐",
556
+ minWidth: 180
557
+ }, {
558
+ dataIndex: "price",
559
+ slotName: "price",
560
+ title: "金额",
561
+ minWidth: 110
562
+ }, {
563
+ dataIndex: "totalPoints",
564
+ slotName: "points",
565
+ title: "积分",
566
+ minWidth: 120
567
+ }, {
568
+ dataIndex: "status",
569
+ slotName: "status",
570
+ title: "状态",
571
+ minWidth: 110
572
+ }, {
573
+ dataIndex: "refund",
574
+ slotName: "refund",
575
+ title: "退款状态",
576
+ minWidth: 150
577
+ }, {
578
+ dataIndex: "outTradeNo",
579
+ title: "订单号",
580
+ minWidth: 260,
581
+ cellClassName: "mono-value"
582
+ }, {
583
+ dataIndex: "expireAt",
584
+ title: "支付有效期",
585
+ minWidth: 180
586
+ }, {
587
+ dataIndex: "createAt",
588
+ title: "创建时间",
589
+ minWidth: 180
590
+ }, {
591
+ dataIndex: "actions",
592
+ slotName: "actions",
593
+ title: "操作",
594
+ width: 120,
595
+ fixed: "right",
596
+ cellClassName: "invoice-actions-cell"
597
+ }], Ke = [{
598
+ dataIndex: "type",
599
+ slotName: "type",
600
+ title: "类型",
601
+ minWidth: 100,
602
+ align: "center"
603
+ }, {
604
+ dataIndex: "subType",
605
+ slotName: "subType",
606
+ title: "场景",
607
+ minWidth: 140,
608
+ ellipsis: !0,
609
+ tooltip: !0
610
+ }, {
611
+ dataIndex: "amount",
612
+ slotName: "amount",
613
+ title: "变动积分",
614
+ minWidth: 120,
615
+ align: "right"
616
+ }, {
617
+ dataIndex: "balance",
618
+ slotName: "balance",
619
+ title: "变动后余额",
620
+ minWidth: 120,
621
+ align: "right"
622
+ }, {
623
+ dataIndex: "description",
624
+ title: "说明",
625
+ minWidth: 300,
626
+ ellipsis: !0,
627
+ tooltip: !0
628
+ }, {
629
+ dataIndex: "orderId",
630
+ slotName: "orderId",
631
+ title: "订单号",
632
+ minWidth: 260,
633
+ cellClassName: "mono-value"
634
+ }, {
635
+ dataIndex: "createAt",
636
+ title: "时间",
637
+ minWidth: 180
638
+ }];
639
+ function Ge(e) {
640
+ return te.getStatusColor(e);
641
+ }
642
+ function Je(e) {
643
+ return te.getStatusLabel(e);
644
+ }
645
+ function Pe(e) {
646
+ return ne.getStatusColor(e);
647
+ }
648
+ function ke(e) {
649
+ return ne.getStatusLabel(e);
650
+ }
651
+ function Qe(e) {
652
+ return ae.getStatusColor(e);
653
+ }
654
+ function Xe(e) {
655
+ return ae.getStatusLabel(e);
656
+ }
657
+ function Ze(e) {
658
+ return e ? {
659
+ new_subscription: "新购",
660
+ upgrade: "升级",
661
+ downgrade: "降级",
662
+ renewal: "续费",
663
+ subscription: "订阅"
664
+ }[e] || e : "-";
665
+ }
666
+ function Se() {
667
+ var e;
668
+ return ((e = z.value) == null ? void 0 : e.totalPoints) ?? 0;
669
+ }
670
+ function Ie(e) {
671
+ return Se() >= e.totalPoints;
672
+ }
673
+ function et(e) {
674
+ return `退款将原路退钱,并扣除 ${E(e.totalPoints)} 积分。当前余额 ${E(Se())}。提交后将进入人工审核,确定申请退款吗?`;
675
+ }
676
+ function tt(e) {
677
+ return {
678
+ day: "每天",
679
+ week: "每周",
680
+ month: "每月",
681
+ year: "每年",
682
+ lifetime: "不重置"
683
+ }[e] || e;
684
+ }
685
+ function Ce(e, t = 1) {
686
+ const u = t > 1 ? `每 ${t} ` : "按", h = {
687
+ day: `${u}天`,
688
+ week: `${u}周`,
689
+ month: `${u}月`,
690
+ year: `${u}年`
691
+ };
692
+ return e ? h[e] || e : "-";
693
+ }
694
+ function nt(e, t, u = 1) {
695
+ if (typeof e != "number") return "-";
696
+ const h = Ce(t, u).replace("按", "").replace("每 ", "");
697
+ return `¥${(e / 100).toFixed(2)} / ${h}`;
698
+ }
699
+ function E(e) {
700
+ return Ut(e);
701
+ }
702
+ function at(e) {
703
+ return typeof e == "number" ? me(e) : "-";
704
+ }
705
+ function st(e) {
706
+ return e > 0 ? "point-history-amount-positive" : e < 0 ? "point-history-amount-negative" : "";
707
+ }
708
+ function it() {
709
+ C.value = !1, m("cancel");
710
+ }
711
+ function ce() {
712
+ Jt();
713
+ }
714
+ async function ot() {
715
+ b.value = "invoices", await j();
716
+ }
717
+ async function lt() {
718
+ await Promise.all([te.statusOptionsApi(), ne.statusOptionsApi(), ae.statusOptionsApi()]);
719
+ }
720
+ async function rt() {
721
+ await R();
722
+ }
723
+ async function xe(e) {
724
+ e === "points" ? (H.value.current = 1, await Promise.all([ut(), D()])) : e === "usage" ? (U.value.current = 1, await G()) : e === "invoices" && (F.value.current = 1, await j());
725
+ }
726
+ async function j() {
727
+ se.value = !0;
728
+ const {
729
+ data: e,
730
+ error: t
731
+ } = await S().billing.invoices.my.post({
732
+ current: F.value.current,
733
+ pageSize: F.value.pageSize
734
+ });
735
+ if (se.value = !1, t || !e)
736
+ return;
737
+ const u = e;
738
+ be.value = u.items ?? [], F.value.total = u.count ?? 0;
739
+ }
740
+ async function D() {
741
+ re.value = !0;
742
+ const {
743
+ data: e,
744
+ error: t
745
+ } = await S().billing.pointsRecharge.orders.post({
746
+ page: H.value.current,
747
+ pageSize: H.value.pageSize
748
+ });
749
+ if (re.value = !1, t || !e)
750
+ return;
751
+ const u = e;
752
+ we.value = u.items ?? [], H.value.total = u.count ?? 0;
753
+ }
754
+ async function G() {
755
+ ue.value = !0;
756
+ const {
757
+ data: e,
758
+ error: t
759
+ } = await S().billing.pointsHistory.find.post({
760
+ page: U.value.current,
761
+ pageSize: U.value.pageSize
762
+ });
763
+ if (ue.value = !1, t || !e)
764
+ return;
765
+ const u = e;
766
+ he.value = u.items ?? [], U.value.total = u.count ?? 0;
767
+ }
768
+ async function ut() {
769
+ ie.value = !0;
770
+ const {
771
+ data: e,
772
+ error: t
773
+ } = await S().billing.pointsRecharge.packages.post();
774
+ if (ie.value = !1, t || !e)
775
+ return;
776
+ const u = e;
777
+ Y.value = u.packages ?? [], Y.value.length > 0 && !B.value && (B.value = Y.value[0].id);
778
+ }
779
+ async function ct() {
780
+ var h;
781
+ if (!B.value) return;
782
+ oe.value = !0, N.value = null, A.value = "";
783
+ const {
784
+ data: e,
785
+ error: t
786
+ } = await S().billing.pointsRecharge.createOrder.post({
787
+ packageId: B.value,
788
+ payType: "alipay"
789
+ });
790
+ if (oe.value = !1, t || !e)
791
+ return;
792
+ const u = e;
793
+ if (!u.alipayUrl) {
794
+ M.error("获取支付链接失败");
795
+ return;
796
+ }
797
+ N.value = {
798
+ orderId: u.orderId,
799
+ packageName: ((h = Q.value) == null ? void 0 : h.name) || "积分充值",
800
+ priceYuan: u.priceYuan,
801
+ totalPoints: u.totalPoints
802
+ }, window.open(u.alipayUrl, "_blank", "noopener,noreferrer"), V.value = !0, dt(u.orderId), await D();
803
+ }
804
+ function dt(e) {
805
+ A.value = "等待支付确认...", Me({
806
+ scene: "recharge",
807
+ orderId: e,
808
+ onSuccess: async (t) => {
809
+ var h;
810
+ const u = t.pointsAdded || ((h = N.value) == null ? void 0 : h.totalPoints) || 0;
811
+ V.value = !1, N.value = null, A.value = "", M.success(`充值成功,已到账 ${E(u)} 积分`), await R(), await D(), await G();
812
+ },
813
+ onWaiting: (t) => {
814
+ A.value = t.message || "等待支付确认...";
815
+ },
816
+ onError: (t) => {
817
+ A.value = t instanceof Error ? t.message : "查询支付状态失败";
818
+ }
819
+ });
820
+ }
821
+ async function pt() {
822
+ var t, u;
823
+ if (!((t = N.value) != null && t.orderId)) return;
824
+ const e = await Ye("recharge", N.value.orderId);
825
+ if (e.error) {
826
+ A.value = e.message || "查询支付状态失败";
827
+ return;
828
+ }
829
+ if (e.success) {
830
+ const h = e.pointsAdded || ((u = N.value) == null ? void 0 : u.totalPoints) || 0;
831
+ le(), V.value = !1, N.value = null, A.value = "", M.success(`充值成功,已到账 ${E(h)} 积分`), await R(), await D(), await G();
832
+ return;
833
+ }
834
+ A.value = e.message || "等待支付确认...";
835
+ }
836
+ function Ne() {
837
+ le(), V.value = !1, N.value = null, A.value = "", D();
838
+ }
839
+ async function vt(e) {
840
+ const {
841
+ data: t,
842
+ error: u
843
+ } = await S().billing.invoices.pay.post({
844
+ id: e.id
845
+ });
846
+ u || !(t != null && t.alipayUrl) || window.open(t.alipayUrl, "_blank", "noopener,noreferrer");
847
+ }
848
+ async function gt(e) {
849
+ const {
850
+ error: t
851
+ } = await S().billing.invoices.cancel.post({
852
+ id: e.id,
853
+ reason: "用户取消待支付订阅账单"
854
+ });
855
+ t || (M.success("账单已取消"), await R(), await j());
856
+ }
857
+ async function ft(e) {
858
+ if (q.value) return;
859
+ q.value = !0;
860
+ const {
861
+ error: t
862
+ } = await S().billing.refund.applySubscription.post({
863
+ invoiceId: e.id,
864
+ reason: "用户申请订阅退款"
865
+ });
866
+ q.value = !1, !t && (M.success("退款申请已提交,等待人工审核"), await R(), await j());
867
+ }
868
+ async function mt(e) {
869
+ if (q.value) return;
870
+ if (!Ie(e)) {
871
+ M.warning("账户积分不足,无法退款");
872
+ return;
873
+ }
874
+ q.value = !0;
875
+ const {
876
+ error: t
877
+ } = await S().billing.refund.apply.post({
878
+ orderId: e.id,
879
+ reason: "用户申请充值退款"
880
+ });
881
+ q.value = !1, !t && (M.success("退款申请已提交,等待人工审核"), await R(), await D());
882
+ }
883
+ async function yt() {
884
+ if (!f.value) return;
885
+ const {
886
+ error: e
887
+ } = await S().billing.subscriptions.cancel.post({
888
+ subscriptionId: f.value.id,
889
+ cancelAtPeriodEnd: !0
890
+ });
891
+ e || await R();
892
+ }
893
+ async function _t() {
894
+ if (!f.value) return;
895
+ const {
896
+ error: e
897
+ } = await S().billing.subscriptions.resume.post({
898
+ subscriptionId: f.value.id
899
+ });
900
+ e || await R();
901
+ }
902
+ function bt(e) {
903
+ F.value.current = e, j();
904
+ }
905
+ function wt(e) {
906
+ F.value.pageSize = e, F.value.current = 1, j();
907
+ }
908
+ function ht(e) {
909
+ H.value.current = e, D();
910
+ }
911
+ function Pt(e) {
912
+ H.value.pageSize = e, H.value.current = 1, D();
913
+ }
914
+ function kt(e) {
915
+ U.value.current = e, G();
916
+ }
917
+ function St(e) {
918
+ U.value.pageSize = e, U.value.current = 1, G();
919
+ }
920
+ function It(e) {
921
+ return (e == null ? void 0 : e.target) === "points" ? "points" : (e == null ? void 0 : e.target) === "usage" ? "usage" : (e == null ? void 0 : e.target) === "invoices" || (e == null ? void 0 : e.target) === "subscriptions" ? "invoices" : ((e == null ? void 0 : e.target) === "quotas", "overview");
922
+ }
923
+ function Ct(e) {
924
+ xe(String(e));
925
+ }
926
+ function xt(e, t) {
927
+ C.value = t, w.value = "编辑", b.value = It(e), t && (lt(), rt(), xe(b.value));
928
+ }
929
+ return Fe(() => {
930
+ le();
931
+ }), p({
932
+ setData: xt
933
+ }), (e, t) => (l(), d(X, null, [c(n(Oe), {
934
+ visible: n(C),
935
+ "onUpdate:visible": t[1] || (t[1] = (u) => Tt(C) ? C.value = u : null),
936
+ loading: !1,
937
+ "body-class": "SubscriptionsbodyClass",
938
+ "mask-closable": !1,
939
+ footer: !1,
940
+ width: n(Nt),
941
+ "unmount-on-close": "",
942
+ onCancel: it
943
+ }, {
944
+ title: i(() => [...t[3] || (t[3] = [g(" 订阅与积分 ", -1)])]),
945
+ default: i(() => {
946
+ var u, h, ze;
947
+ return [a("div", Xt, [x.value ? (l(), d("div", Zt, [a("div", en, [a("div", tn, [a("h3", null, r(n(Re)(x.value)), 1)]), a("div", nn, [x.value.type === "trial" ? (l(), K(n(P), {
948
+ key: 0,
949
+ type: "primary",
950
+ size: "small",
951
+ onClick: ce
952
+ }, {
953
+ default: i(() => [...t[4] || (t[4] = [g(" 立即订阅 ", -1)])]),
954
+ _: 1
955
+ })) : (u = n(f)) != null && u.cancelAtPeriodEnd ? (l(), K(n(P), {
956
+ key: 1,
957
+ type: "primary",
958
+ size: "small",
959
+ onClick: _t
960
+ }, {
961
+ default: i(() => [...t[5] || (t[5] = [g(" 恢复订阅 ", -1)])]),
962
+ _: 1
963
+ })) : n(f) ? (l(), d(X, {
964
+ key: 2
965
+ }, [c(n(P), {
966
+ type: "primary",
967
+ size: "small",
968
+ onClick: ce
969
+ }, {
970
+ default: i(() => [...t[6] || (t[6] = [g(" 修改订阅 ", -1)])]),
971
+ _: 1
972
+ }), c(n(Z), {
973
+ content: "取消后订阅将在当前周期结束时失效,确定取消吗?",
974
+ onOk: yt
975
+ }, {
976
+ default: i(() => [c(n(P), {
977
+ type: "outline",
978
+ size: "small",
979
+ status: "warning"
980
+ }, {
981
+ default: i(() => [...t[7] || (t[7] = [g(" 取消订阅 ", -1)])]),
982
+ _: 1
983
+ })]),
984
+ _: 1
985
+ })], 64)) : O("", !0)])]), a("div", an, [n(f) ? (l(), d("div", sn, [t[8] || (t[8] = a("span", {
986
+ class: "label"
987
+ }, "价格方案:", -1)), a("span", null, r(x.value.productName), 1)])) : O("", !0), n(f) ? (l(), d("div", on, [t[9] || (t[9] = a("span", {
988
+ class: "label"
989
+ }, "计费周期:", -1)), a("span", null, r(Ce(n(f).interval, n(f).intervalCount)), 1)])) : O("", !0), n(f) ? (l(), d("div", ln, [t[10] || (t[10] = a("span", {
990
+ class: "label"
991
+ }, "价格:", -1)), a("span", null, r(nt(n(f).unitAmount, n(f).interval, n(f).intervalCount)), 1)])) : O("", !0), x.value.endAt ? (l(), d("div", rn, [a("span", un, r(n(Ee)(x.value)) + ":", 1), a("span", null, r(x.value.endAt), 1)])) : O("", !0), (h = n(f)) != null && h.cancelAtPeriodEnd ? (l(), d("div", cn, [...t[11] || (t[11] = [a("span", {
992
+ class: "label"
993
+ }, "订阅将于周期结束后停止", -1)])])) : (ze = n(f)) != null && ze.pendingChange ? (l(), d("div", dn, [t[12] || (t[12] = a("span", {
994
+ class: "label"
995
+ }, "到期后变更为:", -1)), a("span", null, r(n(f).pendingChange.productName || "新方案"), 1)])) : O("", !0), n(z) ? (l(), d("div", pn, [t[13] || (t[13] = a("span", {
996
+ class: "label"
997
+ }, "积分余额:", -1)), a("span", null, r(n(fe)(n(z).totalPoints)), 1)])) : O("", !0)]), n(T) ? (l(), d("div", vn, [t[15] || (t[15] = a("div", null, [a("strong", null, "存在待支付订阅账单"), a("span", null, "可继续支付,也可取消后重新选择方案。")], -1)), c(n(P), {
998
+ type: "primary",
999
+ status: "warning",
1000
+ size: "small",
1001
+ onClick: ot
1002
+ }, {
1003
+ default: i(() => [...t[14] || (t[14] = [g(" 处理 ", -1)])]),
1004
+ _: 1
1005
+ })])) : O("", !0)])) : (l(), d("div", gn, [t[17] || (t[17] = a("span", {
1006
+ class: "no-subscription-text"
1007
+ }, "您当前尚未订阅任何套餐", -1)), c(n(P), {
1008
+ type: "primary",
1009
+ size: "small",
1010
+ onClick: ce
1011
+ }, {
1012
+ default: i(() => [...t[16] || (t[16] = [g("立即订阅", -1)])]),
1013
+ _: 1
1014
+ })])), c(n(At), {
1015
+ "active-key": b.value,
1016
+ "onUpdate:activeKey": t[0] || (t[0] = (o) => b.value = o),
1017
+ class: "subscription-tabs",
1018
+ onChange: Ct
1019
+ }, {
1020
+ default: i(() => [c(n(ee), {
1021
+ key: "overview",
1022
+ title: "概览"
1023
+ }, {
1024
+ default: i(() => {
1025
+ var o, v;
1026
+ return [a("div", fn, [a("div", mn, [t[18] || (t[18] = a("div", {
1027
+ class: "overview-card__label"
1028
+ }, "当前权益", -1)), a("div", yn, r(n(Re)(x.value)), 1), (o = x.value) != null && o.endAt ? (l(), d("div", _n, r(n(Ee)(x.value)) + ":" + r(x.value.endAt), 1)) : O("", !0)]), a("div", bn, [t[19] || (t[19] = a("div", {
1029
+ class: "overview-card__label"
1030
+ }, "积分余额", -1)), a("div", wn, r(n(fe)((v = n(z)) == null ? void 0 : v.totalPoints)), 1), t[20] || (t[20] = a("div", {
1031
+ class: "overview-card__meta"
1032
+ }, "用于 AI 模型调用和按量服务消费", -1))]), a("div", hn, [t[21] || (t[21] = a("div", {
1033
+ class: "overview-card__label"
1034
+ }, "待支付订阅账单", -1)), a("div", Pn, r(n(T) ? `¥${(n(T).total / 100).toFixed(2)}` : "无"), 1), t[22] || (t[22] = a("div", {
1035
+ class: "overview-card__meta"
1036
+ }, "仅包含订阅方案产生的待支付账单", -1))])]), Ve.value ? (l(), d("div", kn, [c(n(de))])) : n(L).length === 0 ? (l(), d("div", Sn, [c(n(We), {
1037
+ description: "暂无配额限制"
1038
+ })])) : (l(), d("div", In, [(l(!0), d(X, null, Te(n(L), (I) => (l(), d("div", {
1039
+ key: I.featureKey,
1040
+ class: "quota-card"
1041
+ }, [a("div", Cn, [a("span", xn, r(I.name), 1), a("span", Nn, r(tt(I.period)), 1)]), a("div", zn, [c(n(Ot), {
1042
+ percent: I.percentage,
1043
+ status: I.percentage >= 90 ? "danger" : I.percentage >= 70 ? "warning" : "normal"
1044
+ }, null, 8, ["percent", "status"])]), a("div", Tn, [I.unlimited ? (l(), d("span", An, "无限制")) : (l(), d("span", On, "已使用 " + r(I.used) + " / " + r(I.limit), 1)), I.resetsAt ? (l(), d("span", Wn, r(I.resetsAt) + " 重置", 1)) : O("", !0)])]))), 128))]))];
1045
+ }),
1046
+ _: 1
1047
+ }), c(n(ee), {
1048
+ key: "invoices",
1049
+ title: "订阅账单"
1050
+ }, {
1051
+ default: i(() => [c(ve, {
1052
+ columns: qe,
1053
+ data: be.value,
1054
+ loading: se.value,
1055
+ pagination: F.value,
1056
+ onPageChange: bt,
1057
+ onPageSizeChange: wt
1058
+ }, {
1059
+ id: i(({
1060
+ record: o
1061
+ }) => [a("span", {
1062
+ class: "copyable-id mono-value",
1063
+ title: o.id
1064
+ }, [a("span", null, r(o.id), 1), c(Le, {
1065
+ value: o.id,
1066
+ message: "账单 ID 已复制"
1067
+ }, null, 8, ["value"])], 8, Ln)]),
1068
+ status: i(({
1069
+ record: o
1070
+ }) => [c(n(J), {
1071
+ color: Ge(o.status)
1072
+ }, {
1073
+ default: i(() => [g(r(Je(o.status)), 1)]),
1074
+ _: 2
1075
+ }, 1032, ["color"])]),
1076
+ billingType: i(({
1077
+ record: o
1078
+ }) => [g(r(Ze(o.billingType)), 1)]),
1079
+ refund: i(({
1080
+ record: o
1081
+ }) => [o.refund ? (l(), K(n(pe), {
1082
+ key: 0,
1083
+ content: n($e)(o.refund.status)
1084
+ }, {
1085
+ default: i(() => [c(n(J), {
1086
+ color: Pe(o.refund.status)
1087
+ }, {
1088
+ default: i(() => [g(r(ke(o.refund.status)), 1)]),
1089
+ _: 2
1090
+ }, 1032, ["color"])]),
1091
+ _: 2
1092
+ }, 1032, ["content"])) : (l(), d("span", Rn, "-"))]),
1093
+ total: i(({
1094
+ record: o
1095
+ }) => [g(" ¥" + r((o.total / 100).toFixed(2)), 1)]),
1096
+ actions: i(({
1097
+ record: o
1098
+ }) => [o.status === "open" ? (l(), d("div", En, [c(n(P), {
1099
+ type: "primary",
1100
+ status: "warning",
1101
+ size: "small",
1102
+ onClick: (v) => vt(o)
1103
+ }, {
1104
+ default: i(() => [...t[23] || (t[23] = [g(" 去支付 ", -1)])]),
1105
+ _: 1
1106
+ }, 8, ["onClick"]), c(n(Z), {
1107
+ content: "取消后可重新发起支付,订阅方案不会变更。确定取消吗?",
1108
+ onOk: (v) => gt(o)
1109
+ }, {
1110
+ default: i(() => [c(n(P), {
1111
+ type: "secondary",
1112
+ status: "warning",
1113
+ size: "small"
1114
+ }, {
1115
+ default: i(() => [...t[24] || (t[24] = [g("取消支付", -1)])]),
1116
+ _: 1
1117
+ })]),
1118
+ _: 1
1119
+ }, 8, ["onOk"])])) : o.status === "paid" && !o.refund ? (l(), d("div", $n, [c(n(Z), {
1120
+ content: "提交后将进入人工审核,审核通过后原路退款。确定申请退款吗?",
1121
+ onOk: (v) => ft(o)
1122
+ }, {
1123
+ default: i(() => [c(n(P), {
1124
+ type: "secondary",
1125
+ size: "small"
1126
+ }, {
1127
+ default: i(() => [...t[25] || (t[25] = [g(" 申请退款 ", -1)])]),
1128
+ _: 1
1129
+ })]),
1130
+ _: 1
1131
+ }, 8, ["onOk"])])) : (l(), d("span", Fn, "-"))]),
1132
+ _: 1
1133
+ }, 8, ["data", "loading", "pagination"])]),
1134
+ _: 1
1135
+ }), c(n(ee), {
1136
+ key: "points",
1137
+ title: "积分账户"
1138
+ }, {
1139
+ default: i(() => {
1140
+ var o;
1141
+ return [a("div", Bn, [a("div", Hn, [a("div", null, [t[26] || (t[26] = a("div", {
1142
+ class: "points-balance-label"
1143
+ }, "当前积分余额", -1)), a("div", Un, r(n(fe)((o = n(z)) == null ? void 0 : o.totalPoints)), 1), t[27] || (t[27] = a("div", {
1144
+ class: "points-balance-tip"
1145
+ }, "充值后实时到账。退款需账户积分不少于该单充值积分。", -1))]), c(n(P), {
1146
+ loading: n(_e),
1147
+ onClick: n(R)
1148
+ }, {
1149
+ default: i(() => [...t[28] || (t[28] = [g("刷新余额", -1)])]),
1150
+ _: 1
1151
+ }, 8, ["loading", "onClick"])]), t[32] || (t[32] = a("div", {
1152
+ class: "points-section-header"
1153
+ }, [a("h4", null, "充值套餐")], -1)), ie.value ? (l(), d("div", Dn, [c(n(de))])) : Y.value.length === 0 ? (l(), d("div", Mn, [c(n(We), {
1154
+ description: "暂无充值套餐"
1155
+ })])) : (l(), d("div", Yn, [(l(!0), d(X, null, Te(Y.value, (v) => (l(), d("button", {
1156
+ key: v.id,
1157
+ type: "button",
1158
+ class: Ae(["points-package", {
1159
+ "points-package--selected": B.value === v.id
1160
+ }]),
1161
+ onClick: (I) => B.value = v.id
1162
+ }, [a("span", qn, r(v.name), 1), a("span", jn, r(E(v.totalPoints)) + " 积分", 1), a("span", Kn, "¥" + r(v.priceYuan), 1), a("span", Gn, " 基础 " + r(E(v.points)) + " · 赠送 " + r(E(v.bonus)), 1)], 10, Vn))), 128))])), a("div", Jn, [Q.value ? (l(), d("span", Qn, " 应付 ¥" + r(Q.value.priceYuan) + ",获得 " + r(E(Q.value.totalPoints)) + " 积分 ", 1)) : (l(), d("span", Xn, "请选择充值套餐")), c(n(P), {
1163
+ type: "primary",
1164
+ loading: oe.value,
1165
+ disabled: !B.value,
1166
+ onClick: ct
1167
+ }, {
1168
+ default: i(() => [...t[29] || (t[29] = [g(" 立即充值 ", -1)])]),
1169
+ _: 1
1170
+ }, 8, ["loading", "disabled"])]), t[33] || (t[33] = a("div", {
1171
+ class: "points-section-header"
1172
+ }, [a("h4", null, "充值记录")], -1)), c(ve, {
1173
+ columns: je,
1174
+ data: we.value,
1175
+ loading: re.value,
1176
+ pagination: H.value,
1177
+ onPageChange: ht,
1178
+ onPageSizeChange: Pt
1179
+ }, {
1180
+ price: i(({
1181
+ record: v
1182
+ }) => [g(" ¥" + r(v.priceYuan), 1)]),
1183
+ points: i(({
1184
+ record: v
1185
+ }) => [g(r(E(v.totalPoints)), 1)]),
1186
+ status: i(({
1187
+ record: v
1188
+ }) => [c(n(J), {
1189
+ color: Qe(v.status)
1190
+ }, {
1191
+ default: i(() => [g(r(Xe(v.status)), 1)]),
1192
+ _: 2
1193
+ }, 1032, ["color"])]),
1194
+ refund: i(({
1195
+ record: v
1196
+ }) => [v.refund ? (l(), K(n(pe), {
1197
+ key: 0,
1198
+ content: n($e)(v.refund.status)
1199
+ }, {
1200
+ default: i(() => [c(n(J), {
1201
+ color: Pe(v.refund.status)
1202
+ }, {
1203
+ default: i(() => [g(r(ke(v.refund.status)), 1)]),
1204
+ _: 2
1205
+ }, 1032, ["color"])]),
1206
+ _: 2
1207
+ }, 1032, ["content"])) : (l(), d("span", Zn, "-"))]),
1208
+ actions: i(({
1209
+ record: v
1210
+ }) => [v.status === "paid" && !v.refund ? (l(), d("div", ea, [Ie(v) ? (l(), K(n(Z), {
1211
+ key: 0,
1212
+ content: et(v),
1213
+ onOk: (I) => mt(v)
1214
+ }, {
1215
+ default: i(() => [c(n(P), {
1216
+ type: "secondary",
1217
+ size: "small"
1218
+ }, {
1219
+ default: i(() => [...t[30] || (t[30] = [g(" 申请退款 ", -1)])]),
1220
+ _: 1
1221
+ })]),
1222
+ _: 1
1223
+ }, 8, ["content", "onOk"])) : (l(), K(n(pe), {
1224
+ key: 1,
1225
+ content: "账户积分不足,无法退款"
1226
+ }, {
1227
+ default: i(() => [c(n(P), {
1228
+ type: "secondary",
1229
+ size: "small",
1230
+ disabled: ""
1231
+ }, {
1232
+ default: i(() => [...t[31] || (t[31] = [g(" 积分不足 ", -1)])]),
1233
+ _: 1
1234
+ })]),
1235
+ _: 1
1236
+ }))])) : (l(), d("span", ta, "-"))]),
1237
+ _: 1
1238
+ }, 8, ["data", "loading", "pagination"])])];
1239
+ }),
1240
+ _: 1
1241
+ }), c(n(ee), {
1242
+ key: "usage",
1243
+ title: "积分流水"
1244
+ }, {
1245
+ default: i(() => [c(ve, {
1246
+ columns: Ke,
1247
+ data: he.value,
1248
+ loading: ue.value,
1249
+ pagination: U.value,
1250
+ onPageChange: kt,
1251
+ onPageSizeChange: St
1252
+ }, {
1253
+ type: i(({
1254
+ record: o
1255
+ }) => [c(n(J), {
1256
+ color: n(qt)(o.type)
1257
+ }, {
1258
+ default: i(() => [g(r(n(Vt)(o.type)), 1)]),
1259
+ _: 2
1260
+ }, 1032, ["color"])]),
1261
+ subType: i(({
1262
+ record: o
1263
+ }) => [g(r(n(Yt)(o.subType)), 1)]),
1264
+ amount: i(({
1265
+ record: o
1266
+ }) => [a("span", {
1267
+ class: Ae(st(o.amount))
1268
+ }, r(n(Dt)(o.amount)), 3)]),
1269
+ balance: i(({
1270
+ record: o
1271
+ }) => [g(r(at(o.balance)), 1)]),
1272
+ orderId: i(({
1273
+ record: o
1274
+ }) => [o.orderId ? (l(), d("span", {
1275
+ key: 0,
1276
+ class: "copyable-id mono-value",
1277
+ title: o.orderId
1278
+ }, [a("span", null, r(o.orderId), 1), c(Le, {
1279
+ value: o.orderId,
1280
+ message: "订单号已复制"
1281
+ }, null, 8, ["value"])], 8, na)) : (l(), d("span", aa, "-"))]),
1282
+ _: 1
1283
+ }, 8, ["data", "loading", "pagination"])]),
1284
+ _: 1
1285
+ })]),
1286
+ _: 1
1287
+ }, 8, ["active-key"])])];
1288
+ }),
1289
+ _: 1
1290
+ }, 8, ["visible", "width"]), c(n(Oe), {
1291
+ visible: V.value,
1292
+ "onUpdate:visible": t[2] || (t[2] = (u) => V.value = u),
1293
+ title: "等待支付完成",
1294
+ footer: !1,
1295
+ "mask-closable": !1,
1296
+ width: 380,
1297
+ onCancel: Ne
1298
+ }, {
1299
+ default: i(() => {
1300
+ var u, h;
1301
+ return [a("div", sa, [a("div", ia, [a("span", null, r(((u = N.value) == null ? void 0 : u.packageName) || "积分充值"), 1), a("strong", null, "¥" + r(((h = N.value) == null ? void 0 : h.priceYuan) || "0.00"), 1)]), a("div", oa, [c(n(de), {
1302
+ size: 32
1303
+ })]), a("div", la, [t[34] || (t[34] = a("span", null, "支付宝收银台已在浏览器打开", -1)), a("small", null, r(n(A) || "请在支付宝页面完成支付,支付成功后这里会自动刷新余额"), 1)]), a("div", ra, [c(n(P), {
1304
+ onClick: Ne
1305
+ }, {
1306
+ default: i(() => [...t[35] || (t[35] = [g("取消", -1)])]),
1307
+ _: 1
1308
+ }), c(n(P), {
1309
+ type: "primary",
1310
+ loading: n(De),
1311
+ onClick: pt
1312
+ }, {
1313
+ default: i(() => [...t[36] || (t[36] = [g(" 我已完成支付 ", -1)])]),
1314
+ _: 1
1315
+ }, 8, ["loading"])])])];
1316
+ }),
1317
+ _: 1
1318
+ }, 8, ["visible"])], 64));
1319
+ }
1320
+ }), za = /* @__PURE__ */ Ft(ua, [["__scopeId", "data-v-3e2aad1e"]]);
1321
+ export {
1322
+ za as P,
1323
+ Ue as a,
1324
+ Na as b,
1325
+ Ht as c,
1326
+ fe as f,
1327
+ Re as g,
1328
+ xa as s,
1329
+ Bt as u,
1330
+ jt as v
1331
+ };