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