Skip to content

Commit

Permalink
style: pay page perf (#2535)
Browse files Browse the repository at this point in the history
* style: pay page perf

* perf: package status logic && add pay text
  • Loading branch information
Patrickill authored Aug 27, 2024
1 parent d057ad3 commit 454a479
Show file tree
Hide file tree
Showing 15 changed files with 518 additions and 322 deletions.
18 changes: 15 additions & 3 deletions packages/global/support/wallet/sub/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,17 @@ export const standardSubLevelMap = {
},
[StandardSubLevelEnum.experience]: {
label: i18nT('common:support.wallet.subscription.standardSubLevel.experience'),
desc: '',
desc: i18nT('common:support.wallet.subscription.standardSubLevel.experience_desc'),
weight: 2
},
[StandardSubLevelEnum.team]: {
label: i18nT('common:support.wallet.subscription.standardSubLevel.team'),
desc: '',
desc: i18nT('common:support.wallet.subscription.standardSubLevel.team_desc'),
weight: 3
},
[StandardSubLevelEnum.enterprise]: {
label: i18nT('common:support.wallet.subscription.standardSubLevel.enterprise'),
desc: '',
desc: i18nT('common:support.wallet.subscription.standardSubLevel.enterprise_desc'),
weight: 4
},
[StandardSubLevelEnum.custom]: {
Expand All @@ -72,3 +72,15 @@ export const standardSubLevelMap = {
weight: 5
}
};

export enum PackageChangeStatusEnum {
buy = 'buy',
renewal = 'renewal',
upgrade = 'upgrade'
}

export const packagePayTextMap = {
[PackageChangeStatusEnum.buy]: i18nT('common:pay.package_tip.buy'),
[PackageChangeStatusEnum.renewal]: i18nT('common:pay.package_tip.renewal'),
[PackageChangeStatusEnum.upgrade]: i18nT('common:pay.package_tip.upgrade')
};
24 changes: 22 additions & 2 deletions packages/web/i18n/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,18 @@
"auto_renew_q": "Will the subscription package automatically renew?",
"change_package_a": "When the current package price is greater than the new package, you cannot switch immediately. You will be switched in the form of \"renewal\" after the current package expires.\n\nWhen the current package price is lower than the new package, the system will automatically calculate the remaining balance of the current package, and you can pay the price difference to switch packages.",
"change_package_q": "Can I switch subscription plans?",
"check_subscription_a": "Account - personal information - package details - usage. \nYou can view the effective and expiry dates of the packages you own. \nWhen the paid package expires, it will automatically switch to the free version.",
"check_subscription_q": "Where can I check my subscribed plans?",
"dataset_compute_a": "1 knowledge base storage is equal to 1 knowledge base index. \nA piece of knowledge base data can contain one or more knowledge base indexes. \nDuring enhanced training, 1 piece of data will generate 5 indexes.",
"dataset_compute_q": "How to calculate knowledge base storage?",
"dataset_index_a": "Won't. \nHowever, when the knowledge base index exceeds, knowledge base content cannot be inserted and updated.",
"dataset_index_q": "Will the knowledge base index be deleted if it exceeds the limit?",
"free_user_clean_a": "After free version users (free version without purchasing additional packages) have no usage records for 30 days, the system will automatically clear all knowledge base content under the account.",
"free_user_clean_q": "Will the data in the free version be cleared?",
"package_overlay_a": "OK. \nEach resource package purchased is independent and will be used stacked within its validity period. \nAI points will be deducted from the resource package that expires first.",
"package_overlay_q": "Can additional resource packs be stacked?"
"package_overlay_q": "Can additional resource packs be stacked?",
"switch_package_a": "The package usage rule is to give priority to more advanced packages. Therefore, if the new package purchased is more advanced than the current package, the new package will take effect immediately: otherwise, the current package will continue to be used.",
"switch_package_q": "Switch subscription plans?"
},
"Folder": "Folder",
"Login": "Login",
Expand Down Expand Up @@ -1070,6 +1074,7 @@
},
"extraction_results": "Extract results",
"field_name": "Name",
"free": "free",
"get_QR_failed": "Failed to obtain QR code",
"get_app_failed": "Failed to get app",
"get_laf_failed": "Failed to get Laf function list",
Expand All @@ -1089,6 +1094,7 @@
},
"invalid_variable": "Invalid variable",
"is_open": "Opened",
"is_using": "in use",
"item_description": "Field description",
"item_name": "Field name",
"key_repetition": "key duplicate",
Expand Down Expand Up @@ -1117,6 +1123,11 @@
"notice": "Do not close the page",
"old_package_price": "Old package price",
"other": "For other amounts, please round up the whole number",
"package_tip": {
"buy": "The package level you purchased is lower than the current package, and the package will take effect after the current package expires. \nYou can check the package usage in Account—Personal Information—Package Details.",
"renewal": "You are renewing your plan. \nYou can check the package usage in Account—Personal Information—Package Details.",
"upgrade": "If the package you purchased is higher than the current package, the package will take effect immediately, and the current package will take effect later. \nYou can check the package usage in Account—Personal Information—Package Details."
},
"to_recharge": "Insufficient balance, please recharge",
"wechat": "Please scan the QR code on WeChat to pay:",
"yuan": "Yuan"
Expand Down Expand Up @@ -1205,6 +1216,7 @@
"AI Bonus Points": "AI points",
"Expired Time": "End time",
"Start Time": "Start time",
"due_date": "Expiration time",
"storage": "Storage amount",
"type": "Type"
},
Expand Down Expand Up @@ -1365,10 +1377,18 @@
"standardSubLevel": {
"custom": "Customized version",
"enterprise": "Enterprise edition",
"enterprise_desc": "Suitable for small and medium-sized enterprises to build knowledge base applications in production environments",
"experience": "Experience edition",
"experience_desc": "Unlocks the full functionality of FastGPT",
"free": "Free edition",
"free desc": "Basic functions can be used for free every month, and the knowledge base will be cleared if there is no usage record for 30 days",
"team": "Team edition"
"team": "Team edition",
"team_desc": "Suitable for small teams to build knowledge base applications and provide external services"
},
"status": {
"active": "Taking effect",
"expired": "Expired",
"inactive": "To be used"
},
"token_compute": "Click to view the online Tokens calculator",
"type": {
Expand Down
15 changes: 14 additions & 1 deletion packages/web/i18n/en/user.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
{
"bill": {
"balance": "Balance",
"buy_plan": "Buy a package",
"buy_standard_plan_success": "Package purchased successfully",
"contact_customer_service": "Contact customer service",
"conversion": "exchange",
"convert_error": "Redemption failed",
"convert_success": "Redemption successful",
"current_token_price": "Current points price",
"not_need_invoice": "Balance payment, unable to issue invoice",
"price": "price",
"renew_plan": "Renewal package",
"standard_valid_tip": "Package usage rules: The system gives priority to using more advanced packages, and the original unused packages will take effect later.",
"valid_time": "Effective time"
"token_expire_1year": "Points are valid for one year",
"tokens": "integral",
"use_balance": "Use balance",
"use_balance_hint": "Due to the system upgrade, the original \"automatic renewal and deduction from balance\" mode has been cancelled, and the balance recharge entrance has been closed. \nYour balance can be used to purchase points",
"valid_time": "Effective time",
"you_can_convert": "You can redeem",
"yuan": "Yuan"
},
"bind_inform_account_error": "Abnormal binding notification account",
"bind_inform_account_success": "Binding notification account successful",
Expand Down
29 changes: 24 additions & 5 deletions packages/web/i18n/zh/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,20 @@
"free_user_clean_a": "免费版团队(免费版且未购买额外套餐)连续 30 天未登录系统,系统会自动清除该团队下所有知识库内容。",
"free_user_clean_q": "免费版数据会清除么?",
"package_overlay_a": "可以的。每次购买的资源包都是独立的,在其有效期内将会叠加使用。AI积分会优先扣除最先过期的资源包。",
"package_overlay_q": "额外资源包可以叠加么?"
"package_overlay_q": "额外资源包可以叠加么?",
"switch_package_q": "是否切换订阅套餐?",
"switch_package_a": "套餐使用规则为优先使用更高级的套餐,因此,购买的新套餐若比当前套餐更高级,则新套餐立即生效:否则将继续使用当前套餐。",
"check_subscription_q": "在哪里查看已订阅的套餐?",
"check_subscription_a": "账号-个人信息-套餐详情-使用情况。您可以查看所拥有套餐的生效和到期时间。当付费套餐到期后将自动切换免费版。"
},
"Folder": "文件夹",
"Login": "登录",
"is_using": "正在使用",
"Move": "移动",
"Name": "名称",
"Rename": "重命名",
"Resume": "恢复",
"free": "免费",
"Running": "运行中",
"UnKnow": "未知",
"Warning": "提示",
Expand Down Expand Up @@ -631,8 +637,7 @@
"success": "开始同步"
}
},
"training": {
}
"training": {}
},
"data": {
"Auxiliary Data": "辅助数据",
Expand Down Expand Up @@ -1119,7 +1124,12 @@
"other": "其他金额,请取整数",
"to_recharge": "余额不足,去充值",
"wechat": "请微信扫码支付: {{price}}元\n请勿关闭页面",
"yuan": "{{amount}}元"
"yuan": "{{amount}}元",
"package_tip": {
"buy": "您购买的套餐等级低于当前套餐,该套餐将在当前套餐过期后生效。您可在账号—个人信息—套餐详情里,查看套餐使用情况。",
"renewal": "您正在续费套餐。您可在账号—个人信息—套餐详情里,查看套餐使用情况。",
"upgrade": "您购买的套餐等级高于当前套餐,该套餐将即刻生效,当前套餐将延后生效。您可在账号—个人信息—套餐详情里,查看套餐使用情况。"
}
},
"permission": {
"Collaborator": "协作者",
Expand Down Expand Up @@ -1204,6 +1214,7 @@
"standard": {
"AI Bonus Points": "AI 积分",
"Expired Time": "结束时间",
"due_date": "到期时间",
"Start Time": "开始时间",
"storage": "存储量",
"type": "类型"
Expand Down Expand Up @@ -1320,6 +1331,11 @@
"noBill": "无账单记录~",
"no_invoice": "暂无开票记录",
"subscription": {
"status": {
"expired": "已过期",
"active": "生效中",
"inactive": "待使用"
},
"AI points": "AI 积分",
"AI points click to read tip": "每次调用 AI 模型时,都会消耗一定的 AI 积分(类似于 token)。点击可查看详细计算规则。",
"AI points usage": "AI 积分使用量",
Expand Down Expand Up @@ -1368,7 +1384,10 @@
"experience": "体验版",
"free": "免费版",
"free desc": "每月均可免费使用基础功能,连续 30 天未登录系统,将会自动清除知识库",
"team": "团队版"
"team": "团队版",
"experience_desc": "可解锁 FastGPT 完整功能",
"team_desc": "适合小团队构建知识库应用并提供对外服务",
"enterprise_desc": "适合中小企业在生产环境构建知识库应用"
},
"token_compute": "点击查看在线 Tokens 计算器",
"type": {
Expand Down
13 changes: 13 additions & 0 deletions packages/web/styles/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -680,6 +680,19 @@ export const theme = extendTheme({
800: '#93370D',
900: '#7A2E0E'
},
adora: {
25: '#FCFCFF',
50: '#F0EEFF',
100: '#E4E1FC',
200: '#D3CAFF',
300: '#B6A8FC',
400: '#9E8DFB',
500: '#8774EE',
600: '#6F5DD7',
700: '#5E4EBD',
800: '#4E4198',
900: '#42387D'
},
borderColor: {
low: '#E8EBF0',
base: '#DFE2EA',
Expand Down
Loading

0 comments on commit 454a479

Please sign in to comment.