Files
order_site/apps/extensions/pdd-cookie-sync/popup.html
T
yml2213 9fb27b0ad2 feat(pdd): 拼多多订单支持 out_sku_sn 匹配与浏览器插件加密保活
- 拼多多进单 Cookie 失效即时拦截与告警修复(支持 43001 会话过期等错误识别)
- 拼多多订单映射优先使用 out_sku_sn(外部商家编码)作为商品规格与工单匹配核心字段
- 新增 Chrome/Edge 浏览器扩展 (Manifest V3),支持端到端 RSA-OAEP + AES-256-GCM 信封加密自动保活
- 后台店铺管理新增插件配对面板、专属密钥管理与一键导入配置 JSON
2026-09-14 12:24:48 +08:00

217 lines
6.0 KiB
HTML

<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>拼多多 Cookie 自动保活</title>
<style>
* {
box-sizing: border-box;
margin: 0;
padding: 0;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
body {
width: 360px;
padding: 16px;
background: #f8fafc;
color: #1e293b;
font-size: 13px;
}
.header {
display: flex;
align-items: center;
justify-content: space-between;
padding-bottom: 12px;
border-bottom: 1px solid #e2e8f0;
margin-bottom: 14px;
}
.title {
font-size: 15px;
font-weight: 600;
color: #0f172a;
display: flex;
align-items: center;
gap: 6px;
}
.badge {
display: inline-block;
padding: 2px 8px;
border-radius: 12px;
font-size: 11px;
font-weight: 500;
}
.badge-ok { background: #dcfce7; color: #15803d; }
.badge-err { background: #fee2e2; color: #b91c1c; }
.badge-gray { background: #f1f5f9; color: #64748b; }
.card {
background: #ffffff;
border: 1px solid #e2e8f0;
border-radius: 8px;
padding: 12px;
margin-bottom: 12px;
box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.row {
display: flex;
justify-content: space-between;
margin-bottom: 8px;
}
.row:last-child {
margin-bottom: 0;
}
.label {
color: #64748b;
}
.val {
font-weight: 500;
color: #0f172a;
}
.form-group {
margin-bottom: 10px;
}
.form-group label {
display: block;
margin-bottom: 4px;
font-weight: 500;
font-size: 12px;
color: #334155;
}
input, textarea {
width: 100%;
padding: 7px 10px;
border: 1px solid #cbd5e1;
border-radius: 6px;
font-size: 12px;
outline: none;
transition: border-color 0.2s;
}
input:focus, textarea:focus {
border-color: #3b82f6;
box-shadow: 0 0 0 2px rgba(59,130,246,0.1);
}
.btn {
display: inline-block;
width: 100%;
padding: 8px 14px;
border-radius: 6px;
font-size: 13px;
font-weight: 500;
text-align: center;
cursor: pointer;
border: none;
transition: all 0.2s;
}
.btn-primary {
background: #2563eb;
color: #ffffff;
}
.btn-primary:hover {
background: #1d4ed8;
}
.btn-secondary {
background: #ffffff;
border: 1px solid #cbd5e1;
color: #334155;
margin-top: 6px;
}
.btn-secondary:hover {
background: #f8fafc;
border-color: #94a3b8;
}
.btn:disabled {
opacity: 0.6;
cursor: not-allowed;
}
.security-tag {
font-size: 11px;
color: #64748b;
text-align: center;
margin-top: 10px;
display: flex;
align-items: center;
justify-content: center;
gap: 4px;
}
.msg-box {
font-size: 11px;
padding: 6px 10px;
border-radius: 4px;
margin-top: 8px;
display: none;
}
.msg-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.msg-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
</style>
</head>
<body>
<div class="header">
<div class="title">
<span>拼多多 Cookie 保活</span>
</div>
<div id="statusBadge" class="badge badge-gray">未检测</div>
</div>
<!-- 状态概览卡片 -->
<div class="card">
<div class="row">
<span class="label">MMS 登录状态:</span>
<span id="mmsStatus" class="val">检测中...</span>
</div>
<div class="row">
<span class="label">绑定店铺:</span>
<span id="shopDisplay" class="val">未配置</span>
</div>
<div class="row">
<span class="label">上次同步:</span>
<span id="lastSyncDisplay" class="val">未同步</span>
</div>
<div class="row" id="orderCountRow" style="display: none;">
<span class="label">在售/历史单:</span>
<span id="orderCountDisplay" class="val" style="color: #2563eb;">0 笔</span>
</div>
<div id="statusMsg" class="msg-box"></div>
</div>
<!-- 手动立即同步按钮 -->
<button id="btnSyncNow" class="btn btn-primary">立即上传同步 Cookie</button>
<!-- 配置折叠区 -->
<div style="margin-top: 12px;">
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px;">
<span style="font-weight: 600; font-size: 12px; color: #475569;">连接配置</span>
<a href="#" id="btnToggleImport" style="font-size: 11px; color: #2563eb; text-decoration: none;">一键导入配置 JSON</a>
</div>
<!-- 导入 JSON 框(默认隐藏) -->
<div id="importArea" style="display: none; margin-bottom: 10px;">
<textarea id="importJsonInput" rows="3" placeholder="在此粘贴后台复制的完整配置 JSON..."></textarea>
<button id="btnApplyImport" class="btn btn-secondary" style="margin-top: 4px; padding: 5px;">解析并填充</button>
</div>
<div class="card" style="margin-bottom: 8px;">
<div class="form-group">
<label for="inputServerUrl">服务端 API 地址</label>
<input type="text" id="inputServerUrl" placeholder="例如:https://order.domain.com">
</div>
<div class="form-group">
<label for="inputShopId">店铺标识 (Shop ID)</label>
<input type="text" id="inputShopId" placeholder="例如:store_pdd_01">
</div>
<div class="form-group" style="margin-bottom: 0;">
<label for="inputSyncToken">专属配对密钥 (Sync Token)</label>
<input type="password" id="inputSyncToken" placeholder="例如:pdd_tok_xxx">
</div>
</div>
<button id="btnSaveConfig" class="btn btn-secondary">保存配置并重连</button>
</div>
<div class="security-tag">
<span>🛡️ RSA-OAEP + AES-256-GCM 端到端信封加密</span>
</div>
<script src="popup.js"></script>
</body>
</html>