Files
crawler-plugin/frontend-vue/src/pages/amazon/components/AmazonToolPageShell.vue
T
huangzd1997 208583e14c feat(common-tools): 工具台新增常用工具分类,三个桌面工具网页化
- tool-catalog 最前插入「常用工具」组(brand_common_tools,23 工具·4 大分类),
  三工具各自权限键:pricing-calc / five-asin / keyword-share
- /pricing-calc:站点(英 GBP÷9、德法 EUR÷8)+ 买货价/运费 → 营业额/利润/
  利润率/换算汇率,公式与精度照抄桌面版,纯函数 node --test 钉住
- /five-asin:五国常量 + ASIN 10 位校验 → 亚马逊商品链接,window.open 与
  :href 出口全部过 safeHttpUrl(url-outlet 棘轮),邮编一键复制
- /keyword-share:筛选/四级类目级联/统计卡/表格分页 200/标记与取消使用/
  添加/删除/随机抽词/共享记录,对接 keywordshare 后端九端点
- 顶栏与 BrandTopBar 导航同步;router 注册三路由;补 test:mount 脚本
  (vitest mount 套件入口,与后管同口径)
2026-10-23 21:56:56 +08:00

155 lines
4.0 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<template>
<div class="amazon-tool-shell">
<AmazonTopBar :active-cat="groupKey" />
<div class="tool-head">
<router-link class="tool-head__back" :to="backHref">← 返回{{ group ? group.name : '工具' }}列表</router-link>
<span class="tool-head__title">{{ tool?.name ?? '' }}</span>
<span class="tool-head__desc">{{ detailText }}</span>
<a
v-if="tool?.id === 'source'"
class="tool-head__aliprice"
:href="ALIPRICE_URL"
target="_blank"
rel="noopener"
>Aliprice点击注册</a>
</div>
<!-- 工具说明提示卡已按需求移除(原棕色底 note 卡区域) -->
<div class="tool-shell-body">
<slot />
</div>
<AmazonFooterBar />
<!-- 下载进度面板:工具页统一下载进度展示(位置 fixed,挂在外壳即可覆盖所有工具页) -->
<DownloadProgressPanel />
</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 DownloadProgressPanel from '@/shared/components/DownloadProgressPanel.vue'
import { TOOL_DETAILS, TOOL_GROUPS, TOOL_MAP } from '@/pages/amazon/tool-catalog'
import type { ToolGroupKey } from '@/pages/amazon/tool-catalog'
import { resolvePageHref } from '@/shared/page-prefix'
/** Aliprice 注册推广链接(对齐 gemini-code 工具页头 Aliprice 按钮) */
const ALIPRICE_URL =
'https://www.aiprice.com/?ext_id=10100&channel=chrome_offline&platform=1688&version=4.0.5&browser=chrome&mv=3'
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<ToolGroupKey>(() => 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;
background-color: #1a1f2e;
/* 深色底 + 青色网点纹理(对齐 gemini-code body) */
background-image: radial-gradient(rgba(45, 212, 191, 0.08) 1px, transparent 1px);
background-size: 48px 48px;
font-family: "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", "微软雅黑", sans-serif;
}
.tool-head {
flex: 0 0 auto;
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 20px;
min-height: 62px;
padding: 10px 34px;
background: #1a1f2e;
}
.tool-head__back {
flex-shrink: 0;
display: inline-flex;
align-items: center;
gap: 6px;
padding: 6px 14px;
border: 1px solid #3e4a62;
border-radius: 6px;
color: #c8d2e2;
font-size: 13px;
text-decoration: none;
white-space: nowrap;
transition: all 0.2s;
}
.tool-head__back:hover {
background: #2b3447;
color: #f5f8fc;
}
.tool-head__title {
flex-shrink: 0;
color: #f5f8fc;
font-size: 22px;
font-weight: 700;
white-space: nowrap;
}
.tool-head__desc {
min-width: 0;
max-width: 760px;
color: #a0acbe;
font-size: 14px;
line-height: 1.5;
overflow: hidden;
text-overflow: ellipsis;
}
/* Aliprice 注册按钮(仅货源查询显示,TEAL 渐变,对齐 gemini-code aliprice-btn) */
.tool-head__aliprice {
display: inline-flex;
align-items: center;
margin-left: 10px;
padding: 6px 14px;
background: linear-gradient(135deg, #14b8a6, #0d9488);
color: #ffffff;
font-size: 11px;
font-weight: 700;
text-decoration: none;
white-space: nowrap;
transition: all 0.2s;
}
.tool-head__aliprice:hover {
filter: brightness(1.15);
}
.tool-shell-body {
flex: 1 1 auto;
min-height: 0;
overflow: hidden;
}
@media (max-width: 1100px) {
.tool-head {
padding: 10px 16px;
gap: 10px;
}
}
</style>