@huyooo/ui 1.0.3 → 1.0.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.
Files changed (182) hide show
  1. package/dist/AuthkitAppSetting-BN8-xgNq.js +2674 -0
  2. package/dist/{Contact-M6iyuyNL.js → Contact-DBH8CyKp.js} +105 -113
  3. package/dist/CustomTable-BzGfaAVH.js +276 -0
  4. package/dist/FeedbackModal.vue_vue_type_script_setup_true_lang-B9BqGWm8.js +1480 -0
  5. package/dist/LandingPageDescription-BczWZHKy.js +12 -0
  6. package/dist/{LandingPageLinkGroup-DDNRivMt.js → LandingPageLinkGroup-r-t3H1X0.js} +87 -88
  7. package/dist/LandingPageSectionHeader-CVAqc7bx.js +137 -0
  8. package/dist/{LandingPageSectionTabs-Ce3_Rc2L.js → LandingPageSectionTabs-DhKpOj5F.js} +300 -309
  9. package/dist/LegalDocViewer-DlaLKGyX.js +2501 -0
  10. package/dist/Menu-uCexrsKP.js +199 -0
  11. package/dist/MessageHandle-mEkCsv9e.js +1173 -0
  12. package/dist/MessageList-Ce-_LNTk.js +244 -0
  13. package/dist/PaySubscriptions-CXkEjqr2.js +1326 -0
  14. package/dist/PricingPlans-DoWP5aX7.js +427 -0
  15. package/dist/ReferrerReferees-DgygiIiE.js +237 -0
  16. package/dist/{Upload.vue_vue_type_script_setup_true_lang-B6NOZjK0.js → Upload.vue_vue_type_script_setup_true_lang-VGh2V4o0.js} +1 -1
  17. package/dist/UserMenuInvitationsItem.vue_vue_type_script_setup_true_lang-zgjpFVln.js +592 -0
  18. package/dist/WidthContainer-PeWkCK0p.js +721 -0
  19. package/dist/{apiClients-DrGX2iJy.js → apiClients-BcXOLuYu.js} +131 -98
  20. package/dist/authkit.d.ts +6 -2
  21. package/dist/authkit.js +53 -44
  22. package/dist/common/authProviderIcons.d.ts +12 -0
  23. package/dist/common/globalConfig.d.ts +5 -0
  24. package/dist/common/tableColumnWidths.d.ts +11 -0
  25. package/dist/common.js +3 -3
  26. package/dist/components/AuthProviderIcon.vue.d.ts +12 -0
  27. package/dist/components/Authkit/AppSetting/AuthkitEmailVerify.vue.d.ts +2 -2
  28. package/dist/components/Authkit/AppSetting/AuthkitOAuthBinding.vue.d.ts +2 -1
  29. package/dist/components/Authkit/AppSetting/AuthkitPasskeyBinding.vue.d.ts +14 -0
  30. package/dist/components/Authkit/AppSetting/AuthkitPasswordUpdate.vue.d.ts +11 -1
  31. package/dist/components/Authkit/AppSetting/AuthkitPersonalInformation.vue.d.ts +1 -3
  32. package/dist/components/Authkit/AppSetting/AuthkitPhoneVerify.vue.d.ts +13 -3
  33. package/dist/components/Authkit/Auth/AuthkitBindEmail.vue.d.ts +29 -2
  34. package/dist/components/Authkit/Auth/AuthkitBindPhone.vue.d.ts +2 -2
  35. package/dist/components/Authkit/Auth/AuthkitEmailUpdate.vue.d.ts +2 -2
  36. package/dist/components/Authkit/Auth/AuthkitOauthItem.vue.d.ts +37 -9
  37. package/dist/components/Authkit/Auth/AuthkitOauthList.vue.d.ts +7 -11
  38. package/dist/components/Authkit/Auth/AuthkitPasswordUpdateAndVerify.vue.d.ts +2 -2
  39. package/dist/components/Authkit/Auth/AuthkitPhonePasswordUpdateAndVerify.vue.d.ts +2 -2
  40. package/dist/components/Authkit/Auth/AuthkitServiceAgreementAndPrivacyProtection.vue.d.ts +11 -7
  41. package/dist/components/Authkit/Auth/AuthkitSignInEmailCode.vue.d.ts +2 -2
  42. package/dist/components/Authkit/Auth/AuthkitSignInPhone.vue.d.ts +3 -62
  43. package/dist/components/Authkit/Auth/AuthkitSignUpPhone.vue.d.ts +2 -2
  44. package/dist/components/Authkit/Auth/AuthkitSwitchSignUpOrResetPassword.vue.d.ts +9 -0
  45. package/dist/components/Authkit/AuthkitAuth.vue.d.ts +2 -8
  46. package/dist/components/Authkit/AuthkitAuthModal.vue.d.ts +0 -4
  47. package/dist/components/Authkit/AuthkitProvider.vue.d.ts +5 -2
  48. package/dist/components/Authkit/AuthkitSendVerifyCode.vue.d.ts +2 -1
  49. package/dist/components/CustomTable.vue.d.ts +27 -1
  50. package/dist/components/Ellipsis.vue.d.ts +2 -6
  51. package/dist/components/Feedback/FeedbackList.vue.d.ts +4 -1
  52. package/dist/components/Gradientbackground.vue.d.ts +2 -2
  53. package/dist/components/HeaderMenus.vue.d.ts +4 -1
  54. package/dist/components/InfiniteLoading.vue.d.ts +1 -1
  55. package/dist/components/LandingPage/LandingPageContainer.vue.d.ts +2 -2
  56. package/dist/components/LandingPage/LandingPagePageContent.vue.d.ts +2 -2
  57. package/dist/components/LegalDoc/LegalDocViewer.vue.d.ts +7 -0
  58. package/dist/components/Menu.vue.d.ts +2 -1
  59. package/dist/components/MenuItem.vue.d.ts +3 -1
  60. package/dist/components/Message/MessageAppMessage.vue.d.ts +12 -2
  61. package/dist/components/Message/MessageDetails.vue.d.ts +9 -161
  62. package/dist/components/Message/MessageHandle.vue.d.ts +16 -4
  63. package/dist/components/Message/MessageList.vue.d.ts +4 -3
  64. package/dist/components/Message/MessageNotificationDetails.vue.d.ts +13 -0
  65. package/dist/components/Message/messageBody/DescriptionsMessageBody.vue.d.ts +3 -0
  66. package/dist/components/Message/messageBody/JsonMessageBodyFallback.vue.d.ts +3 -0
  67. package/dist/components/Message/messageBody/TextMessageBody.vue.d.ts +3 -0
  68. package/dist/components/Message/messageBody/descriptionRows.d.ts +14 -0
  69. package/dist/components/Message/messageBody/descriptionsMessageBody.d.ts +32 -0
  70. package/dist/components/Message/messageBody/descriptionsValueRender.d.ts +4 -0
  71. package/dist/components/Message/messageBody/messageBodyRegistry.d.ts +9 -0
  72. package/dist/components/Message/messageBody/registerBuiltinMessageBodies.d.ts +2 -0
  73. package/dist/components/Message/messageBody/types.d.ts +7 -0
  74. package/dist/components/Referrer/ReferrerRefereeCell.vue.d.ts +7 -0
  75. package/dist/components/Referrer/ReferrerReferees.vue.d.ts +1 -0
  76. package/dist/components/UserMenu/UserAccountMenu.vue.d.ts +1 -16
  77. package/dist/components/UserMenu/UserMenuItem.vue.d.ts +4 -0
  78. package/dist/components/UserMenu/UserMenuModals.vue.d.ts +18 -4
  79. package/dist/components/UserMenu/parts/UserAvatar.vue.d.ts +6 -0
  80. package/dist/components/UserMenu/parts/UserBasicInformation.vue.d.ts +7 -2
  81. package/dist/composables/Authkit/fetchAuthPageAboutUs.d.ts +3 -0
  82. package/dist/composables/Authkit/resolveRoutePermission.d.ts +2 -0
  83. package/dist/composables/Authkit/useAuthkitAppsAuthPageInfo.d.ts +16 -0
  84. package/dist/composables/Authkit/useAuthkitAuth.d.ts +2 -0
  85. package/dist/composables/Authkit/useAuthkitPasskey.d.ts +10 -0
  86. package/dist/composables/Authkit/useLegalDocHostActions.d.ts +6 -0
  87. package/dist/composables/Authkit/useLegalDocs.d.ts +19 -0
  88. package/dist/composables/Authkit/useOauth.d.ts +17 -4
  89. package/dist/composables/Authkit/useRegistrationTerms.d.ts +24 -0
  90. package/dist/composables/Authkit/verifyCodeCooldown.d.ts +19 -0
  91. package/dist/composables/Billing/useBillingPlans.d.ts +0 -4
  92. package/dist/composables/Billing/useBillingStatusOptions.d.ts +2 -6
  93. package/dist/composables/Billing/useBillingSubscriptionSummary.d.ts +16 -0
  94. package/dist/composables/Billing/usePaidProductOptions.d.ts +5 -0
  95. package/dist/composables/Message/messageCenterBadgeCounts.d.ts +28 -0
  96. package/dist/composables/UserMenu/useUserMenuBadgeCounts.d.ts +9 -0
  97. package/dist/composables/useInfiniteList.d.ts +19 -0
  98. package/dist/composables/useMessageNotifications.d.ts +3 -6
  99. package/dist/composables.d.ts +4 -2
  100. package/dist/composables.js +50 -45
  101. package/dist/feedback.d.ts +1 -0
  102. package/dist/feedback.js +12 -11
  103. package/dist/fetchAuthPageAboutUs-dzTSwRsB.js +25 -0
  104. package/dist/{Clipboard-Bo7gdpR6.js → index-BkLvw1PU.js} +1 -1
  105. package/dist/landingPage.js +21 -21
  106. package/dist/legalDocs/buildBuiltinUrl.d.ts +3 -0
  107. package/dist/{utils/legalLinks.d.ts → legalDocs/constants.d.ts} +0 -10
  108. package/dist/legalDocs/index.d.ts +7 -0
  109. package/dist/legalDocs/isConfigured.d.ts +7 -0
  110. package/dist/legalDocs/open.d.ts +3 -0
  111. package/dist/legalDocs/resolveAppId.d.ts +8 -0
  112. package/dist/legalDocs/resolveTarget.d.ts +4 -0
  113. package/dist/legalDocs/types.d.ts +12 -0
  114. package/dist/main.js +320 -308
  115. package/dist/message.d.ts +3 -0
  116. package/dist/message.js +301 -21
  117. package/dist/pay.d.ts +1 -1
  118. package/dist/pay.js +14 -17
  119. package/dist/privateCom.js +1 -1
  120. package/dist/referrer.js +1 -1
  121. package/dist/style.css +1 -1
  122. package/dist/types/api/auth.generated.d.ts +1385 -328
  123. package/dist/types/api/billing.generated.d.ts +907 -76
  124. package/dist/types/api/ones.generated.d.ts +131 -2
  125. package/dist/types/api.d.ts +1 -0
  126. package/dist/types/app.d.ts +10 -0
  127. package/dist/types/user.d.ts +1 -0
  128. package/dist/upload.js +2 -2
  129. package/dist/{useAuthkitAppsAuthPageInfo-C2yKgl8t.js → useAuthkitAppsAuthPageInfo-CNudJd04.js} +18 -17
  130. package/dist/useAuthkitAuth-3m0yW6uP.js +267 -0
  131. package/dist/{useAuthkitCreateAndUpdate-oo9517Gj.js → useAuthkitCreateAndUpdate-BsINsI-E.js} +1 -1
  132. package/dist/{useAuthkitUsersProfile-BZDk21c8.js → useAuthkitUsersProfile-DJlMsftY.js} +3 -3
  133. package/dist/useBillingStatusOptions-CfHQOFNw.js +71 -0
  134. package/dist/{useEnsureAuthenticated-BuIbxqsO.js → useEnsureAuthenticated-DNkCCy_Y.js} +2 -2
  135. package/dist/useLegalDocs-DQP_Yq6B.js +106 -0
  136. package/dist/{useMessageNotifications-D85_-mDq.js → useMessageNotifications-CAphguOm.js} +21 -24
  137. package/dist/useRoutePermission-CEiya9AM.js +218 -0
  138. package/dist/useSEO-CDWxbk8B.js +221 -0
  139. package/dist/useSubscriptionCheckout-d_M_rKRa.js +368 -0
  140. package/dist/{useUploadCos-BRKRzSy3.js → useUploadCos-C8BqFPkx.js} +1 -1
  141. package/dist/user.js +1 -1
  142. package/dist/userMenuModal-D-nDaYqM.js +66 -0
  143. package/dist/utils/apiMiddlewares.d.ts +5 -5
  144. package/dist/utils/apiResponse.d.ts +11 -0
  145. package/dist/utils/authProviderIcon.d.ts +3 -0
  146. package/dist/utils/authkit.d.ts +20 -7
  147. package/dist/utils/formatPoints.d.ts +8 -0
  148. package/dist/utils/messageNotificationContent.d.ts +4 -0
  149. package/dist/utils/messageTextLink.d.ts +9 -0
  150. package/dist/utils/passkeySupport.d.ts +8 -0
  151. package/dist/utils/pointsFlowTypes.d.ts +10 -0
  152. package/dist/utils/pointsHistoryDisplay.d.ts +8 -0
  153. package/dist/utils/refundStatusDisplay.d.ts +1 -0
  154. package/dist/utils/subscriptionDisplay.d.ts +7 -0
  155. package/dist/utils/userDisplay.d.ts +41 -0
  156. package/package.json +11 -3
  157. package/dist/AuthkitAppSetting-C-0uuLSg.js +0 -1921
  158. package/dist/AuthkitGithubBinding-C5zEy9zN.js +0 -2207
  159. package/dist/CustomTable-nsxN4Ja4.js +0 -276
  160. package/dist/FeedbackModal.vue_vue_type_script_setup_true_lang-M1NQ-rx-.js +0 -1396
  161. package/dist/LandingPageFAQ-CZJXvor9.js +0 -80
  162. package/dist/LandingPageSectionHeader-D_74W4My.js +0 -69
  163. package/dist/Menu-Cy2ZPeaz.js +0 -170
  164. package/dist/MessageHandle-BG12aX0i.js +0 -924
  165. package/dist/MessageList-CrCF8mU6.js +0 -233
  166. package/dist/MessageNoticeNotificationsDetails.vue_vue_type_script_setup_true_lang-gsjL6yAe.js +0 -142
  167. package/dist/PaySubscriptions-lWnEioX5.js +0 -1241
  168. package/dist/PricingPlans-DFcjOMWS.js +0 -404
  169. package/dist/ReferrerReferees-Cn7KaO8z.js +0 -106
  170. package/dist/UserMenuInvitationsItem.vue_vue_type_script_setup_true_lang-P0X1Exyu.js +0 -520
  171. package/dist/WidthContainer-CF3qOLWW.js +0 -688
  172. package/dist/components/Feedback/FeedbackDetails.vue.d.ts +0 -178
  173. package/dist/composables/Authkit/useLegalLinks.d.ts +0 -34
  174. package/dist/index-D3Kp6R4z.js +0 -4
  175. package/dist/useAuthkitAuth-DmS-H7M2.js +0 -175
  176. package/dist/useBillingStatusOptions-B7xLU3fs.js +0 -145
  177. package/dist/useLegalLinks-Cwr45PBT.js +0 -60
  178. package/dist/useRoutePermission-CaWtjLRA.js +0 -212
  179. package/dist/useSEO-BSMQdBR9.js +0 -158
  180. package/dist/useSubscriptionCheckout-BRk5h9aC.js +0 -365
  181. package/dist/useTableHandle-BdujaiNX.js +0 -69
  182. /package/dist/components/{Feedback/FeedbackVideoPreview.vue.d.ts → VideoPreview.vue.d.ts} +0 -0
@@ -1,1241 +0,0 @@
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 { h as B, g as X } from "./apiClients-DrGX2iJy.js";
10
- import { ref as g, computed as A, onUnmounted as Ae, defineComponent as It, openBlock as l, createElementBlock as u, Fragment as te, createVNode as r, unref as n, isRef as xt, withCtx as s, createElementVNode as a, toDisplayString as o, createBlock as q, createTextVNode as v, createCommentVNode as z, 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 Q, Tooltip as Wt } from "@arco-design/web-vue";
12
- import { u as Tt, b as zt, a as At } from "./useBillingStatusOptions-B7xLU3fs.js";
13
- import { u as Et } from "./useAuthkitCreateAndUpdate-oo9517Gj.js";
14
- import { C as fe } from "./CustomTable-nsxN4Ja4.js";
15
- import { C as Lt } from "./Clipboard-Bo7gdpR6.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 p = g(ze()), _ = g(!1), d = A(() => p.value.current), h = A(() => p.value.trial), P = A(() => p.value.entitlement), x = A(() => p.value.features), y = A(() => p.value.quotas), f = A(() => p.value.pointsBalance), R = A(() => p.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
- p.value = b || ze();
40
- } finally {
41
- _.value = !1;
42
- }
43
- }
44
- return {
45
- summary: p,
46
- current: d,
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(p) {
58
- return /^https?:\/\//i.test(p) || p.startsWith("//");
59
- }
60
- function Bt() {
61
- if (X.openPricing) {
62
- X.openPricing();
63
- return;
64
- }
65
- const p = X.pricingUrl || "/Pricing";
66
- if (Ut(p)) {
67
- window.open(p, "_blank", "noopener,noreferrer");
68
- return;
69
- }
70
- window.location.assign(p);
71
- }
72
- async function K(p, _ = {}) {
73
- const d = localStorage.getItem("jwtToken"), h = await fetch(`${X.billingPrefixUrl}${p}`, {
74
- method: "POST",
75
- headers: {
76
- "Content-Type": "application/json",
77
- "app-id": X.appId,
78
- ...d ? {
79
- authorization: `Bearer ${d}`
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(p, _) {
89
- if (p === "recharge") {
90
- const d = await K("/pointsRecharge/verifyPayment", {
91
- orderId: _
92
- });
93
- return {
94
- success: !!(d.success || d.status === "paid"),
95
- status: d.status || "unknown",
96
- message: d.message,
97
- pointsAdded: d.pointsAdded
98
- };
99
- }
100
- if (p === "subscription") {
101
- const d = await K("/invoices/verifyPayment", {
102
- orderId: _
103
- });
104
- return {
105
- success: !!(d.success || d.status === "paid"),
106
- status: d.status || "unknown",
107
- message: d.message
108
- };
109
- }
110
- return {
111
- success: !1,
112
- status: "unsupported",
113
- message: "暂不支持的支付场景"
114
- };
115
- }
116
- const Dt = 3e3;
117
- function Ee() {
118
- const p = g(!1), _ = g("");
119
- let d = null;
120
- function h() {
121
- d && (clearInterval(d), d = null);
122
- }
123
- async function P(y, f) {
124
- p.value = !0;
125
- try {
126
- return await Ht(y, f);
127
- } finally {
128
- p.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(), d = setInterval(() => {
147
- f();
148
- }, Dt);
149
- }
150
- return Ae(h), {
151
- checking: p,
152
- statusText: _,
153
- startPolling: x,
154
- stopPolling: h,
155
- verifyNow: P
156
- };
157
- }
158
- function fn(p) {
159
- const _ = g("loading"), d = 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", d.value = "正在确认支付结果...", x({
168
- scene: E,
169
- orderId: b,
170
- onSuccess: (C) => {
171
- _.value = "success", d.value = C.message || "支付成功", window.setTimeout(() => {
172
- window.location.replace(p());
173
- }, 1200);
174
- },
175
- onWaiting: (C) => {
176
- d.value = C.message || P.value || "等待支付确认...";
177
- },
178
- onError: (C) => {
179
- _.value = "failed", d.value = C instanceof Error ? C.message : "确认支付失败", S.error(d.value);
180
- }
181
- });
182
- }
183
- return {
184
- phase: _,
185
- message: d,
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-package-extra"
311
- }, Ba = {
312
- class: "points-pay-row"
313
- }, Ha = {
314
- key: 0
315
- }, Da = {
316
- key: 1
317
- }, Ya = {
318
- key: 1
319
- }, Ma = {
320
- key: 0,
321
- class: "invoice-actions"
322
- }, Fa = {
323
- key: 1
324
- }, Va = {
325
- class: "points-money-cell"
326
- }, ja = {
327
- class: "payment-wait-content"
328
- }, qa = {
329
- class: "payment-wait-summary"
330
- }, Ka = {
331
- class: "payment-wait-icon"
332
- }, Ja = {
333
- class: "payment-wait-tip"
334
- }, Ga = {
335
- class: "payment-wait-actions"
336
- }, Qa = /* @__PURE__ */ It({
337
- __name: "PaySubscriptions",
338
- emits: ["confirm", "cancel"],
339
- setup(p, {
340
- expose: _,
341
- emit: d
342
- }) {
343
- const h = d, {
344
- changeType: P,
345
- show: x
346
- } = Et(h), y = g("overview"), {
347
- current: f,
348
- entitlement: R,
349
- quotas: E,
350
- pointsBalance: b,
351
- pendingInvoice: C,
352
- loading: ge,
353
- refresh: L
354
- } = $t(), N = A(() => R.value), se = Tt(), ie = zt(), oe = At(), ye = g([]), le = g(!1), H = g({
355
- current: 1,
356
- pageSize: 10,
357
- total: 0
358
- }), M = g([]), $ = g(""), re = g(!1), ue = g(!1), F = g(!1), O = g(null), {
359
- checking: Le,
360
- statusText: T,
361
- startPolling: Re,
362
- stopPolling: ce,
363
- verifyNow: $e
364
- } = Ee(), V = g(!1), _e = g([]), de = g(!1), D = g({
365
- current: 1,
366
- pageSize: 10,
367
- total: 0
368
- }), we = g([]), pe = g(!1), Y = g({
369
- current: 1,
370
- pageSize: 10,
371
- total: 0
372
- }), Z = A(() => M.value.find((e) => e.id === $.value)), Ue = A(() => ge.value), Be = [{
373
- dataIndex: "id",
374
- slotName: "id",
375
- title: "账单 ID",
376
- minWidth: 320
377
- }, {
378
- dataIndex: "productName",
379
- title: "价格方案",
380
- minWidth: 180
381
- }, {
382
- dataIndex: "billingType",
383
- slotName: "billingType",
384
- title: "账单类型",
385
- minWidth: 120
386
- }, {
387
- dataIndex: "total",
388
- slotName: "total",
389
- title: "金额",
390
- minWidth: 110
391
- }, {
392
- dataIndex: "status",
393
- slotName: "status",
394
- title: "状态",
395
- minWidth: 110
396
- }, {
397
- dataIndex: "refund",
398
- slotName: "refund",
399
- title: "退款",
400
- minWidth: 120
401
- }, {
402
- dataIndex: "tradeNo",
403
- title: "交易号",
404
- minWidth: 320,
405
- cellClassName: "mono-value"
406
- }, {
407
- dataIndex: "periodStart",
408
- title: "周期开始",
409
- minWidth: 180
410
- }, {
411
- dataIndex: "periodEnd",
412
- title: "周期结束",
413
- minWidth: 180
414
- }, {
415
- dataIndex: "paidAt",
416
- title: "支付时间",
417
- minWidth: 180
418
- }, {
419
- dataIndex: "expireAt",
420
- title: "支付有效期",
421
- minWidth: 180
422
- }, {
423
- dataIndex: "createAt",
424
- title: "创建时间",
425
- minWidth: 180
426
- }, {
427
- dataIndex: "actions",
428
- slotName: "actions",
429
- title: "操作",
430
- width: 190,
431
- fixed: "right",
432
- cellClassName: "invoice-actions-cell"
433
- }], He = [{
434
- dataIndex: "packageName",
435
- title: "套餐",
436
- minWidth: 180
437
- }, {
438
- dataIndex: "price",
439
- slotName: "price",
440
- title: "金额",
441
- minWidth: 110
442
- }, {
443
- dataIndex: "totalPoints",
444
- slotName: "points",
445
- title: "积分",
446
- minWidth: 120
447
- }, {
448
- dataIndex: "status",
449
- slotName: "status",
450
- title: "状态",
451
- minWidth: 110
452
- }, {
453
- dataIndex: "refund",
454
- slotName: "refund",
455
- title: "退款",
456
- minWidth: 120
457
- }, {
458
- dataIndex: "outTradeNo",
459
- title: "订单号",
460
- minWidth: 260,
461
- cellClassName: "mono-value"
462
- }, {
463
- dataIndex: "expireAt",
464
- title: "支付有效期",
465
- minWidth: 180
466
- }, {
467
- dataIndex: "createAt",
468
- title: "创建时间",
469
- minWidth: 180
470
- }, {
471
- dataIndex: "actions",
472
- slotName: "actions",
473
- title: "操作",
474
- width: 120,
475
- fixed: "right",
476
- cellClassName: "invoice-actions-cell"
477
- }], De = [{
478
- dataIndex: "type",
479
- slotName: "type",
480
- title: "类型",
481
- minWidth: 110
482
- }, {
483
- dataIndex: "amount",
484
- slotName: "amount",
485
- title: "金额",
486
- minWidth: 150
487
- }, {
488
- dataIndex: "balance",
489
- slotName: "balance",
490
- title: "余额",
491
- minWidth: 150
492
- }, {
493
- dataIndex: "exchangeRate",
494
- slotName: "exchangeRate",
495
- title: "汇率",
496
- minWidth: 130
497
- }, {
498
- dataIndex: "description",
499
- slotName: "description",
500
- title: "说明",
501
- minWidth: 300
502
- }, {
503
- dataIndex: "priceName",
504
- slotName: "service",
505
- title: "服务",
506
- minWidth: 180
507
- }, {
508
- dataIndex: "createAt",
509
- title: "时间",
510
- minWidth: 180
511
- }];
512
- function Ye(e) {
513
- return se.getStatusColor(e);
514
- }
515
- function Me(e) {
516
- return se.getStatusLabel(e);
517
- }
518
- function be(e) {
519
- return ie.getStatusColor(e);
520
- }
521
- function he(e) {
522
- return ie.getStatusLabel(e);
523
- }
524
- function Fe(e) {
525
- return oe.getStatusColor(e);
526
- }
527
- function Ve(e) {
528
- return oe.getStatusLabel(e);
529
- }
530
- function je(e) {
531
- return e ? {
532
- new_subscription: "新购",
533
- upgrade: "升级",
534
- downgrade: "降级",
535
- renewal: "续费",
536
- subscription: "订阅"
537
- }[e] || e : "-";
538
- }
539
- function ke() {
540
- var e;
541
- return ((e = b.value) == null ? void 0 : e.totalPoints) ?? 0;
542
- }
543
- function Pe(e) {
544
- return ke() >= e.totalPoints;
545
- }
546
- function qe(e) {
547
- return `退款将原路退钱,并扣除 ${I(e.totalPoints)} 积分。当前余额 ${I(ke())}。提交后将进入人工审核,确定申请退款吗?`;
548
- }
549
- function Ke(e) {
550
- return {
551
- day: "每天",
552
- week: "每周",
553
- month: "每月",
554
- year: "每年",
555
- lifetime: "不重置"
556
- }[e] || e;
557
- }
558
- function Se(e, t = 1) {
559
- const m = t > 1 ? `每 ${t} ` : "按", w = {
560
- day: `${m}天`,
561
- week: `${m}周`,
562
- month: `${m}月`,
563
- year: `${m}年`
564
- };
565
- return e ? w[e] || e : "-";
566
- }
567
- function Je(e, t, m = 1) {
568
- if (typeof e != "number") return "-";
569
- const w = Se(t, m).replace("按", "").replace("每 ", "");
570
- return `¥${(e / 100).toFixed(2)} / ${w}`;
571
- }
572
- function I(e) {
573
- return Number(e || 0).toLocaleString();
574
- }
575
- function Ge(e) {
576
- return typeof e == "number" ? I(e) : "-";
577
- }
578
- function Ce(e, t = !1) {
579
- return typeof e != "number" ? "-" : `${t && e > 0 ? "+" : ""}¥${(e / 100).toFixed(2)}`;
580
- }
581
- function Qe(e) {
582
- var w, G;
583
- const t = (w = e.metadata) == null ? void 0 : w.billing;
584
- if (((t == null ? void 0 : t.currency) || ((G = t == null ? void 0 : t.pricing) == null ? void 0 : G.currency)) === "USD") {
585
- const i = (t == null ? void 0 : t.exchangeRate) || (t == null ? void 0 : t.usdToCny);
586
- return i ? `USD→CNY ${Number(i).toFixed(2)}` : "USD→CNY";
587
- }
588
- return "CNY";
589
- }
590
- function Xe(e) {
591
- return {
592
- earn: "green",
593
- consume: "orange",
594
- deduct: "orange",
595
- reversal: "blue",
596
- clawback: "red",
597
- adjust: "purple"
598
- }[e] || "gray";
599
- }
600
- function Ze(e) {
601
- return {
602
- earn: "收入",
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, T.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 = Z.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
- T.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, T.value = "", S.success(`充值成功,已到账 ${I(m)} 积分`), await L(), await U(), await J();
728
- },
729
- onWaiting: (t) => {
730
- T.value = t.message || "等待支付确认...";
731
- },
732
- onError: (t) => {
733
- T.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, T.value = "", S.success(`充值成功,已到账 ${I(w)} 积分`), await L(), await U(), await J();
745
- return;
746
- }
747
- T.value = m.message || "等待支付确认...";
748
- } catch (m) {
749
- T.value = m instanceof Error ? m.message : "查询支付状态失败";
750
- }
751
- }
752
- function xe() {
753
- ce(), F.value = !1, O.value = null, T.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(), u(te, null, [r(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] = [v(" 订阅与积分 ", -1)])]),
872
- default: s(() => {
873
- var m, w, G;
874
- return [a("div", Yt, [N.value ? (l(), u("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] = [v(" 立即订阅 ", -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] = [v(" 恢复订阅 ", -1)])]),
889
- _: 1
890
- })) : n(f) ? (l(), u(te, {
891
- key: 2
892
- }, [r(n(k), {
893
- type: "primary",
894
- size: "small",
895
- onClick: ve
896
- }, {
897
- default: s(() => [...t[6] || (t[6] = [v(" 修改订阅 ", -1)])]),
898
- _: 1
899
- }), r(n(ae), {
900
- content: "取消后订阅将在当前周期结束时失效,确定取消吗?",
901
- onOk: mt
902
- }, {
903
- default: s(() => [r(n(k), {
904
- type: "outline",
905
- size: "small",
906
- status: "warning"
907
- }, {
908
- default: s(() => [...t[7] || (t[7] = [v(" 取消订阅 ", -1)])]),
909
- _: 1
910
- })]),
911
- _: 1
912
- })], 64)) : z("", !0)])]), a("div", qt, [n(f) ? (l(), u("div", Kt, [t[8] || (t[8] = a("span", {
913
- class: "label"
914
- }, "价格方案:", -1)), a("span", null, o(N.value.productName), 1)])) : z("", !0), n(f) ? (l(), u("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)])) : z("", !0), n(f) ? (l(), u("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)])) : z("", !0), N.value.endAt ? (l(), u("div", Qt, [a("span", Xt, o(N.value.type === "trial" ? "试用有效期至:" : "当前周期结束:"), 1), a("span", null, o(N.value.endAt), 1)])) : z("", !0), (w = n(f)) != null && w.cancelAtPeriodEnd ? (l(), u("div", Zt, [...t[11] || (t[11] = [a("span", {
919
- class: "label"
920
- }, "订阅将于周期结束后停止", -1)])])) : (G = n(f)) != null && G.pendingChange ? (l(), u("div", ea, [t[12] || (t[12] = a("span", {
921
- class: "label"
922
- }, "到期后变更为:", -1)), a("span", null, o(n(f).pendingChange.productName || "新方案"), 1)])) : z("", !0), n(b) ? (l(), u("div", ta, [t[13] || (t[13] = a("span", {
923
- class: "label"
924
- }, "积分余额:", -1)), a("span", null, o(n(b).totalPoints), 1)])) : z("", !0)]), n(C) ? (l(), u("div", aa, [t[15] || (t[15] = a("div", null, [a("strong", null, "存在待支付订阅账单"), a("span", null, "可继续支付,也可取消后重新选择方案。")], -1)), r(n(k), {
925
- type: "primary",
926
- status: "warning",
927
- size: "small",
928
- onClick: nt
929
- }, {
930
- default: s(() => [...t[14] || (t[14] = [v(" 处理 ", -1)])]),
931
- _: 1
932
- })])) : z("", !0)])) : (l(), u("div", na, [t[17] || (t[17] = a("span", {
933
- class: "no-subscription-text"
934
- }, "暂无方案", -1)), r(n(k), {
935
- type: "primary",
936
- size: "small",
937
- onClick: ve
938
- }, {
939
- default: s(() => [...t[16] || (t[16] = [v("查看价格方案", -1)])]),
940
- _: 1
941
- })])), r(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(() => [r(n(ne), {
948
- key: "overview",
949
- title: "概览"
950
- }, {
951
- default: s(() => {
952
- var i, c, ee;
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(), u("div", la, o(N.value.type === "trial" ? "试用有效期至" : "当前周期结束") + ":" + o(N.value.endAt), 1)) : z("", !0)]), a("div", ra, [t[19] || (t[19] = a("div", {
956
- class: "overview-card__label"
957
- }, "积分余额", -1)), a("div", ua, o(I(((ee = n(b)) == null ? void 0 : ee.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(), u("div", pa, [r(n(me))])) : n(E).length === 0 ? (l(), u("div", va, [r(n(Te), {
964
- description: "暂无配额限制"
965
- })])) : (l(), u("div", ma, [(l(!0), u(te, null, Ne(n(E), (W) => (l(), u("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, [r(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(), u("span", ba, "无限制")) : (l(), u("span", ha, "已使用 " + o(W.used) + " / " + o(W.limit), 1)), W.resetsAt ? (l(), u("span", ka, o(W.resetsAt) + " 重置", 1)) : z("", !0)])]))), 128))]))];
972
- }),
973
- _: 1
974
- }), r(n(ne), {
975
- key: "invoices",
976
- title: "订阅账单"
977
- }, {
978
- default: s(() => [r(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), r(Lt, {
992
- value: i.id,
993
- message: "账单 ID 已复制"
994
- }, null, 8, ["value"])], 8, Pa)]),
995
- status: s(({
996
- record: i
997
- }) => [r(n(Q), {
998
- color: Ye(i.status)
999
- }, {
1000
- default: s(() => [v(o(Me(i.status)), 1)]),
1001
- _: 2
1002
- }, 1032, ["color"])]),
1003
- billingType: s(({
1004
- record: i
1005
- }) => [v(o(je(i.billingType)), 1)]),
1006
- refund: s(({
1007
- record: i
1008
- }) => [i.refund ? (l(), q(n(Q), {
1009
- key: 0,
1010
- color: be(i.refund.status)
1011
- }, {
1012
- default: s(() => [v(o(he(i.refund.status)), 1)]),
1013
- _: 2
1014
- }, 1032, ["color"])) : (l(), u("span", Sa, "-"))]),
1015
- total: s(({
1016
- record: i
1017
- }) => [v(" ¥" + o((i.total / 100).toFixed(2)), 1)]),
1018
- actions: s(({
1019
- record: i
1020
- }) => [i.status === "open" ? (l(), u("div", Ca, [r(n(k), {
1021
- type: "primary",
1022
- status: "warning",
1023
- size: "small",
1024
- onClick: (c) => ct(i)
1025
- }, {
1026
- default: s(() => [...t[23] || (t[23] = [v(" 去支付 ", -1)])]),
1027
- _: 1
1028
- }, 8, ["onClick"]), r(n(ae), {
1029
- content: "取消后可重新发起支付,订阅方案不会变更。确定取消吗?",
1030
- onOk: (c) => dt(i)
1031
- }, {
1032
- default: s(() => [r(n(k), {
1033
- type: "secondary",
1034
- status: "warning",
1035
- size: "small"
1036
- }, {
1037
- default: s(() => [...t[24] || (t[24] = [v("取消支付", -1)])]),
1038
- _: 1
1039
- })]),
1040
- _: 1
1041
- }, 8, ["onOk"])])) : i.status === "paid" && !i.refund ? (l(), u("div", Ia, [r(n(ae), {
1042
- content: "提交后将进入人工审核,审核通过后原路退款。确定申请退款吗?",
1043
- onOk: (c) => pt(i)
1044
- }, {
1045
- default: s(() => [r(n(k), {
1046
- type: "secondary",
1047
- size: "small"
1048
- }, {
1049
- default: s(() => [...t[25] || (t[25] = [v(" 申请退款 ", -1)])]),
1050
- _: 1
1051
- })]),
1052
- _: 1
1053
- }, 8, ["onOk"])])) : (l(), u("span", xa, "-"))]),
1054
- _: 1
1055
- }, 8, ["data", "loading", "pagination"])]),
1056
- _: 1
1057
- }), r(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))]), r(n(k), {
1068
- loading: n(ge),
1069
- onClick: n(L)
1070
- }, {
1071
- default: s(() => [...t[28] || (t[28] = [v("刷新余额", -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(), u("div", Ta, [r(n(me))])) : M.value.length === 0 ? (l(), u("div", za, [r(n(Te), {
1076
- description: "暂无充值套餐"
1077
- })])) : (l(), u("div", Aa, [(l(!0), u(te, null, Ne(M.value, (c) => (l(), u("button", {
1078
- key: c.id,
1079
- type: "button",
1080
- class: Oe(["points-package", {
1081
- "points-package--selected": $.value === c.id
1082
- }]),
1083
- onClick: (ee) => $.value = c.id
1084
- }, [a("span", La, o(c.name), 1), a("span", Ra, o(I(c.totalPoints)) + " 积分", 1), a("span", $a, "¥" + o(c.priceYuan), 1), a("span", Ua, " 基础 " + o(I(c.points)) + " · 赠送 " + o(I(c.bonus)), 1)], 10, Ea))), 128))])), a("div", Ba, [Z.value ? (l(), u("span", Ha, " 应付 ¥" + o(Z.value.priceYuan) + ",获得 " + o(I(Z.value.totalPoints)) + " 积分 ", 1)) : (l(), u("span", Da, "请选择充值套餐")), r(n(k), {
1085
- type: "primary",
1086
- loading: ue.value,
1087
- disabled: !$.value,
1088
- onClick: lt
1089
- }, {
1090
- default: s(() => [...t[29] || (t[29] = [v(" 立即充值 ", -1)])]),
1091
- _: 1
1092
- }, 8, ["loading", "disabled"])]), t[33] || (t[33] = a("div", {
1093
- class: "points-section-header"
1094
- }, [a("h4", null, "充值记录")], -1)), r(fe, {
1095
- columns: He,
1096
- data: _e.value,
1097
- loading: de.value,
1098
- pagination: D.value,
1099
- onPageChange: _t,
1100
- onPageSizeChange: wt
1101
- }, {
1102
- price: s(({
1103
- record: c
1104
- }) => [v(" ¥" + o(c.priceYuan), 1)]),
1105
- points: s(({
1106
- record: c
1107
- }) => [v(o(I(c.totalPoints)), 1)]),
1108
- status: s(({
1109
- record: c
1110
- }) => [r(n(Q), {
1111
- color: Fe(c.status)
1112
- }, {
1113
- default: s(() => [v(o(Ve(c.status)), 1)]),
1114
- _: 2
1115
- }, 1032, ["color"])]),
1116
- refund: s(({
1117
- record: c
1118
- }) => [c.refund ? (l(), q(n(Q), {
1119
- key: 0,
1120
- color: be(c.refund.status)
1121
- }, {
1122
- default: s(() => [v(o(he(c.refund.status)), 1)]),
1123
- _: 2
1124
- }, 1032, ["color"])) : (l(), u("span", Ya, "-"))]),
1125
- actions: s(({
1126
- record: c
1127
- }) => [c.status === "paid" && !c.refund ? (l(), u("div", Ma, [Pe(c) ? (l(), q(n(ae), {
1128
- key: 0,
1129
- content: qe(c),
1130
- onOk: (ee) => vt(c)
1131
- }, {
1132
- default: s(() => [r(n(k), {
1133
- type: "secondary",
1134
- size: "small"
1135
- }, {
1136
- default: s(() => [...t[30] || (t[30] = [v(" 申请退款 ", -1)])]),
1137
- _: 1
1138
- })]),
1139
- _: 1
1140
- }, 8, ["content", "onOk"])) : (l(), q(n(Wt), {
1141
- key: 1,
1142
- content: "账户积分不足,无法退款"
1143
- }, {
1144
- default: s(() => [r(n(k), {
1145
- type: "secondary",
1146
- size: "small",
1147
- disabled: ""
1148
- }, {
1149
- default: s(() => [...t[31] || (t[31] = [v(" 积分不足 ", -1)])]),
1150
- _: 1
1151
- })]),
1152
- _: 1
1153
- }))])) : (l(), u("span", Fa, "-"))]),
1154
- _: 1
1155
- }, 8, ["data", "loading", "pagination"])])];
1156
- }),
1157
- _: 1
1158
- }), r(n(ne), {
1159
- key: "usage",
1160
- title: "积分流水"
1161
- }, {
1162
- default: s(() => [r(fe, {
1163
- columns: De,
1164
- data: we.value,
1165
- loading: pe.value,
1166
- pagination: Y.value,
1167
- onPageChange: bt,
1168
- onPageSizeChange: ht
1169
- }, {
1170
- type: s(({
1171
- record: i
1172
- }) => [r(n(Q), {
1173
- color: Xe(i.type)
1174
- }, {
1175
- default: s(() => [v(o(Ze(i.type)), 1)]),
1176
- _: 2
1177
- }, 1032, ["color"])]),
1178
- amount: s(({
1179
- record: i
1180
- }) => [a("div", {
1181
- class: Oe(["points-money-cell", i.amount >= 0 ? "points-amount-plus" : "points-amount-minus"])
1182
- }, [a("span", null, o(Ce(i.amount, !0)), 1), a("small", null, o(i.amount >= 0 ? "+" : "") + o(I(i.amount)) + " 积分", 1)], 2)]),
1183
- balance: s(({
1184
- record: i
1185
- }) => [a("div", Va, [a("span", null, o(Ce(i.balance)), 1), a("small", null, o(Ge(i.balance)) + " 积分", 1)])]),
1186
- exchangeRate: s(({
1187
- record: i
1188
- }) => [v(o(Qe(i)), 1)]),
1189
- description: s(({
1190
- record: i
1191
- }) => [v(o(i.description || "-"), 1)]),
1192
- service: s(({
1193
- record: i
1194
- }) => [v(o(tt(i)), 1)]),
1195
- _: 1
1196
- }, 8, ["data", "loading", "pagination"])]),
1197
- _: 1
1198
- })]),
1199
- _: 1
1200
- }, 8, ["active-key"])])];
1201
- }),
1202
- _: 1
1203
- }, 8, ["visible", "width"]), r(n(We), {
1204
- visible: F.value,
1205
- "onUpdate:visible": t[2] || (t[2] = (m) => F.value = m),
1206
- title: "等待支付完成",
1207
- footer: !1,
1208
- "mask-closable": !1,
1209
- width: 380,
1210
- onCancel: xe
1211
- }, {
1212
- default: s(() => {
1213
- var m, w;
1214
- return [a("div", ja, [a("div", qa, [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", Ka, [r(n(me), {
1215
- size: 32
1216
- })]), a("div", Ja, [t[34] || (t[34] = a("span", null, "支付宝收银台已在浏览器打开", -1)), a("small", null, o(n(T) || "请在支付宝页面完成支付,支付成功后这里会自动刷新余额"), 1)]), a("div", Ga, [r(n(k), {
1217
- onClick: xe
1218
- }, {
1219
- default: s(() => [...t[35] || (t[35] = [v("取消", -1)])]),
1220
- _: 1
1221
- }), r(n(k), {
1222
- type: "primary",
1223
- loading: n(Le),
1224
- onClick: ut
1225
- }, {
1226
- default: s(() => [...t[36] || (t[36] = [v(" 我已完成支付 ", -1)])]),
1227
- _: 1
1228
- }, 8, ["loading"])])])];
1229
- }),
1230
- _: 1
1231
- }, 8, ["visible"])], 64));
1232
- }
1233
- }), gn = /* @__PURE__ */ Rt(Qa, [["__scopeId", "data-v-6a329ee9"]]);
1234
- export {
1235
- gn as P,
1236
- Ee as a,
1237
- fn as b,
1238
- Bt as o,
1239
- $t as u,
1240
- Ht as v
1241
- };