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