@huyooo/ui 2.1.8 → 2.1.12

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