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