@huyooo/ui 1.0.7 → 2.0.1
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/dist/AuthkitAppSetting-DCQH9IpU.js +2678 -0
- package/dist/{Contact-BWuVR9ho.js → Contact-C7ROEqe-.js} +9 -9
- package/dist/{CustomTable-BzGfaAVH.js → CustomTable-GgvDEidl.js} +1 -1
- package/dist/FeedbackModal.vue_vue_type_script_setup_true_lang-C1hPqnNT.js +1531 -0
- package/dist/{LegalDocViewer-DM8FYBpf.js → LegalDocViewer-D_QUh0uf.js} +747 -748
- package/dist/MessageHandle-DKoySsCG.js +1233 -0
- package/dist/{MessageList-Ce-_LNTk.js → MessageList-HSiKkUoD.js} +4 -4
- package/dist/PaySubscriptions-NcATVJGm.js +1331 -0
- package/dist/{PricingPlans-CV97ck9p.js → PricingPlans-CZn6eJby.js} +99 -105
- package/dist/{ReferrerReferees-DgygiIiE.js → ReferrerReferees-BoOQIssE.js} +47 -46
- package/dist/Upload.vue_vue_type_script_setup_true_lang-CkS2S9Xc.js +83 -0
- package/dist/{UserMenuInvitationsItem.vue_vue_type_script_setup_true_lang-0Td42Nb3.js → UserMenuInvitationsItem.vue_vue_type_script_setup_true_lang-BrNx6JWe.js} +64 -65
- package/dist/WidthContainer-BJLdZfzF.js +717 -0
- package/dist/api/billingSubscriptionApi.d.ts +4 -1
- package/dist/apiClients-CR-hEwog.js +245 -0
- package/dist/authkit.js +10 -10
- package/dist/common/globalConfig.d.ts +36 -18
- package/dist/common.js +2 -2
- package/dist/components/Authkit/Auth/AuthkitOauthCallback.vue.d.ts +2 -2
- package/dist/components/Authkit/AuthkitProvider.vue.d.ts +0 -5
- package/dist/components/Feedback/FeedbackDetails.vue.d.ts +11 -0
- package/dist/components/Upload/Upload.vue.d.ts +7 -6
- package/dist/composables/Authkit/useAuthkitAuth.d.ts +3 -0
- package/dist/composables/Billing/usePaymentReturn.d.ts +1 -0
- package/dist/composables/uploadFeedbackAttachment.d.ts +8 -1
- package/dist/composables/useMessageList.d.ts +2 -1
- package/dist/composables.d.ts +2 -2
- package/dist/composables.js +46 -46
- package/dist/feedback.js +2 -2
- package/dist/{fetchAuthPageAboutUs-dzTSwRsB.js → fetchAuthPageAboutUs-BnKWq_TL.js} +4 -4
- package/dist/{index-BkLvw1PU.js → index-BhVwozr0.js} +1 -1
- package/dist/legalDocs/resolveAppId.d.ts +1 -1
- package/dist/main.d.ts +4 -3
- package/dist/main.js +464 -469
- package/dist/message.js +53 -52
- package/dist/pay.js +4 -4
- package/dist/privateCom.js +1 -1
- package/dist/referrer.js +1 -1
- package/dist/{useUploadCos-C8BqFPkx.js → runtime-DMCyhVcI.js} +2305 -2185
- package/dist/runtime.d.ts +22 -0
- package/dist/style.css +1 -1
- package/dist/types/api/auth.generated.d.ts +0 -10
- package/dist/upload/browserCosTransport.d.ts +22 -0
- package/dist/upload/browserUploadService.d.ts +21 -0
- package/dist/upload.d.ts +2 -1
- package/dist/upload.js +5 -4
- package/dist/{useAuthkitAppsAuthPageInfo-CNudJd04.js → useAuthkitAppsAuthPageInfo-Byu0yvrx.js} +18 -21
- package/dist/useAuthkitAuth-M2vTpEcb.js +272 -0
- package/dist/{useAuthkitCreateAndUpdate-BsINsI-E.js → useAuthkitCreateAndUpdate-D2_Bdazi.js} +1 -1
- package/dist/useAuthkitUsersProfile-DdUAENic.js +39 -0
- package/dist/useBillingStatusOptions-Jq6Wqfxb.js +61 -0
- package/dist/{useEnsureAuthenticated-DNkCCy_Y.js → useEnsureAuthenticated-Hel8hWLJ.js} +2 -2
- package/dist/{useLegalDocs-DQP_Yq6B.js → useLegalDocs-BOjqYRyQ.js} +25 -25
- package/dist/useMessageNotifications-AznFeFMD.js +80 -0
- package/dist/{useRoutePermission-CEiya9AM.js → useRoutePermission-BmUXTwQc.js} +2 -2
- package/dist/{useSEO-CDWxbk8B.js → useSEO-Chz4Zxuu.js} +89 -86
- package/dist/useSubscriptionCheckout-3ivcOcgC.js +353 -0
- package/dist/user.js +1 -1
- package/dist/utils/apiClients.d.ts +20 -12
- package/dist/utils/apiMiddlewares.d.ts +9 -23
- package/package.json +1 -1
- package/dist/AuthkitAppSetting-BN8-xgNq.js +0 -2674
- package/dist/FeedbackModal.vue_vue_type_script_setup_true_lang-DrL_XBqf.js +0 -1481
- package/dist/MessageHandle-mEkCsv9e.js +0 -1173
- package/dist/PaySubscriptions-CXkEjqr2.js +0 -1326
- package/dist/Upload.vue_vue_type_script_setup_true_lang-VGh2V4o0.js +0 -76
- package/dist/WidthContainer-CFMQRsCy.js +0 -721
- package/dist/apiClients-BcXOLuYu.js +0 -272
- package/dist/composables/Upload/useUploadCos.d.ts +0 -12
- package/dist/useAuthkitAuth-3m0yW6uP.js +0 -267
- package/dist/useAuthkitUsersProfile-DJlMsftY.js +0 -40
- package/dist/useBillingStatusOptions-CfHQOFNw.js +0 -71
- package/dist/useMessageNotifications-CAphguOm.js +0 -75
- package/dist/useSubscriptionCheckout-d_M_rKRa.js +0 -368
- package/dist/utils/billingFetch.d.ts +0 -1
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { ref as a, computed as w } from "vue";
|
|
2
|
-
import { o as c } from "./apiClients-BcXOLuYu.js";
|
|
3
|
-
function z() {
|
|
4
|
-
const n = a(!0), f = a(""), i = a(!1), d = a(!1), o = a([]), t = a({
|
|
5
|
-
total: 0,
|
|
6
|
-
current: 1,
|
|
7
|
-
pageSize: 10
|
|
8
|
-
}), l = a(!1), u = a(!1), r = a("unread"), p = [{
|
|
9
|
-
label: "未读消息",
|
|
10
|
-
key: "unread"
|
|
11
|
-
}, {
|
|
12
|
-
label: "已读消息",
|
|
13
|
-
key: "read"
|
|
14
|
-
}], v = w(() => r.value === "read");
|
|
15
|
-
function A() {
|
|
16
|
-
n.value = !0;
|
|
17
|
-
}
|
|
18
|
-
function N(e) {
|
|
19
|
-
r.value = e, t.value.current = 1, s();
|
|
20
|
-
}
|
|
21
|
-
async function g(e) {
|
|
22
|
-
l.value = !0, await c.messageCenter.messageNotifications.read.post({
|
|
23
|
-
messageId: e
|
|
24
|
-
}), l.value = !1;
|
|
25
|
-
}
|
|
26
|
-
async function m() {
|
|
27
|
-
u.value = !0;
|
|
28
|
-
const {
|
|
29
|
-
error: e
|
|
30
|
-
} = await c.messageCenter.messageNotifications.readAll.post({});
|
|
31
|
-
u.value = !1, e || s();
|
|
32
|
-
}
|
|
33
|
-
function b() {
|
|
34
|
-
o.value.length !== 0 && m();
|
|
35
|
-
}
|
|
36
|
-
async function s() {
|
|
37
|
-
i.value = !0;
|
|
38
|
-
const {
|
|
39
|
-
data: e
|
|
40
|
-
} = await c.messageCenter.messageNotifications.own.post({
|
|
41
|
-
current: t.value.current,
|
|
42
|
-
pageSize: t.value.pageSize,
|
|
43
|
-
where: {
|
|
44
|
-
read: v.value
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
i.value = !1, e && (o.value = e.items, t.value.total = e.count, d.value = e.items.length < t.value.pageSize);
|
|
48
|
-
}
|
|
49
|
-
function h(e) {
|
|
50
|
-
f.value = e.id, n.value = !1, g(e.id);
|
|
51
|
-
}
|
|
52
|
-
return s(), {
|
|
53
|
-
isList: n,
|
|
54
|
-
id: f,
|
|
55
|
-
loading: i,
|
|
56
|
-
finished: d,
|
|
57
|
-
messageList: o,
|
|
58
|
-
pagination: t,
|
|
59
|
-
readLoading: l,
|
|
60
|
-
readAllLoading: u,
|
|
61
|
-
activeTab: r,
|
|
62
|
-
tabs: p,
|
|
63
|
-
read: v,
|
|
64
|
-
toList: A,
|
|
65
|
-
onTabChange: N,
|
|
66
|
-
messageNotificationsReadApi: g,
|
|
67
|
-
messageNotificationsReadAllApi: m,
|
|
68
|
-
readAll: b,
|
|
69
|
-
getData: s,
|
|
70
|
-
openDetails: h
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
export {
|
|
74
|
-
z as u
|
|
75
|
-
};
|
|
@@ -1,368 +0,0 @@
|
|
|
1
|
-
/* empty css */
|
|
2
|
-
import { f as $ } from "./apiClients-BcXOLuYu.js";
|
|
3
|
-
import { Message as g } from "@arco-design/web-vue";
|
|
4
|
-
import { ref as y, computed as q } from "vue";
|
|
5
|
-
import { d as z } from "./useBillingStatusOptions-CfHQOFNw.js";
|
|
6
|
-
import { u as H } from "./useEnsureAuthenticated-DNkCCy_Y.js";
|
|
7
|
-
function D(e) {
|
|
8
|
-
var i;
|
|
9
|
-
const n = (i = e == null ? void 0 : e.metadata) == null ? void 0 : i.originalPrice;
|
|
10
|
-
return typeof n == "number" ? n : void 0;
|
|
11
|
-
}
|
|
12
|
-
function F(e) {
|
|
13
|
-
const n = D(e);
|
|
14
|
-
return !e || n === void 0 || n <= e.unitAmount ? 0 : n - e.unitAmount;
|
|
15
|
-
}
|
|
16
|
-
function J(e) {
|
|
17
|
-
const n = F(e);
|
|
18
|
-
return n > 0 ? `优惠 ¥${h(n)}` : "";
|
|
19
|
-
}
|
|
20
|
-
function h(e) {
|
|
21
|
-
return e === void 0 ? 0 : Math.floor(e / 100);
|
|
22
|
-
}
|
|
23
|
-
function N(e, n = 1) {
|
|
24
|
-
const i = n > 1 ? `每 ${n} ` : "按";
|
|
25
|
-
switch (e) {
|
|
26
|
-
case "month":
|
|
27
|
-
return `${i}月订阅`;
|
|
28
|
-
case "year":
|
|
29
|
-
return `${i}年订阅`;
|
|
30
|
-
case "day":
|
|
31
|
-
return `${i}天订阅`;
|
|
32
|
-
case "week":
|
|
33
|
-
return `${i}周订阅`;
|
|
34
|
-
default:
|
|
35
|
-
return "";
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
function W(e) {
|
|
39
|
-
const n = e != null && e.intervalCount && e.intervalCount > 1 ? `${e.intervalCount} ` : "";
|
|
40
|
-
switch (e == null ? void 0 : e.interval) {
|
|
41
|
-
case "month":
|
|
42
|
-
return `/ ${n}月`;
|
|
43
|
-
case "year":
|
|
44
|
-
return `/ ${n}年`;
|
|
45
|
-
case "day":
|
|
46
|
-
return `/ ${n}天`;
|
|
47
|
-
case "week":
|
|
48
|
-
return `/ ${n}周`;
|
|
49
|
-
default:
|
|
50
|
-
return "";
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
function X(e) {
|
|
54
|
-
const n = (e == null ? void 0 : e.intervalCount) ?? 1;
|
|
55
|
-
switch (e == null ? void 0 : e.interval) {
|
|
56
|
-
case "month":
|
|
57
|
-
return `${n} 个月`;
|
|
58
|
-
case "year":
|
|
59
|
-
return `${n} 年`;
|
|
60
|
-
case "day":
|
|
61
|
-
return `${n} 天`;
|
|
62
|
-
case "week":
|
|
63
|
-
return `${n} 周`;
|
|
64
|
-
default:
|
|
65
|
-
return "";
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
function I(e) {
|
|
69
|
-
switch (e) {
|
|
70
|
-
case "day":
|
|
71
|
-
return "每天";
|
|
72
|
-
case "week":
|
|
73
|
-
return "每周";
|
|
74
|
-
case "month":
|
|
75
|
-
return "每月";
|
|
76
|
-
case "year":
|
|
77
|
-
return "每年";
|
|
78
|
-
case "lifetime":
|
|
79
|
-
return "不重置";
|
|
80
|
-
default:
|
|
81
|
-
return "";
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
function S(e) {
|
|
85
|
-
if (e.type === "quota" && e.value !== void 0) {
|
|
86
|
-
const n = I(e.quotaPeriod), i = n ? ` / ${n}` : "";
|
|
87
|
-
return `${e.name}: ${e.value === -1 ? "无限" : e.value}${i}`;
|
|
88
|
-
}
|
|
89
|
-
if (e.type === "unlimited") {
|
|
90
|
-
const n = I(e.quotaPeriod);
|
|
91
|
-
return n ? `${e.name}: 不限 / ${n}` : `${e.name}不限`;
|
|
92
|
-
}
|
|
93
|
-
return e.type === "boolean" && e.value === !1 ? `${e.name}(不支持)` : e.name;
|
|
94
|
-
}
|
|
95
|
-
function w(e) {
|
|
96
|
-
return e.type !== "recurring" || !e.interval ? null : {
|
|
97
|
-
key: `${e.interval}:${e.intervalCount ?? 1}`,
|
|
98
|
-
interval: e.interval,
|
|
99
|
-
intervalCount: e.intervalCount ?? 1
|
|
100
|
-
};
|
|
101
|
-
}
|
|
102
|
-
function Y(e, n) {
|
|
103
|
-
const i = {
|
|
104
|
-
day: 1,
|
|
105
|
-
week: 2,
|
|
106
|
-
month: 3,
|
|
107
|
-
year: 4
|
|
108
|
-
};
|
|
109
|
-
return i[e.interval] - i[n.interval] || e.intervalCount - n.intervalCount;
|
|
110
|
-
}
|
|
111
|
-
function Z(e, n) {
|
|
112
|
-
let i = 0;
|
|
113
|
-
for (const d of e)
|
|
114
|
-
for (const m of d.prices) {
|
|
115
|
-
const s = w(m);
|
|
116
|
-
(s == null ? void 0 : s.key) === n && (i = Math.max(i, F(m)));
|
|
117
|
-
}
|
|
118
|
-
return i > 0 ? `最高优惠 ¥${h(i)}` : void 0;
|
|
119
|
-
}
|
|
120
|
-
function ee(e) {
|
|
121
|
-
return e.includes(":") ? e : `${e}:1`;
|
|
122
|
-
}
|
|
123
|
-
function B() {
|
|
124
|
-
return !!localStorage.getItem("jwtToken");
|
|
125
|
-
}
|
|
126
|
-
function le(e = "month") {
|
|
127
|
-
const n = y([]), i = y(null), d = y(null), m = y(!1), s = y(!1), a = y(ee(e)), l = q(() => {
|
|
128
|
-
const t = /* @__PURE__ */ new Map();
|
|
129
|
-
for (const r of n.value)
|
|
130
|
-
for (const u of r.prices) {
|
|
131
|
-
const c = w(u);
|
|
132
|
-
c && t.set(c.key, c);
|
|
133
|
-
}
|
|
134
|
-
return [...t.values()].sort(Y).map((r) => ({
|
|
135
|
-
value: r.key,
|
|
136
|
-
label: N(r.interval, r.intervalCount),
|
|
137
|
-
badge: Z(n.value, r.key)
|
|
138
|
-
}));
|
|
139
|
-
}), P = q(() => {
|
|
140
|
-
const t = [];
|
|
141
|
-
for (const r of n.value) {
|
|
142
|
-
const u = r.prices.find((o) => {
|
|
143
|
-
const b = w(o);
|
|
144
|
-
return (b == null ? void 0 : b.key) === a.value;
|
|
145
|
-
}), c = r.prices.find((o) => o.type === "free"), f = u ?? (c && r.prices.every((o) => o.type === "free") ? c : void 0);
|
|
146
|
-
f && t.push({
|
|
147
|
-
...r,
|
|
148
|
-
features: f.features ?? [],
|
|
149
|
-
selectedPrice: f
|
|
150
|
-
});
|
|
151
|
-
}
|
|
152
|
-
return t;
|
|
153
|
-
});
|
|
154
|
-
function x(t) {
|
|
155
|
-
a.value = t;
|
|
156
|
-
}
|
|
157
|
-
function p(t) {
|
|
158
|
-
const r = i.value, u = d.value;
|
|
159
|
-
return r != null && r.priceId && t.selectedPrice ? r.priceId === t.selectedPrice.id : r ? r.productId === t.id : u != null && u.priceId && t.selectedPrice ? u.priceId === t.selectedPrice.id : u ? u.productId === t.id : !1;
|
|
160
|
-
}
|
|
161
|
-
function A(t) {
|
|
162
|
-
var r;
|
|
163
|
-
return ((r = i.value) == null ? void 0 : r.productId) === t.id;
|
|
164
|
-
}
|
|
165
|
-
function v(t) {
|
|
166
|
-
var r;
|
|
167
|
-
return ((r = t.selectedPrice) == null ? void 0 : r.type) === "free";
|
|
168
|
-
}
|
|
169
|
-
function U() {
|
|
170
|
-
return !!i.value;
|
|
171
|
-
}
|
|
172
|
-
function M(t) {
|
|
173
|
-
return !!(!t.selectedPrice || p(t) || v(t) && U());
|
|
174
|
-
}
|
|
175
|
-
function C(t) {
|
|
176
|
-
var r;
|
|
177
|
-
return ((r = t.metadata) == null ? void 0 : r.recommended) === !0;
|
|
178
|
-
}
|
|
179
|
-
function G(t) {
|
|
180
|
-
var r;
|
|
181
|
-
return h((r = t.selectedPrice) == null ? void 0 : r.unitAmount);
|
|
182
|
-
}
|
|
183
|
-
function O(t) {
|
|
184
|
-
const r = D(t.selectedPrice);
|
|
185
|
-
return r === void 0 ? void 0 : h(r);
|
|
186
|
-
}
|
|
187
|
-
function T(t) {
|
|
188
|
-
return v(t) ? "" : W(t.selectedPrice);
|
|
189
|
-
}
|
|
190
|
-
function j(t) {
|
|
191
|
-
if (v(t)) {
|
|
192
|
-
const r = X(t.selectedPrice);
|
|
193
|
-
return r ? `${r}免费体验` : "免费体验";
|
|
194
|
-
}
|
|
195
|
-
return J(t.selectedPrice);
|
|
196
|
-
}
|
|
197
|
-
function E(t) {
|
|
198
|
-
const r = [];
|
|
199
|
-
return p(t) ? r.push({
|
|
200
|
-
label: "当前方案",
|
|
201
|
-
type: "current"
|
|
202
|
-
}) : v(t) ? r.push({
|
|
203
|
-
label: "免费体验",
|
|
204
|
-
type: "trial"
|
|
205
|
-
}) : C(t) && r.push({
|
|
206
|
-
label: "最受欢迎",
|
|
207
|
-
type: "recommended"
|
|
208
|
-
}), r;
|
|
209
|
-
}
|
|
210
|
-
function R(t) {
|
|
211
|
-
const r = i.value;
|
|
212
|
-
return p(t) ? "当前方案" : v(t) ? r ? "已订阅付费方案" : B() ? "免费开通" : "免费注册" : r ? A(t) ? "切换周期" : typeof r.unitAmount == "number" && t.selectedPrice.unitAmount > r.unitAmount ? "升级方案" : "切换方案" : "立即订阅";
|
|
213
|
-
}
|
|
214
|
-
function K(t, r) {
|
|
215
|
-
const u = t.features.find((c) => c.type === "quota" && c.value !== void 0);
|
|
216
|
-
if (u) {
|
|
217
|
-
const c = I(u.quotaPeriod), f = u.value === -1 ? "不限量" : u.value;
|
|
218
|
-
return `${u.name} ${c ? `${f} / ${c}` : f},覆盖核心使用场景。`;
|
|
219
|
-
}
|
|
220
|
-
return v(t) ? "注册后自动开通免费权益,适合先体验核心能力。" : r === 1 ? "为正式团队准备的高配能力组合。" : "包含入门所需的核心能力。";
|
|
221
|
-
}
|
|
222
|
-
function Q(t) {
|
|
223
|
-
return t.filter((r) => r.highlight !== !1).map((r) => ({
|
|
224
|
-
title: S(r),
|
|
225
|
-
description: r.description || ""
|
|
226
|
-
}));
|
|
227
|
-
}
|
|
228
|
-
function V(t) {
|
|
229
|
-
const r = t.filter((o) => o.highlight !== !1), u = r.filter((o) => o.type === "quota" || o.type === "unlimited").map((o) => ({
|
|
230
|
-
title: S(o),
|
|
231
|
-
description: o.description || ""
|
|
232
|
-
})), c = r.filter((o) => o.type === "boolean" && o.value !== !1).map((o) => ({
|
|
233
|
-
title: o.name,
|
|
234
|
-
description: o.description || ""
|
|
235
|
-
})), f = [];
|
|
236
|
-
return c.length && f.push({
|
|
237
|
-
title: "功能特性",
|
|
238
|
-
items: c
|
|
239
|
-
}), u.length && f.push({
|
|
240
|
-
title: "用量配额",
|
|
241
|
-
items: u
|
|
242
|
-
}), f;
|
|
243
|
-
}
|
|
244
|
-
async function k() {
|
|
245
|
-
m.value = !0;
|
|
246
|
-
try {
|
|
247
|
-
const t = await z.productOptions();
|
|
248
|
-
n.value = Array.isArray(t) ? t : [], !l.value.some((u) => u.value === a.value) && l.value[0] && (a.value = l.value[0].value);
|
|
249
|
-
} catch (t) {
|
|
250
|
-
n.value = [], g.error(t instanceof Error ? t.message : "加载定价方案失败");
|
|
251
|
-
} finally {
|
|
252
|
-
m.value = !1;
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
async function L() {
|
|
256
|
-
if (!B()) {
|
|
257
|
-
i.value = null, d.value = null;
|
|
258
|
-
return;
|
|
259
|
-
}
|
|
260
|
-
s.value = !0;
|
|
261
|
-
try {
|
|
262
|
-
const {
|
|
263
|
-
data: t,
|
|
264
|
-
error: r
|
|
265
|
-
} = await $.subscriptions.summary.post();
|
|
266
|
-
if (r)
|
|
267
|
-
return;
|
|
268
|
-
i.value = (t == null ? void 0 : t.current) ?? null, d.value = (t == null ? void 0 : t.trial) ?? null;
|
|
269
|
-
} catch (t) {
|
|
270
|
-
g.error(t instanceof Error ? t.message : "加载当前订阅失败");
|
|
271
|
-
} finally {
|
|
272
|
-
s.value = !1;
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
async function _() {
|
|
276
|
-
await Promise.all([k(), L()]);
|
|
277
|
-
}
|
|
278
|
-
return {
|
|
279
|
-
products: n,
|
|
280
|
-
plans: P,
|
|
281
|
-
currentSubscription: i,
|
|
282
|
-
currentTrial: d,
|
|
283
|
-
listLoading: m,
|
|
284
|
-
currentLoading: s,
|
|
285
|
-
billingInterval: a,
|
|
286
|
-
billingIntervalTabs: l,
|
|
287
|
-
setBillingInterval: x,
|
|
288
|
-
isCurrentPlan: p,
|
|
289
|
-
isSameProduct: A,
|
|
290
|
-
isRecommendedPlan: C,
|
|
291
|
-
isFreePlan: v,
|
|
292
|
-
isPlanActionDisabled: M,
|
|
293
|
-
getDisplayPrice: G,
|
|
294
|
-
getDisplayOriginalPrice: O,
|
|
295
|
-
getDisplayCycle: T,
|
|
296
|
-
getPromotionLabel: j,
|
|
297
|
-
getBadgeLabels: E,
|
|
298
|
-
getButtonLabel: R,
|
|
299
|
-
getPlanSummary: K,
|
|
300
|
-
getFeatureItems: Q,
|
|
301
|
-
getFeatureGroups: V,
|
|
302
|
-
loadProducts: k,
|
|
303
|
-
loadCurrentSubscription: L,
|
|
304
|
-
refresh: _
|
|
305
|
-
};
|
|
306
|
-
}
|
|
307
|
-
function te(e) {
|
|
308
|
-
window.open(e, "_blank", "noopener,noreferrer");
|
|
309
|
-
}
|
|
310
|
-
function re(e) {
|
|
311
|
-
return e && typeof e == "object" && "message" in e && typeof e.message == "string" ? e.message : "";
|
|
312
|
-
}
|
|
313
|
-
function ne(e) {
|
|
314
|
-
return e && typeof e == "object" && "alipayUrl" in e && typeof e.alipayUrl == "string" ? e.alipayUrl : "";
|
|
315
|
-
}
|
|
316
|
-
function fe(e) {
|
|
317
|
-
const n = y(null), {
|
|
318
|
-
ensureAuthenticated: i
|
|
319
|
-
} = H();
|
|
320
|
-
async function d(s) {
|
|
321
|
-
if (!s.selectedPrice) {
|
|
322
|
-
g.warning("当前方案暂无可购买价格");
|
|
323
|
-
return;
|
|
324
|
-
}
|
|
325
|
-
if (!i(() => d(s))) return;
|
|
326
|
-
const a = e.currentSubscription.value;
|
|
327
|
-
if ((a == null ? void 0 : a.priceId) === s.selectedPrice.id) {
|
|
328
|
-
g.info("当前已经是该方案");
|
|
329
|
-
return;
|
|
330
|
-
}
|
|
331
|
-
n.value = s.id;
|
|
332
|
-
try {
|
|
333
|
-
if (s.selectedPrice.type === "free")
|
|
334
|
-
return;
|
|
335
|
-
const l = a ? await $.subscriptions.change.post({
|
|
336
|
-
subscriptionId: a.id,
|
|
337
|
-
newPriceId: s.selectedPrice.id,
|
|
338
|
-
proration: !0
|
|
339
|
-
}) : await $.subscriptions.create.post({
|
|
340
|
-
priceId: s.selectedPrice.id
|
|
341
|
-
});
|
|
342
|
-
if (l.error)
|
|
343
|
-
return;
|
|
344
|
-
const P = ne(l.data);
|
|
345
|
-
if (P) {
|
|
346
|
-
te(P);
|
|
347
|
-
return;
|
|
348
|
-
}
|
|
349
|
-
g.success(re(l.data) || "订阅已更新"), await e.refreshCurrentSubscription();
|
|
350
|
-
} catch (l) {
|
|
351
|
-
console.error("订阅操作失败", l), g.error("订阅操作失败,请稍后重试");
|
|
352
|
-
} finally {
|
|
353
|
-
n.value = null;
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
function m(s) {
|
|
357
|
-
return n.value === s.id;
|
|
358
|
-
}
|
|
359
|
-
return {
|
|
360
|
-
checkoutPlanId: n,
|
|
361
|
-
checkout: d,
|
|
362
|
-
isCheckingOut: m
|
|
363
|
-
};
|
|
364
|
-
}
|
|
365
|
-
export {
|
|
366
|
-
fe as a,
|
|
367
|
-
le as u
|
|
368
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function billingFetch<T>(path: string, body?: Record<string, unknown>): Promise<T>;
|