feat(common-tools): 定价换算页补常用链接与资料下载区
链接清单与桌面版资料页同源(2026-10-23 实测可达),4 个资料文件随 public/materials/ 部署(目录名避开 .gitignore 的 downloads/ 规则)。
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
/**
|
||||
* 定价利润换算页 · 常用链接与资料下载
|
||||
*
|
||||
* 链接清单源自桌面版 shufu_calc_app.py 的 PAGE_LINKS / 资料页(2026-10-23 实测可达),
|
||||
* 下载文件随前端 public/materials/ 一并部署(源自「数富资料下载_独立版_v1.0.0」;
|
||||
* 目录名避开 .gitignore 的 downloads/ 规则)。
|
||||
*/
|
||||
|
||||
export type CommonLink = {
|
||||
name: string
|
||||
url: string
|
||||
}
|
||||
|
||||
export type DownloadItem = {
|
||||
name: string
|
||||
/** public/materials/ 下的文件名(含空格/中文,渲染时 encodeURI) */
|
||||
file: string
|
||||
}
|
||||
|
||||
export const PRICING_COMMON_LINKS: ReadonlyArray<CommonLink> = [
|
||||
{ name: 'Aliprice 1688 采集插件', url: 'https://www.aiprice.com/?ext_id=10100&channel=chrome_offline&platform=1688&version=4.0.5' },
|
||||
{ name: '店小密导出设置', url: 'https://www.dianxiaomi.com/web/orderSetting/export' },
|
||||
{ name: '数富AI BUG登记系统', url: 'https://bug.aishufu.top/bug-tracker/' },
|
||||
{ name: '代理IP提取', url: 'https://www.jikip.com/user/extractapi' },
|
||||
{ name: 'LLM 平台', url: 'https://ai.t8star.org/' },
|
||||
{ name: '豆包CDN短链', url: 'https://aka.doubaocdn.com/s/O1DRPbr9rd#f=1' },
|
||||
{ name: '紫鸟浏览器下载', url: 'https://www.ziniao.com/download/?from=97340' },
|
||||
{ name: '无影下载', url: 'https://www.aliyun.com/product/wuying/download' },
|
||||
{ name: 'WebView2 运行时', url: 'https://go.microsoft.com/fwlink/p/?LinkId=2124703' },
|
||||
]
|
||||
|
||||
export const PRICING_DOWNLOADS: ReadonlyArray<DownloadItem> = [
|
||||
{ name: 'winsrc兼容补丁.bat', file: 'winsrc兼容补丁.bat' },
|
||||
{ name: '百分30利润表格.xlsx', file: '百分30利润表格.xlsx' },
|
||||
{ name: '虚拟桌面任务工作_结构化.xlsx', file: '虚拟桌面任务工作_结构化.xlsx' },
|
||||
{ name: '设置最低价ASIN 批量文档格式.xlsx', file: '设置最低价ASIN 批量文档格式.xlsx' },
|
||||
]
|
||||
|
||||
export function downloadHref(file: string): string {
|
||||
return `/materials/${encodeURI(file)}`
|
||||
}
|
||||
@@ -84,6 +84,40 @@
|
||||
</ul>
|
||||
<p class="formula-note">切换站点会清空当前结果;金额输入支持带 ¥/¥ 与千分位逗号。</p>
|
||||
</section>
|
||||
|
||||
<section class="calc-panel">
|
||||
<div class="panel-title">常用链接与资料下载</div>
|
||||
<div class="resource-grid">
|
||||
<div class="resource-block">
|
||||
<div class="resource-block-title">常用链接</div>
|
||||
<ul class="resource-list">
|
||||
<li v-for="link in PRICING_COMMON_LINKS" :key="link.url" class="resource-item">
|
||||
<span class="resource-name" :title="link.url">{{ link.name }}</span>
|
||||
<a
|
||||
class="resource-action"
|
||||
:href="safeHttpUrl(link.url)"
|
||||
target="_blank"
|
||||
rel="noopener"
|
||||
>打开</a>
|
||||
<button
|
||||
type="button"
|
||||
class="resource-copy"
|
||||
@click="copyText(link.url, `「${link.name}」链接已复制`)"
|
||||
>复制</button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="resource-block">
|
||||
<div class="resource-block-title">资料下载</div>
|
||||
<ul class="resource-list">
|
||||
<li v-for="item in PRICING_DOWNLOADS" :key="item.file" class="resource-item">
|
||||
<span class="resource-name">{{ item.name }}</span>
|
||||
<a class="resource-action" :href="downloadHref(item.file)" download>下载</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</AmazonToolPageShell>
|
||||
</div>
|
||||
@@ -94,6 +128,12 @@ import { computed, ref } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
|
||||
import AmazonToolPageShell from '@/pages/amazon/components/AmazonToolPageShell.vue'
|
||||
import {
|
||||
downloadHref,
|
||||
PRICING_COMMON_LINKS,
|
||||
PRICING_DOWNLOADS,
|
||||
} from '@/pages/amazon/pricing-resources'
|
||||
import { safeHttpUrl } from '@/shared/utils/safe-url'
|
||||
import {
|
||||
calcPricing,
|
||||
formatExchangeRate,
|
||||
@@ -146,6 +186,15 @@ function resetAll() {
|
||||
freightInput.value = ''
|
||||
result.value = null
|
||||
}
|
||||
|
||||
/** 复制常用链接(口径与 FiveAsinPage 一致:clipboard + toast,失败给明确提示) */
|
||||
function copyText(text: string, successText: string) {
|
||||
if (!text) return
|
||||
navigator.clipboard
|
||||
.writeText(text)
|
||||
.then(() => ElMessage.success(successText))
|
||||
.catch(() => ElMessage.error('复制失败,请手动复制'))
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
@@ -329,9 +378,82 @@ function resetAll() {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.resource-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
gap: 18px;
|
||||
}
|
||||
|
||||
.resource-block-title {
|
||||
margin-bottom: 10px;
|
||||
color: #c8d2e2;
|
||||
font-size: 13px;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.resource-list {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.resource-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
padding: 8px 12px;
|
||||
border: 1px solid #3e4a62;
|
||||
border-radius: 6px;
|
||||
background: #2b3447;
|
||||
}
|
||||
|
||||
.resource-name {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
overflow: hidden;
|
||||
color: #f5f8fc;
|
||||
font-size: 13px;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.resource-action {
|
||||
flex-shrink: 0;
|
||||
color: #f59e0b;
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.resource-action:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.resource-copy {
|
||||
flex-shrink: 0;
|
||||
padding: 4px 12px;
|
||||
border: 1px solid #3e4a62;
|
||||
border-radius: 4px;
|
||||
background: transparent;
|
||||
color: #c8d2e2;
|
||||
font-size: 12px;
|
||||
font-family: inherit;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
|
||||
.resource-copy:hover {
|
||||
border-color: #f59e0b;
|
||||
color: #f59e0b;
|
||||
}
|
||||
|
||||
@media (max-width: 900px) {
|
||||
.input-grid,
|
||||
.result-grid {
|
||||
.result-grid,
|
||||
.resource-grid {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user