with one click
dxm-sku-pricing
店小秘速卖通编辑页——SKU定价栏模块:零售价/货值/库存/重量/尺寸/是否原箱/物流属性/商品编码,含定价公式
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
店小秘速卖通编辑页——SKU定价栏模块:零售价/货值/库存/重量/尺寸/是否原箱/物流属性/商品编码,含定价公式
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
速卖通店铺运营自动化 — 每日巡检/每周策略/商品上架/数据分析全流程。填入你的店铺名即可使用。
店小秘速卖通编辑页——属性信息模块:产品属性批量填(ant-select CDP填充)+ 自定义属性删除
店小秘速卖通编辑页——基本信息模块:标题改英文 + 产品分类选择
速卖通上架——1688采集模块:从1688搜索产品 → 采集到店小秘采集箱 → 提取产品参数(价格/库存/重量/材质等)
店小秘速卖通编辑页——店小秘信息模块:来源URL(只读,记录用)
店小秘速卖通上品完整工作流——从采集箱到发布的所有模块编排、调用顺序、区域调价、保存发布
| name | dxm-sku-pricing |
| description | 店小秘速卖通编辑页——SKU定价栏模块:零售价/货值/库存/重量/尺寸/是否原箱/物流属性/商品编码,含定价公式 |
| domain | ecommerce |
| triggers | ["用户说\"SKU\"、\"定价栏\"、\"零售价\"、\"货值\"、\"物流属性\"、\"商品编码\"、\"原箱\"、\"填充SKU\"","店小秘编辑页产品信息 tab 需要填SKU表"] |
CDP browser_cdp 直连。
SKU表在「产品信息」tab 的下方,颜色SKU配置区域之后。
| 字段 | 规则 |
|---|---|
| 零售价(CNY) | = 货值,由定价公式计算。≠1688成本价! |
| 货值(CNY) | = 零售价,两列填同一个数 |
| 库存 | 1688库存>2000封顶2000,≤2000如实写 |
| 重量(kg) | 从1688提取 |
| 包装尺寸(cm) | 长/宽/高,1688有则填,无跳过 |
| 是否原箱 | 原生<select>,设为「是」(value=1) |
| 物流属性 | 无电→普货;有电→内电(选具体电池类型) |
| 商品编码 | 一键生成,1688有货号则填为前缀 |
零售价 = 货值 = (1688成本价 + 国内运费¥5) × 1.02 ÷ [0.70 × (1 - 21% - 净利率)]
零售价 = (成本 + 5) × 1.02 ÷ 0.413
= (成本 + 5) × 2.469
page.locator().fill() — 唯一可靠方式店小秘 SKU 表的 antd input 不能用 triple-click+keyboard.type 或 nativeValueSetter 填值。唯一可靠方式:Playwright page.locator('input[placeholder="字段名"]').fill('值')。
# 零售价 (SKU 1 = nth(0), SKU 2 = nth(2)! 跳过 nth(1) 隐藏行)
await page.locator('input[placeholder="零售价"]').nth(0).fill('15.56') # SKU 1 (Green)
await page.locator('input[placeholder="零售价"]').nth(2).fill('15.56') # SKU 2 (Pink)
# 货值(同零售价)
await page.locator('input[placeholder="货值"]').nth(0).fill('15.56')
await page.locator('input[placeholder="货值"]').nth(2).fill('15.56')
# 库存
await page.locator('input[placeholder="库存"]').nth(0).fill('2000')
await page.locator('input[placeholder="库存"]').nth(2).fill('2000')
# 重量
await page.locator('input[placeholder="重量"]').nth(0).fill('0.2')
await page.locator('input[placeholder="重量"]').nth(2).fill('0.2')
nth(0) 是第 1 个 SKU,nth(2) 是第 2 个 SKU!nth(1) 是隐藏/批量行,不要填它!nth(i).click() 聚焦,再 .fill(value)dispatchEvent — Playwright fill 会自动触发 Vue 3 响应<select>,不是 ant-select!# Playwright select_option(推荐)
selects = page.locator('table select')
for i in range(selects.count()):
opts = await selects.nth(i).locator('option').all_inner_texts()
if '是' in opts:
await selects.nth(i).select_option(value='1') # 1 = 是
# JS fallback(备选)
await page.evaluate('''() => {
const selects = document.querySelectorAll('table select');
for (const sel of selects) {
if (sel.options.length >= 3 && sel.options[2].text === '是') {
sel.selectedIndex = 2;
sel.dispatchEvent(new Event('change', {bubbles: true}));
}
}
}''')
⚠️ 第一个 select(i=0)通常是颜色筛选器,跳过它。只改 是否原箱 的 select。
⚠️ Playwright select_option 是原生 select 的最可靠方式。
| 产品类型 | 物流属性 |
|---|---|
| 无电(硅胶碗、普通日用品) | 普货 |
| USB充电(风扇、净化器) | 内电→非纽扣锂离子电池 |
| 纽扣电池(LED灯) | 内电→纽扣式锂电池 |
| 干电池(遥控器) | 内电→干电池 |
| 充电宝/电池盒 | 内电→非纽扣锂离子电池 |
1. 找物流属性列 header 中的「批量」span
th_textContent_contains('物流属性') → querySelector('span') → 文字为'批量'
坐标约 (1778, 709)(scroll 后可能变化,每次实时查询)
2. page.mouse.click(x, y) 打开弹窗
弹窗结构:
物流属性
禁运: 禁运
普货: 普货 ← 选这个
纯电: 纯电
强磁: 强磁
特货: 液体/粉末/膏体/特货其他
特敏: 危险品/特敏其他
内电: 干电池/铅酸蓄电池/.../非纽扣锂离子电池
外电: 外电
弱磁: 弱磁
[取消] [确定]
3. 选对应 checkbox
page.mouse.click(普货_label_x, 普货_label_y) // 约 (790, 232)
4. 点「确定」
page.mouse.click(确定_btn_x, 确定_btn_y) // 约 (1466, 842)
getBoundingClientRect() 获取1. 点 header 中的「一键生成」span(约 1899, 710)
page.mouse.click(1899, 710)
2. 弹窗「商品编码 设置」出现
按钮:[关闭] [设置]
3. 点「设置」自动生成(约 1213, 164)
page.mouse.click(1213, 164)
4. 弹窗关闭 → 每个 SKU 行商品编码自动填入(值如 'Green' / 'Pink')
1688.com 的 a 链接 / innerTextsession_search 搜产品标题 + "1688" + "价格"1. 在已有 Chrome CDP 连接中:ctx.new_page()
2. goto('https://s.1688.com/selloffer/offer_search.htm?keywords=产品关键词&n=y')
3. page.evaluate('document.body.innerText') 提取搜索结果
4. 匹配标题最接近的产品,从 innerText 中提取价格(正则:/¥\s*([\d.]+)/)
5. 或直接 page.mouse.click 点进详情页 → goto('https://detail.1688.com/offer/{offer_id}.html')
6. 从详情页 innerText 提取:
- 价格:¥(\d+\.\d+)
- 库存:规格行后紧跟的 \d+ 数字
- 重量:(\d+)g
- 材质/品牌/产地:表格文本中提取
用户明确要求:自己从浏览器中找,不要问用户。 "你自己分辨,你不要问我,好吗?我们都已经上架了,你刚才在编辑那个页面,那个页面上也有网页链接,有采集的产品的链接,你自己去学习,自己去研究。" → 优先用浏览器搜索1688找到产品并提取价格,实在找不到(如1688需验证码/登录失效)时再问。
<select>,第一个 select 是颜色筛选器要跳过page.locator('input[placeholder="..."]').fill() — 这是填 antd 表 input 的唯一可靠方式。triple-click+keyboard 和 nativeValueSetter 均无效。作者: Rigi AI Commons | 小红书 @瑞吉AI人民公社 | AI自动化专家工作流