From f900c018bc3ca19c46f14dbd234774a78e4885ec Mon Sep 17 00:00:00 2001 From: Karlcarlo Date: Mon, 5 Oct 2026 03:22:03 +0000 Subject: [PATCH] =?UTF-8?q?=E3=80=8C=E6=88=91=E7=9A=84=E3=80=8D=E5=B8=B8?= =?UTF-8?q?=E7=94=A8=E6=9C=8D=E5=8A=A1=E5=8A=A0=E5=85=91=E6=8D=A2=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=E5=85=A5=E5=8F=A3=EF=BC=88=E8=B7=B3=E5=95=86=E5=9F=8E?= =?UTF-8?q?=20=3Fpage=3Dorders=EF=BC=8C=E8=A7=92=E6=A0=87=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=BE=85=E5=8F=91=E8=B4=A7=E7=AC=94=E6=95=B0=EF=BC=89?= =?UTF-8?q?(v26100454)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 --- index.html | 5 ++++- js/app.js | 17 +++++++++++++---- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/index.html b/index.html index bb9ebde..a913dfa 100644 --- a/index.html +++ b/index.html @@ -7,7 +7,7 @@ 兜爸心选 · 孕育陪伴 - + @@ -1178,6 +1178,9 @@ + + diff --git a/js/app.js b/js/app.js index 7f237ce..37af250 100644 --- a/js/app.js +++ b/js/app.js @@ -3,7 +3,7 @@ (function () { 'use strict'; /* 页面版本号(YYMMDD+序号):显示在「关于兜爸心选」页底部;bump 时同步 head 注释与 ?v= */ - var VER = '26100453'; + var VER = '26100454'; const $ = (s, c) => (c || document).querySelector(s); const $$ = (s, c) => Array.from((c || document).querySelectorAll(s)); @@ -5105,16 +5105,22 @@ const EXCH_IDS = ['doudou-duihuan', 'doudouduihuan', 'duihuan']; const EXCH_URL = 'https://taidong.douba.top/doudou-duihuan/'; const DOU_API = EXCH_URL + 'api'; - function openExchange() { + /* page:可选,'orders' = 直接弹商城的「兑换记录」(2026-10-05 商城会话 cc4ca879 提供 ?page=orders; + 带 return_url 时点 × 直接回首页,不带只关面板留在商城)。 */ + function openExchange(page) { let app = null; for (const id of EXCH_IDS) { if (APP_BY_ID[id]) { app = APP_BY_ID[id]; break; } } const base = (app && app.url) || EXCH_URL; - const url = base + (base.indexOf('?') >= 0 ? '&' : '?') + 'return_url=' + encodeURIComponent(location.href); + const url = base + (base.indexOf('?') >= 0 ? '&' : '?') + (typeof page === 'string' && page ? 'page=' + encodeURIComponent(page) + '&' : '') + + 'return_url=' + encodeURIComponent(location.href); jumpApp(url, (app && app.identifier) || 'doudou-duihuan'); } $$('#meExchCard, #homeExch').forEach(function (b) { - b.addEventListener('click', openExchange); + b.addEventListener('click', function () { openExchange(); }); }); + /* 「我的 → 兑换记录」(2026-10-05) */ + const _mo = $('#meExchOrders'); + if (_mo) _mo.addEventListener('click', function () { openExchange('orders'); }); /* 兜豆余额 + 可兑件数 + 本场热门好物。 · /mall/drop 无需登录:拿商品(热门前 3 显示在「我的」页卡片底部); @@ -5194,6 +5200,9 @@ }).then(function (sum) { if (DEMO) sum = Object.assign({}, sum || {}, { balance: 2000 }); // 示例模式:兜豆默认 2000 if (!sum || typeof sum.balance !== 'number') return; + /* 「兑换记录」角标:待发货笔数(orders_pending,商城 2026-10-05 加的字段;0 / 没这个字段就不显示) */ + const _ov = $('#meOrdersV'); + if (_ov) _ov.textContent = sum.orders_pending > 0 ? sum.orders_pending + ' 待发货' : ''; return dropP.then(function (d) { const now = d && d.server_time ? new Date(d.server_time).getTime() : Date.now(); const n = ((d && d.goods) || []).filter(function (g) {