feat: 增加自动选最大页码功能

This commit is contained in:
2026-08-16 18:00:26 +08:00
parent 3c0dfc2f77
commit 8a8e36602f
9 changed files with 393 additions and 102 deletions
+23 -23
View File
@@ -118,42 +118,42 @@ onMounted(async () => {
</script>
<template>
<div class="flex w-[360px] flex-col gap-3 p-4">
<div class="flex w-[360px] flex-col gap-3 bg-antd-bg p-4 text-antd-text">
<header>
<h1 class="text-base font-semibold tracking-tight">{{ EXTENSION_NAME }}</h1>
<p class="mt-0.5 text-xs text-slate-500">
<h1 class="text-base font-semibold tracking-tight text-antd-text">{{ EXTENSION_NAME }}</h1>
<p class="mt-0.5 text-xs text-antd-text-secondary">
Popup 负责配置与开关;业务操作在页内悬浮层完成。
</p>
</header>
<section class="space-y-2 rounded-lg border border-slate-200 bg-white p-3">
<h2 class="text-xs font-semibold uppercase tracking-wide text-slate-500">Open API 配置</h2>
<label class="block text-xs text-slate-600">
<section class="space-y-2 rounded-antd-lg border border-antd-border-secondary bg-white p-3 shadow-sm">
<h2 class="text-xs font-semibold text-antd-text-secondary">Open API 配置</h2>
<label class="block text-xs text-antd-text-secondary">
Base URL
<input
v-model="apiBaseUrl"
class="mt-1 w-full rounded-md border border-slate-200 px-2 py-1.5 text-sm outline-none focus:border-slate-400"
class="mt-1 w-full rounded-antd border border-antd-border px-2.5 py-1.5 text-sm outline-none transition focus:border-antd-primary focus:shadow-[0_0_0_2px_rgba(22,119,255,0.2)]"
placeholder="https://host/api"
/>
</label>
<label class="block text-xs text-slate-600">
<label class="block text-xs text-antd-text-secondary">
API Key
<input
v-model="apiKey"
type="password"
class="mt-1 w-full rounded-md border border-slate-200 px-2 py-1.5 text-sm outline-none focus:border-slate-400"
class="mt-1 w-full rounded-antd border border-antd-border px-2.5 py-1.5 text-sm outline-none transition focus:border-antd-primary focus:shadow-[0_0_0_2px_rgba(22,119,255,0.2)]"
placeholder="sk_live_..."
/>
</label>
<p class="text-[11px] leading-relaxed text-slate-400">
<p class="text-[11px] leading-relaxed text-antd-text-tertiary">
需要 scope:{{ OPEN_SCOPES.pddShopRead }}、{{ OPEN_SCOPES.pddGoodsAdFeeImport }}
</p>
<div class="space-y-1">
<div class="flex items-center justify-between">
<span class="text-xs text-slate-600">默认渠道店铺</span>
<span class="text-xs text-antd-text-secondary">默认渠道店铺</span>
<button
class="text-xs text-sky-700 hover:underline"
class="text-xs text-antd-primary hover:text-antd-primary-hover hover:underline"
type="button"
:disabled="shopsLoading || busy"
@click="loadShops"
@@ -162,7 +162,7 @@ onMounted(async () => {
</button>
</div>
<select
class="w-full rounded-md border border-slate-200 px-2 py-1.5 text-sm"
class="w-full rounded-antd border border-antd-border px-2.5 py-1.5 text-sm outline-none transition focus:border-antd-primary"
:value="channelShopId ?? ''"
@change="onShopChange"
>
@@ -174,7 +174,7 @@ onMounted(async () => {
</div>
<button
class="w-full rounded-md bg-slate-900 px-3 py-1.5 text-sm text-white hover:bg-slate-800"
class="w-full rounded-antd border border-antd-border bg-white px-3 py-1.5 text-sm text-antd-text transition hover:border-antd-primary hover:text-antd-primary disabled:opacity-50"
type="button"
:disabled="busy"
@click="persistSettings"
@@ -183,15 +183,15 @@ onMounted(async () => {
</button>
</section>
<section class="space-y-2 rounded-lg border border-slate-200 bg-white p-3">
<h2 class="text-xs font-semibold uppercase tracking-wide text-slate-500">页内悬浮层</h2>
<p class="text-xs text-slate-500">
<section class="space-y-2 rounded-antd-lg border border-antd-border-secondary bg-white p-3 shadow-sm">
<h2 class="text-xs font-semibold text-antd-text-secondary">页内悬浮层</h2>
<p class="text-xs text-antd-text-secondary">
当前状态:
<span class="font-medium text-slate-800">{{ panelVisible ? '已打开' : '未打开' }}</span>
<span class="font-medium text-antd-text">{{ panelVisible ? '已打开' : '未打开' }}</span>
</p>
<div class="flex gap-2">
<button
class="flex-1 rounded-md bg-emerald-600 px-3 py-2 text-sm font-medium text-white hover:bg-emerald-500 disabled:opacity-50"
class="flex-1 rounded-antd bg-antd-primary px-3 py-2 text-sm font-medium text-white transition hover:bg-antd-primary-hover disabled:opacity-50"
type="button"
:disabled="busy"
@click="handleOpenPanel"
@@ -199,7 +199,7 @@ onMounted(async () => {
打开悬浮层
</button>
<button
class="flex-1 rounded-md border border-slate-300 bg-white px-3 py-2 text-sm font-medium hover:bg-slate-50 disabled:opacity-50"
class="flex-1 rounded-antd border border-antd-border bg-white px-3 py-2 text-sm font-medium text-antd-text transition hover:border-antd-primary hover:text-antd-primary disabled:opacity-50"
type="button"
:disabled="busy"
@click="handleTogglePanel"
@@ -207,10 +207,10 @@ onMounted(async () => {
开关切换
</button>
</div>
<p class="text-[11px] text-slate-400">若提示无法连接页面脚本,请先刷新目标网页。</p>
<p class="text-[11px] text-antd-text-tertiary">若提示无法连接页面脚本,请先刷新目标网页。</p>
</section>
<p v-if="statusText" class="text-xs text-emerald-700">{{ statusText }}</p>
<p v-if="errorText" class="text-xs text-rose-600">{{ errorText }}</p>
<p v-if="statusText" class="text-xs text-antd-success">{{ statusText }}</p>
<p v-if="errorText" class="text-xs text-antd-error">{{ errorText }}</p>
</div>
</template>
+11
View File
@@ -7,4 +7,15 @@ body {
margin: 0;
min-width: 360px;
min-height: 480px;
color: rgba(0, 0, 0, 0.88);
background: #ffffff;
font-family:
-apple-system,
BlinkMacSystemFont,
'Segoe UI',
Roboto,
'Helvetica Neue',
Arial,
'Noto Sans',
sans-serif;
}