chore: comm trial

v2-dev-buy
xiaojunnuo 2025-08-15 00:11:48 +08:00
parent 962f8233b0
commit 94cbeba495
4 changed files with 30 additions and 18 deletions

View File

@ -8,10 +8,10 @@ export async function doActive(form: any) {
}); });
} }
export async function getVipTrial() { export async function getVipTrial(vipType:string) {
return await request({ return await request({
url: "/sys/plus/getVipTrial", url: "/sys/plus/getVipTrial",
method: "post", method: "post",
data: {}, data: {vipType},
}); });
} }

View File

@ -165,34 +165,38 @@ function goAccount() {
router.push("/sys/account"); router.push("/sys/account");
} }
async function getVipTrial() { async function getVipTrial(vipType = "plus") {
const res = await api.getVipTrial(); const res = await api.getVipTrial(vipType);
message.success(t("vip.congratulations_vip_trial", { duration: res.duration })); message.success(t("vip.congratulations_vip_trial", { duration: res.duration }));
await settingStore.init(); await settingStore.init();
} }
function openTrialModal() { function openTrialModal(vipType = "plus") {
Modal.destroyAll(); Modal.destroyAll();
modal.confirm({ modal.confirm({
title: t("vip.trial_modal_title"), title: t("vip.trial_modal_title"),
okText: t("vip.trial_modal_ok_text"), okText: t("vip.trial_modal_ok_text"),
onOk() { onOk() {
getVipTrial(); getVipTrial(vipType);
}, },
width: 600, width: 600,
content: () => { content: () => {
return ( return (
<div class="flex-col mt-10 mb-10"> <div class="flex-col mt-10 mb-10">
<div>{t("vip.trial_modal_thanks")}</div> <div>{t("vip.trial_modal_thanks")}</div>
<div>{t("vip.trial_modal_click_confirm")}</div> <div>{t("vip.trial_modal_click_confirm", { vipType })}</div>
</div> </div>
); );
}, },
}); });
} }
function openStarModal() { function openStarModal(vipType: string) {
if (settingStore.isPlus) {
message.error(t("vip.already_vip"));
return;
}
Modal.destroyAll(); Modal.destroyAll();
const goGithub = () => { const goGithub = () => {
window.open("https://github.com/certd/certd/"); window.open("https://github.com/certd/certd/");
@ -203,7 +207,7 @@ function openStarModal() {
okText: t("vip.star_now"), okText: t("vip.star_now"),
onOk() { onOk() {
goGithub(); goGithub();
openTrialModal(); openTrialModal(vipType);
}, },
width: 600, width: 600,
content: () => { content: () => {
@ -255,7 +259,7 @@ function openUpgrade() {
trial: { trial: {
title: t("vip.click_to_get_7_day_trial"), title: t("vip.click_to_get_7_day_trial"),
click: () => { click: () => {
openStarModal(); openStarModal("plus");
}, },
}, },
icon: "stash:thumb-up", icon: "stash:thumb-up",
@ -281,6 +285,12 @@ function openUpgrade() {
price: productInfo.comm.price, price: productInfo.comm.price,
price3: `¥${productInfo.comm.price3}/3${t("vip.years")}`, price3: `¥${productInfo.comm.price3}/3${t("vip.years")}`,
tooltip: productInfo.comm.tooltip, tooltip: productInfo.comm.tooltip,
trial: {
title: t("vip.click_to_get_7_day_trial"),
click: () => {
openStarModal("comm");
},
},
get() { get() {
return ( return (
<a-button size="small" type="primary" href={goBuyCommUrl} target="_blank"> <a-button size="small" type="primary" href={goBuyCommUrl} target="_blank">

View File

@ -32,13 +32,14 @@ export default {
successContent: "You have successfully activated {vipLabel}, valid until: {expireDate}", successContent: "You have successfully activated {vipLabel}, valid until: {expireDate}",
bindAccountTitle: "Bind Your Account", bindAccountTitle: "Bind Your Account",
bindAccountContent: "Binding your account helps prevent license loss. Strongly recommended.", bindAccountContent: "Binding your account helps prevent license loss. Strongly recommended.",
congratulations_vip_trial: "Congratulations, you have received a Pro version {duration} days trial", congratulations_vip_trial: "Congratulations, you have received a VIP version {duration} days trial",
trial_modal_title: "7-day Pro version trial acquisition", trial_modal_title: "7-day VIP version trial acquisition",
trial_modal_ok_text: "Get now", trial_modal_ok_text: "Get now",
trial_modal_thanks: "Thank you for supporting the open source project", trial_modal_thanks: "Thank you for supporting the open source project",
trial_modal_click_confirm: "Click confirm to get a 7-day Pro version trial", trial_modal_click_confirm: "Click confirm to get a 7-day VIP({vipType}) version trial",
get_7_day_pro_trial: "7-day professional version trial", get_7_day_pro_trial: "7-day VIP version trial",
star_now: "Star Now", star_now: "Star Now",
already_vip: "Already VIP version, can't trial ",
please_help_star: "Could you please help by starring? Thanks a lot!", please_help_star: "Could you please help by starring? Thanks a lot!",
admin_only_operation: "Admin operation only", admin_only_operation: "Admin operation only",
enter_activation_code: "Please enter the activation code", enter_activation_code: "Please enter the activation code",

View File

@ -32,13 +32,14 @@ export default {
successContent: "您已成功激活{vipLabel},有效期至:{expireDate}", successContent: "您已成功激活{vipLabel},有效期至:{expireDate}",
bindAccountTitle: "是否绑定袖手账号", bindAccountTitle: "是否绑定袖手账号",
bindAccountContent: "绑定账号后可以避免License丢失强烈建议绑定", bindAccountContent: "绑定账号后可以避免License丢失强烈建议绑定",
congratulations_vip_trial: "恭喜,您已获得专业版{duration}天试用", congratulations_vip_trial: "恭喜,您已获得VIP{duration}天试用",
trial_modal_title: "7天专业版试用获取", trial_modal_title: "7天VIP试用获取",
trial_modal_ok_text: "立即获取", trial_modal_ok_text: "立即获取",
trial_modal_thanks: "感谢您对开源项目的支持", trial_modal_thanks: "感谢您对开源项目的支持",
trial_modal_click_confirm: "点击确认即可获取7天专业版试用", trial_modal_click_confirm: "点击确认即可获取7天VIP({vipType})试用",
get_7_day_pro_trial: "7天专业版试用获取", get_7_day_pro_trial: "7天VIP试用获取",
star_now: "立即去Star", star_now: "立即去Star",
already_vip: "您已经是VIP了不能试用",
please_help_star: "可以先请您帮忙点个star吗感谢感谢", please_help_star: "可以先请您帮忙点个star吗感谢感谢",
admin_only_operation: "仅限管理员操作", admin_only_operation: "仅限管理员操作",
enter_activation_code: "请输入激活码", enter_activation_code: "请输入激活码",