@huyooo/ui 0.12.2 → 0.13.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,405 @@
1
+ /* empty css */
2
+ import "./index-D3Kp6R4z.js";
3
+ import "./apiClients-B8bOvWw_.js";
4
+ /* empty css */
5
+ import { defineComponent as z, computed as k, onMounted as te, onUnmounted as Pe, openBlock as n, createElementBlock as s, createElementVNode as i, unref as e, createBlock as H, toDisplayString as r, createVNode as v, withCtx as b, createTextVNode as R, resolveDirective as me, withDirectives as fe, normalizeClass as L, Fragment as w, renderList as C, createCommentVNode as p } from "vue";
6
+ import { Spin as ne, Button as A, Message as Z } from "@arco-design/web-vue";
7
+ import { useRoute as pe, useRouter as ve } from "vue-router";
8
+ import { b as ye } from "./PaySubscriptions-Bxh35MKo.js";
9
+ import { _ as G } from "./_plugin-vue_export-helper-CHgC5LLL.js";
10
+ import { L as he, a as ke } from "./LandingPageFAQ-CZJXvor9.js";
11
+ import { L as be } from "./LandingPageSectionHeader-D_74W4My.js";
12
+ import { Icon as ee } from "@iconify/vue";
13
+ import { u as Te, a as Ie } from "./useSubscriptionCheckout-DNLuRGmx.js";
14
+ import { u as we } from "./useEnsureAuthenticated-MpHmn2co.js";
15
+ const pt = "/Pay/Return";
16
+ function V(a) {
17
+ const u = typeof a.scene == "string" ? a.scene : null, l = typeof a.orderId == "string" ? a.orderId : null, c = typeof a.returnTo == "string" ? a.returnTo.trim() : null, _ = c != null && c.startsWith("/") && !c.startsWith("//") ? c : null;
18
+ return u !== "subscription" && u !== "recharge" && u !== "agreement" ? {
19
+ scene: null,
20
+ orderId: l,
21
+ returnTo: _
22
+ } : {
23
+ scene: u,
24
+ orderId: (l == null ? void 0 : l.trim()) || null,
25
+ returnTo: _
26
+ };
27
+ }
28
+ function Ce(a, u) {
29
+ const {
30
+ returnTo: l
31
+ } = V(a);
32
+ return l || u;
33
+ }
34
+ const Be = {
35
+ class: "payment-return-page"
36
+ }, Le = {
37
+ class: "payment-return-card"
38
+ }, Re = {
39
+ key: 1,
40
+ class: "payment-return-icon success"
41
+ }, Ae = {
42
+ key: 2,
43
+ class: "payment-return-icon failed"
44
+ }, De = {
45
+ key: 3,
46
+ class: "payment-return-actions"
47
+ }, $e = {
48
+ key: 4,
49
+ class: "payment-return-actions"
50
+ }, qe = /* @__PURE__ */ z({
51
+ __name: "PaymentReturnPage",
52
+ props: {
53
+ defaultReturnTo: {
54
+ default: "/Pricing"
55
+ }
56
+ },
57
+ setup(a) {
58
+ const u = a, l = pe(), c = ve();
59
+ function _() {
60
+ return Ce(l.query, u.defaultReturnTo);
61
+ }
62
+ const {
63
+ phase: g,
64
+ message: y,
65
+ checking: F,
66
+ confirmPayment: D,
67
+ stopPolling: S,
68
+ verifyNow: N
69
+ } = ye(_), $ = k(() => g.value === "success" ? "支付成功" : g.value === "failed" ? "支付未完成" : "正在确认支付");
70
+ function B() {
71
+ c.replace(_());
72
+ }
73
+ async function E() {
74
+ const {
75
+ scene: m,
76
+ orderId: o
77
+ } = V(l.query);
78
+ if (!m || !o) {
79
+ Z.error("支付参数无效");
80
+ return;
81
+ }
82
+ try {
83
+ const f = await N(m, o);
84
+ if (f.success) {
85
+ g.value = "success", y.value = f.message || "支付成功", window.setTimeout(() => {
86
+ c.replace(_());
87
+ }, 1200);
88
+ return;
89
+ }
90
+ y.value = f.message || "等待支付确认...";
91
+ } catch (f) {
92
+ Z.error(f instanceof Error ? f.message : "确认支付失败");
93
+ }
94
+ }
95
+ return te(() => {
96
+ const {
97
+ scene: m,
98
+ orderId: o
99
+ } = V(l.query);
100
+ if (!m || !o) {
101
+ g.value = "failed", y.value = "缺少支付回跳参数";
102
+ return;
103
+ }
104
+ if (m === "agreement") {
105
+ g.value = "success", y.value = "签约流程已完成,正在返回...", window.setTimeout(() => {
106
+ c.replace(_());
107
+ }, 1200);
108
+ return;
109
+ }
110
+ D(m, o);
111
+ }), Pe(S), (m, o) => (n(), s("div", Be, [i("div", Le, [e(g) === "loading" ? (n(), H(e(ne), {
112
+ key: 0,
113
+ size: 36
114
+ })) : e(g) === "success" ? (n(), s("div", Re, "✓")) : (n(), s("div", Ae, "!")), i("h1", null, r($.value), 1), i("p", null, r(e(y)), 1), e(g) === "loading" ? (n(), s("div", De, [v(e(A), {
115
+ loading: e(F),
116
+ type: "primary",
117
+ onClick: E
118
+ }, {
119
+ default: b(() => [...o[0] || (o[0] = [R(" 我已完成支付 ", -1)])]),
120
+ _: 1
121
+ }, 8, ["loading"]), v(e(A), {
122
+ onClick: B
123
+ }, {
124
+ default: b(() => [...o[1] || (o[1] = [R("返回", -1)])]),
125
+ _: 1
126
+ })])) : (n(), s("div", $e, [v(e(A), {
127
+ type: "primary",
128
+ onClick: B
129
+ }, {
130
+ default: b(() => [...o[2] || (o[2] = [R("返回", -1)])]),
131
+ _: 1
132
+ })]))])]));
133
+ }
134
+ }), vt = /* @__PURE__ */ G(qe, [["__scopeId", "data-v-b72bedf1"]]), Fe = /* @__PURE__ */ z({
135
+ __name: "PricingFAQ",
136
+ props: {
137
+ title: {
138
+ default: "订阅常见问题"
139
+ },
140
+ subtitle: {
141
+ default: "关于试用、付款、配额、升级和取消订阅的说明。"
142
+ },
143
+ activeKeys: {
144
+ default: () => []
145
+ },
146
+ faqItems: {
147
+ default: void 0
148
+ }
149
+ },
150
+ setup(a) {
151
+ const u = [{
152
+ question: "可以先试用再付费吗?",
153
+ answer: "可以。支持试用的方案会在卡片按钮上标明试用天数。试用期间可使用对应方案能力,到期后再决定是否继续订阅。"
154
+ }, {
155
+ question: "月付和年付有什么区别?",
156
+ answer: "月付适合短期验证和灵活使用,年付适合稳定团队和长期项目,通常会有更优惠的价格。"
157
+ }, {
158
+ question: "已有订阅后可以升级或切换方案吗?",
159
+ answer: "可以。升级或切换方案时,系统会根据当前订阅和新方案计算差额;如需补差价,会跳转到支付页面完成支付。"
160
+ }, {
161
+ question: "取消订阅后还能继续使用吗?",
162
+ answer: "可以。取消订阅后,当前计费周期内仍可继续使用,周期结束后订阅权益将停止续期。"
163
+ }, {
164
+ question: "配额什么时候重置?",
165
+ answer: "配额按订阅周期重置,不一定是自然月月初。例如您在 4 月 15 日订阅月付方案,下一次配额重置通常发生在 5 月 15 日。"
166
+ }, {
167
+ question: "不同方案的技术支持有什么区别?",
168
+ answer: "基础方案适合个人和轻量团队,包含常规支持;更高等级方案面向正式团队和生产场景,通常包含更高优先级支持。"
169
+ }, {
170
+ question: "是否支持退款?",
171
+ answer: "订阅可随时取消。退款规则以付费服务协议为准,如遇到重复扣费或异常支付,可以联系支持团队处理。"
172
+ }, {
173
+ question: "使用订阅服务有什么限制?",
174
+ answer: "请按正常业务场景使用服务,禁止共享、转售订阅或用于违法违规场景。严重滥用可能导致服务受限或账户终止。"
175
+ }], l = a, c = k(() => l.faqItems ?? u);
176
+ return (_, g) => (n(), H(he, {
177
+ class: "PricingFAQ"
178
+ }, {
179
+ BlockHeader: b(() => [v(be, {
180
+ title: a.title,
181
+ subtitle: a.subtitle
182
+ }, null, 8, ["title", "subtitle"])]),
183
+ BlockBody: b(() => [v(ke, {
184
+ "active-keys": a.activeKeys,
185
+ "faq-items": c.value
186
+ }, null, 8, ["active-keys", "faq-items"])]),
187
+ _: 1
188
+ }));
189
+ }
190
+ }), yt = /* @__PURE__ */ G(Fe, [["__scopeId", "data-v-fcab2f05"]]), Se = {
191
+ class: "PricingPlans"
192
+ }, Ne = {
193
+ class: "PricingPlans__trialMain"
194
+ }, Ee = {
195
+ class: "PricingPlans__trialCopy"
196
+ }, xe = {
197
+ key: 0,
198
+ class: "PricingPlans__trialFeatures"
199
+ }, Me = {
200
+ class: "PricingPlans__trialAction"
201
+ }, Qe = {
202
+ key: 1,
203
+ class: "PricingPlans__toolbar"
204
+ }, Ve = {
205
+ key: 0,
206
+ class: "PricingPlans__toggle",
207
+ role: "tablist",
208
+ "aria-label": "计费周期"
209
+ }, ze = ["onClick"], He = {
210
+ key: 0,
211
+ class: "PricingPlans__toggleBadge"
212
+ }, Ge = {
213
+ key: 1,
214
+ class: "PricingPlans__note"
215
+ }, Ke = {
216
+ class: "PricingPlans__badgeRow"
217
+ }, Oe = {
218
+ class: "PricingPlans__header"
219
+ }, Ue = {
220
+ class: "PricingPlans__price"
221
+ }, We = {
222
+ key: 0,
223
+ class: "PricingPlans__originalPrice"
224
+ }, je = {
225
+ class: "PricingPlans__amount"
226
+ }, Ye = {
227
+ class: "PricingPlans__cycle"
228
+ }, Je = {
229
+ key: 0,
230
+ class: "PricingPlans__promotion"
231
+ }, Xe = {
232
+ class: "PricingPlans__summary"
233
+ }, Ze = {
234
+ class: "PricingPlans__featureGroups"
235
+ }, et = {
236
+ class: "PricingPlans__features"
237
+ }, tt = {
238
+ key: 3,
239
+ class: "PricingPlans__empty"
240
+ }, nt = /* @__PURE__ */ z({
241
+ __name: "PricingPlans",
242
+ props: {
243
+ appName: {
244
+ default: "Huyooo"
245
+ },
246
+ defaultInterval: {
247
+ default: "month"
248
+ },
249
+ note: {
250
+ default: ""
251
+ }
252
+ },
253
+ setup(a) {
254
+ const u = a, {
255
+ products: l,
256
+ plans: c,
257
+ currentSubscription: _,
258
+ currentLoading: g,
259
+ listLoading: y,
260
+ billingInterval: F,
261
+ billingIntervalTabs: D,
262
+ setBillingInterval: S,
263
+ currentTrial: N,
264
+ isCurrentPlan: $,
265
+ isRecommendedPlan: B,
266
+ isFreePlan: E,
267
+ isPlanActionDisabled: m,
268
+ getDisplayPrice: o,
269
+ getDisplayOriginalPrice: f,
270
+ getDisplayCycle: se,
271
+ getPromotionLabel: K,
272
+ getBadgeLabels: ie,
273
+ getButtonLabel: re,
274
+ getPlanSummary: O,
275
+ getFeatureGroups: U,
276
+ loadCurrentSubscription: W,
277
+ refresh: ae
278
+ } = Te(u.defaultInterval), T = k(() => {
279
+ var d;
280
+ if (!_.value)
281
+ for (const P of l.value) {
282
+ const I = P.prices.find((t) => t.type === "free");
283
+ if (I)
284
+ return {
285
+ ...P,
286
+ features: (d = I.features) != null && d.length ? I.features : P.features,
287
+ selectedPrice: I
288
+ };
289
+ }
290
+ }), q = k(() => c.value.filter((d) => !E(d))), j = k(() => !!localStorage.getItem("jwtToken")), x = k(() => !!N.value), M = k(() => j.value && g.value && !x.value), Y = k(() => x.value || M.value), {
291
+ checkout: le,
292
+ isCheckingOut: oe
293
+ } = Ie({
294
+ currentSubscription: _,
295
+ refreshCurrentSubscription: W
296
+ }), {
297
+ ensureAuthenticated: ce
298
+ } = we();
299
+ function ue(d) {
300
+ return d === 1 ? "适合团队协作与更高频使用" : "适合个人和轻量团队使用";
301
+ }
302
+ function J(d) {
303
+ return U(d.features).flatMap((P) => P.items).slice(0, 3);
304
+ }
305
+ function de(d) {
306
+ return (d.description || O(d, 0)).replace(/^\s*\d+\s*天(?:免费)?体验[,,、\s]*/, "").replace(/^\s*免费体验[,,、\s]*/, "").trim();
307
+ }
308
+ function _e() {
309
+ return M.value ? "权益加载中" : x.value ? "正在体验当前权益" : "立即体验";
310
+ }
311
+ async function ge() {
312
+ if (!Y.value) {
313
+ if (j.value) {
314
+ await W();
315
+ return;
316
+ }
317
+ ce();
318
+ }
319
+ }
320
+ return te(() => {
321
+ ae();
322
+ }), (d, P) => {
323
+ const I = me("motion-slide-top");
324
+ return n(), s("section", Se, [fe((n(), H(e(ne), {
325
+ loading: e(y),
326
+ tip: "数据加载中",
327
+ class: "PricingPlans__spin"
328
+ }, {
329
+ default: b(() => [T.value ? (n(), s("article", {
330
+ key: 0,
331
+ class: L(["PricingPlans__trial", {
332
+ "is-current": e($)(T.value)
333
+ }])
334
+ }, [i("div", Ne, [i("div", Ee, [i("h2", null, r(T.value.name), 1), i("p", null, r(de(T.value)), 1), J(T.value).length ? (n(), s("ul", xe, [(n(!0), s(w, null, C(J(T.value), (t) => (n(), s("li", {
335
+ key: t.title
336
+ }, [v(e(ee), {
337
+ icon: "mingcute:check-circle-fill",
338
+ class: "PricingPlans__trialFeatureIcon"
339
+ }), i("span", null, r(t.title), 1)]))), 128))])) : p("", !0)]), i("div", Me, [v(e(A), {
340
+ size: "large",
341
+ class: "PricingPlans__trialButton",
342
+ loading: M.value,
343
+ disabled: Y.value,
344
+ onClick: ge
345
+ }, {
346
+ default: b(() => [R(r(_e()), 1)]),
347
+ _: 1
348
+ }, 8, ["loading", "disabled"])])])], 2)) : p("", !0), q.value.length ? (n(), s("div", Qe, [e(D).length > 1 ? (n(), s("div", Ve, [(n(!0), s(w, null, C(e(D), (t) => (n(), s("button", {
349
+ key: t.value,
350
+ type: "button",
351
+ class: L(["PricingPlans__toggleItem", {
352
+ "is-active": e(F) === t.value
353
+ }]),
354
+ onClick: (Q) => e(S)(t.value)
355
+ }, [i("span", null, r(t.label), 1), t.badge ? (n(), s("span", He, r(t.badge), 1)) : p("", !0)], 10, ze))), 128))])) : p("", !0), a.note ? (n(), s("p", Ge, r(a.note), 1)) : p("", !0)])) : p("", !0), q.value.length ? (n(), s("div", {
356
+ key: 2,
357
+ class: L(["PricingPlans__grid", {
358
+ "PricingPlans__grid--compact": q.value.length <= 2
359
+ }])
360
+ }, [(n(!0), s(w, null, C(q.value, (t, Q) => (n(), s("article", {
361
+ key: t.id,
362
+ class: L(["PricingPlans__card", {
363
+ "is-recommended": e(B)(t),
364
+ "is-current": e($)(t)
365
+ }])
366
+ }, [i("div", Ke, [(n(!0), s(w, null, C(e(ie)(t), (h) => (n(), s("span", {
367
+ key: h.type,
368
+ class: L(["PricingPlans__badge", `is-${h.type}`])
369
+ }, r(h.label), 3))), 128))]), i("div", Oe, [i("h2", null, r(t.name), 1), i("p", null, r(t.description || ue(Q)), 1)]), i("div", Ue, [e(f)(t) ? (n(), s("span", We, " ¥" + r(e(f)(t)), 1)) : p("", !0), P[0] || (P[0] = i("span", {
370
+ class: "PricingPlans__currency"
371
+ }, "¥", -1)), i("span", je, r(e(o)(t)), 1), i("span", Ye, r(e(se)(t)), 1)]), e(K)(t) ? (n(), s("p", Je, r(e(K)(t)), 1)) : p("", !0), i("p", Xe, r(e(O)(t, Q)), 1), v(e(A), {
372
+ long: "",
373
+ size: "large",
374
+ class: "PricingPlans__button",
375
+ type: e(B)(t) ? "primary" : "outline",
376
+ loading: e(oe)(t),
377
+ disabled: e(m)(t),
378
+ onClick: (h) => e(le)(t)
379
+ }, {
380
+ default: b(() => [R(r(e(re)(t)), 1)]),
381
+ _: 2
382
+ }, 1032, ["type", "loading", "disabled", "onClick"]), P[1] || (P[1] = i("div", {
383
+ class: "PricingPlans__divider"
384
+ }, null, -1)), i("div", Ze, [(n(!0), s(w, null, C(e(U)(t.features), (h) => (n(), s("section", {
385
+ key: h.title,
386
+ class: "PricingPlans__featureGroup"
387
+ }, [i("h3", null, r(h.title), 1), i("ul", et, [(n(!0), s(w, null, C(h.items, (X) => (n(), s("li", {
388
+ key: X.title
389
+ }, [v(e(ee), {
390
+ icon: "mingcute:check-circle-fill",
391
+ class: "PricingPlans__featureIcon"
392
+ }), i("span", null, r(X.title), 1)]))), 128))])]))), 128))])], 2))), 128))], 2)) : !T.value && !e(y) ? (n(), s("div", tt, " 当前暂无可订阅方案 ")) : p("", !0)]),
393
+ _: 1
394
+ }, 8, ["loading"])), [[I]])]);
395
+ };
396
+ }
397
+ }), ht = /* @__PURE__ */ G(nt, [["__scopeId", "data-v-6ca2e434"]]);
398
+ export {
399
+ pt as P,
400
+ vt as a,
401
+ yt as b,
402
+ ht as c,
403
+ V as p,
404
+ Ce as r
405
+ };
@@ -5,7 +5,7 @@ import { defineComponent as w, ref as d, openBlock as p, createBlock as v, unref
5
5
  import { Modal as D } from "@arco-design/web-vue";
6
6
  import { e as T } from "./apiClients-B8bOvWw_.js";
7
7
  import { u as V } from "./useTableHandle-B9aFmwYM.js";
8
- import { C as y } from "./CustomTable-BUkwlbzN.js";
8
+ import { C as y } from "./CustomTable-BBcd4nNL.js";
9
9
  import { C as E } from "./Clipboard-k0jtK4CJ.js";
10
10
  import { u as M } from "./useAuthkitUsersProfile-CoQceogN.js";
11
11
  import { _ as B } from "./_plugin-vue_export-helper-CHgC5LLL.js";