265 lines
16 KiB
HTML
265 lines
16 KiB
HTML
<!DOCTYPE html><html class="light" lang="zh-CN"><head>
|
|
<meta charset="utf-8">
|
|
<meta content="width=device-width, initial-scale=1.0" name="viewport">
|
|
<title>添加商品 - 杜康总部管理系统</title>
|
|
<script src="https://cdn.tailwindcss.com?plugins=forms,container-queries"></script>
|
|
<link href="https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700&family=Be+Vietnam+Pro:wght@400;500&family=Inter:wght@400;500&display=swap" rel="stylesheet">
|
|
<link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:wght,FILL@100..700,0..1&display=swap" rel="stylesheet">
|
|
<link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:wght,FILL@100..700,0..1&display=swap" rel="stylesheet">
|
|
<script id="tailwind-config">
|
|
tailwind.config = {
|
|
darkMode: "class",
|
|
theme: {
|
|
extend: {
|
|
"colors": {
|
|
"tertiary-fixed": "#dae5dd",
|
|
"on-secondary-fixed-variant": "#574500",
|
|
"subtle-gray": "#999999",
|
|
"on-tertiary": "#ffffff",
|
|
"secondary-container": "#fed65b",
|
|
"success-green": "#2D6A4F",
|
|
"on-secondary-fixed": "#241a00",
|
|
"on-primary-fixed": "#410004",
|
|
"on-background": "#1a1c1b",
|
|
"heritage-red": "#A61D24",
|
|
"outline-variant": "#e2bebc",
|
|
"aged-amber": "#FFBF00",
|
|
"tertiary-fixed-dim": "#bec9c2",
|
|
"on-secondary": "#ffffff",
|
|
"surface-container-high": "#e9e8e6",
|
|
"inverse-on-surface": "#f1f1ef",
|
|
"error-container": "#ffdad6",
|
|
"surface-container-low": "#f4f3f1",
|
|
"surface-bright": "#faf9f7",
|
|
"on-error-container": "#93000a",
|
|
"primary": "#820012",
|
|
"on-tertiary-fixed": "#141e19",
|
|
"tertiary": "#37413b",
|
|
"on-primary-fixed-variant": "#910817",
|
|
"surface-container-lowest": "#ffffff",
|
|
"tertiary-container": "#4e5852",
|
|
"primary-fixed": "#ffdad7",
|
|
"ink-black": "#1A1A1A",
|
|
"surface-container": "#efeeec",
|
|
"on-primary": "#ffffff",
|
|
"inverse-primary": "#ffb3ae",
|
|
"surface": "#faf9f7",
|
|
"on-secondary-container": "#745c00",
|
|
"primary-container": "#a61d24",
|
|
"on-tertiary-container": "#c2cdc6",
|
|
"secondary": "#735c00",
|
|
"background": "#faf9f7",
|
|
"on-surface-variant": "#5a413f",
|
|
"secondary-fixed-dim": "#e9c349",
|
|
"on-tertiary-fixed-variant": "#3f4943",
|
|
"surface-variant": "#e3e2e0",
|
|
"surface-dim": "#dadad8",
|
|
"error": "#ba1a1a",
|
|
"on-primary-container": "#ffb9b4",
|
|
"on-surface": "#1a1c1b",
|
|
"outline": "#8d706e",
|
|
"surface-container-highest": "#e3e2e0",
|
|
"secondary-fixed": "#ffe088",
|
|
"status-blue": "#2A6EBB",
|
|
"surface-tint": "#b3272c",
|
|
"primary-fixed-dim": "#ffb3ae",
|
|
"on-error": "#ffffff",
|
|
"inverse-surface": "#2f3130"
|
|
},
|
|
"borderRadius": {
|
|
"DEFAULT": "0.25rem",
|
|
"lg": "0.5rem",
|
|
"xl": "0.75rem",
|
|
"full": "9999px"
|
|
},
|
|
"spacing": {
|
|
"base": "8px",
|
|
"stack-lg": "32px",
|
|
"stack-sm": "4px",
|
|
"stack-md": "16px",
|
|
"gutter-card": "12px",
|
|
"margin-page": "20px"
|
|
},
|
|
"fontFamily": {
|
|
"body-lg": ["Be Vietnam Pro"],
|
|
"headline-lg": ["Manrope"],
|
|
"label-md": ["Inter"],
|
|
"headline-md": ["Manrope"],
|
|
"headline-lg-mobile": ["Manrope"],
|
|
"headline-xl": ["Manrope"],
|
|
"coupon-amount": ["Manrope"],
|
|
"body-md": ["Be Vietnam Pro"]
|
|
},
|
|
"fontSize": {
|
|
"body-lg": ["16px", {"lineHeight": "24px", "fontWeight": "400"}],
|
|
"headline-lg": ["24px", {"lineHeight": "32px", "fontWeight": "600"}],
|
|
"label-md": ["12px", {"lineHeight": "16px", "letterSpacing": "0.05em", "fontWeight": "500"}],
|
|
"headline-md": ["18px", {"lineHeight": "26px", "fontWeight": "600"}],
|
|
"headline-lg-mobile": ["20px", {"lineHeight": "28px", "fontWeight": "600"}],
|
|
"headline-xl": ["32px", {"lineHeight": "40px", "letterSpacing": "-0.02em", "fontWeight": "700"}],
|
|
"coupon-amount": ["28px", {"lineHeight": "28px", "fontWeight": "700"}],
|
|
"body-md": ["14px", {"lineHeight": "20px", "fontWeight": "400"}]
|
|
}
|
|
},
|
|
},
|
|
}
|
|
</script>
|
|
<style>
|
|
.no-scrollbar::-webkit-scrollbar { display: none; }
|
|
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }
|
|
.heritage-shadow { box-shadow: 0px 4px 20px rgba(166, 29, 36, 0.05); }
|
|
.input-focus:focus { border-color: #A61D24; ring: 0; outline: none; }
|
|
</style>
|
|
<style>
|
|
body {
|
|
min-height: max(884px, 100dvh);
|
|
}
|
|
</style>
|
|
</head>
|
|
<body class="bg-background min-h-screen pb-32">
|
|
<!-- TopAppBar -->
|
|
<header class="fixed top-0 w-full z-50 bg-background flex items-center justify-between px-margin-page h-14 w-full">
|
|
<div class="flex items-center gap-2">
|
|
<span class="material-symbols-outlined text-primary active:scale-95 transition-transform cursor-pointer" data-icon="arrow_back">arrow_back</span>
|
|
</div>
|
|
<h1 class="font-headline-lg-mobile text-headline-lg-mobile font-semibold text-primary">添加商品</h1>
|
|
<div class="w-6"></div> <!-- Spacer for centering -->
|
|
</header>
|
|
<main class="mt-14 px-margin-page py-stack-md flex flex-col gap-stack-md">
|
|
<!-- Image Upload Section -->
|
|
<section class="bg-surface-container-lowest rounded-lg p-stack-md heritage-shadow">
|
|
<div class="flex justify-between items-center mb-stack-md">
|
|
<h2 class="font-headline-md text-headline-md text-on-surface">商品图片 <span class="text-heritage-red">*</span></h2>
|
|
<span class="font-label-md text-label-md text-on-surface-variant">至少上传1张图片</span>
|
|
</div>
|
|
<div class="grid grid-cols-3 gap-gutter-card">
|
|
<!-- Filled Image Placeholder -->
|
|
<div class="aspect-square relative rounded-lg overflow-hidden border border-outline-variant">
|
|
<img class="w-full h-full object-cover" data-alt="A premium close-up studio photograph of a Dukang liquor bottle, featuring intricate golden calligraphy on a deep white porcelain bottle. The lighting is soft and cinematic, highlighting the elegant curves and high-end texture of the glass. The background is a minimalist warm cream, maintaining the heritage modernism aesthetic of the brand with subtle shadows and a clean, luxury editorial feel." src="https://lh3.googleusercontent.com/aida-public/AB6AXuBFdtEEmeJaf8GdGslgnogsiDwFaQhgoaRQk1RtW29beTB1E3uaszgk_swaSTEGufyIK0-XSsFCj_mtOgBlW36zCRt3ZLQbdT5y7xcRGg0ukbQn1DPIfY4xmEK6GQ3uUhCvDLtXgfrsmnh3tW9gYNiApNKwPGlb72yAP4gA1oXXG3YvZcs7pURc_0z1jxwZHc1M6WG89GAo_QvbrnC9zb5RAaeDwdB1s-bfoz85I5jx2PcXcIROra3e_6019R216EaOhl6VgxsE6BY">
|
|
<div class="absolute top-1 right-1 bg-black/50 rounded-full p-0.5 text-white cursor-pointer active:scale-90 transition-all">
|
|
<span class="material-symbols-outlined text-[16px]" data-icon="close">close</span>
|
|
</div>
|
|
</div>
|
|
<!-- Upload Buttons -->
|
|
<button class="aspect-square flex flex-col items-center justify-center border-2 border-dashed border-outline-variant rounded-lg bg-surface-container-low active:bg-surface-container-high transition-colors text-on-surface-variant">
|
|
<span class="material-symbols-outlined mb-1" data-icon="add_a_photo">add_a_photo</span>
|
|
<span class="font-label-md text-label-md">上传图片</span>
|
|
</button>
|
|
<button class="aspect-square flex flex-col items-center justify-center border-2 border-dashed border-outline-variant rounded-lg bg-surface-container-low opacity-60">
|
|
<span class="material-symbols-outlined text-on-surface-variant" data-icon="add">add</span>
|
|
</button>
|
|
</div>
|
|
</section>
|
|
<!-- Basic Info Section -->
|
|
<section class="bg-surface-container-lowest rounded-lg p-stack-md heritage-shadow flex flex-col gap-stack-md">
|
|
<div>
|
|
<label class="block font-label-md text-label-md text-on-surface-variant mb-2">商品名称</label>
|
|
<input class="w-full border border-outline-variant rounded-lg px-4 py-3 font-body-md text-body-md focus:border-heritage-red focus:ring-1 focus:ring-heritage-red/20 outline-none transition-all" placeholder="请输入商品名称 (2-50字)" type="text">
|
|
</div>
|
|
<div>
|
|
<label class="block font-label-md text-label-md text-on-surface-variant mb-2">商品分类</label>
|
|
<div class="relative">
|
|
<select class="w-full appearance-none border border-outline-variant rounded-lg px-4 py-3 font-body-md text-body-md bg-transparent focus:border-heritage-red focus:ring-1 focus:ring-heritage-red/20 outline-none transition-all cursor-pointer">
|
|
<option disabled="" selected="" value="">请选择分类</option>
|
|
<option value="1">清香型</option>
|
|
<option value="2">酱香型</option>
|
|
<option value="3">浓香型</option>
|
|
</select>
|
|
<span class="material-symbols-outlined absolute right-4 top-1/2 -translate-y-1/2 pointer-events-none text-on-surface-variant" data-icon="unfold_more">unfold_more</span>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<label class="block font-label-md text-label-md text-on-surface-variant mb-2">商品价格</label>
|
|
<div class="flex items-center border border-outline-variant rounded-lg px-4 bg-white focus-within:border-heritage-red focus-within:ring-1 focus-within:ring-heritage-red/20 transition-all">
|
|
<span class="font-headline-md text-headline-md text-heritage-red mr-2">¥</span>
|
|
<input class="flex-1 py-3 border-none focus:ring-0 font-body-lg text-body-lg" placeholder="0.00" step="0.01" type="number">
|
|
<span class="font-body-md text-body-md text-on-surface-variant ml-2">元</span>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
<!-- Product Description Section -->
|
|
<section class="bg-surface-container-lowest rounded-lg p-stack-md heritage-shadow">
|
|
<label class="block font-headline-md text-headline-md text-on-surface mb-stack-md">商品介绍</label>
|
|
<div class="relative border border-outline-variant rounded-lg bg-surface-bright overflow-hidden">
|
|
<div class="flex gap-2 p-2 border-b border-outline-variant bg-surface-container-low">
|
|
<button class="p-1 hover:bg-surface-container-high rounded transition-colors text-on-surface-variant">
|
|
<span class="material-symbols-outlined text-[20px]" data-icon="format_bold">format_bold</span>
|
|
</button>
|
|
<button class="p-1 hover:bg-surface-container-high rounded transition-colors text-on-surface-variant">
|
|
<span class="material-symbols-outlined text-[20px]" data-icon="format_list_bulleted">format_list_bulleted</span>
|
|
</button>
|
|
<button class="p-1 hover:bg-surface-container-high rounded transition-colors text-on-surface-variant">
|
|
<span class="material-symbols-outlined text-[20px]" data-icon="add_photo_alternate">add_photo_alternate</span>
|
|
</button>
|
|
</div>
|
|
<textarea class="w-full p-4 font-body-md text-body-md bg-transparent border-none focus:ring-0 resize-none" placeholder="输入商品的详细描述,展示杜康酒的千年传承与匠心酿造..." rows="6"></textarea>
|
|
<div class="absolute bottom-2 right-4 font-label-md text-label-md text-subtle-gray">
|
|
0/500
|
|
</div>
|
|
</div>
|
|
</section>
|
|
<!-- Settings Section -->
|
|
<section class="bg-surface-container-lowest rounded-lg p-stack-md heritage-shadow flex flex-col gap-4">
|
|
<div class="flex items-center justify-between">
|
|
<div class="flex flex-col">
|
|
<span class="font-headline-md text-headline-md text-on-surface">立即上架</span>
|
|
<span class="font-label-md text-label-md text-on-surface-variant">商品发布后将立即显示在商城首页</span>
|
|
</div>
|
|
<!-- Toggle Switch -->
|
|
<label class="relative inline-flex items-center cursor-pointer">
|
|
<input checked="" class="sr-only peer" type="checkbox">
|
|
<div class="w-12 h-6 bg-surface-variant rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-heritage-red"></div>
|
|
</label>
|
|
</div>
|
|
<div class="h-px bg-outline-variant/30"></div>
|
|
<div class="flex items-center justify-between">
|
|
<span class="font-headline-md text-headline-md text-on-surface">排序权重</span>
|
|
<div class="flex items-center border border-outline-variant rounded-lg overflow-hidden h-10">
|
|
<button class="px-3 h-full hover:bg-surface-container active:bg-surface-container-high transition-colors" onclick="this.nextElementSibling.stepDown()">
|
|
<span class="material-symbols-outlined text-[18px]" data-icon="remove">remove</span>
|
|
</button>
|
|
<input class="w-16 h-full text-center border-none focus:ring-0 font-body-lg font-semibold bg-transparent" type="number" value="0">
|
|
<button class="px-3 h-full hover:bg-surface-container active:bg-surface-container-high transition-colors" onclick="this.previousElementSibling.stepUp()">
|
|
<span class="material-symbols-outlined text-[18px]" data-icon="add">add</span>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
</main>
|
|
<!-- BottomNavBar as Footer -->
|
|
<footer class="fixed bottom-0 left-0 w-full z-50 flex justify-between items-center px-margin-page py-stack-md bg-surface shadow-[0px_-4px_20px_rgba(166,29,36,0.05)] rounded-t-xl">
|
|
<button class="flex items-center justify-center text-on-surface-variant px-6 py-3 w-full mx-2 border border-outline rounded-lg active:scale-98 transition-all hover:bg-primary-container/10">
|
|
<span class="material-symbols-outlined mr-2" data-icon="close">close</span>
|
|
<span class="font-label-md text-label-md">取消</span>
|
|
</button>
|
|
<button class="flex items-center justify-center bg-primary text-on-primary rounded-lg px-6 py-3 w-full mx-2 active:scale-98 transition-all hover:bg-primary-container">
|
|
<span class="material-symbols-outlined mr-2" data-icon="publish">publish</span>
|
|
<span class="font-label-md text-label-md">保存并发布</span>
|
|
</button>
|
|
</footer>
|
|
<script>
|
|
// Character counter logic
|
|
const textarea = document.querySelector('textarea');
|
|
const counter = document.querySelector('.text-subtle-gray');
|
|
|
|
textarea.addEventListener('input', (e) => {
|
|
const length = e.target.value.length;
|
|
counter.textContent = `${length}/500`;
|
|
if (length > 500) {
|
|
counter.classList.add('text-error');
|
|
} else {
|
|
counter.classList.remove('text-error');
|
|
}
|
|
});
|
|
|
|
// Simple touch feedback
|
|
document.querySelectorAll('button, .cursor-pointer').forEach(el => {
|
|
el.addEventListener('touchstart', () => {
|
|
el.style.opacity = '0.7';
|
|
});
|
|
el.addEventListener('touchend', () => {
|
|
el.style.opacity = '1';
|
|
});
|
|
});
|
|
</script>
|
|
</body></html> |