@huyooo/ui 2.1.16 → 2.1.20

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.
@@ -584,6 +584,15 @@ export type Api = {
584
584
  return: any;
585
585
  };
586
586
  };
587
+ noAccessRoleId: {
588
+ /** 更新试用结束或无有效套餐时回退的角色 */
589
+ post: {
590
+ body: {
591
+ noAccessRoleId: string;
592
+ };
593
+ return: any;
594
+ };
595
+ };
587
596
  emailConfig: {
588
597
  /** 更新应用邮件发送配置 */
589
598
  post: {
@@ -2795,6 +2804,12 @@ export interface ApiClient {
2795
2804
  defaultRoleId: string;
2796
2805
  }, config?: RequestConfig) => RequestBuilder<any>;
2797
2806
  };
2807
+ noAccessRoleId: {
2808
+ /** 更新试用结束或无有效套餐时回退的角色 */
2809
+ post: (body: {
2810
+ noAccessRoleId: string;
2811
+ }, config?: RequestConfig) => RequestBuilder<any>;
2812
+ };
2798
2813
  emailConfig: {
2799
2814
  /** 更新应用邮件发送配置 */
2800
2815
  post: (body?: {
@@ -128,6 +128,7 @@ export type Api = {
128
128
  interval?: "day" | "week" | "month" | "year";
129
129
  intervalCount?: number;
130
130
  bonusPoints?: number;
131
+ claimLimit?: number;
131
132
  metadata?: Record<string, unknown>;
132
133
  active?: boolean;
133
134
  };
@@ -155,6 +156,7 @@ export type Api = {
155
156
  active?: boolean;
156
157
  metadata?: Record<string, unknown>;
157
158
  bonusPoints?: number;
159
+ claimLimit?: number;
158
160
  unitAmount?: number;
159
161
  interval?: "day" | "week" | "month" | "year";
160
162
  intervalCount?: number;
@@ -507,6 +509,15 @@ export type Api = {
507
509
  return: any;
508
510
  };
509
511
  };
512
+ claimStatus: {
513
+ /** 查询当前用户对指定免费价是否还可领取 */
514
+ post: {
515
+ body: {
516
+ priceId?: string;
517
+ };
518
+ return: any;
519
+ };
520
+ };
510
521
  start: {
511
522
  /** 领取当前应用的免费体验权益 */
512
523
  post: {
@@ -3463,6 +3474,7 @@ export interface ApiClient {
3463
3474
  interval?: "day" | "week" | "month" | "year";
3464
3475
  intervalCount?: number;
3465
3476
  bonusPoints?: number;
3477
+ claimLimit?: number;
3466
3478
  metadata?: Record<string, unknown>;
3467
3479
  active?: boolean;
3468
3480
  }, config?: RequestConfig) => RequestBuilder<any>;
@@ -3484,6 +3496,7 @@ export interface ApiClient {
3484
3496
  active?: boolean;
3485
3497
  metadata?: Record<string, unknown>;
3486
3498
  bonusPoints?: number;
3499
+ claimLimit?: number;
3487
3500
  unitAmount?: number;
3488
3501
  interval?: "day" | "week" | "month" | "year";
3489
3502
  intervalCount?: number;
@@ -3743,6 +3756,12 @@ export interface ApiClient {
3743
3756
  /** 获取当前用户免费体验状态 */
3744
3757
  post: (config?: RequestConfig) => RequestBuilder<any>;
3745
3758
  };
3759
+ claimStatus: {
3760
+ /** 查询当前用户对指定免费价是否还可领取 */
3761
+ post: (body?: {
3762
+ priceId?: string;
3763
+ }, config?: RequestConfig) => RequestBuilder<any>;
3764
+ };
3746
3765
  start: {
3747
3766
  /** 领取当前应用的免费体验权益 */
3748
3767
  post: (body?: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@huyooo/ui",
3
- "version": "2.1.16",
3
+ "version": "2.1.20",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "files": [
@@ -1,395 +0,0 @@
1
- /* empty css */
2
- import "./userMenuModal-D-nDaYqM.js";
3
- import "./apiClients-CWSwNzGk.js";
4
- /* empty css */
5
- import { defineComponent as Q, computed as w, onMounted as Y, onUnmounted as oe, openBlock as t, createElementBlock as n, createElementVNode as i, unref as e, createBlock as V, toDisplayString as a, createVNode as p, withCtx as h, createTextVNode as B, resolveDirective as ce, withDirectives as ue, normalizeClass as I, Fragment as C, renderList as T, createCommentVNode as P } from "vue";
6
- import { Spin as J, Button as R, Message as de } from "@arco-design/web-vue";
7
- import { useRoute as _e, useRouter as ge } from "vue-router";
8
- import { a as Pe } from "./PaySubscriptions-pEZtjp1g.js";
9
- import { _ as z } from "./_plugin-vue_export-helper-CHgC5LLL.js";
10
- import { L as me, a as fe, b as pe } from "./LandingPageSectionHeader-3hiuw6G0.js";
11
- import { Icon as j } from "@iconify/vue";
12
- import { u as ve, a as ye } from "./useSubscriptionCheckout-CZZLk_1d.js";
13
- import { u as he } from "./useEnsureAuthenticated-RZ1DflLz.js";
14
- const dt = "/Pay/Return";
15
- function M(r) {
16
- const d = typeof r.scene == "string" ? r.scene : null, o = typeof r.orderId == "string" ? r.orderId : null, c = typeof r.returnTo == "string" ? r.returnTo.trim() : null, g = c != null && c.startsWith("/") && !c.startsWith("//") ? c : null;
17
- return d !== "subscription" && d !== "recharge" && d !== "agreement" ? {
18
- scene: null,
19
- orderId: o,
20
- returnTo: g
21
- } : {
22
- scene: d,
23
- orderId: (o == null ? void 0 : o.trim()) || null,
24
- returnTo: g
25
- };
26
- }
27
- function ke(r, d) {
28
- const {
29
- returnTo: o
30
- } = M(r);
31
- return o || d;
32
- }
33
- const be = {
34
- class: "payment-return-page"
35
- }, Ie = {
36
- class: "payment-return-card"
37
- }, Ce = {
38
- key: 1,
39
- class: "payment-return-icon success"
40
- }, Te = {
41
- key: 2,
42
- class: "payment-return-icon failed"
43
- }, we = {
44
- key: 3,
45
- class: "payment-return-actions"
46
- }, Be = {
47
- key: 4,
48
- class: "payment-return-actions"
49
- }, Re = /* @__PURE__ */ Q({
50
- __name: "PaymentReturnPage",
51
- props: {
52
- defaultReturnTo: {
53
- default: "/Pricing"
54
- }
55
- },
56
- setup(r) {
57
- const d = r, o = _e(), c = ge();
58
- function g() {
59
- return ke(o.query, d.defaultReturnTo);
60
- }
61
- const {
62
- phase: u,
63
- message: v,
64
- checking: L,
65
- confirmPayment: A,
66
- stopPolling: F,
67
- verifyNow: D
68
- } = Pe(g), S = w(() => u.value === "success" ? "支付成功" : u.value === "failed" ? "支付未完成" : "正在确认支付");
69
- function $() {
70
- c.replace(g());
71
- }
72
- async function N() {
73
- const {
74
- scene: m,
75
- orderId: l
76
- } = M(o.query);
77
- if (!m || !l) {
78
- de.error("支付参数无效");
79
- return;
80
- }
81
- const k = await D(m, l);
82
- if (k.error) {
83
- u.value = "failed", v.value = k.message || "确认支付失败";
84
- return;
85
- }
86
- if (k.success) {
87
- u.value = "success", v.value = k.message || "支付成功", window.setTimeout(() => {
88
- c.replace(g());
89
- }, 1200);
90
- return;
91
- }
92
- v.value = k.message || "等待支付确认...";
93
- }
94
- return Y(() => {
95
- const {
96
- scene: m,
97
- orderId: l
98
- } = M(o.query);
99
- if (!m || !l) {
100
- u.value = "failed", v.value = "缺少支付回跳参数";
101
- return;
102
- }
103
- if (m === "agreement") {
104
- u.value = "success", v.value = "签约流程已完成,正在返回...", window.setTimeout(() => {
105
- c.replace(g());
106
- }, 1200);
107
- return;
108
- }
109
- A(m, l);
110
- }), oe(F), (m, l) => (t(), n("div", be, [i("div", Ie, [e(u) === "loading" ? (t(), V(e(J), {
111
- key: 0,
112
- size: 36
113
- })) : e(u) === "success" ? (t(), n("div", Ce, "✓")) : (t(), n("div", Te, "!")), i("h1", null, a(S.value), 1), i("p", null, a(e(v)), 1), e(u) === "loading" ? (t(), n("div", we, [p(e(R), {
114
- loading: e(L),
115
- type: "primary",
116
- onClick: N
117
- }, {
118
- default: h(() => [...l[0] || (l[0] = [B(" 我已完成支付 ", -1)])]),
119
- _: 1
120
- }, 8, ["loading"]), p(e(R), {
121
- onClick: $
122
- }, {
123
- default: h(() => [...l[1] || (l[1] = [B("返回", -1)])]),
124
- _: 1
125
- })])) : (t(), n("div", Be, [p(e(R), {
126
- type: "primary",
127
- onClick: $
128
- }, {
129
- default: h(() => [...l[2] || (l[2] = [B("返回", -1)])]),
130
- _: 1
131
- })]))])]));
132
- }
133
- }), _t = /* @__PURE__ */ z(Re, [["__scopeId", "data-v-65b534f9"]]), Le = /* @__PURE__ */ Q({
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(r) {
150
- const d = [{
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
- }], o = r, c = w(() => o.faqItems ?? d);
175
- return (g, u) => (t(), V(me, {
176
- class: "PricingFAQ"
177
- }, {
178
- BlockHeader: h(() => [p(pe, {
179
- title: r.title,
180
- subtitle: r.subtitle
181
- }, null, 8, ["title", "subtitle"])]),
182
- BlockBody: h(() => [p(fe, {
183
- "active-keys": r.activeKeys,
184
- "faq-items": c.value
185
- }, null, 8, ["active-keys", "faq-items"])]),
186
- _: 1
187
- }));
188
- }
189
- }), gt = /* @__PURE__ */ z(Le, [["__scopeId", "data-v-fcab2f05"]]), Se = {
190
- class: "PricingPlans"
191
- }, $e = {
192
- class: "PricingPlans__trialMain"
193
- }, qe = {
194
- class: "PricingPlans__trialCopy"
195
- }, Ae = {
196
- key: 0,
197
- class: "PricingPlans__trialFeatures"
198
- }, Fe = {
199
- key: 0,
200
- class: "PricingPlans__trialAction"
201
- }, De = {
202
- key: 1,
203
- class: "PricingPlans__trialStatus"
204
- }, Ne = {
205
- key: 1,
206
- class: "PricingPlans__toolbar"
207
- }, xe = {
208
- key: 0,
209
- class: "PricingPlans__toggle",
210
- role: "tablist",
211
- "aria-label": "计费周期"
212
- }, Ee = ["onClick"], Me = {
213
- key: 0,
214
- class: "PricingPlans__toggleBadge"
215
- }, Qe = {
216
- key: 1,
217
- class: "PricingPlans__note"
218
- }, Ve = {
219
- class: "PricingPlans__badgeRow"
220
- }, ze = {
221
- class: "PricingPlans__header"
222
- }, He = {
223
- class: "PricingPlans__price"
224
- }, Ge = {
225
- key: 0,
226
- class: "PricingPlans__originalPrice"
227
- }, Ke = {
228
- class: "PricingPlans__amount"
229
- }, Oe = {
230
- class: "PricingPlans__cycle"
231
- }, Ue = {
232
- key: 0,
233
- class: "PricingPlans__promotion"
234
- }, We = {
235
- class: "PricingPlans__featureGroups"
236
- }, je = {
237
- class: "PricingPlans__features"
238
- }, Ye = {
239
- key: 3,
240
- class: "PricingPlans__empty"
241
- }, Je = /* @__PURE__ */ Q({
242
- __name: "PricingPlans",
243
- props: {
244
- appName: {
245
- default: "Huyooo"
246
- },
247
- defaultInterval: {
248
- default: "month"
249
- },
250
- note: {
251
- default: ""
252
- }
253
- },
254
- setup(r) {
255
- const d = r, {
256
- products: o,
257
- plans: c,
258
- currentSubscription: g,
259
- listLoading: u,
260
- billingInterval: v,
261
- billingIntervalTabs: L,
262
- setBillingInterval: A,
263
- currentTrial: F,
264
- isCurrentPlan: D,
265
- isRecommendedPlan: S,
266
- isFreePlan: $,
267
- isPlanActionDisabled: N,
268
- getDisplayPrice: m,
269
- getDisplayOriginalPrice: l,
270
- getDisplayCycle: k,
271
- getPromotionLabel: H,
272
- getBadgeLabels: X,
273
- getButtonLabel: Z,
274
- getPlanSummary: ee,
275
- getFeatureGroups: G,
276
- loadCurrentSubscription: K,
277
- refresh: te
278
- } = ve(d.defaultInterval), b = w(() => {
279
- if (!g.value)
280
- for (const f of o.value) {
281
- const _ = f.prices.find((x) => x.type === "free");
282
- if (_)
283
- return {
284
- ...f,
285
- features: _.features ?? [],
286
- selectedPrice: _
287
- };
288
- }
289
- }), q = w(() => c.value.filter((f) => !$(f))), ne = w(() => !!localStorage.getItem("jwtToken")), O = w(() => !!F.value), {
290
- checkout: se,
291
- isCheckingOut: ie
292
- } = ye({
293
- currentSubscription: g,
294
- refreshCurrentSubscription: K
295
- }), {
296
- ensureAuthenticated: re
297
- } = he();
298
- function ae(f) {
299
- return f === 1 ? "适合团队协作与更高频使用" : "适合个人和轻量团队使用";
300
- }
301
- function U(f) {
302
- return G(f.features).flatMap((_) => _.items).slice(0, 3);
303
- }
304
- function le() {
305
- re(() => {
306
- K();
307
- });
308
- }
309
- return Y(() => {
310
- te();
311
- }), (f, _) => {
312
- const x = ce("motion-slide-top");
313
- return t(), n("section", Se, [ue((t(), V(e(J), {
314
- loading: e(u),
315
- tip: "数据加载中",
316
- class: "PricingPlans__spin"
317
- }, {
318
- default: h(() => [b.value ? (t(), n("article", {
319
- key: 0,
320
- class: I(["PricingPlans__trial", {
321
- "is-current": O.value
322
- }])
323
- }, [i("div", $e, [i("div", qe, [i("h2", null, a(b.value.name), 1), i("p", null, a(b.value.description || e(ee)(b.value, 0)), 1), U(b.value).length ? (t(), n("ul", Ae, [(t(!0), n(C, null, T(U(b.value), (s) => (t(), n("li", {
324
- key: s.title
325
- }, [p(e(j), {
326
- icon: "mingcute:check-circle-fill",
327
- class: "PricingPlans__trialFeatureIcon"
328
- }), i("span", null, a(s.title), 1)]))), 128))])) : P("", !0)]), ne.value ? O.value ? (t(), n("div", De, " 已开通 ")) : P("", !0) : (t(), n("div", Fe, [p(e(R), {
329
- size: "large",
330
- class: "PricingPlans__trialButton",
331
- onClick: le
332
- }, {
333
- default: h(() => [..._[0] || (_[0] = [B(" 免费注册 ", -1)])]),
334
- _: 1
335
- })]))])], 2)) : P("", !0), q.value.length ? (t(), n("div", Ne, [e(L).length > 1 ? (t(), n("div", xe, [(t(!0), n(C, null, T(e(L), (s) => (t(), n("button", {
336
- key: s.value,
337
- type: "button",
338
- class: I(["PricingPlans__toggleItem", {
339
- "is-active": e(v) === s.value
340
- }]),
341
- onClick: (W) => e(A)(s.value)
342
- }, [i("span", null, a(s.label), 1), s.badge ? (t(), n("span", Me, a(s.badge), 1)) : P("", !0)], 10, Ee))), 128))])) : P("", !0), r.note ? (t(), n("p", Qe, a(r.note), 1)) : P("", !0)])) : P("", !0), q.value.length ? (t(), n("div", {
343
- key: 2,
344
- class: I(["PricingPlans__grid", {
345
- "PricingPlans__grid--compact": q.value.length <= 2
346
- }])
347
- }, [(t(!0), n(C, null, T(q.value, (s, W) => (t(), n("article", {
348
- key: s.id,
349
- class: I(["PricingPlans__card", {
350
- "is-recommended": e(S)(s),
351
- "is-current": e(D)(s)
352
- }])
353
- }, [i("div", Ve, [(t(!0), n(C, null, T(e(X)(s), (y) => (t(), n("span", {
354
- key: y.type,
355
- class: I(["PricingPlans__badge", `is-${y.type}`])
356
- }, a(y.label), 3))), 128))]), i("div", ze, [i("h2", null, a(s.name), 1), i("p", null, a(s.description || ae(W)), 1)]), i("div", He, [e(l)(s) ? (t(), n("span", Ge, " ¥" + a(e(l)(s)), 1)) : P("", !0), _[1] || (_[1] = i("span", {
357
- class: "PricingPlans__currency"
358
- }, "¥", -1)), i("span", Ke, a(e(m)(s)), 1), i("span", Oe, a(e(k)(s)), 1)]), e(H)(s) ? (t(), n("p", Ue, a(e(H)(s)), 1)) : P("", !0), p(e(R), {
359
- long: "",
360
- size: "large",
361
- class: "PricingPlans__button",
362
- type: e(S)(s) ? "primary" : "outline",
363
- loading: e(ie)(s),
364
- disabled: e(N)(s),
365
- onClick: (y) => e(se)(s)
366
- }, {
367
- default: h(() => [B(a(e(Z)(s)), 1)]),
368
- _: 2
369
- }, 1032, ["type", "loading", "disabled", "onClick"]), _[2] || (_[2] = i("div", {
370
- class: "PricingPlans__divider"
371
- }, null, -1)), i("div", We, [(t(!0), n(C, null, T(e(G)(s.features), (y) => (t(), n("section", {
372
- key: y.title,
373
- class: "PricingPlans__featureGroup"
374
- }, [i("h3", null, a(y.title), 1), i("ul", je, [(t(!0), n(C, null, T(y.items, (E) => (t(), n("li", {
375
- key: E.title,
376
- class: I({
377
- "is-highlight": E.highlight
378
- })
379
- }, [p(e(j), {
380
- icon: "mingcute:check-circle-fill",
381
- class: "PricingPlans__featureIcon"
382
- }), i("span", null, a(E.title), 1)], 2))), 128))])]))), 128))])], 2))), 128))], 2)) : !b.value && !e(u) ? (t(), n("div", Ye, " 当前暂无可订阅方案 ")) : P("", !0)]),
383
- _: 1
384
- }, 8, ["loading"])), [[x]])]);
385
- };
386
- }
387
- }), Pt = /* @__PURE__ */ z(Je, [["__scopeId", "data-v-b3658f38"]]);
388
- export {
389
- dt as P,
390
- _t as a,
391
- gt as b,
392
- Pt as c,
393
- M as p,
394
- ke as r
395
- };