This commit is contained in:
12600k-rog-d4
2026-04-03 01:30:36 +08:00
parent 989af85df0
commit 6a486edde8
69 changed files with 2059 additions and 25 deletions

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
node_modules/

View File

@@ -1,5 +1,5 @@
---
name: 设计商品详情
name: 商品详情设计
description: "你是一个电商平台的商品详情设计师,负责设计商品的详情页,包括配置清单、商品实拍图、商品卖点、功能描述等。
---
### 工作职责:

View File

@@ -38,7 +38,4 @@
- 使用一拖三亚克力机箱
- 可选无线网卡
## 商品详情页设计原则

27
check-image-info.js Normal file
View File

@@ -0,0 +1,27 @@
const sharp = require('sharp');
const path = require('path');
const fs = require('fs');
async function checkImageInfo() {
const imageDir = path.join(__dirname, '产品', '飞牛 NAS', 'fyd-亚克力机箱 - 单', '详情', 'image');
const imageFiles = fs.readdirSync(imageDir).filter(file => file.endsWith('.jpg'));
console.log('📸 图片信息检查\n');
for (const imageFile of imageFiles) {
const imagePath = path.join(imageDir, imageFile);
const metadata = await sharp(imagePath).metadata();
console.log(`${imageFile}:`);
console.log(` 宽度: ${metadata.width}px`);
console.log(` 高度: ${metadata.height}px`);
console.log(` 格式: ${metadata.format}`);
console.log('');
}
}
checkImageInfo().catch(error => {
console.error('💥 检查过程出错:', error);
process.exit(1);
});

58
convert-html-to-png.js Normal file
View File

@@ -0,0 +1,58 @@
const puppeteer = require('puppeteer');
const path = require('path');
const fs = require('fs');
async function convertHtmlToPng() {
console.log('🚀 启动 HTML 转 PNG 转换工具...\n');
const browser = await puppeteer.launch({
headless: 'new',
args: ['--no-sandbox', '--disable-setuid-sandbox']
});
const page = await browser.newPage();
await page.setViewport({ width: 1000, height: 1000 });
const detailDir = path.join(__dirname, '产品', '飞牛 NAS', 'fyd-亚克力机箱 - 单', '详情');
const htmlFiles = fs.readdirSync(detailDir)
.filter(file => file.endsWith('.html') && file.includes('亚克力机箱 - 单'));
console.log(`📁 找到 ${htmlFiles.length} 个 HTML 文件需要转换\n`);
for (const htmlFile of htmlFiles) {
try {
const htmlPath = path.join(detailDir, htmlFile);
const pngFile = htmlFile.replace('.html', '.png');
const pngPath = path.join(detailDir, pngFile);
console.log(`📄 正在转换: ${htmlFile}`);
const fileUrl = `file:///${htmlPath.replace(/\\/g, '/')}`;
await page.goto(fileUrl, {
waitUntil: 'networkidle0',
timeout: 10000
});
await page.screenshot({
path: pngPath,
fullPage: false,
type: 'png'
});
console.log(`✅ 已生成: ${pngFile}\n`);
} catch (error) {
console.error(`❌ 转换失败 ${htmlFile}: ${error.message}\n`);
}
}
await browser.close();
console.log('✨ 所有转换任务已完成!');
}
convertHtmlToPng().catch(error => {
console.error('💥 转换过程出错:', error);
process.exit(1);
});

1666
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

20
package.json Normal file
View File

@@ -0,0 +1,20 @@
{
"name": "membank",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git@gitee.com:xiongmaojames/membank.git"
},
"keywords": [],
"author": "",
"license": "ISC",
"description": "",
"dependencies": {
"puppeteer": "^24.40.0",
"sharp": "^0.34.5"
}
}

51
remove-watermark.js Normal file
View File

@@ -0,0 +1,51 @@
const sharp = require('sharp');
const path = require('path');
const fs = require('fs');
const CROP_BOTTOM_HEIGHT = 300;
async function removeWatermark() {
console.log('🖼️ 开始裁剪图片水印...\n');
const imageDir = path.join(__dirname, '产品', '飞牛 NAS', 'fyd-亚克力机箱 - 单', '详情', 'image');
const backupDir = path.join(imageDir, 'backup');
const imageFiles = fs.readdirSync(backupDir).filter(file => file.endsWith('.jpg'));
console.log(`📸 找到 ${imageFiles.length} 张图片需要处理\n`);
console.log(`✂️ 裁剪设置: 从底部裁剪 ${CROP_BOTTOM_HEIGHT}px\n`);
for (const imageFile of imageFiles) {
try {
const backupPath = path.join(backupDir, imageFile);
const imagePath = path.join(imageDir, imageFile);
console.log(`📄 正在处理: ${imageFile}`);
const metadata = await sharp(backupPath).metadata();
const newHeight = metadata.height - CROP_BOTTOM_HEIGHT;
await sharp(backupPath)
.extract({
left: 0,
top: 0,
width: metadata.width,
height: newHeight
})
.toFile(imagePath);
console.log(` ✅ 已裁剪: ${metadata.width}x${metadata.height} -> ${metadata.width}x${newHeight}\n`);
} catch (error) {
console.error(` ❌ 处理失败 ${imageFile}: ${error.message}\n`);
}
}
console.log('✨ 所有图片处理完成!');
}
removeWatermark().catch(error => {
console.error('💥 处理过程出错:', error);
process.exit(1);
});

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 500 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 566 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 754 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 584 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 925 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 847 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1005 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 614 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 635 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 543 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

View File

@@ -0,0 +1,97 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=1000, height=1000">
<title>包装展示 - 亚克力机箱-单</title>
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
width: 1000px;
height: 1000px;
font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
background: linear-gradient(135deg, #e0f2f1 0%, #b2dfdb 50%, #80cbc4 100%);
padding: 40px;
}
.container {
width: 100%;
height: 100%;
background: rgba(255, 255, 255, 0.85);
border-radius: 20px;
padding: 50px;
box-shadow: 0 20px 60px rgba(0,0,0,0.1), inset 0 0 100px rgba(255,255,255,0.5);
backdrop-filter: blur(10px);
border: 2px solid rgba(255,255,255,0.6);
}
.title {
font-size: 56px;
font-weight: bold;
color: #00695c;
text-align: center;
margin-bottom: 40px;
text-shadow: 0 2px 10px rgba(0,105,92,0.2);
}
.image-grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-template-rows: repeat(2, 1fr);
gap: 20px;
height: calc(100% - 96px);
}
.image-box {
background: rgba(255, 255, 255, 0.9);
border-radius: 15px;
overflow: hidden;
display: flex;
flex-direction: column;
box-shadow: 0 4px 15px rgba(0,0,0,0.08);
border: 1px solid rgba(38,166,154,0.3);
}
.image-box img {
width: 100%;
flex: 1;
object-fit: cover;
}
.image-label {
padding: 15px;
text-align: center;
font-size: 24px;
color: #00796b;
font-weight: bold;
background: rgba(255,255,255,0.95);
}
</style>
</head>
<body>
<div class="container">
<div class="title">包装展示</div>
<div class="image-grid">
<div class="image-box">
<img src="image/包装.jpg" alt="包装展示">
<div class="image-label">包装展示</div>
</div>
<div class="image-box">
<img src="image/包装1.jpg" alt="包装细节">
<div class="image-label">包装细节</div>
</div>
<div class="image-box">
<img src="image/包装2.jpg" alt="泡沫保护">
<div class="image-label">泡沫保护</div>
</div>
<div class="image-box">
<img src="image/包装3.jpg" alt="配件包装">
<div class="image-label">配件包装</div>
</div>
<div class="image-box">
<img src="image/包装5.jpg" alt="成品包装">
<div class="image-label">成品包装</div>
</div>
<div class="image-box">
<img src="image/配件清单.jpg" alt="配件清单">
<div class="image-label">配件清单</div>
</div>
</div>
</div>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 800 KiB

View File

@@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=1000, height=1000">
<title>商品实拍图 - 亚克力机箱</title>
<title>商品实拍图 - 亚克力机箱-单</title>
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
@@ -33,29 +33,31 @@
}
.image-grid {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 30px;
grid-template-columns: repeat(3, 1fr);
gap: 20px;
height: calc(100% - 96px);
}
.image-box {
background: rgba(255, 255, 255, 0.9);
border-radius: 15px;
overflow: hidden;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 30px;
box-shadow: 0 4px 15px rgba(0,0,0,0.08);
border: 1px solid rgba(38,166,154,0.3);
}
.image-placeholder {
font-size: 120px;
margin-bottom: 20px;
.image-box img {
width: 100%;
height: 200px;
object-fit: cover;
}
.image-label {
font-size: 28px;
padding: 15px;
text-align: center;
font-size: 24px;
color: #00796b;
font-weight: bold;
background: rgba(255,255,255,0.95);
}
</style>
</head>
@@ -65,20 +67,28 @@
<div class="image-grid">
<div class="image-box">
<div class="image-placeholder">📷</div>
<div class="image-label">透明机箱正面</div>
<img src="image/正面.jpg" alt="正面视图">
<div class="image-label">正面视图</div>
</div>
<div class="image-box">
<div class="image-placeholder">📷</div>
<div class="image-label">透明机箱侧面</div>
<img src="image/侧面.jpg" alt="侧面视图">
<div class="image-label">侧面视图</div>
</div>
<div class="image-box">
<div class="image-placeholder">📷</div>
<div class="image-label">内部结构展示</div>
<img src="image/俯视图.jpg" alt="俯视图">
<div class="image-label">俯视图</div>
</div>
<div class="image-box">
<div class="image-placeholder">📷</div>
<div class="image-label">透明效果展示</div>
<img src="image/底面.jpg" alt="底面视图">
<div class="image-label">底面视图</div>
</div>
<div class="image-box">
<img src="image/接口.jpg" alt="接口细节">
<div class="image-label">接口细节</div>
</div>
<div class="image-box">
<img src="image/竖放.jpg" alt="竖放展示">
<div class="image-label">竖放展示</div>
</div>
</div>
</div>

Binary file not shown.

After

Width:  |  Height:  |  Size: 572 KiB

View File

@@ -0,0 +1,107 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=1000, height=1000">
<title>配件清单 - 亚克力机箱-单</title>
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
width: 1000px;
height: 1000px;
font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
background: linear-gradient(135deg, #e0f2f1 0%, #b2dfdb 50%, #80cbc4 100%);
padding: 40px;
}
.container {
width: 100%;
height: 100%;
background: rgba(255, 255, 255, 0.85);
border-radius: 20px;
padding: 50px;
box-shadow: 0 20px 60px rgba(0,0,0,0.1), inset 0 0 100px rgba(255,255,255,0.5);
backdrop-filter: blur(10px);
border: 2px solid rgba(255,255,255,0.6);
}
.title {
font-size: 56px;
font-weight: bold;
color: #00695c;
text-align: center;
margin-bottom: 40px;
text-shadow: 0 2px 10px rgba(0,105,92,0.2);
}
.content-wrapper {
display: flex;
gap: 40px;
height: calc(100% - 96px);
}
.image-section {
flex: 1;
display: flex;
align-items: center;
justify-content: center;
}
.image-section img {
max-width: 100%;
max-height: 100%;
border-radius: 15px;
box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}
.list-section {
flex: 1;
display: flex;
flex-direction: column;
justify-content: center;
gap: 20px;
}
.list-title {
font-size: 32px;
font-weight: bold;
color: #00695c;
margin-bottom: 10px;
text-align: center;
}
.accessory-item {
background: rgba(255, 255, 255, 0.9);
padding: 20px 25px;
border-radius: 10px;
display: flex;
align-items: center;
gap: 15px;
box-shadow: 0 4px 15px rgba(0,0,0,0.08);
border: 1px solid rgba(38,166,154,0.3);
font-size: 24px;
color: #00796b;
}
.accessory-item:before {
content: "✓";
color: #26a69a;
font-weight: bold;
font-size: 28px;
}
</style>
</head>
<body>
<div class="container">
<div class="title">配件清单</div>
<div class="content-wrapper">
<div class="image-section">
<img src="image/配件清单.jpg" alt="配件清单">
</div>
<div class="list-section">
<div class="list-title">📋 标准配置清单</div>
<div class="accessory-item">亚克力机箱 - 单 SATA 口 × 1</div>
<div class="accessory-item">60W 电源适配器 × 1</div>
<div class="accessory-item">SATA 数据线 × 1</div>
<div class="accessory-item">硬盘固定螺丝 × 4</div>
<div class="accessory-item">机箱脚垫 × 4</div>
<div class="accessory-item">主板固定铜柱 × 若干</div>
<div class="accessory-item">使用说明书 × 1</div>
</div>
</div>
</div>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 336 KiB