|
@@ -24,10 +24,16 @@ import {
|
|
|
HelpCircle,
|
|
HelpCircle,
|
|
|
Compass,
|
|
Compass,
|
|
|
} from 'lucide-react';
|
|
} from 'lucide-react';
|
|
|
-import { SchemaItem, ProductTutorialConfig, TutorialStep, ProductCardConfig } from '@/types';
|
|
|
|
|
|
|
+import { SchemaItem, ProductTutorialConfig, TutorialStep, ProductCardConfig, PluginItem } from '@/types';
|
|
|
|
|
+
|
|
|
import { toast } from 'react-hot-toast';
|
|
import { toast } from 'react-hot-toast';
|
|
|
-import { productService } from '@/lib/services';
|
|
|
|
|
|
|
+import { productService, pluginService } from '@/lib/services';
|
|
|
import ProductTutorialBanner from '@/components/common/ProductTutorialBanner';
|
|
import ProductTutorialBanner from '@/components/common/ProductTutorialBanner';
|
|
|
|
|
+import { ImageUploadField } from '@/components/common/ImageUploadField';
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
import ServicePoster from '@/components/services/ServicePoster';
|
|
import ServicePoster from '@/components/services/ServicePoster';
|
|
|
|
|
|
|
|
interface ProductModalProps {
|
|
interface ProductModalProps {
|
|
@@ -38,6 +44,87 @@ interface ProductModalProps {
|
|
|
onManageSchemas: () => void;
|
|
onManageSchemas: () => void;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+const formatCapitalized = (val: string): string => {
|
|
|
|
|
+ if (!val) return '';
|
|
|
|
|
+ return val
|
|
|
|
|
+ .trim()
|
|
|
|
|
+ .split(/\s+/)
|
|
|
|
|
+ .map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())
|
|
|
|
|
+ .join(' ');
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+const PRESET_COUNTRIES = [
|
|
|
|
|
+ 'France',
|
|
|
|
|
+ 'United Kingdom',
|
|
|
|
|
+ 'United States',
|
|
|
|
|
+ 'Germany',
|
|
|
|
|
+ 'Italy',
|
|
|
|
|
+ 'Spain',
|
|
|
|
|
+ 'Switzerland',
|
|
|
|
|
+ 'Netherlands',
|
|
|
|
|
+ 'Ireland',
|
|
|
|
|
+ 'Greece',
|
|
|
|
|
+ 'Portugal',
|
|
|
|
|
+ 'Austria',
|
|
|
|
|
+ 'Belgium',
|
|
|
|
|
+ 'Sweden',
|
|
|
|
|
+ 'Norway',
|
|
|
|
|
+ 'Denmark',
|
|
|
|
|
+ 'Finland',
|
|
|
|
|
+ 'Poland',
|
|
|
|
|
+ 'Czech Republic',
|
|
|
|
|
+ 'Hungary',
|
|
|
|
|
+ 'Iceland',
|
|
|
|
|
+ 'Japan',
|
|
|
|
|
+ 'South Korea',
|
|
|
|
|
+ 'Singapore',
|
|
|
|
|
+ 'Australia',
|
|
|
|
|
+ 'New Zealand',
|
|
|
|
|
+ 'Canada',
|
|
|
|
|
+ 'China',
|
|
|
|
|
+ 'Thailand',
|
|
|
|
|
+ 'Malaysia',
|
|
|
|
|
+ 'United Arab Emirates',
|
|
|
|
|
+];
|
|
|
|
|
+
|
|
|
|
|
+const COUNTRY_CITY_MAP: Record<string, string[]> = {
|
|
|
|
|
+ France: ['Paris', 'Marseille', 'Lyon', 'Nice', 'Bordeaux', 'Toulouse'],
|
|
|
|
|
+ 'United Kingdom': ['London', 'Manchester', 'Edinburgh', 'Belfast', 'Birmingham', 'Cardiff'],
|
|
|
|
|
+ 'United States': ['New York', 'Los Angeles', 'San Francisco', 'Chicago', 'Washington', 'Boston', 'Seattle', 'Atlanta', 'Dallas', 'Houston', 'Miami'],
|
|
|
|
|
+ Germany: ['Berlin', 'Frankfurt', 'Munich', 'Hamburg', 'Cologne', 'Dusseldorf'],
|
|
|
|
|
+ Italy: ['Rome', 'Milan', 'Florence', 'Naples', 'Venice'],
|
|
|
|
|
+ Spain: ['Madrid', 'Barcelona', 'Valencia', 'Seville'],
|
|
|
|
|
+ Switzerland: ['Zurich', 'Geneva', 'Bern', 'Basel'],
|
|
|
|
|
+ Netherlands: ['Amsterdam', 'Rotterdam', 'The Hague', 'Utrecht'],
|
|
|
|
|
+ Ireland: ['Dublin', 'Cork', 'Galway', 'Limerick'],
|
|
|
|
|
+ China: ['Beijing', 'Shanghai', 'Guangzhou', 'Shenzhen', 'Chengdu', 'Wuhan', 'Hangzhou', 'Nanjing', 'Shenyang', 'Jinan', 'Kunming', 'Xi\'an', 'Chongqing', 'Changsha', 'Fuzhou', 'Hong Kong'],
|
|
|
|
|
+ Japan: ['Tokyo', 'Osaka', 'Nagoya', 'Fukuoka', 'Sapporo'],
|
|
|
|
|
+ 'South Korea': ['Seoul', 'Busan', 'Incheon'],
|
|
|
|
|
+ Singapore: ['Singapore'],
|
|
|
|
|
+ Australia: ['Sydney', 'Melbourne', 'Brisbane', 'Perth', 'Adelaide', 'Canberra'],
|
|
|
|
|
+ 'New Zealand': ['Auckland', 'Wellington', 'Christchurch'],
|
|
|
|
|
+ Canada: ['Toronto', 'Vancouver', 'Montreal', 'Ottawa', 'Calgary', 'Edmonton'],
|
|
|
|
|
+ Greece: ['Athens', 'Thessaloniki'],
|
|
|
|
|
+ Portugal: ['Lisbon', 'Porto'],
|
|
|
|
|
+ Austria: ['Vienna', 'Salzburg'],
|
|
|
|
|
+ Belgium: ['Brussels', 'Antwerp'],
|
|
|
|
|
+ Sweden: ['Stockholm', 'Gothenburg'],
|
|
|
|
|
+ Norway: ['Oslo', 'Bergen'],
|
|
|
|
|
+ Denmark: ['Copenhagen', 'Aarhus'],
|
|
|
|
|
+ Finland: ['Helsinki', 'Tampere'],
|
|
|
|
|
+ Poland: ['Warsaw', 'Krakow'],
|
|
|
|
|
+ 'Czech Republic': ['Prague', 'Brno'],
|
|
|
|
|
+ Hungary: ['Budapest'],
|
|
|
|
|
+ Iceland: ['Reykjavik'],
|
|
|
|
|
+ 'United Arab Emirates': ['Dubai', 'Abu Dhabi'],
|
|
|
|
|
+ Thailand: ['Bangkok', 'Chiang Mai', 'Phuket'],
|
|
|
|
|
+ Malaysia: ['Kuala Lumpur', 'Penang'],
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+const PRESET_CITIES = Array.from(
|
|
|
|
|
+ new Set(Object.values(COUNTRY_CITY_MAP).flat())
|
|
|
|
|
+).sort((a, b) => a.localeCompare(b));
|
|
|
|
|
+
|
|
|
const POPULAR_COUNTRIES = [
|
|
const POPULAR_COUNTRIES = [
|
|
|
'France',
|
|
'France',
|
|
|
'Germany',
|
|
'Germany',
|
|
@@ -154,6 +241,8 @@ export default function ProductModal({
|
|
|
const [schemas, setSchemas] = useState<SchemaItem[]>([]);
|
|
const [schemas, setSchemas] = useState<SchemaItem[]>([]);
|
|
|
const [selectedSchemaDetail, setSelectedSchemaDetail] = useState<any | null>(null);
|
|
const [selectedSchemaDetail, setSelectedSchemaDetail] = useState<any | null>(null);
|
|
|
const [loadingSchemaDetail, setLoadingSchemaDetail] = useState(false);
|
|
const [loadingSchemaDetail, setLoadingSchemaDetail] = useState(false);
|
|
|
|
|
+ const [plugins, setPlugins] = useState<PluginItem[]>([]);
|
|
|
|
|
+ const [loadingPlugins, setLoadingPlugins] = useState(false);
|
|
|
|
|
|
|
|
const [form, setForm] = useState({
|
|
const [form, setForm] = useState({
|
|
|
title: '',
|
|
title: '',
|
|
@@ -167,8 +256,28 @@ export default function ProductModal({
|
|
|
recommend_score: 0,
|
|
recommend_score: 0,
|
|
|
enabled: 1,
|
|
enabled: 1,
|
|
|
schema_id: 0,
|
|
schema_id: 0,
|
|
|
|
|
+ plugin_id: 0,
|
|
|
|
|
+ plugin_name: '',
|
|
|
|
|
+ developer_id: '',
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
+ const [isCustomCountry, setIsCustomCountry] = useState(false);
|
|
|
|
|
+ const [isCustomCity, setIsCustomCity] = useState(false);
|
|
|
|
|
+ const [isCustomVisaType, setIsCustomVisaType] = useState(false);
|
|
|
|
|
+
|
|
|
|
|
+ const currentSuggestedCities = useMemo(() => {
|
|
|
|
|
+ if (!form.country) return [];
|
|
|
|
|
+ const matchedKey = Object.keys(COUNTRY_CITY_MAP).find(
|
|
|
|
|
+ (k) => k.toLowerCase() === form.country.toLowerCase()
|
|
|
|
|
+ );
|
|
|
|
|
+ return matchedKey ? COUNTRY_CITY_MAP[matchedKey] : [];
|
|
|
|
|
+ }, [form.country]);
|
|
|
|
|
+
|
|
|
|
|
+ const otherCities = useMemo(() => {
|
|
|
|
|
+ const suggestedSet = new Set(currentSuggestedCities.map((c) => c.toLowerCase()));
|
|
|
|
|
+ return PRESET_CITIES.filter((c) => !suggestedSet.has(c.toLowerCase()));
|
|
|
|
|
+ }, [currentSuggestedCities]);
|
|
|
|
|
+
|
|
|
// 使用教程配置状态
|
|
// 使用教程配置状态
|
|
|
const [tutorialConfig, setTutorialConfig] = useState<ProductTutorialConfig>({
|
|
const [tutorialConfig, setTutorialConfig] = useState<ProductTutorialConfig>({
|
|
|
enabled: false,
|
|
enabled: false,
|
|
@@ -202,9 +311,51 @@ export default function ProductModal({
|
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
|
if (isOpen) {
|
|
if (isOpen) {
|
|
|
fetchSchemas();
|
|
fetchSchemas();
|
|
|
|
|
+ fetchPlugins();
|
|
|
}
|
|
}
|
|
|
}, [isOpen]);
|
|
}, [isOpen]);
|
|
|
|
|
|
|
|
|
|
+ const fetchPlugins = async () => {
|
|
|
|
|
+ setLoadingPlugins(true);
|
|
|
|
|
+ try {
|
|
|
|
|
+ const res = await pluginService.getList({ page: 1, page_size: 100 });
|
|
|
|
|
+ const rawList =
|
|
|
|
|
+ res?.data?.list ??
|
|
|
|
|
+ res?.data?.items ??
|
|
|
|
|
+ (Array.isArray(res?.data) ? res.data : (Array.isArray(res) ? res : []));
|
|
|
|
|
+ const items: PluginItem[] = Array.isArray(rawList) ? rawList : [];
|
|
|
|
|
+ setPlugins(items);
|
|
|
|
|
+
|
|
|
|
|
+ // 如果当前表单已有 plugin_id 或 plugin_name,自动补齐对应的插件与开发者ID
|
|
|
|
|
+ setForm((prev) => {
|
|
|
|
|
+ if (!prev.plugin_id && prev.plugin_name) {
|
|
|
|
|
+ const matched = items.find((p) => p.name === prev.plugin_name);
|
|
|
|
|
+ if (matched) {
|
|
|
|
|
+ return {
|
|
|
|
|
+ ...prev,
|
|
|
|
|
+ plugin_id: matched.id,
|
|
|
|
|
+ developer_id: prev.developer_id || matched.developer_id || '',
|
|
|
|
|
+ };
|
|
|
|
|
+ }
|
|
|
|
|
+ } else if (prev.plugin_id && !prev.developer_id) {
|
|
|
|
|
+ const matched = items.find((p) => p.id === prev.plugin_id);
|
|
|
|
|
+ if (matched?.developer_id) {
|
|
|
|
|
+ return {
|
|
|
|
|
+ ...prev,
|
|
|
|
|
+ developer_id: matched.developer_id,
|
|
|
|
|
+ };
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ return prev;
|
|
|
|
|
+ });
|
|
|
|
|
+ } catch (e) {
|
|
|
|
|
+ console.error('Failed to load plugins in ProductModal:', e);
|
|
|
|
|
+ setPlugins([]);
|
|
|
|
|
+ } finally {
|
|
|
|
|
+ setLoadingPlugins(false);
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
const fetchSchemas = async () => {
|
|
const fetchSchemas = async () => {
|
|
|
try {
|
|
try {
|
|
|
const res = await productService.listSchemas();
|
|
const res = await productService.listSchemas();
|
|
@@ -230,8 +381,26 @@ export default function ProductModal({
|
|
|
recommend_score: product.recommend_score || 0,
|
|
recommend_score: product.recommend_score || 0,
|
|
|
enabled: product.enabled !== undefined ? Number(product.enabled) : 1,
|
|
enabled: product.enabled !== undefined ? Number(product.enabled) : 1,
|
|
|
schema_id: product.schema_id || 0,
|
|
schema_id: product.schema_id || 0,
|
|
|
|
|
+ plugin_id: product.plugin_id || 0,
|
|
|
|
|
+ plugin_name: product.plugin_name || '',
|
|
|
|
|
+ developer_id: product.developer_id || '',
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
+ const isStandardCountry = PRESET_COUNTRIES.some(
|
|
|
|
|
+ (c) => c.toLowerCase() === (product.country || '').toLowerCase()
|
|
|
|
|
+ );
|
|
|
|
|
+ setIsCustomCountry(Boolean(product.country) && !isStandardCountry);
|
|
|
|
|
+
|
|
|
|
|
+ const isStandardCity = PRESET_CITIES.some(
|
|
|
|
|
+ (c) => c.toLowerCase() === (product.city || '').toLowerCase()
|
|
|
|
|
+ );
|
|
|
|
|
+ setIsCustomCity(Boolean(product.city) && !isStandardCity);
|
|
|
|
|
+
|
|
|
|
|
+ setIsCustomVisaType(
|
|
|
|
|
+ Boolean(product.visa_type) &&
|
|
|
|
|
+ !VISA_OPTIONS.some((o) => o.value.toLowerCase() === (product.visa_type || '').toLowerCase())
|
|
|
|
|
+ );
|
|
|
|
|
+
|
|
|
if (product.extra_fields?.tutorial) {
|
|
if (product.extra_fields?.tutorial) {
|
|
|
const t = product.extra_fields.tutorial;
|
|
const t = product.extra_fields.tutorial;
|
|
|
setTutorialConfig({
|
|
setTutorialConfig({
|
|
@@ -270,12 +439,13 @@ export default function ProductModal({
|
|
|
poster_sub: c.poster_sub || '',
|
|
poster_sub: c.poster_sub || '',
|
|
|
poster_tag: c.poster_tag || '',
|
|
poster_tag: c.poster_tag || '',
|
|
|
poster_accent_color: c.poster_accent_color || '#2563eb',
|
|
poster_accent_color: c.poster_accent_color || '#2563eb',
|
|
|
- official_tag: c.official_tag !== undefined ? c.official_tag : '官方直连',
|
|
|
|
|
- status_tag: c.status_tag !== undefined ? c.status_tag : 'New',
|
|
|
|
|
|
|
+ official_tag: c.official_tag || '',
|
|
|
|
|
+ status_tag: c.status_tag || '',
|
|
|
pill_text: c.pill_text || '',
|
|
pill_text: c.pill_text || '',
|
|
|
sales_text: c.sales_text || '',
|
|
sales_text: c.sales_text || '',
|
|
|
- buy_button_text: c.buy_button_text || '立即购买',
|
|
|
|
|
- sublink_text: c.sublink_text || '查阅服务细则 →',
|
|
|
|
|
|
|
+ status_text: c.status_text || '',
|
|
|
|
|
+ buy_button_text: c.buy_button_text || '',
|
|
|
|
|
+ sublink_text: c.sublink_text || '',
|
|
|
});
|
|
});
|
|
|
} else {
|
|
} else {
|
|
|
setCardConfig({
|
|
setCardConfig({
|
|
@@ -285,12 +455,13 @@ export default function ProductModal({
|
|
|
poster_sub: '',
|
|
poster_sub: '',
|
|
|
poster_tag: '',
|
|
poster_tag: '',
|
|
|
poster_accent_color: '#2563eb',
|
|
poster_accent_color: '#2563eb',
|
|
|
- official_tag: '官方直连',
|
|
|
|
|
- status_tag: 'New',
|
|
|
|
|
|
|
+ official_tag: '',
|
|
|
|
|
+ status_tag: '',
|
|
|
pill_text: '',
|
|
pill_text: '',
|
|
|
sales_text: '',
|
|
sales_text: '',
|
|
|
- buy_button_text: '立即购买',
|
|
|
|
|
- sublink_text: '查阅服务细则 →',
|
|
|
|
|
|
|
+ status_text: '',
|
|
|
|
|
+ buy_button_text: '',
|
|
|
|
|
+ sublink_text: '',
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -312,7 +483,13 @@ export default function ProductModal({
|
|
|
recommend_score: 10,
|
|
recommend_score: 10,
|
|
|
enabled: 1,
|
|
enabled: 1,
|
|
|
schema_id: 0,
|
|
schema_id: 0,
|
|
|
|
|
+ plugin_id: 0,
|
|
|
|
|
+ plugin_name: '',
|
|
|
|
|
+ developer_id: '',
|
|
|
});
|
|
});
|
|
|
|
|
+ setIsCustomCountry(false);
|
|
|
|
|
+ setIsCustomCity(false);
|
|
|
|
|
+ setIsCustomVisaType(false);
|
|
|
setTutorialConfig({
|
|
setTutorialConfig({
|
|
|
enabled: false,
|
|
enabled: false,
|
|
|
display_type: 'both',
|
|
display_type: 'both',
|
|
@@ -365,6 +542,26 @@ export default function ProductModal({
|
|
|
fetchSchemaDetail(newSchemaId);
|
|
fetchSchemaDetail(newSchemaId);
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+ const handlePluginChange = (pluginIdNum: number) => {
|
|
|
|
|
+ if (!pluginIdNum) {
|
|
|
|
|
+ setForm((prev) => ({
|
|
|
|
|
+ ...prev,
|
|
|
|
|
+ plugin_id: 0,
|
|
|
|
|
+ plugin_name: '',
|
|
|
|
|
+ }));
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ const found = plugins.find((p) => p.id === pluginIdNum);
|
|
|
|
|
+ if (found) {
|
|
|
|
|
+ setForm((prev) => ({
|
|
|
|
|
+ ...prev,
|
|
|
|
|
+ plugin_id: found.id,
|
|
|
|
|
+ plugin_name: found.name,
|
|
|
|
|
+ developer_id: found.developer_id || '',
|
|
|
|
|
+ }));
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
const handleAddStep = () => {
|
|
const handleAddStep = () => {
|
|
|
setTutorialConfig((prev) => ({
|
|
setTutorialConfig((prev) => ({
|
|
|
...prev,
|
|
...prev,
|
|
@@ -414,10 +611,16 @@ export default function ProductModal({
|
|
|
try {
|
|
try {
|
|
|
const payload: any = {
|
|
const payload: any = {
|
|
|
...form,
|
|
...form,
|
|
|
|
|
+ country: formatCapitalized(form.country),
|
|
|
|
|
+ city: formatCapitalized(form.city),
|
|
|
|
|
+ visa_type: formatCapitalized(form.visa_type),
|
|
|
price_amount: Math.round(Number(form.price_amount) * 100),
|
|
price_amount: Math.round(Number(form.price_amount) * 100),
|
|
|
recommend_score: Number(form.recommend_score) || 0,
|
|
recommend_score: Number(form.recommend_score) || 0,
|
|
|
enabled: Number(form.enabled),
|
|
enabled: Number(form.enabled),
|
|
|
schema_id: form.schema_id > 0 ? Number(form.schema_id) : null,
|
|
schema_id: form.schema_id > 0 ? Number(form.schema_id) : null,
|
|
|
|
|
+ plugin_id: form.plugin_id > 0 ? Number(form.plugin_id) : null,
|
|
|
|
|
+ plugin_name: form.plugin_name.trim() || null,
|
|
|
|
|
+ developer_id: form.developer_id.trim() || null,
|
|
|
extra_fields: {
|
|
extra_fields: {
|
|
|
...(product?.extra_fields || {}),
|
|
...(product?.extra_fields || {}),
|
|
|
tutorial: tutorialConfig.enabled ? tutorialConfig : null,
|
|
tutorial: tutorialConfig.enabled ? tutorialConfig : null,
|
|
@@ -547,60 +750,179 @@ export default function ProductModal({
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
- <div className="grid grid-cols-1 sm:grid-cols-2 gap-3">
|
|
|
|
|
|
|
+ <div className="grid grid-cols-1 sm:grid-cols-3 gap-3">
|
|
|
|
|
+ {/* 1. 国家 / 地区 */}
|
|
|
<div className="space-y-1">
|
|
<div className="space-y-1">
|
|
|
- <label className="font-bold text-black uppercase block">
|
|
|
|
|
- 国家 / 地区 <span className="text-black">*</span>
|
|
|
|
|
- </label>
|
|
|
|
|
- <input
|
|
|
|
|
- type="text"
|
|
|
|
|
- required
|
|
|
|
|
- placeholder="如: France"
|
|
|
|
|
- className="w-full border-2 border-black bg-white px-3 py-2 text-xs font-sans text-black focus:bg-amber-50 outline-none shadow-[2px_2px_0px_#000]"
|
|
|
|
|
- value={form.country}
|
|
|
|
|
- onChange={(e) => setForm({ ...form, country: e.target.value })}
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ <div className="flex items-center justify-between">
|
|
|
|
|
+ <label className="font-bold text-black uppercase block">
|
|
|
|
|
+ 国家 / 地区 <span className="text-black">*</span>
|
|
|
|
|
+ </label>
|
|
|
|
|
+ <button
|
|
|
|
|
+ type="button"
|
|
|
|
|
+ onClick={() => setIsCustomCountry(!isCustomCountry)}
|
|
|
|
|
+ className="text-[10px] text-neutral-500 hover:text-black underline cursor-pointer"
|
|
|
|
|
+ >
|
|
|
|
|
+ {isCustomCountry ? '选择预设' : '手工输入'}
|
|
|
|
|
+ </button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ {isCustomCountry ? (
|
|
|
|
|
+ <input
|
|
|
|
|
+ type="text"
|
|
|
|
|
+ required
|
|
|
|
|
+ placeholder="如: France"
|
|
|
|
|
+ className="w-full border-2 border-black bg-white px-3 py-2 text-xs font-sans text-black focus:bg-amber-50 outline-none shadow-[2px_2px_0px_#000]"
|
|
|
|
|
+ value={form.country}
|
|
|
|
|
+ onChange={(e) => setForm({ ...form, country: e.target.value })}
|
|
|
|
|
+ onBlur={(e) => setForm({ ...form, country: formatCapitalized(e.target.value) })}
|
|
|
|
|
+ />
|
|
|
|
|
+ ) : (
|
|
|
|
|
+ <select
|
|
|
|
|
+ required
|
|
|
|
|
+ className="w-full border-2 border-black bg-white px-3 py-2 text-xs font-bold text-black focus:bg-amber-50 outline-none shadow-[2px_2px_0px_#000] cursor-pointer"
|
|
|
|
|
+ value={form.country}
|
|
|
|
|
+ onChange={(e) => {
|
|
|
|
|
+ if (e.target.value === '__custom__') {
|
|
|
|
|
+ setIsCustomCountry(true);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ const newCountry = e.target.value;
|
|
|
|
|
+ const recommendedCities = COUNTRY_CITY_MAP[newCountry] || [];
|
|
|
|
|
+ setForm((prev) => ({
|
|
|
|
|
+ ...prev,
|
|
|
|
|
+ country: newCountry,
|
|
|
|
|
+ city:
|
|
|
|
|
+ recommendedCities.length > 0 && !recommendedCities.includes(prev.city)
|
|
|
|
|
+ ? recommendedCities[0]
|
|
|
|
|
+ : prev.city,
|
|
|
|
|
+ }));
|
|
|
|
|
+ }
|
|
|
|
|
+ }}
|
|
|
|
|
+ >
|
|
|
|
|
+ <option value="" disabled>-- 请选择国家/地区 --</option>
|
|
|
|
|
+ {PRESET_COUNTRIES.map((ctry) => (
|
|
|
|
|
+ <option key={ctry} value={ctry}>
|
|
|
|
|
+ {ctry}
|
|
|
|
|
+ </option>
|
|
|
|
|
+ ))}
|
|
|
|
|
+ {!PRESET_COUNTRIES.some((c) => c.toLowerCase() === (form.country || '').toLowerCase()) && form.country && (
|
|
|
|
|
+ <option value={form.country}>
|
|
|
|
|
+ {form.country} (当前配置)
|
|
|
|
|
+ </option>
|
|
|
|
|
+ )}
|
|
|
|
|
+ <option value="__custom__">⚙️ 其他国家 (手工录入)...</option>
|
|
|
|
|
+ </select>
|
|
|
|
|
+ )}
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+
|
|
|
|
|
+ {/* 2. 城市 / 签证中心 */}
|
|
|
<div className="space-y-1">
|
|
<div className="space-y-1">
|
|
|
- <label className="font-bold text-black uppercase block">
|
|
|
|
|
- 城市 / 签证中心
|
|
|
|
|
- </label>
|
|
|
|
|
- <input
|
|
|
|
|
- type="text"
|
|
|
|
|
- placeholder="如: Paris / London / Shanghai"
|
|
|
|
|
- className="w-full border-2 border-black bg-white px-3 py-2 text-xs font-sans text-black focus:bg-amber-50 outline-none shadow-[2px_2px_0px_#000]"
|
|
|
|
|
- value={form.city}
|
|
|
|
|
- onChange={(e) => setForm({ ...form, city: e.target.value })}
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ <div className="flex items-center justify-between">
|
|
|
|
|
+ <label className="font-bold text-black uppercase block">
|
|
|
|
|
+ 城市 / 签证中心 <span className="text-black">*</span>
|
|
|
|
|
+ </label>
|
|
|
|
|
+ <button
|
|
|
|
|
+ type="button"
|
|
|
|
|
+ onClick={() => setIsCustomCity(!isCustomCity)}
|
|
|
|
|
+ className="text-[10px] text-neutral-500 hover:text-black underline cursor-pointer"
|
|
|
|
|
+ >
|
|
|
|
|
+ {isCustomCity ? '选择预设' : '手工输入'}
|
|
|
|
|
+ </button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ {isCustomCity ? (
|
|
|
|
|
+ <input
|
|
|
|
|
+ type="text"
|
|
|
|
|
+ placeholder="如: Paris / London / Shanghai"
|
|
|
|
|
+ className="w-full border-2 border-black bg-white px-3 py-2 text-xs font-sans text-black focus:bg-amber-50 outline-none shadow-[2px_2px_0px_#000]"
|
|
|
|
|
+ value={form.city}
|
|
|
|
|
+ onChange={(e) => setForm({ ...form, city: e.target.value })}
|
|
|
|
|
+ onBlur={(e) => setForm({ ...form, city: formatCapitalized(e.target.value) })}
|
|
|
|
|
+ />
|
|
|
|
|
+ ) : (
|
|
|
|
|
+ <select
|
|
|
|
|
+ className="w-full border-2 border-black bg-white px-3 py-2 text-xs font-bold text-black focus:bg-amber-50 outline-none shadow-[2px_2px_0px_#000] cursor-pointer"
|
|
|
|
|
+ value={form.city}
|
|
|
|
|
+ onChange={(e) => {
|
|
|
|
|
+ if (e.target.value === '__custom__') {
|
|
|
|
|
+ setIsCustomCity(true);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ setForm({ ...form, city: e.target.value });
|
|
|
|
|
+ }
|
|
|
|
|
+ }}
|
|
|
|
|
+ >
|
|
|
|
|
+ <option value="">-- 请选择城市/签证中心 --</option>
|
|
|
|
|
+ {currentSuggestedCities.length > 0 && (
|
|
|
|
|
+ <optgroup label={`建议中心 (${form.country})`}>
|
|
|
|
|
+ {currentSuggestedCities.map((city) => (
|
|
|
|
|
+ <option key={city} value={city}>
|
|
|
|
|
+ {city}
|
|
|
|
|
+ </option>
|
|
|
|
|
+ ))}
|
|
|
|
|
+ </optgroup>
|
|
|
|
|
+ )}
|
|
|
|
|
+ <optgroup label="全部常用城市">
|
|
|
|
|
+ {otherCities.map((city) => (
|
|
|
|
|
+ <option key={city} value={city}>
|
|
|
|
|
+ {city}
|
|
|
|
|
+ </option>
|
|
|
|
|
+ ))}
|
|
|
|
|
+ </optgroup>
|
|
|
|
|
+ {!PRESET_CITIES.some((c) => c.toLowerCase() === (form.city || '').toLowerCase()) && form.city && (
|
|
|
|
|
+ <option value={form.city}>
|
|
|
|
|
+ {form.city} (当前配置)
|
|
|
|
|
+ </option>
|
|
|
|
|
+ )}
|
|
|
|
|
+ <option value="__custom__">⚙️ 其他城市 (手工录入)...</option>
|
|
|
|
|
+ </select>
|
|
|
|
|
+ )}
|
|
|
</div>
|
|
</div>
|
|
|
- </div>
|
|
|
|
|
|
|
|
|
|
- {/* 签证类型选择器 */}
|
|
|
|
|
- <div className="space-y-1.5">
|
|
|
|
|
- <label className="font-bold text-black uppercase block">
|
|
|
|
|
- 签证业务类型
|
|
|
|
|
- </label>
|
|
|
|
|
- <div className="grid grid-cols-2 sm:grid-cols-4 gap-2">
|
|
|
|
|
- {VISA_OPTIONS.map((opt) => {
|
|
|
|
|
- const isSelected = form.visa_type === opt.value;
|
|
|
|
|
- return (
|
|
|
|
|
- <div
|
|
|
|
|
- key={opt.value}
|
|
|
|
|
- onClick={() => setForm({ ...form, visa_type: opt.value })}
|
|
|
|
|
- className={`p-2 border-2 border-black cursor-pointer text-left transition ${
|
|
|
|
|
- isSelected
|
|
|
|
|
- ? 'bg-amber-300 shadow-[2px_2px_0px_#000]'
|
|
|
|
|
- : 'bg-white hover:bg-neutral-100 shadow-[1px_1px_0px_#000]'
|
|
|
|
|
- }`}
|
|
|
|
|
- >
|
|
|
|
|
- <div className="text-xs font-black text-black flex items-center justify-between">
|
|
|
|
|
- <span>{opt.label}</span>
|
|
|
|
|
- {isSelected && <Check size={12} />}
|
|
|
|
|
- </div>
|
|
|
|
|
- <div className="text-[10px] text-neutral-500 font-sans mt-0.5">{opt.desc}</div>
|
|
|
|
|
- </div>
|
|
|
|
|
- );
|
|
|
|
|
- })}
|
|
|
|
|
|
|
+ {/* 3. 签证业务类型 */}
|
|
|
|
|
+ <div className="space-y-1">
|
|
|
|
|
+ <div className="flex items-center justify-between">
|
|
|
|
|
+ <label className="font-bold text-black uppercase block">
|
|
|
|
|
+ 签证业务类型 <span className="text-black">*</span>
|
|
|
|
|
+ </label>
|
|
|
|
|
+ <button
|
|
|
|
|
+ type="button"
|
|
|
|
|
+ onClick={() => setIsCustomVisaType(!isCustomVisaType)}
|
|
|
|
|
+ className="text-[10px] text-neutral-500 hover:text-black underline cursor-pointer"
|
|
|
|
|
+ >
|
|
|
|
|
+ {isCustomVisaType ? '选择预设选项' : '自定义输入'}
|
|
|
|
|
+ </button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ {isCustomVisaType ? (
|
|
|
|
|
+ <input
|
|
|
|
|
+ type="text"
|
|
|
|
|
+ placeholder="如: Tourist / Business"
|
|
|
|
|
+ className="w-full border-2 border-black bg-white px-3 py-2 text-xs font-sans text-black focus:bg-amber-50 outline-none shadow-[2px_2px_0px_#000]"
|
|
|
|
|
+ value={form.visa_type}
|
|
|
|
|
+ onChange={(e) => setForm({ ...form, visa_type: e.target.value })}
|
|
|
|
|
+ onBlur={(e) => setForm({ ...form, visa_type: formatCapitalized(e.target.value) })}
|
|
|
|
|
+ />
|
|
|
|
|
+ ) : (
|
|
|
|
|
+ <select
|
|
|
|
|
+ className="w-full border-2 border-black bg-white px-3 py-2 text-xs font-bold text-black focus:bg-amber-50 outline-none shadow-[2px_2px_0px_#000] cursor-pointer"
|
|
|
|
|
+ value={form.visa_type}
|
|
|
|
|
+ onChange={(e) => {
|
|
|
|
|
+ if (e.target.value === '__custom__') {
|
|
|
|
|
+ setIsCustomVisaType(true);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ setForm({ ...form, visa_type: e.target.value });
|
|
|
|
|
+ }
|
|
|
|
|
+ }}
|
|
|
|
|
+ >
|
|
|
|
|
+ {VISA_OPTIONS.map((opt) => (
|
|
|
|
|
+ <option key={opt.value} value={opt.value}>
|
|
|
|
|
+ {opt.label} ({opt.value} - {opt.desc})
|
|
|
|
|
+ </option>
|
|
|
|
|
+ ))}
|
|
|
|
|
+ {!VISA_OPTIONS.some((o) => o.value === form.visa_type) && form.visa_type && (
|
|
|
|
|
+ <option value={form.visa_type}>
|
|
|
|
|
+ {form.visa_type} (当前配置)
|
|
|
|
|
+ </option>
|
|
|
|
|
+ )}
|
|
|
|
|
+ <option value="__custom__">⚙️ 其他类型 (手工录入)...</option>
|
|
|
|
|
+ </select>
|
|
|
|
|
+ )}
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -777,13 +1099,123 @@ export default function ProductModal({
|
|
|
)}
|
|
)}
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
- {/* 5. 用户使用教程与操作指引配置 (新特性) */}
|
|
|
|
|
|
|
+ {/* 5. 履约插件与技术分成归属 */}
|
|
|
|
|
+ <div className="bg-emerald-50/60 border-2 border-black p-4 shadow-[2px_2px_0px_#000] space-y-3">
|
|
|
|
|
+ <div className="flex items-center justify-between border-b-2 border-black pb-1">
|
|
|
|
|
+ <div className="flex items-center gap-1.5">
|
|
|
|
|
+ <Cpu size={14} className="text-black" />
|
|
|
|
|
+ <span className="text-[10px] font-black uppercase text-black">
|
|
|
|
|
+ [ 05 // 履约插件与技术分成归属 (20% 技术版权) ]
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <span className="text-[10px] font-bold text-neutral-600 bg-white border border-black px-1.5 py-0.2">
|
|
|
|
|
+ 自动核算入账至自然人
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <div className="grid grid-cols-1 sm:grid-cols-2 gap-3">
|
|
|
|
|
+ {/* 绑定执行插件 */}
|
|
|
|
|
+ <div className="space-y-1.5">
|
|
|
|
|
+ <label className="font-bold text-black uppercase block text-xs">
|
|
|
|
|
+ 绑定底层执行插件
|
|
|
|
|
+ </label>
|
|
|
|
|
+ <select
|
|
|
|
|
+ className="w-full border-2 border-black bg-white px-2 py-2 text-xs font-bold text-black outline-none shadow-[2px_2px_0px_#000] focus:bg-amber-50 disabled:bg-neutral-100"
|
|
|
|
|
+ value={form.plugin_id || 0}
|
|
|
|
|
+ onChange={(e) => handlePluginChange(Number(e.target.value))}
|
|
|
|
|
+ disabled={loadingPlugins}
|
|
|
|
|
+ >
|
|
|
|
|
+ {loadingPlugins ? (
|
|
|
|
|
+ <option value={0}>⏳ 正在加载插件列表...</option>
|
|
|
|
|
+ ) : (
|
|
|
|
|
+ <>
|
|
|
|
|
+ <option value={0}>-- 暂不绑定自动化插件 (未指定) --</option>
|
|
|
|
|
+ {plugins.map((pl) => (
|
|
|
|
|
+ <option key={pl.id} value={pl.id}>
|
|
|
|
|
+ {pl.name} ({pl.display_name || '未命名'}{pl.developer_id ? ` · 维护者: ${pl.developer_id}` : ''})
|
|
|
|
|
+ </option>
|
|
|
|
|
+ ))}
|
|
|
|
|
+ </>
|
|
|
|
|
+ )}
|
|
|
|
|
+ </select>
|
|
|
|
|
+ <p className="text-[10px] text-neutral-500 font-sans">
|
|
|
|
|
+ 选择负责处理该服务的自动化抢号或抓取插件,将按其维护者自动计提分成。
|
|
|
|
|
+ </p>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ {/* 技术分成归属人 */}
|
|
|
|
|
+ <div className="space-y-1.5">
|
|
|
|
|
+ <div className="flex items-center justify-between">
|
|
|
|
|
+ <label className="font-bold text-black uppercase block text-xs">
|
|
|
|
|
+ 技术分成归属人 (USER ID)
|
|
|
|
|
+ </label>
|
|
|
|
|
+ {form.plugin_id > 0 && (
|
|
|
|
|
+ <button
|
|
|
|
|
+ type="button"
|
|
|
|
|
+ onClick={() => {
|
|
|
|
|
+ const pl = plugins.find((p) => p.id === form.plugin_id);
|
|
|
|
|
+ if (pl?.developer_id) {
|
|
|
|
|
+ setForm((prev) => ({ ...prev, developer_id: pl.developer_id || '' }));
|
|
|
|
|
+ toast.success(`已重置为插件默认开发者: ${pl.developer_id}`);
|
|
|
|
|
+ }
|
|
|
|
|
+ }}
|
|
|
|
|
+ className="text-[10px] text-blue-700 hover:underline font-mono"
|
|
|
|
|
+ >
|
|
|
|
|
+ [ 重置为插件默认 ]
|
|
|
|
|
+ </button>
|
|
|
|
|
+ )}
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <input
|
|
|
|
|
+ type="text"
|
|
|
|
|
+ placeholder="输入用户ID,如 usr-c1f46c54"
|
|
|
|
|
+ className="w-full border-2 border-black bg-white px-3 py-2 text-xs font-mono text-black focus:bg-amber-50 outline-none shadow-[2px_2px_0px_#000]"
|
|
|
|
|
+ value={form.developer_id}
|
|
|
|
|
+ onChange={(e) => setForm({ ...form, developer_id: e.target.value })}
|
|
|
|
|
+ />
|
|
|
|
|
+ <p className="text-[10px] text-neutral-500 font-sans">
|
|
|
|
|
+ 默认继承所选插件的开发管理者,支持特殊情况下手动输入其它自然人用户ID覆盖。
|
|
|
|
|
+ </p>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ {/* 插件关联与分润预览卡片 */}
|
|
|
|
|
+ {form.plugin_id > 0 && (() => {
|
|
|
|
|
+ const currentPl = plugins.find((p) => p.id === form.plugin_id);
|
|
|
|
|
+ return (
|
|
|
|
|
+ <div className="p-2.5 bg-white border border-black shadow-[1px_1px_0px_#000] text-xs font-mono space-y-1.5">
|
|
|
|
|
+ <div className="flex flex-wrap items-center justify-between gap-1">
|
|
|
|
|
+ <div className="flex items-center gap-1.5">
|
|
|
|
|
+ <span className="font-bold text-emerald-800">
|
|
|
|
|
+ 🔌 已关联插件: {currentPl?.name}
|
|
|
|
|
+ </span>
|
|
|
|
|
+ <span className="text-[10px] bg-neutral-100 border border-neutral-300 px-1 py-0.5">
|
|
|
|
|
+ {currentPl?.display_name}
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <span className="text-[10px] font-bold text-purple-700 bg-purple-50 border border-purple-200 px-1.5 py-0.5">
|
|
|
|
|
+ 分成比例: 20% 净利润技术版权
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div className="text-[11px] text-neutral-600 flex items-center gap-2">
|
|
|
|
|
+ <span>插件默认维护者: <strong className="text-black">{currentPl?.developer_id || '未配置'}</strong></span>
|
|
|
|
|
+ {form.developer_id && form.developer_id !== currentPl?.developer_id && (
|
|
|
|
|
+ <span className="text-amber-700 font-bold">
|
|
|
|
|
+ (已特殊覆盖为: {form.developer_id})
|
|
|
|
|
+ </span>
|
|
|
|
|
+ )}
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ );
|
|
|
|
|
+ })()}
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ {/* 6. 用户使用教程与操作指引配置 (新特性) */}
|
|
|
<div className="bg-sky-50 border-2 border-black p-4 shadow-[2px_2px_0px_#000] space-y-3.5">
|
|
<div className="bg-sky-50 border-2 border-black p-4 shadow-[2px_2px_0px_#000] space-y-3.5">
|
|
|
<div className="flex flex-wrap items-center justify-between gap-2 border-b-2 border-black pb-2">
|
|
<div className="flex flex-wrap items-center justify-between gap-2 border-b-2 border-black pb-2">
|
|
|
<div className="flex items-center gap-2">
|
|
<div className="flex items-center gap-2">
|
|
|
<BookOpen size={16} className="text-black" />
|
|
<BookOpen size={16} className="text-black" />
|
|
|
<span className="font-black text-black text-xs uppercase">
|
|
<span className="font-black text-black text-xs uppercase">
|
|
|
- [ 05 // 用户使用教程与操作指引配置 (可选) ]
|
|
|
|
|
|
|
+ [ 06 // 用户使用教程与操作指引配置 (可选) ]
|
|
|
</span>
|
|
</span>
|
|
|
</div>
|
|
</div>
|
|
|
<label className="flex items-center gap-2 cursor-pointer font-bold text-xs select-none">
|
|
<label className="flex items-center gap-2 cursor-pointer font-bold text-xs select-none">
|
|
@@ -830,22 +1262,22 @@ export default function ProductModal({
|
|
|
{
|
|
{
|
|
|
type: 'both',
|
|
type: 'both',
|
|
|
label: '⚡️ 弹窗 + 外部超链接 (推荐)',
|
|
label: '⚡️ 弹窗 + 外部超链接 (推荐)',
|
|
|
- desc: '既可弹窗看步骤,又可点外链跳文档',
|
|
|
|
|
|
|
+ desc: '既可弹窗查阅步骤,又可直接点击跳转外部官方文档',
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
type: 'modal',
|
|
type: 'modal',
|
|
|
- label: '💬 弹出对话框类型 (Modal)',
|
|
|
|
|
- desc: '点击按钮弹出详细操作步骤对话框',
|
|
|
|
|
|
|
+ label: '💬 弹出对话框模式 (Modal)',
|
|
|
|
|
+ desc: '前台点击按钮弹出居中详细操作步骤与说明对话框',
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
type: 'link',
|
|
type: 'link',
|
|
|
- label: '🔗 外部超链接类型 (Link)',
|
|
|
|
|
- desc: '直接在新标签页跳转飞书/语雀/Wiki',
|
|
|
|
|
|
|
+ label: '🔗 外部超链接模式 (Link)',
|
|
|
|
|
+ desc: '前台按钮直接在新标签页打开外部文档,不弹窗',
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
type: 'embedded',
|
|
type: 'embedded',
|
|
|
label: '📑 页面内嵌展开卡片 (Embedded)',
|
|
label: '📑 页面内嵌展开卡片 (Embedded)',
|
|
|
- desc: '直接在下单页面上方以卡片形式展开',
|
|
|
|
|
|
|
+ desc: '前台商品卡片与下单页直接内嵌展开步骤与FAQ,不弹窗',
|
|
|
},
|
|
},
|
|
|
].map((item) => {
|
|
].map((item) => {
|
|
|
const isSelected = tutorialConfig.display_type === item.type;
|
|
const isSelected = tutorialConfig.display_type === item.type;
|
|
@@ -892,7 +1324,7 @@ export default function ProductModal({
|
|
|
</div>
|
|
</div>
|
|
|
<div className="space-y-1">
|
|
<div className="space-y-1">
|
|
|
<label className="font-bold text-black uppercase block">
|
|
<label className="font-bold text-black uppercase block">
|
|
|
- 教程弹窗大标题
|
|
|
|
|
|
|
+ 教程大标题 (弹窗/卡片主标题)
|
|
|
</label>
|
|
</label>
|
|
|
<input
|
|
<input
|
|
|
type="text"
|
|
type="text"
|
|
@@ -1061,7 +1493,7 @@ export default function ProductModal({
|
|
|
<div className="flex items-center gap-2">
|
|
<div className="flex items-center gap-2">
|
|
|
<span className="w-2.5 h-2.5 bg-black" />
|
|
<span className="w-2.5 h-2.5 bg-black" />
|
|
|
<span className="text-xs font-black uppercase text-black">
|
|
<span className="text-xs font-black uppercase text-black">
|
|
|
- [ 06 // 前台展示卡片包装与海报定制 (Showcase Card & Poster) ]
|
|
|
|
|
|
|
+ [ 07 // 前台展示卡片包装与海报定制 (Showcase Card & Poster) ]
|
|
|
</span>
|
|
</span>
|
|
|
</div>
|
|
</div>
|
|
|
<span className="text-[10px] font-mono text-neutral-500 uppercase">
|
|
<span className="text-[10px] font-mono text-neutral-500 uppercase">
|
|
@@ -1084,19 +1516,18 @@ export default function ProductModal({
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<div className="grid grid-cols-1 md:grid-cols-2 gap-3">
|
|
<div className="grid grid-cols-1 md:grid-cols-2 gap-3">
|
|
|
- <div className="space-y-1 md:col-span-2">
|
|
|
|
|
- <label className="text-[11px] font-bold text-black uppercase">
|
|
|
|
|
- 自定义海报大图 URL (可选,填入后将覆盖默认 3D 海报)
|
|
|
|
|
- </label>
|
|
|
|
|
- <input
|
|
|
|
|
- type="text"
|
|
|
|
|
- placeholder="https://... 或图床外链图片地址"
|
|
|
|
|
- className="w-full border-2 border-black bg-white px-2.5 py-1.5 text-xs font-mono text-black outline-none shadow-[2px_2px_0px_#000]"
|
|
|
|
|
|
|
+ <div className="md:col-span-2">
|
|
|
|
|
+ <ImageUploadField
|
|
|
|
|
+ label="自定义海报大图 (本地上传,将上传至 R2 对象存储并覆盖默认 3D 海报)"
|
|
|
value={cardConfig.banner_url || ''}
|
|
value={cardConfig.banner_url || ''}
|
|
|
- onChange={(e) => setCardConfig((prev) => ({ ...prev, banner_url: e.target.value }))}
|
|
|
|
|
|
|
+ onChange={(url) => setCardConfig((prev) => ({ ...prev, banner_url: url }))}
|
|
|
|
|
+ prefix="posters"
|
|
|
|
|
+ aspectRatio="16:9"
|
|
|
|
|
+ helperText="点击选择本地海报图片,支持 PNG, JPG, WEBP (最大 1MB)"
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
+
|
|
|
<div className="space-y-1">
|
|
<div className="space-y-1">
|
|
|
<label className="text-[11px] font-bold text-black uppercase">
|
|
<label className="text-[11px] font-bold text-black uppercase">
|
|
|
海报主标题 (大字,如: FRANCE, USA, GPT Plus)
|
|
海报主标题 (大字,如: FRANCE, USA, GPT Plus)
|
|
@@ -1196,11 +1627,11 @@ export default function ProductModal({
|
|
|
<div className="grid grid-cols-1 md:grid-cols-2 gap-3">
|
|
<div className="grid grid-cols-1 md:grid-cols-2 gap-3">
|
|
|
<div className="space-y-1">
|
|
<div className="space-y-1">
|
|
|
<label className="text-[11px] font-bold text-black uppercase">
|
|
<label className="text-[11px] font-bold text-black uppercase">
|
|
|
- 活动/通道标贴 (青色微斜标签,如: 官方活动、官方直连、特惠直供)
|
|
|
|
|
|
|
+ 活动/通道标贴 (如: 官方活动、官方直连、特惠直供)
|
|
|
</label>
|
|
</label>
|
|
|
<input
|
|
<input
|
|
|
type="text"
|
|
type="text"
|
|
|
- placeholder="默认: 官方直连"
|
|
|
|
|
|
|
+ placeholder="留空则不显示"
|
|
|
className="w-full border-2 border-black bg-white px-2.5 py-1.5 text-xs font-mono text-black outline-none shadow-[2px_2px_0px_#000]"
|
|
className="w-full border-2 border-black bg-white px-2.5 py-1.5 text-xs font-mono text-black outline-none shadow-[2px_2px_0px_#000]"
|
|
|
value={cardConfig.official_tag || ''}
|
|
value={cardConfig.official_tag || ''}
|
|
|
onChange={(e) => setCardConfig((prev) => ({ ...prev, official_tag: e.target.value }))}
|
|
onChange={(e) => setCardConfig((prev) => ({ ...prev, official_tag: e.target.value }))}
|
|
@@ -1209,11 +1640,11 @@ export default function ProductModal({
|
|
|
|
|
|
|
|
<div className="space-y-1">
|
|
<div className="space-y-1">
|
|
|
<label className="text-[11px] font-bold text-black uppercase">
|
|
<label className="text-[11px] font-bold text-black uppercase">
|
|
|
- 状态徽标 (天蓝角标,如: New、Hot、限时可约)
|
|
|
|
|
|
|
+ 状态徽标 (如: New、Hot、限时可约)
|
|
|
</label>
|
|
</label>
|
|
|
<input
|
|
<input
|
|
|
type="text"
|
|
type="text"
|
|
|
- placeholder="默认: New"
|
|
|
|
|
|
|
+ placeholder="留空则不显示"
|
|
|
className="w-full border-2 border-black bg-white px-2.5 py-1.5 text-xs font-mono text-black outline-none shadow-[2px_2px_0px_#000]"
|
|
className="w-full border-2 border-black bg-white px-2.5 py-1.5 text-xs font-mono text-black outline-none shadow-[2px_2px_0px_#000]"
|
|
|
value={cardConfig.status_tag || ''}
|
|
value={cardConfig.status_tag || ''}
|
|
|
onChange={(e) => setCardConfig((prev) => ({ ...prev, status_tag: e.target.value }))}
|
|
onChange={(e) => setCardConfig((prev) => ({ ...prev, status_tag: e.target.value }))}
|
|
@@ -1226,7 +1657,7 @@ export default function ProductModal({
|
|
|
</label>
|
|
</label>
|
|
|
<input
|
|
<input
|
|
|
type="text"
|
|
type="text"
|
|
|
- placeholder="留空则自动显示教程标题或全额退款保障"
|
|
|
|
|
|
|
+ placeholder="留空则不显示"
|
|
|
className="w-full border-2 border-black bg-white px-2.5 py-1.5 text-xs font-mono text-black outline-none shadow-[2px_2px_0px_#000]"
|
|
className="w-full border-2 border-black bg-white px-2.5 py-1.5 text-xs font-mono text-black outline-none shadow-[2px_2px_0px_#000]"
|
|
|
value={cardConfig.pill_text || ''}
|
|
value={cardConfig.pill_text || ''}
|
|
|
onChange={(e) => setCardConfig((prev) => ({ ...prev, pill_text: e.target.value }))}
|
|
onChange={(e) => setCardConfig((prev) => ({ ...prev, pill_text: e.target.value }))}
|
|
@@ -1235,24 +1666,37 @@ export default function ProductModal({
|
|
|
|
|
|
|
|
<div className="space-y-1">
|
|
<div className="space-y-1">
|
|
|
<label className="text-[11px] font-bold text-black uppercase">
|
|
<label className="text-[11px] font-bold text-black uppercase">
|
|
|
- 底部销售/库存描述 (如: 仅剩 5 件 · 已售 77、实时监控中 · 已售 120)
|
|
|
|
|
|
|
+ 底部销售/库存描述 (如: 仅剩 5 件 · 已售 77、实时监控中)
|
|
|
</label>
|
|
</label>
|
|
|
<input
|
|
<input
|
|
|
type="text"
|
|
type="text"
|
|
|
- placeholder="留空则根据商品推荐分自动生成"
|
|
|
|
|
|
|
+ placeholder="留空则不显示"
|
|
|
className="w-full border-2 border-black bg-white px-2.5 py-1.5 text-xs font-mono text-black outline-none shadow-[2px_2px_0px_#000]"
|
|
className="w-full border-2 border-black bg-white px-2.5 py-1.5 text-xs font-mono text-black outline-none shadow-[2px_2px_0px_#000]"
|
|
|
value={cardConfig.sales_text || ''}
|
|
value={cardConfig.sales_text || ''}
|
|
|
onChange={(e) => setCardConfig((prev) => ({ ...prev, sales_text: e.target.value }))}
|
|
onChange={(e) => setCardConfig((prev) => ({ ...prev, sales_text: e.target.value }))}
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
+ <div className="space-y-1">
|
|
|
|
|
+ <label className="text-[11px] font-bold text-black uppercase">
|
|
|
|
|
+ 渠道状态文案 (如: 直连就绪、通道正常、全天候巡检)
|
|
|
|
|
+ </label>
|
|
|
|
|
+ <input
|
|
|
|
|
+ type="text"
|
|
|
|
|
+ placeholder="留空则不显示"
|
|
|
|
|
+ className="w-full border-2 border-black bg-white px-2.5 py-1.5 text-xs font-mono text-black outline-none shadow-[2px_2px_0px_#000]"
|
|
|
|
|
+ value={cardConfig.status_text || ''}
|
|
|
|
|
+ onChange={(e) => setCardConfig((prev) => ({ ...prev, status_text: e.target.value }))}
|
|
|
|
|
+ />
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
<div className="space-y-1">
|
|
<div className="space-y-1">
|
|
|
<label className="text-[11px] font-bold text-black uppercase">
|
|
<label className="text-[11px] font-bold text-black uppercase">
|
|
|
右侧购买按键文案 (如: 立即购买、立即申请、立即抢位)
|
|
右侧购买按键文案 (如: 立即购买、立即申请、立即抢位)
|
|
|
</label>
|
|
</label>
|
|
|
<input
|
|
<input
|
|
|
type="text"
|
|
type="text"
|
|
|
- placeholder="默认: 立即购买"
|
|
|
|
|
|
|
+ placeholder="默认: 立即购买 / Order Now"
|
|
|
className="w-full border-2 border-black bg-white px-2.5 py-1.5 text-xs font-mono text-black outline-none shadow-[2px_2px_0px_#000]"
|
|
className="w-full border-2 border-black bg-white px-2.5 py-1.5 text-xs font-mono text-black outline-none shadow-[2px_2px_0px_#000]"
|
|
|
value={cardConfig.buy_button_text || ''}
|
|
value={cardConfig.buy_button_text || ''}
|
|
|
onChange={(e) => setCardConfig((prev) => ({ ...prev, buy_button_text: e.target.value }))}
|
|
onChange={(e) => setCardConfig((prev) => ({ ...prev, buy_button_text: e.target.value }))}
|
|
@@ -1265,7 +1709,7 @@ export default function ProductModal({
|
|
|
</label>
|
|
</label>
|
|
|
<input
|
|
<input
|
|
|
type="text"
|
|
type="text"
|
|
|
- placeholder="默认: 查阅服务细则 →"
|
|
|
|
|
|
|
+ placeholder="留空则不显示"
|
|
|
className="w-full border-2 border-black bg-white px-2.5 py-1.5 text-xs font-mono text-black outline-none shadow-[2px_2px_0px_#000]"
|
|
className="w-full border-2 border-black bg-white px-2.5 py-1.5 text-xs font-mono text-black outline-none shadow-[2px_2px_0px_#000]"
|
|
|
value={cardConfig.sublink_text || ''}
|
|
value={cardConfig.sublink_text || ''}
|
|
|
onChange={(e) => setCardConfig((prev) => ({ ...prev, sublink_text: e.target.value }))}
|
|
onChange={(e) => setCardConfig((prev) => ({ ...prev, sublink_text: e.target.value }))}
|
|
@@ -1315,21 +1759,35 @@ export default function ProductModal({
|
|
|
)}
|
|
)}
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
- <p className="text-neutral-600 text-xs line-clamp-2 leading-relaxed">
|
|
|
|
|
- {form.description || '官方直连极速通道,分布式集群 24 小时毫秒级抢位,预约失败无条件全额退款。'}
|
|
|
|
|
- </p>
|
|
|
|
|
|
|
+ {form.description && (
|
|
|
|
|
+ <p className="text-neutral-600 text-xs line-clamp-2 leading-relaxed">
|
|
|
|
|
+ {form.description}
|
|
|
|
|
+ </p>
|
|
|
|
|
+ )}
|
|
|
|
|
|
|
|
- <div>
|
|
|
|
|
- <span className="inline-flex items-center gap-1.5 px-3 py-1 bg-amber-50 text-black border-2 border-black font-mono text-xs font-bold shadow-[2px_2px_0px_#000]">
|
|
|
|
|
- [ {cardConfig.pill_text || (tutorialConfig.enabled ? (tutorialConfig.modal_title || '查看办理教程与材料指引') : '7×24H 官方代抢 · 失败全额退款')} → ]
|
|
|
|
|
- </span>
|
|
|
|
|
- </div>
|
|
|
|
|
-
|
|
|
|
|
- <div className="text-neutral-500 text-[11px] font-mono pt-1 border-t border-neutral-200">
|
|
|
|
|
- <strong className="text-neutral-800 font-bold">
|
|
|
|
|
- {cardConfig.sales_text || '实时监控中 · 已售 88'}
|
|
|
|
|
- </strong>
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ {cardConfig.pill_text && (
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <span className="inline-flex items-center gap-1.5 px-3 py-1 bg-amber-50 text-black border-2 border-black font-mono text-xs font-bold shadow-[2px_2px_0px_#000]">
|
|
|
|
|
+ [ {cardConfig.pill_text} → ]
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ )}
|
|
|
|
|
+
|
|
|
|
|
+ {(cardConfig.sales_text || cardConfig.status_text) && (
|
|
|
|
|
+ <div className="text-neutral-500 text-[11px] font-mono pt-1 border-t border-neutral-200 flex items-center gap-2">
|
|
|
|
|
+ {cardConfig.sales_text && (
|
|
|
|
|
+ <strong className="text-neutral-800 font-bold">
|
|
|
|
|
+ {cardConfig.sales_text}
|
|
|
|
|
+ </strong>
|
|
|
|
|
+ )}
|
|
|
|
|
+ {cardConfig.status_text && (
|
|
|
|
|
+ <span className="text-emerald-700 font-bold flex items-center gap-1">
|
|
|
|
|
+ <span className="w-1.5 h-1.5 rounded-full bg-emerald-500 animate-pulse" />
|
|
|
|
|
+ {cardConfig.status_text}
|
|
|
|
|
+ </span>
|
|
|
|
|
+ )}
|
|
|
|
|
+ </div>
|
|
|
|
|
+ )}
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<div className="md:w-40 shrink-0 flex flex-row md:flex-col items-center md:items-end justify-between md:justify-center gap-2 pt-3 md:pt-0 border-t-2 border-neutral-200 md:border-t-0 md:border-l-2 md:border-neutral-200 md:pl-4">
|
|
<div className="md:w-40 shrink-0 flex flex-row md:flex-col items-center md:items-end justify-between md:justify-center gap-2 pt-3 md:pt-0 border-t-2 border-neutral-200 md:border-t-0 md:border-l-2 md:border-neutral-200 md:pl-4">
|
|
@@ -1345,9 +1803,11 @@ export default function ProductModal({
|
|
|
[ {cardConfig.buy_button_text || '立即购买'} ]
|
|
[ {cardConfig.buy_button_text || '立即购买'} ]
|
|
|
</span>
|
|
</span>
|
|
|
|
|
|
|
|
- <span className="text-[10px] font-mono font-bold text-neutral-600 underline underline-offset-2">
|
|
|
|
|
- {cardConfig.sublink_text || '查阅服务细则 →'}
|
|
|
|
|
- </span>
|
|
|
|
|
|
|
+ {cardConfig.sublink_text && (
|
|
|
|
|
+ <span className="text-[10px] font-mono font-bold text-neutral-600 underline underline-offset-2">
|
|
|
|
|
+ {cardConfig.sublink_text}
|
|
|
|
|
+ </span>
|
|
|
|
|
+ )}
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|