Improve trial upgrade conversion

This commit is contained in:
2569718930@qq.com
2026-06-09 18:17:19 +08:00
parent c98ff34c1e
commit 7b965ac60d
11 changed files with 221 additions and 8 deletions
@@ -7,7 +7,7 @@ const ACCESS_TERM = {
signInToContinue: { en: "Sign in to continue", zh: "请先登录" },
proAccessRequired: { en: "Pro subscription required", zh: "需要开通 Pro" },
month: { en: "/ 30 days", zh: "/ 30 天" },
subscribeNow: { en: "View Pro plans", zh: "查看订阅方案" },
subscribeNow: { en: "Subscribe & Activate", zh: "立即订阅并激活" },
backToProduct: { en: "Back to product overview", zh: "返回产品介绍页" },
} as const;
@@ -77,7 +77,7 @@ function SubscriptionGate({ isEn }: { isEn: boolean }) {
</ul>
<Link
href="/account"
href="/account?checkout=1"
className="flex w-full items-center justify-center gap-2 rounded-xl bg-blue-600 py-3.5 text-sm font-black text-white shadow-sm transition hover:bg-blue-700"
>
<CreditCard size={16} />
@@ -0,0 +1,26 @@
import fs from "node:fs";
import path from "node:path";
function assert(condition: unknown, message: string) {
if (!condition) throw new Error(message);
}
export function runTests() {
const dashboardSource = fs.readFileSync(
path.join(process.cwd(), "components", "dashboard", "ScanTerminalDashboard.tsx"),
"utf8",
);
assert(
dashboardSource.includes("isTrialTerminalAccess") &&
dashboardSource.includes("trialUpgradeLabel") &&
dashboardSource.includes('href="/account?checkout=1"'),
"terminal header must show a non-blocking trial countdown with a direct Pro upgrade entry",
);
assert(
dashboardSource.includes("subscriptionPlanCode") &&
dashboardSource.includes("signup_trial"),
"terminal trial upgrade nudge must be driven by the active trial subscription plan, not a generic subscribed state",
);
}