1 Commits
5 changed files with 118 additions and 8 deletions

No files matched your search

+14
View File
@@ -4,6 +4,20 @@ B站评论助手 版本历史。下载:https://dl.88531.cn/bili.html · 
---
## v1.10.6 · 2026-10-21
### ✨ 新功能
- 购买页订单一直「等待支付中」时,**30 秒后自动出现「付款后没反应」帮助面板**,给出两条明确出路:
- **🔁 立即刷新核对**:马上向授权系统重查一次订单(不用等下一轮 5 秒轮询)
- **🔄 重新下单(换新二维码)**:本页订单 15 分钟有效,扫过期码/旧订单码会付不上,一键生成新单
- 帮助面板同时说明:付款通知通常几秒到 1 分钟内自动到达,**请勿重复付款**;等待超过 120 秒会提示留好订单号与微信/支付宝交易号
- 下单后立刻先查一次订单状态,不再干等 5 秒
### 🔧 优化
- 轮询拆成单次查询函数,定时器与手动刷新共用同一逻辑,行为一致
---
## v1.10.5 · 2026-10-20
### ✨ 新功能
+14
View File
@@ -113,6 +113,20 @@ h2 {
.tip { margin-top: 12px; font-size: 12px; color: #999; }
/* 「付款后没反应」的帮助面板:给用户明确出口,而不是干等 */
.pay-help { margin-top: 10px; padding: 12px 14px; background: #fff8e6; border: 1px solid #ffd98a;
border-radius: 8px; font-size: 13px; line-height: 1.7; }
.pay-help .ph-title { font-weight: bold; color: #8a5a00; margin-bottom: 6px; }
.pay-help .ph-list { margin: 0 0 10px; padding-left: 18px; color: #6b4a00; }
.pay-help .ph-list li { margin-bottom: 3px; }
.ph-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.ph-btn { flex: 1 1 150px; min-height: 38px; border: none; border-radius: 7px; cursor: pointer;
background: linear-gradient(90deg, #00a1d6, #0077a3); color: #fff; font-weight: bold;
font-size: 13px; padding: 8px 10px; }
.ph-btn.ghost { background: #fff; color: #0077a3; border: 1px solid #00a1d6; }
.ph-btn:hover { filter: brightness(1.05); }
.ph-tip { margin: 8px 0 0; color: #a06b00; font-size: 12px; min-height: 1em; }
.order-status {
font-size: 14px;
line-height: 1.8;
+12
View File
@@ -34,6 +34,18 @@
<section id="order-panel" hidden>
<h2><span class="num">3</span> 订单状态</h2>
<div id="order-status" class="order-status">等待创建订单…</div>
<div id="pay-help" class="pay-help" hidden>
<div class="ph-title">付款后这里一直没动静?</div>
<ul class="ph-list">
<li>付款通知一般<b>几秒到 1 分钟</b>内自动到达,到达后会自动显示卡密,<b>请不要重复付款</b>。</li>
<li>本页订单 <b>15 分钟</b>内有效;扫<b>过期二维码</b>或其他订单的码会付不上,需要重新下单拿新码。</li>
</ul>
<div class="ph-btns">
<button type="button" id="ph-refresh" class="ph-btn">🔁 立即刷新核对</button>
<button type="button" id="ph-renew" class="ph-btn ghost">🔄 重新下单(换新二维码)</button>
</div>
<p class="ph-tip" id="ph-tip"></p>
</div>
<div id="card-box" class="card-box" hidden>
<div class="cb-title"><span class="cb-dot"></span>你的卡密</div>
<div class="cb-key"><code id="cb-key-text"></code></div>
+77 -7
View File
@@ -4,6 +4,9 @@ let packages = [];
let selected = null;
let orderNo = null;
let pollTimer = null;
let lastPayType = null; // 记住当前支付方式,「重新下单」时直接复用
let payHelpShown = false;
let helpTipStage = 0; // 1=30秒提示 2=120秒提示;同阶段不重复覆盖刚点出来的反馈
function esc(s) {
return String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({
@@ -60,8 +63,10 @@ function selectPackage(id) {
async function createOrder(payType) {
if (!selected) return;
lastPayType = payType;
$('order-panel').hidden = false;
$('order-panel').scrollIntoView({ behavior: 'smooth', block: 'center' });
hidePayHelp();
const status = $('order-status');
status.className = 'order-status pending';
status.textContent = '⏳ 正在创建订单…';
@@ -83,11 +88,11 @@ async function createOrder(payType) {
}
}
function startPolling() {
if (pollTimer) clearInterval(pollTimer);
let attempts = 0;
pollTimer = setInterval(async () => {
attempts++;
let attempts = 0;
/** 单次订单查询:5 秒轮询与「立即刷新核对」按钮共用同一段逻辑 */
async function queryOrderOnce() {
attempts++;
if (attempts > 240) {
clearInterval(pollTimer);
pollTimer = null;
@@ -109,6 +114,7 @@ function startPolling() {
} else if (res.cardKey) {
clearInterval(pollTimer);
pollTimer = null;
hidePayHelp();
const status = $('order-status');
status.className = 'order-status error';
status.innerHTML = '✗ <b>已支付并已发卡</b>,但自动激活未成功(' +
@@ -126,14 +132,76 @@ function startPolling() {
'</b> 付款状态为已支付,<b>权益不会丢失</b>:继续等会自动发放,或凭此订单号联系客服补发。';
}
} else {
const waited = attempts * 5;
const status = $('order-status');
status.className = 'order-status pending';
status.textContent = '⏳ 等待支付中…(订单 ' + orderNo + ',已等待 ' + attempts * 5 + ' 秒)';
status.textContent = '⏳ 等待支付中…(订单 ' + orderNo + ',已等待 ' + waited + ' 秒)';
// 30 秒还没动静就主动给出口(付款通知丢失 / 扫了过期码 / 实际没扣款)
if (waited >= 30) showPayHelp(waited);
}
} catch (e) {
/* 单次查询失败不中断轮询 */
}
}, 5000);
}
function startPolling() {
if (pollTimer) clearInterval(pollTimer);
attempts = 0;
hidePayHelp();
queryOrderOnce(); // 先立刻查一次,不干等 5 秒
pollTimer = setInterval(queryOrderOnce, 5000);
}
/** 付款迟迟没动静时给出路,别让用户对着「等待支付中」干等 */
function showPayHelp(waited) {
const box = $('pay-help');
if (!box) return;
box.hidden = false;
payHelpShown = true;
const tip = $('ph-tip');
if (!tip) return;
const stage = waited >= 120 ? 2 : 1;
if (tip.textContent && stage <= helpTipStage) return; // 不覆盖用户刚点「刷新」得到的反馈
helpTipStage = stage;
if (stage === 2) {
tip.textContent = '已等待 ' + waited + ' 秒仍未确认支付。若你确已完成付款:请勿重复支付,留好订单号 ' +
(orderNo || '') + ' 与微信/支付宝交易号;若二维码是旧的/已过期,点「重新下单」换一个新码再付。';
} else {
tip.textContent = '正在等待付款通知…已完成付款的话,点「立即刷新核对」可以马上重查一次。';
}
}
function hidePayHelp() {
const box = $('pay-help');
if (box) box.hidden = true;
payHelpShown = false;
helpTipStage = 0;
const tip = $('ph-tip');
if (tip) tip.textContent = '';
}
function wirePayHelp() {
const rf = $('ph-refresh'), rn = $('ph-renew');
if (rf) rf.addEventListener('click', async () => {
const tip = $('ph-tip');
if (tip) tip.textContent = '正在向授权系统核对…';
await queryOrderOnce();
const box = $('pay-help');
if (!box || box.hidden || !tip) return; // 已出卡激活就不必再提示
tip.textContent = '已于 ' + new Date().toLocaleTimeString() +
' 重新核对:仍未确认支付。若你确已完成付款请勿重复支付(通知可能延迟);二维码过期就点「重新下单」。';
});
if (rn) rn.addEventListener('click', () => {
if (!selected) {
const tip = $('ph-tip');
if (tip) tip.textContent = '请先在上方重新选择套餐,再选支付方式生成新订单。';
const sp = $('step-package');
if (sp) sp.scrollIntoView({ behavior: 'smooth', block: 'start' });
return;
}
if (pollTimer) { clearInterval(pollTimer); pollTimer = null; }
createOrder(lastPayType || 'wxpay');
});
}
/** 支付成功后立刻把卡密展示给用户(含自动激活失败的场景) */
@@ -148,6 +216,7 @@ function showCardBox(key, activated) {
}
function showActivated(res) {
hidePayHelp();
const status = $('order-status');
const permanent = !!res.isPermanent;
const exp = String(res.expireTime || '').trim();
@@ -196,4 +265,5 @@ $('cb-copy') && $('cb-copy').addEventListener('click', async () => {
$('cb-copy-tip').textContent = ok ? '已复制,可直接粘贴到侧边栏激活' : '复制失败,请手动长按选择卡密';
});
wirePayHelp();
loadPackages();
+1 -1
View File
@@ -1,7 +1,7 @@
{
"manifest_version": 3,
"name": "B站评论助手",
"version": "1.10.5",
"version": "1.10.6",
"description": "B站网页版关键词评论助手:按搜索关键词找视频,默认模拟真人(打开视频页、滚到评论区、逐字输入、点发布),也可快速API直发;支持下载当前页视频;带防重复记录、可中断执行与页面实时进度浮层。",
"permissions": ["storage", "tabs", "scripting", "sidePanel", "downloads", "declarativeNetRequest", "alarms"],
"host_permissions": [