feat(frontend-vue): 亚马逊运营工具台与新功能页接入——新版工具台(amazon-console+tool-catalog)、品牌检测/ASIN变体采集/查询ASIN 三个工具页 Vue 化并对接既有后端与桌面桥接;桌面首页/登录页 Vue 化(沿用旧视觉);补充 vc_*/get_device_id/save_file_from_url 桥类型、dev 代理;品牌默认勾选排名+FBM;修正 query-asin 标题

含未提交新版改造累积:Brand*Tab 套入工具台壳(AmazonToolPageShell/AmazonTopBar)与目录/权限联动。
This commit is contained in:
2026-09-07 11:06:05 +08:00
parent 7f0b3f906d
commit b54165a551
43 changed files with 4513 additions and 614 deletions
@@ -0,0 +1,643 @@
<template>
<div class="page-shell module-page amazon-console">
<AmazonTopBar />
<main class="console-body">
<!-- Hero 宣传区 -->
<section class="hero">
<div class="hero-inner">
<div class="hero-left">
<span class="hero-pill">运营辅助 · 数据安全 · 高效跟价</span>
<h1 class="hero-title">让亚马逊运营,更清晰高效</h1>
<p class="hero-sub">
从采集、去重、查品到上架跟价,20 个工具按「前端 · 运营 · 后勤」三线组织,每条工具一句话讲清用途,标准流程一步不缺。
</p>
<div class="hero-stats">
<div class="stat">
<strong style="color: #2dd4bf">20</strong>
<span>个工具</span>
</div>
<div class="stat">
<strong style="color: #60a5fa">3</strong>
<span>大分类</span>
</div>
<div class="stat">
<strong style="color: #f59e0b">8</strong>
<span>前端标准流程步骤</span>
</div>
</div>
</div>
<div class="hero-card">
<div class="hero-card-head">
<div class="hero-card-dots">
<i class="dot dot--teal"></i>
<i class="dot dot--blue"></i>
<i class="dot dot--brand"></i>
<span class="dots-line"></span>
</div>
<span class="hero-card-caption">数富AI · 运营工作台</span>
</div>
<h2 class="hero-card-title">让每一次运营动作,<br />都有清晰的工作流。</h2>
<div class="hero-card-divider"></div>
<p class="hero-card-sub">内置完整使用教程,从软件配置到运营上架,每一步流程清晰可查。</p>
<button type="button" class="hero-card-btn" @click="scrollToTools">查看工具</button>
</div>
</div>
</section>
<!-- 三组工具:标题 + 标准工作流 + 卡片墙 -->
<section v-for="group in visibleGroups" :key="group.key" class="tool-group" :id="`group-${group.key}`">
<header class="group-head">
<i class="group-dot" :style="{ background: group.color }"></i>
<span class="group-name">{{ group.name }}</span>
<span class="group-desc">{{ group.desc }}</span>
<span class="group-count">{{ group.tools.length }} 个工具</span>
</header>
<!-- 标准工作流时间线 -->
<section v-if="visibleWorkflow(group)?.length" class="workflow-panel">
<div class="workflow-head">
<span class="workflow-title">{{ group.workflowTitle }}</span>
<span class="workflow-badge" :style="{ color: group.color }">{{ group.workflowBadge }}</span>
<span class="workflow-hint">{{ group.workflowHint }}</span>
</div>
<ol class="workflow-steps">
<li
v-for="(step, index) in visibleWorkflow(group)"
:key="`${group.key}-${index}`"
class="workflow-step"
:class="{ 'workflow-step--disabled': !step.toolId || !stepHref(step.toolId) }"
@click="onWorkflowStepClick(step)"
>
<span class="step-circle" :style="{ background: group.weak, color: group.color }">{{ index + 1 }}</span>
<span class="step-name">{{ step.name }}</span>
<span class="step-desc">{{ step.desc }}</span>
<span v-if="index < visibleWorkflow(group).length - 1" class="step-line" :style="{ background: group.weak }"></span>
</li>
</ol>
</section>
<!-- 卡片墙 -->
<div class="card-grid">
<template v-for="tool in group.tools" :key="tool.id">
<a v-if="resolveHref(tool.href)" :href="resolveHref(tool.href)!" class="tool-card">
<div class="tool-card-top">
<ToolIcon :name="tool.id" />
<span v-if="tool.tag" class="tool-tag" :style="{ color: group.color }">{{ tool.tag }}</span>
</div>
<div class="tool-card-name">{{ tool.name }}</div>
<div class="tool-card-desc">{{ tool.desc }}</div>
<div class="tool-card-go">打开工具 →</div>
</a>
<button v-else type="button" class="tool-card tool-card--disabled" @click="onPendingClick(tool)">
<div class="tool-card-top">
<ToolIcon :name="tool.id" />
<span v-if="tool.tag" class="tool-tag" :style="{ color: group.color }">{{ tool.tag }}</span>
</div>
<div class="tool-card-name">{{ tool.name }}</div>
<div class="tool-card-desc">{{ tool.desc }}</div>
<div class="tool-card-go">{{ tool.href ? '仅桌面客户端可用' : '暂未开通' }}</div>
</button>
</template>
</div>
</section>
</main>
<AmazonFooterBar />
<div class="toast" :class="{ show: Boolean(statusText), error: statusType === 'error' }">{{ statusText }}</div>
</div>
</template>
<script setup lang="ts">
import { computed, nextTick, onMounted, ref } from 'vue'
import AmazonTopBar from '@/pages/amazon/components/AmazonTopBar.vue'
import AmazonFooterBar from '@/pages/amazon/components/AmazonFooterBar.vue'
import ToolIcon from '@/pages/amazon/components/ToolIcon.vue'
import { filterGroupsByPermission, filterWorkflowByPermission, TOOL_GROUPS, TOOL_MAP } from '@/pages/amazon/tool-catalog'
import type { ToolInfo, VisibleGroup, WorkflowStep } from '@/pages/amazon/tool-catalog'
import { resolvePageHref } from '@/shared/page-prefix'
import { getCurrentUserAppColumnKeys } from '@/shared/api/permission'
const allowedKeys = ref<string[]>([])
const visibleGroups = ref<VisibleGroup[]>(TOOL_GROUPS.map((group) => ({ ...group, tools: [...group.tools] })))
/** 权限接口异常时为 true:展示全部工具与时间线,避免页面空白 */
const permissionUnavailable = ref(false)
const statusText = ref('')
const statusType = ref<'normal' | 'error'>('normal')
let statusTimer: number | undefined
/** 链接本地化:dev 预览去掉 /new_web_source 前缀;/brand、/web_source/* 等旧静态页仅桌面端存在 */
function resolveHref(rawHref?: string): string {
return resolvePageHref(rawHref)
}
function visibleWorkflow(group: VisibleGroup) {
if (permissionUnavailable.value) return group.workflow ?? []
return group.workflow ? filterWorkflowByPermission(group.workflow, allowedKeys.value) : []
}
function stepHref(toolId?: string) {
if (!toolId) return ''
return resolveHref(TOOL_MAP.get(toolId)?.href ?? '')
}
function onWorkflowStepClick(step: WorkflowStep) {
if (!step.toolId) {
return
}
const target = TOOL_MAP.get(step.toolId)
const href = resolveHref(target?.href ?? '')
if (href) {
window.location.href = href
return
}
showSoon(target?.href ? `${step.name}仅桌面客户端可用` : `${step.name}暂未开通,敬请期待`)
}
function onPendingClick(tool: ToolInfo) {
if (!tool.href) {
showSoon(`${tool.name}暂未开通,敬请期待`)
return
}
showSoon(`${tool.name}仅桌面客户端可用`)
}
function showSoon(name: string) {
statusText.value = `${name}暂未开通,敬请期待`
statusType.value = 'normal'
if (statusTimer) {
window.clearTimeout(statusTimer)
}
statusTimer = window.setTimeout(() => {
statusText.value = ''
}, 2200)
}
function scrollToTools() {
void nextTick(() => {
document.querySelector('.card-grid')?.scrollIntoView({ behavior: 'smooth', block: 'start' })
})
}
function scrollToHashGroup() {
const hash = window.location.hash.replace('#', '')
if (!hash) return
const target = document.getElementById(hash)
if (target) {
void nextTick(() => {
target.scrollIntoView({ behavior: 'smooth', block: 'start' })
})
}
}
onMounted(async () => {
try {
allowedKeys.value = await getCurrentUserAppColumnKeys()
} catch (_error) {
// 权限接口异常时展示全部工具,避免页面空白;正常时按菜单权限过滤
permissionUnavailable.value = true
}
visibleGroups.value = permissionUnavailable.value
? TOOL_GROUPS.map((group) => ({ ...group, tools: [...group.tools] }))
: filterGroupsByPermission(TOOL_GROUPS, allowedKeys.value)
scrollToHashGroup()
})
</script>
<style scoped>
.amazon-console {
display: flex;
flex-direction: column;
min-height: 0;
overflow: hidden;
background: #151a25;
}
.console-body {
flex: 1 1 auto;
min-height: 0;
overflow-y: auto;
overscroll-behavior: contain;
padding: 22px 34px 44px;
background: #151a25;
}
/* ===== Hero ===== */
.hero {
max-width: 1180px;
margin: 0 auto 26px;
border: 1px solid #2e3a52;
border-radius: 16px;
background: linear-gradient(135deg, #1b2233 0%, #151a24 100%);
}
.hero-inner {
display: flex;
gap: 24px;
padding: 26px 28px;
}
.hero-left {
flex: 1 1 auto;
min-width: 0;
}
.hero-pill {
display: inline-block;
padding: 5px 12px;
border-radius: 999px;
background: rgba(45, 212, 191, 0.14);
color: #2dd4bf;
font-size: 11px;
font-weight: 700;
letter-spacing: 0.04em;
}
.hero-title {
margin: 14px 0 0;
color: #f5f8fc;
font-size: 28px;
font-weight: 800;
line-height: 1.3;
}
.hero-sub {
max-width: 620px;
margin: 10px 0 0;
color: #a0acbe;
font-size: 12px;
line-height: 1.7;
}
.hero-stats {
display: flex;
gap: 44px;
margin-top: 22px;
}
.stat strong {
display: block;
font-size: 22px;
font-weight: 800;
line-height: 1.2;
}
.stat span {
display: block;
margin-top: 3px;
color: #5e6878;
font-size: 10px;
}
/* Hero 右侧工作台卡 */
.hero-card {
width: 300px;
flex-shrink: 0;
padding: 18px 20px;
border: 1px solid #2e3a52;
border-radius: 12px;
background: #202a3e;
}
.hero-card-head {
display: flex;
align-items: center;
gap: 12px;
}
.hero-card-dots {
display: flex;
align-items: center;
}
.dot {
width: 10px;
height: 10px;
border-radius: 50%;
}
.dot--teal {
background: #2dd4bf;
}
.dot--blue {
background: #60a5fa;
margin-left: 6px;
}
.dot--brand {
background: #f59e0b;
margin-left: 6px;
}
.dots-line {
display: block;
width: 42px;
height: 2px;
margin-top: 14px;
background: #3e4a62;
}
.hero-card-caption {
color: #5e6878;
font-size: 10px;
}
.hero-card-title {
margin: 16px 0 0;
color: #f5f8fc;
font-size: 17px;
font-weight: 800;
line-height: 1.6;
}
.hero-card-divider {
height: 1px;
margin: 14px 0;
background: #3e4a62;
}
.hero-card-sub {
margin: 0;
color: #a0acbe;
font-size: 11px;
line-height: 1.7;
}
.hero-card-btn {
margin-top: 14px;
padding: 9px 22px;
border: 0;
border-radius: 8px;
background: #f59e0b;
color: #fff;
font: inherit;
font-size: 13px;
font-weight: 700;
cursor: pointer;
transition: background 0.18s ease;
}
.hero-card-btn:hover {
background: #f7b13c;
}
/* ===== 工具分组 ===== */
.tool-group {
max-width: 1180px;
margin: 0 auto 34px;
}
.group-head {
display: flex;
align-items: center;
gap: 10px;
margin: 0 0 14px;
}
.group-dot {
width: 10px;
height: 10px;
border-radius: 2px;
}
.group-name {
color: #f5f8fc;
font-size: 17px;
font-weight: 800;
}
.group-desc {
color: #5e6878;
font-size: 11px;
}
.group-count {
margin-left: auto;
color: #5e6878;
font-size: 11px;
}
/* ===== 工作流时间线 ===== */
.workflow-panel {
margin-bottom: 18px;
padding: 16px 22px 20px;
border: 1px solid #2e3a52;
border-radius: 12px;
background: #1c2333;
}
.workflow-head {
display: flex;
align-items: center;
gap: 12px;
}
.workflow-title {
color: #f5f8fc;
font-size: 14px;
font-weight: 700;
}
.workflow-badge {
padding: 3px 10px;
border-radius: 999px;
background: rgba(245, 158, 11, 0.14);
font-size: 10px;
font-weight: 700;
}
.workflow-hint {
margin-left: auto;
color: #5e6878;
font-size: 10px;
}
.workflow-steps {
display: flex;
align-items: flex-start;
margin: 16px 0 0;
padding: 0;
list-style: none;
}
.workflow-step {
display: flex;
flex-direction: column;
align-items: center;
min-width: 0;
cursor: pointer;
}
.workflow-step--disabled {
cursor: default;
opacity: 0.7;
}
.step-circle {
display: flex;
align-items: center;
justify-content: center;
width: 32px;
height: 32px;
border-radius: 50%;
font-size: 12px;
font-weight: 800;
}
.step-name {
margin-top: 8px;
color: #c8d2e2;
font-size: 11px;
font-weight: 700;
text-align: center;
}
.step-desc {
margin-top: 2px;
color: #5e6878;
font-size: 9px;
text-align: center;
}
.step-line {
flex: 1 1 auto;
min-width: 12px;
height: 2px;
margin-top: 15px;
align-self: flex-start;
}
/* ===== 卡片墙 ===== */
.card-grid {
display: grid;
grid-template-columns: repeat(4, minmax(0, 1fr));
gap: 12px;
}
.tool-card {
display: flex;
flex-direction: column;
min-width: 0;
padding: 16px 18px 14px;
border: 2px solid #2e3a52;
border-radius: 12px;
background: #1c2333;
text-align: left;
text-decoration: none;
font: inherit;
cursor: pointer;
transition: border-color 0.18s ease, background 0.18s ease;
}
.tool-card:hover {
border-color: #2dd4bf;
background: #262f42;
}
.tool-card-top {
display: flex;
align-items: flex-start;
justify-content: space-between;
gap: 8px;
}
.tool-tag {
padding: 3px 9px;
border-radius: 999px;
background: rgba(255, 255, 255, 0.06);
font-size: 9px;
font-weight: 700;
white-space: nowrap;
}
.tool-card-name {
margin-top: 12px;
color: #f5f8fc;
font-size: 15px;
font-weight: 700;
}
.tool-card-desc {
margin-top: 6px;
color: #5e6878;
font-size: 11px;
line-height: 1.6;
}
.tool-card-go {
margin-top: 14px;
color: #5e6878;
font-size: 11px;
transition: color 0.18s ease;
}
.tool-card:hover .tool-card-go {
color: #2dd4bf;
font-weight: 700;
}
.tool-card--disabled {
cursor: default;
opacity: 0.55;
}
.tool-card--disabled:hover {
border-color: #2e3a52;
background: #1c2333;
}
.tool-card--disabled:hover .tool-card-go {
color: #5e6878;
font-weight: 400;
}
/* ===== toast ===== */
.toast {
position: fixed;
bottom: 40px;
left: 50%;
z-index: 1000;
padding: 12px 24px;
max-width: min(420px, calc(100vw - 48px));
border-radius: 8px;
background: rgba(0, 0, 0, 0.75);
color: #fff;
font-size: 14px;
text-align: center;
opacity: 0;
pointer-events: none;
transform: translateX(-50%);
transition: opacity 0.3s;
}
.toast.show {
opacity: 1;
}
.toast.error {
background: rgba(176, 42, 55, 0.92);
}
@media (max-width: 1100px) {
.card-grid {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
.hero-inner {
flex-direction: column;
}
.hero-card {
width: 100%;
}
.console-body {
padding: 18px 20px 36px;
}
}
</style>
@@ -0,0 +1,85 @@
<template>
<footer class="amazon-footer">
<div class="amazon-footer__gradient"></div>
<div class="amazon-footer__inner">
<a class="bug-banner" href="https://bug.aishufu.top/bug-tracker/" target="_blank" rel="noopener">
<span class="bug-banner__title">数富AI-BUG登记系统</span>
<span class="bug-banner__url">bug.aishufu.top/bug-tracker/</span>
</a>
<span class="amazon-footer__status">前端 · 运营 · 后勤 三线 20 工具,一眼看清用途</span>
</div>
</footer>
</template>
<style scoped>
.amazon-footer {
flex: 0 0 auto;
background: #151a25;
}
.amazon-footer__gradient {
height: 4px;
background: linear-gradient(90deg, #2dd4bf 0%, #60a5fa 55%, #a78bfa 72%, #f59e0b 87%, #f59e0b 100%);
}
.amazon-footer__inner {
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
padding: 8px 12px;
}
.bug-banner {
flex: 1;
min-width: 0;
display: flex;
align-items: center;
gap: 48px;
padding: 9px 24px;
border: 1px solid #2dd4bf;
border-radius: 8px;
background: #1e293b;
text-decoration: none;
transition: background 0.18s ease, border-color 0.18s ease;
}
.bug-banner:hover {
background: #0f172a;
border-color: #60a5fa;
}
.bug-banner__title {
color: #2dd4bf;
font-size: 13px;
font-weight: 800;
white-space: nowrap;
}
.bug-banner__url {
min-width: 0;
overflow: hidden;
color: #94a3b8;
font-size: 11px;
text-overflow: ellipsis;
white-space: nowrap;
}
.amazon-footer__status {
flex-shrink: 0;
color: #c8d2e2;
font-size: 12px;
white-space: nowrap;
}
@media (max-width: 900px) {
.bug-banner {
gap: 12px;
padding: 8px 14px;
}
.amazon-footer__status {
display: none;
}
}
</style>
@@ -0,0 +1,112 @@
<template>
<div class="amazon-tool-shell">
<AmazonTopBar :active-cat="groupKey" />
<div class="tool-head">
<a class="tool-head__back" :href="backHref">← 返回{{ group ? group.name : '工具' }}列表</a>
<span class="tool-head__sep"></span>
<span class="tool-head__title">{{ tool?.name ?? '' }}</span>
<span class="tool-head__desc">{{ detailText }}</span>
</div>
<div class="tool-shell-body">
<slot />
</div>
<AmazonFooterBar />
</div>
</template>
<script setup lang="ts">
import { computed } from 'vue'
import AmazonTopBar from '@/pages/amazon/components/AmazonTopBar.vue'
import AmazonFooterBar from '@/pages/amazon/components/AmazonFooterBar.vue'
import { TOOL_DETAILS, TOOL_GROUPS, TOOL_MAP } from '@/pages/amazon/tool-catalog'
import { resolvePageHref } from '@/shared/page-prefix'
const props = defineProps<{
/** 工具 id(见 tool-catalog TOOL_MAP) */
toolId: string
}>()
const tool = computed(() => TOOL_MAP.get(props.toolId))
const group = computed(() => TOOL_GROUPS.find((g) => g.tools.some((t) => t.id === props.toolId)))
const groupKey = computed(() => group.value?.key ?? 'front')
const detailText = computed(() => {
if (!tool.value) return ''
return TOOL_DETAILS[tool.value.id] ?? tool.value.desc
})
/** 返回工具台列表对应分组(带锚点) */
const backHref = computed(() => `${resolvePageHref('/new_web_source/amazon-console.html')}#group-${groupKey.value}`)
</script>
<style scoped>
.amazon-tool-shell {
display: flex;
flex-direction: column;
flex: 1 1 auto;
min-height: 0;
}
.tool-head {
flex: 0 0 auto;
display: flex;
align-items: center;
gap: 14px;
min-height: 62px;
padding: 10px 34px;
background: #151a25;
border-bottom: 1px solid #2a3344;
}
.tool-head__back {
flex-shrink: 0;
color: #c8d2e2;
font-size: 13px;
text-decoration: none;
white-space: nowrap;
}
.tool-head__back:hover {
color: #fff;
}
.tool-head__sep {
flex-shrink: 0;
width: 1px;
height: 18px;
background: #3e4a62;
}
.tool-head__title {
flex-shrink: 0;
color: #f5f8fc;
font-size: 20px;
font-weight: 800;
white-space: nowrap;
}
.tool-head__desc {
min-width: 0;
overflow: hidden;
color: #a0acbe;
font-size: 12px;
text-overflow: ellipsis;
white-space: nowrap;
}
.tool-shell-body {
flex: 1 1 auto;
min-height: 0;
overflow: hidden;
}
@media (max-width: 1100px) {
.tool-head {
padding: 10px 16px;
flex-wrap: wrap;
gap: 8px;
}
}
</style>
@@ -0,0 +1,249 @@
<template>
<header class="amazon-top">
<div class="brand">
<span class="brand-logo">富</span>
<div class="brand-text">
<span class="brand-name">数富AI</span>
<span class="brand-sub">亚马逊运营工具台</span>
</div>
</div>
<nav class="cat-tabs" aria-label="分类导航">
<template v-for="cat in visibleCats" :key="cat.key">
<a
class="cat-tab"
:class="{ 'cat-tab--active': cat.key === activeCat }"
:href="`${toolbarHref}#group-${cat.key}`"
>
<span class="cat-dot" :style="{ background: cat.color }"></span>
<span class="cat-name">{{ cat.name }}</span>
<span class="cat-badge" :style="badgeStyle(cat)">{{ cat.tools.length }}</span>
<span class="cat-underline" :style="{ background: cat.color }"></span>
</a>
</template>
</nav>
<div class="top-right">
<a href="/home" class="btn-home">返回首页</a>
<BrandApiSecretSettingsButton />
<span class="help-mark" title="帮助">?</span>
</div>
</header>
</template>
<script setup lang="ts">
import { computed, onMounted, ref } from 'vue'
import BrandApiSecretSettingsButton from '@/pages/brand/components/BrandApiSecretSettingsButton.vue'
import { filterGroupsByPermission, TOOL_GROUPS } from '@/pages/amazon/tool-catalog'
import type { VisibleGroup } from '@/pages/amazon/tool-catalog'
import { resolvePageHref } from '@/shared/page-prefix'
import { getCurrentUserAppColumnKeys } from '@/shared/api/permission'
const props = withDefaults(
defineProps<{
/** 当前工具所属分类(功能页高亮对应 tab;工具台首页不传) */
activeCat?: 'front' | 'ops' | 'logi'
}>(),
{
activeCat: undefined,
},
)
const activeCat = computed(() => props.activeCat)
const visibleCats = ref<VisibleGroup[]>(TOOL_GROUPS.map((group) => ({ ...group, tools: [...group.tools] })))
/** 分类 tab 点击回到工具台对应分组 */
const toolbarHref = resolvePageHref('/new_web_source/amazon-console.html')
function badgeStyle(cat: VisibleGroup) {
return activeCat.value === cat.key ? { background: cat.color } : {}
}
onMounted(async () => {
try {
const keys = await getCurrentUserAppColumnKeys()
visibleCats.value = filterGroupsByPermission(TOOL_GROUPS, keys)
} catch (_error) {
// 权限接口异常时展示全部分类,避免顶栏空白
visibleCats.value = TOOL_GROUPS.map((group) => ({ ...group, tools: [...group.tools] }))
}
})
</script>
<style scoped>
.amazon-top {
flex: 0 0 auto;
min-height: 64px;
display: flex;
align-items: center;
justify-content: space-between;
gap: 20px;
padding: 0 24px;
background: #151a25;
border-bottom: 1px solid #2a3344;
}
.brand {
display: flex;
align-items: center;
gap: 12px;
flex-shrink: 0;
}
.brand-logo {
display: flex;
align-items: center;
justify-content: center;
width: 38px;
height: 38px;
border-radius: 9px;
background: #f59e0b;
color: #fff;
font-size: 15px;
font-weight: 800;
}
.brand-text {
display: flex;
flex-direction: column;
line-height: 1.35;
}
.brand-name {
color: #f5f8fc;
font-size: 16px;
font-weight: 800;
letter-spacing: 0.02em;
white-space: nowrap;
}
.brand-sub {
color: #5e6878;
font-size: 10px;
white-space: nowrap;
}
.cat-tabs {
flex: 1;
min-width: 0;
display: flex;
align-items: center;
justify-content: center;
gap: 6px;
}
.cat-tab {
position: relative;
display: inline-flex;
align-items: center;
gap: 8px;
min-width: 132px;
height: 38px;
padding: 0 14px;
border-radius: 10px;
background: transparent;
color: #c8d2e2;
font-size: 13px;
font-weight: 700;
text-decoration: none;
transition: background 0.18s ease, color 0.18s ease;
}
.cat-tab:hover {
background: #232a3b;
color: #f5f8fc;
}
.cat-tab--active {
background: #3d4a63;
color: #f5f8fc;
}
.cat-dot {
width: 8px;
height: 8px;
border-radius: 50%;
flex-shrink: 0;
}
.cat-badge {
display: inline-flex;
align-items: center;
justify-content: center;
min-width: 22px;
height: 18px;
padding: 0 4px;
border-radius: 999px;
background: #2b3447;
color: #5e6878;
font-size: 10px;
font-weight: 800;
}
.cat-tab--active .cat-badge {
color: #fff;
}
.cat-underline {
position: absolute;
left: 10px;
right: 10px;
bottom: -4px;
height: 3px;
border-radius: 2px;
background: transparent;
opacity: 0;
}
.cat-tab--active .cat-underline {
opacity: 1;
}
.top-right {
display: flex;
align-items: center;
gap: 14px;
flex-shrink: 0;
}
.btn-home {
color: #a0acbe;
font-size: 13px;
text-decoration: none;
white-space: nowrap;
}
.btn-home:hover {
color: #fff;
}
.help-mark {
display: inline-flex;
align-items: center;
justify-content: center;
width: 22px;
height: 22px;
border-radius: 50%;
background: #232a3b;
color: #a0acbe;
font-size: 13px;
font-weight: 800;
cursor: help;
}
@media (max-width: 1100px) {
.amazon-top {
flex-wrap: wrap;
height: auto;
padding: 10px 16px;
}
.cat-tabs {
order: 3;
width: 100%;
justify-content: flex-start;
overflow-x: auto;
}
}
</style>
@@ -0,0 +1,59 @@
<template>
<span class="tool-icon" :style="{ background: gradient }" aria-hidden="true">
<svg viewBox="0 0 48 48" fill="none" stroke="#fff" stroke-width="3" stroke-linecap="butt" stroke-linejoin="miter" v-html="shape"></svg>
</span>
</template>
<script setup lang="ts">
import { computed } from 'vue'
import { TOOL_ICON_GRADIENTS, TOOL_ICON_SHAPES } from '@/pages/amazon/tool-catalog'
const props = withDefaults(
defineProps<{
name: string
size?: number
}>(),
{
size: 48,
},
)
const gradient = computed(() => TOOL_ICON_GRADIENTS[props.name] ?? TOOL_ICON_GRADIENTS.collect)
const shape = computed(() => TOOL_ICON_SHAPES[props.name] ?? TOOL_ICON_SHAPES.collect)
</script>
<style scoped>
.tool-icon {
display: inline-flex;
align-items: center;
justify-content: center;
width: 48px;
height: 48px;
flex-shrink: 0;
border-radius: 10px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.35);
}
.tool-icon svg {
width: 40px;
height: 40px;
}
.tool-icon :deep(path:not(.fill)),
.tool-icon :deep(rect),
.tool-icon :deep(circle:not(.fill)),
.tool-icon :deep(ellipse),
.tool-icon :deep(line) {
fill: none;
stroke: #fff;
stroke-width: 3;
stroke-linecap: butt;
stroke-linejoin: miter;
}
.tool-icon :deep(.fill) {
fill: #fff;
stroke: none;
}
</style>
@@ -0,0 +1,392 @@
/**
* 亚马逊运营工具台 · 工具目录
*
* 来源:reference/数富AI工具台_含源代码/数富AI工具台_主程序.py 的 CATS 数据,
* 页面链接按现有 BrandTopBar 导航映射到既有功能页(表单 + 右侧任务全部保留现有)。
*/
export type ToolInfo = {
/** 工具 id(与参考桌面板一致) */
id: string
/** 工具名称 */
name: string
/** 卡片一句话描述 */
desc: string
/** 角标文字(如 流程·1 / 重点 / 核心),无则不显示 */
tag?: string
/** 是否核心工具(角标走核心样式) */
core?: boolean
/** 现有功能页面地址;未提供表示暂未开通 */
href?: string
/** 菜单权限键(小写),与 BrandTopBar 导航一致 */
permissionKeys: string[]
}
export type WorkflowStep = {
name: string
desc: string
/** 指向的工具 id,用于点击跳转 */
toolId?: string
}
export type ToolGroup = {
key: 'front' | 'ops' | 'logi'
/** 菜单权限组键(与 BrandTopBar 一致) */
columnKey: string
name: string
desc: string
/** 分类主色 */
color: string
/** 分类弱色(角标底、编号圆底) */
weak: string
tools: ToolInfo[]
/** 标准工作流时间线(后勤无) */
workflowTitle?: string
workflowBadge?: string
workflowHint?: string
workflow?: WorkflowStep[]
}
/** 现有功能页地址(全部为 new_web_source 的 Vue 构建页) */
const VM = '/new_web_source'
export const TOOL_GROUPS: ReadonlyArray<ToolGroup> = [
{
key: 'front',
columnKey: 'brand_front_tools',
name: '前端工具',
desc: '采集 · 清洗 · 查品,产出安全可上架的数据',
color: '#2DD4BF',
weak: '#0F2E28',
workflowTitle: '前端工具 · 标准工作流',
workflowBadge: '产出完整安全数据',
workflowHint: '8步工作流 · 从采集到上架,一步不缺',
workflow: [
{ name: '采集数据', desc: '站点批量采集', toolId: 'collect' },
{ name: 'ASIN变体采集', desc: '按ASIN拉变体', toolId: 'variant' },
{ name: '数据去重', desc: '谁先采集归谁', toolId: 'dedupe' },
{ name: '货源查询·第一遍', desc: '粗略不扣费', toolId: 'source' },
{ name: '品牌检测', desc: '精确+嵌入', toolId: 'brand' },
{ name: '外观专利检测', desc: '规避专利风险', toolId: 'patent' },
{ name: '货源查询·第二遍', desc: '精细扣费', toolId: 'source' },
{ name: '上传后台', desc: '可上架数据', toolId: 'convert' },
],
tools: [
{
id: 'collect',
name: '采集数据',
desc: '批量采集站点商品数据,按照自己要求数据',
tag: '流程·1',
href: `${VM}/collect-data.html`,
permissionKeys: ['collect-data'],
},
{
id: 'variant',
name: 'ASIN变体采集',
desc: '支持粘贴和文档,按照采集国家选择导出',
tag: '流程·2',
href: `${VM}/variant-collection.html`,
permissionKeys: ['variant-collection'],
},
{
id: 'dedupe',
name: '数据去重',
desc: '全站唯一 ASIN 归属:谁先采集归谁,自动过滤撞款',
tag: '重点',
core: true,
href: `${VM}/dedupe.html`,
permissionKeys: ['dedupe'],
},
{
id: 'source',
name: '货源查询',
desc: '关闭图片检查和类目检测不扣费,打开需要算力费用',
tag: '流程·4',
href: `${VM}/similar-asin.html`,
permissionKeys: ['similar-asin'],
},
{
id: 'brand',
name: '品牌检测',
desc: '核查上架数据品牌风险,精确 / 嵌入两种策略',
tag: '流程·5',
href: `${VM}/brand.html`,
permissionKeys: ['brand'],
},
{
id: 'patent',
name: '外观专利检测',
desc: '检测商品外观专利,版权,标题,图片。详细页风险,规避下架',
tag: '流程·6',
href: `${VM}/appearance-patent.html`,
permissionKeys: ['appearance-patent'],
},
{
id: 'split',
name: '数据拆分',
desc: '大文件按规则拆分,便于分批处理与上传',
href: `${VM}/split.html`,
permissionKeys: ['split'],
},
{
id: 'convert',
name: '格式转换',
desc: '数据格式一键转换,适配各工具导入',
href: `${VM}/convert.html`,
permissionKeys: ['convert'],
},
],
},
{
key: 'ops',
columnKey: 'brand_operation_tools',
name: '运营工具',
desc: '上架 · 跟价 · 查品 · 巡店,日常店铺运营与维护',
color: '#60A5FA',
weak: '#12243D',
workflowTitle: '运营工具 · 标准工作流',
workflowBadge: '日常运营与维护',
workflowHint: '10步工作流 · 从上架到复盘,环环相扣',
workflow: [
{ name: '上架', desc: '安全数据批量上架', toolId: 'list' },
{ name: '指定删除ASIN', desc: '批量清理无效ASIN', toolId: 'delasin' },
{ name: '商品风险解决', desc: '4类风险一键处理', toolId: 'risk' },
{ name: '定时匹配', desc: '定时价格匹配', toolId: 'time' },
{ name: '跟价', desc: '跟价规则配置', toolId: 'follow' },
{ name: '巡店删除', desc: '巡检店铺状态', toolId: 'patrol' },
{ name: '查询ASIN', desc: '排查ASIN在售状态', toolId: 'qasin' },
{ name: '店铺数据抓取', desc: '抓取运营数据', toolId: 'scrape' },
{ name: '取款', desc: '留足平台扣款费用', toolId: 'cash' },
{ name: '店铺状态查询', desc: '查询店铺账号状态', toolId: 'shop' },
],
tools: [
{
id: 'list',
name: '上架',
desc: '把安全数据批量上架到指定店铺',
href: `${VM}/publish.html`,
permissionKeys: ['publish'],
},
{
id: 'delasin',
name: '指定删除ASIN',
desc: '批量删除需清理的 ASIN(风险 / 优化 / 邮箱汇总)',
href: `${VM}/delete-brand.html`,
permissionKeys: ['delete-brand'],
},
{
id: 'risk',
name: '商品风险解决',
desc: '4 类风险一键处理:禁止显示 / 需要批准 / 详情已删 / 账户状态',
tag: '高频',
core: true,
href: `${VM}/product-risk.html`,
permissionKeys: ['product-risk'],
},
{
id: 'time',
name: '定时匹配',
desc: '定时价格匹配,更快更及时抢回购物车',
href: `${VM}/shop-match.html`,
permissionKeys: ['shop-match'],
},
{
id: 'follow',
name: '跟价',
desc: '核心工具 · 时时跟价抢购物车,支持指定 ASIN 快速跟价',
tag: '核心',
core: true,
href: `${VM}/price-track.html`,
permissionKeys: ['pricing', 'price-track'],
},
{
id: 'patrol',
name: '巡店删除',
desc: '按商品状态巡店清理,摸清店铺商品全貌',
href: `${VM}/patrol-delete.html`,
permissionKeys: ['patrol-delete'],
},
{
id: 'qasin',
name: '查询ASIN',
desc: '排查出单 ASIN 是否仍在售,保住优质数据',
href: `${VM}/query-asin.html`,
permissionKeys: ['query-asin'],
},
{
id: 'scrape',
name: '店铺数据抓取',
desc: '核心 · 抓取店铺排名 / 品牌 / 销售,支撑复查与优化',
tag: '核心',
core: true,
href: `${VM}/shop-data-crawl.html`,
permissionKeys: ['shop-data-crawl', 'shop_data_crawl'],
},
{
id: 'cash',
name: '取款',
desc: '留足平台扣款费用,其余全部提现',
href: `${VM}/withdraw.html`,
permissionKeys: ['withdraw'],
},
{
id: 'shop',
name: '店铺状态查询',
desc: '查询店铺账号当前状态,及时发现异常',
permissionKeys: ['shop-status', 'shop'],
},
],
},
{
key: 'logi',
columnKey: 'brand_logistics_tools',
name: '后勤工具',
desc: '采购 · ERP,供应链与系统对接',
color: '#A78BFA',
weak: '#221E38',
tools: [
{
id: 'purchase',
name: '采购',
desc: '供应链采购与订单管理',
permissionKeys: ['purchase'],
},
{
id: 'erp',
name: 'ERP',
desc: '对接 ERP 系统,同步库存与订单',
permissionKeys: ['erp'],
},
],
},
]
/** 图标渐变背景(照 icons.py ICON_COLORS 转 CSS) */
export const TOOL_ICON_GRADIENTS: Record<string, string> = {
collect: 'linear-gradient(180deg, #5EEAD4, #14B8A6)',
variant: 'linear-gradient(180deg, #93C5FD, #3B82F6)',
dedupe: 'linear-gradient(180deg, #C4B5FD, #8B5CF6)',
source: 'linear-gradient(180deg, #F9A8D4, #EC4899)',
brand: 'linear-gradient(180deg, #FDBA74, #F97316)',
patent: 'linear-gradient(180deg, #FDE047, #EAB308)',
split: 'linear-gradient(180deg, #86EFAC, #22C55E)',
convert: 'linear-gradient(180deg, #FCA5A5, #EF4444)',
list: 'linear-gradient(180deg, #5EEAD4, #14B8A6)',
delasin: 'linear-gradient(180deg, #93C5FD, #3B82F6)',
risk: 'linear-gradient(180deg, #C4B5FD, #8B5CF6)',
time: 'linear-gradient(180deg, #F9A8D4, #EC4899)',
follow: 'linear-gradient(180deg, #FDBA74, #F97316)',
patrol: 'linear-gradient(180deg, #FDE047, #EAB308)',
qasin: 'linear-gradient(180deg, #86EFAC, #22C55E)',
scrape: 'linear-gradient(180deg, #FCA5A5, #EF4444)',
cash: 'linear-gradient(180deg, #5EEAD4, #14B8A6)',
shop: 'linear-gradient(180deg, #93C5FD, #3B82F6)',
purchase: 'linear-gradient(180deg, #C4B5FD, #8B5CF6)',
erp: 'linear-gradient(180deg, #F9A8D4, #EC4899)',
}
/**
* 图标白色图形(48x48,照 icons.py 各 icon_* 坐标转 SVG 路径)
* 默认描边 stroke:#fff width:3(方头 butt),实心填充 shape 用 .fill 标记
*/
export const TOOL_ICON_SHAPES: Record<string, string> = {
// 采集数据:圆角方框+向下箭头
collect: '<rect x="10" y="8" width="28" height="24"/><line x1="24" y1="14" x2="24" y2="36"/><path class="fill" d="M19 33 L29 33 L24 38 Z"/>',
// ASIN变体采集:两个重叠方框
variant: '<rect x="8" y="10" width="20" height="20"/><rect x="20" y="18" width="20" height="20"/>',
// 数据去重:左右双向箭头
dedupe: '<line x1="10" y1="24" x2="38" y2="24"/><path class="fill" d="M15 19 L15 29 L10 24 Z"/><path class="fill" d="M33 19 L33 29 L38 24 Z"/>',
// 货源查询:地球(圆+经纬线)
source: '<circle cx="24" cy="24" r="14"/><line x1="24" y1="10" x2="24" y2="38"/><line x1="10" y1="24" x2="38" y2="24"/><path d="M24 38 A 10 14 0 0 1 24 10"/><path d="M24 10 A 10 14 0 0 1 24 38"/>',
// 品牌检测:盾牌+对勾
brand: '<path d="M14 10 L34 10 L34 28 L24 38 L14 28 Z"/><path d="M19 22 L23 25 L29 17"/>',
// 外观专利检测:灯泡+对勾
patent: '<circle cx="24" cy="20" r="12"/><rect x="18" y="32" width="12" height="6"/><path d="M19 20 L23 23 L29 15"/>',
// 数据拆分:Y形分叉箭头
split: '<line x1="24" y1="12" x2="24" y2="24"/><line x1="24" y1="24" x2="14" y2="36"/><line x1="24" y1="24" x2="34" y2="36"/><path class="fill" d="M10 32 L18 32 L14 36 Z"/><path class="fill" d="M30 32 L38 32 L34 36 Z"/>',
// 格式转换:循环箭头
convert: '<path d="M11.88 31 A 14 14 0 0 1 36.12 17"/><path d="M36.12 17 A 14 14 0 0 1 11.88 31"/><path class="fill" d="M32 18 L40 18 L36 14 Z"/><path class="fill" d="M8 30 L16 30 L12 34 Z"/>',
// 上架:方框+向上箭头
list: '<rect x="10" y="16" width="28" height="24"/><line x1="24" y1="34" x2="24" y2="12"/><path class="fill" d="M19 15 L29 15 L24 10 Z"/>',
// 删除ASIN:垃圾桶
delasin: '<rect x="10" y="10" width="28" height="6"/><path d="M13 18 L35 18 L33 40 L15 40 Z"/><line x1="20" y1="22" x2="20" y2="36"/><line x1="28" y1="22" x2="28" y2="36"/>',
// 商品风险解决:三角+感叹号
risk: '<path d="M24 8 L40 38 L8 38 Z"/><line x1="24" y1="18" x2="24" y2="28" stroke-width="3"/><circle class="fill" cx="24" cy="33" r="2"/>',
// 定时匹配:时钟
time: '<circle cx="24" cy="24" r="16"/><line x1="24" y1="14" x2="24" y2="24"/><line x1="24" y1="24" x2="32" y2="28"/>',
// 跟价:标签
follow: '<path d="M10 12 L32 12 L40 24 L32 36 L10 36 Z"/><circle cx="32" cy="23" r="2" stroke-width="2"/>',
// 巡店删除:眼睛
patrol: '<ellipse cx="24" cy="24" rx="16" ry="8"/><circle class="fill" cx="24" cy="24" r="4"/>',
// 查询ASIN:放大镜
qasin: '<circle cx="20" cy="20" r="12"/><line x1="28" y1="28" x2="40" y2="40" stroke-width="4"/>',
// 店铺数据抓取:立方体
scrape: '<path d="M24 8 L40 16 L24 24 L8 16 Z"/><path d="M8 16 L24 24 L24 40 L8 32 Z"/><path d="M40 16 L24 24 L24 40 L40 32 Z"/>',
// 取款:钱包
cash: '<rect x="8" y="14" width="32" height="22"/><rect x="8" y="10" width="20" height="8"/><circle class="fill" cx="35" cy="25" r="3"/>',
// 店铺状态查询:店铺
shop: '<path d="M8 20 L24 8 L40 20 Z"/><rect x="10" y="20" width="28" height="20"/><rect x="20" y="26" width="8" height="14"/>',
// 采购:购物车
purchase: '<path d="M10 14 L34 14 L30 34 L14 34 Z"/><line x1="34" y1="14" x2="40" y2="14"/><line x1="40" y1="14" x2="38" y2="20"/><circle class="fill" cx="19" cy="39" r="3"/><circle class="fill" cx="33" cy="39" r="3"/>',
// ERP:网格
erp: '<rect x="8" y="8" width="32" height="32"/><line x1="24" y1="8" x2="24" y2="40"/><line x1="8" y1="24" x2="40" y2="24"/>',
}
export const TOOL_MAP: ReadonlyMap<string, ToolInfo> = new Map(
TOOL_GROUPS.flatMap((group) => group.tools.map((tool) => [tool.id, tool] as const)),
)
/**
* 工具页页头长描述(参考桌面板 detail_desc,优先于卡片 desc 显示)
*/
export const TOOL_DETAILS: Readonly<Record<string, string>> = {
collect: '默认勾选有排名和FBM这两个选择',
dedupe: '去重之后,切记一定上传到数富后台去重数据库',
brand: '核查上架数据品牌风险,先跑精确匹配,后跑嵌入式',
delasin: '收集统一要删除的ASIN,批量删除清理',
risk:
'A 搜索结果中禁止显示;B 需要批准(最通用、使用频率最高);C 详情页面已删除;D 账户状态处理(需审批时用后台处理)。',
follow:
'一个虚拟桌面跟一个国家,错开跑即可时时跟价抢购物车。指定 ASIN 文档跟价:用后台有利润数据快速跟价,下班前跑一下,确保出单数据及时是我们的购物车。',
patrol: '巡店删除是按商品状态删除,如审核多次不通过的商品。不放任何状态跑一遍,可清楚掌握店铺数据情况。',
qasin: '通过店小蜜导出出单 ASIN,上传后台,时不时排查是否还在店铺售卖,确保优质数据时刻在店。',
scrape:
'没排名、久未出单数据可优化删除;获取店铺所有数据的排名、品牌和销售情况。半个月到一个月复查一次品牌,确保数据没有被注册。',
}
export type VisibleGroup = ToolGroup & { tools: ToolInfo[] }
/**
* 按菜单权限过滤分组(逻辑与 BrandTopBar.visibleNavGroups 一致):
* 组键(brand_front_tools 等)命中则整组展示;否则只展示有权限的工具;
* 无任何可见工具的分组整体隐藏。
*/
export function filterGroupsByPermission(
groups: ReadonlyArray<ToolGroup>,
allowedKeys: ReadonlyArray<string>,
): VisibleGroup[] {
const allowedSet = new Set(allowedKeys.map((key) => String(key || '').trim().toLowerCase()).filter(Boolean))
return groups.flatMap((group) => {
if (allowedSet.has(group.columnKey)) {
return [{ ...group, tools: [...group.tools] }]
}
const tools = group.tools.filter((tool) =>
tool.permissionKeys.some((key) => allowedSet.has(key.toLowerCase())),
)
return tools.length ? [{ ...group, tools }] : []
})
}
/** 从工作流时间线中截取有权限的步骤(与分组逻辑共用权限集合) */
export function filterWorkflowByPermission(
steps: ReadonlyArray<WorkflowStep>,
allowedKeys: ReadonlyArray<string>,
): WorkflowStep[] {
const allowedSet = new Set(allowedKeys.map((key) => String(key || '').trim().toLowerCase()).filter(Boolean))
return steps.filter((step) => {
if (!step.toolId) return true
const tool = TOOL_MAP.get(step.toolId)
if (!tool) return true
return tool.permissionKeys.some((key) => allowedSet.has(key.toLowerCase()))
})
}