「我的」常用服务加兑换记录入口(跳商城 ?page=orders,角标显示待发货笔数)(v26100454)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
<meta name="mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<title>兜爸心选 · 孕育陪伴</title>
|
||||
<!-- V:26100453 缓存版本标记:改 css/js 时同步 bump 该值(与 js/app.js 的 VER 同源),静态资源按 mtime 走 ETag 自动刷新 -->
|
||||
<!-- V:26100454 缓存版本标记:改 css/js 时同步 bump 该值(与 js/app.js 的 VER 同源),静态资源按 mtime 走 ETag 自动刷新 -->
|
||||
<link rel="stylesheet" href="mama-box.css">
|
||||
<script src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
|
||||
<!-- 共享助手:授权/跳商城/位置上报(分享卡片同步,见 docs/h5-auth-standard.md 第四节) -->
|
||||
@@ -1178,6 +1178,9 @@
|
||||
<button class="svc ripple" data-open="detailSetting" data-set="privacy"><span class="sv-ico p"><svg viewBox="0 0 24 24" width="22" height="22" aria-hidden="true"><rect x="4.5" y="10" width="15" height="10.5" rx="3" fill="none" stroke="currentColor" stroke-width="1.8"/><path d="M8.2 10V7.6a3.8 3.8 0 0 1 7.6 0V10" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/><circle cx="12" cy="15.2" r="1.5" fill="currentColor"/></svg></span><span class="sv-t">隐私权限</span></button>
|
||||
<button class="svc ripple" data-open="detailSetting" data-set="help"><span class="sv-ico o"><svg viewBox="0 0 24 24" width="22" height="22" aria-hidden="true"><path d="M12 4.2c4.5 0 7.8 2.8 7.8 6.4s-3.3 6.4-7.8 6.4c-.7 0-1.3-.06-1.9-.18l-3.6 2.3a.4.4 0 0 1-.6-.45l.8-2.9c-1.5-1.16-2.3-2.7-2.3-4.4 0-3.6 3.1-6.4 7.6-6.4z" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linejoin="round"/><path d="M9.9 9.4a2.2 2.2 0 0 1 4.2.8c0 1.5-2.1 1.6-2.1 3" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round"/></svg></span><span class="sv-t">帮助反馈</span></button>
|
||||
<!-- 2026-10-04 意见反馈(用户:「我的页面里加一个客服反馈,功能上的反馈、功能上的建议」)→ #modalFeedback,提交到 box_app /api/mp/public/mama-box/feedback -->
|
||||
<!-- 2026-10-05 用户:「『我的』里加一个兑换记录,就是商城兑换的记录」→ 跳兜豆兑换商城 ?page=orders(商城会话 cc4ca879 提供,直接弹「兑换记录」,× 回首页);
|
||||
#meOrdersV 角标 = 待发货笔数(/api/dou/summary 的 orders_pending,0 不显示)。 -->
|
||||
<button class="svc ripple" id="meExchOrders"><span class="sv-ico o"><svg viewBox="0 0 24 24" width="22" height="22" aria-hidden="true"><path d="M6.5 3.8h11a1.2 1.2 0 0 1 1.2 1.2v15.1l-2.3-1.5-2.2 1.5-2.2-1.5-2.2 1.5-2.2-1.5-2.3 1.5V5a1.2 1.2 0 0 1 1.2-1.2z" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linejoin="round"/><path d="M8.6 8.6h6.8M8.6 12h6.8M8.6 15.4h4" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/></svg></span><span class="sv-t">兑换记录</span><span class="sv-badge" id="meOrdersV"></span></button>
|
||||
<button class="svc ripple" id="meFeedback"><span class="sv-ico g"><svg viewBox="0 0 24 24" width="22" height="22" aria-hidden="true"><path d="M5.5 4.8h13a1.7 1.7 0 0 1 1.7 1.7v8.6a1.7 1.7 0 0 1-1.7 1.7H11l-4.1 3a.4.4 0 0 1-.64-.32V16.8H5.5a1.7 1.7 0 0 1-1.7-1.7V6.5a1.7 1.7 0 0 1 1.7-1.7z" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linejoin="round"/><path d="M8.2 9.3h7.6M8.2 12.5h4.8" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/></svg></span><span class="sv-t">意见反馈</span></button>
|
||||
<button class="svc ripple" data-open="detailSetting" data-set="about"><span class="sv-ico b"><svg viewBox="0 0 24 24" width="22" height="22" aria-hidden="true"><circle cx="12" cy="12" r="8.2" fill="none" stroke="currentColor" stroke-width="1.8"/><path d="M12 11v5.4" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round"/><circle cx="12" cy="7.9" r="1.15" fill="currentColor"/></svg></span><span class="sv-t">关于我们</span></button>
|
||||
</div>
|
||||
|
||||
17
js/app.js
17
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) {
|
||||
|
||||
Reference in New Issue
Block a user