refactor: switch to free-trial/private-deploy/buyout pricing, fix feature gaps, add SEO landing + deploy config

This commit is contained in:
TradeMate Dev
2026-07-12 08:09:28 +08:00
parent 9ca5d79d8a
commit 04924e3bc4
36 changed files with 1026 additions and 975 deletions
+30 -2
View File
@@ -7,6 +7,7 @@ import {
generateReply,
searchLeads,
generateMarketing,
extractInfo,
getBalance,
getSubscriptionPlans,
getCreditPackages,
@@ -53,6 +54,11 @@ const marketingStyle = $('marketing-style');
const marketingBtn = $('marketing-btn');
const marketingResult = $('marketing-result');
const extractInput = $('extract-input');
const extractType = $('extract-type');
const extractBtn = $('extract-btn');
const extractResult = $('extract-result');
const creditsDisplay = $('credits-display');
const btnSettings = $('btn-settings');
const upgradeBanner = $('upgrade-banner');
@@ -215,7 +221,7 @@ function setupUpgradeUI() {
// Open backend payment page or settings page
// For now, open the workspace credits page
chrome.tabs.create({
url: `${settingsUrl.value?.replace(/\/+$/, '') || 'https://trade.yuzhiran.com'}/workspace/credits`,
url: `${settingsUrl.value?.replace(/\/+$/, '') || 'https://trade.yuzhiran.com'}/workspace/upgrade`,
});
hideUpgradeModal();
});
@@ -225,7 +231,7 @@ function setupUpgradeUI() {
btn.addEventListener('click', () => {
const pkg = btn.dataset.pkg;
chrome.tabs.create({
url: `${settingsUrl.value?.replace(/\/+$/, '') || 'https://trade.yuzhiran.com'}/workspace/credits`,
url: `${settingsUrl.value?.replace(/\/+$/, '') || 'https://trade.yuzhiran.com'}/workspace/upgrade`,
});
hidePackageModal();
});
@@ -465,6 +471,28 @@ function setupActions() {
}
});
});
// Extract customer info
extractBtn.addEventListener('click', async () => {
const text = extractInput.value.trim();
if (!text) return;
setLoading(extractBtn, true);
showResult(extractResult, '<div class="loading"><span class="spinner"></span>提取中...</div>');
try {
const result = await extractInfo(text, extractType.value);
const info = result.extracted || {};
const rows = Object.entries(info)
.filter(([, v]) => v !== null && v !== undefined && v !== '')
.map(([k, v]) => `<div class="item"><div class="item-label">${escapeHtml(k)}</div><div>${escapeHtml(String(Array.isArray(v) ? v.join(', ') : v))}</div></div>`)
.join('');
showResult(extractResult, rows || '(无提取结果)');
refreshCredits();
} catch (err) {
handleApiError(extractResult, err);
} finally {
setLoading(extractBtn, false);
}
});
}
// Auto-init on load