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