feat: 抢单页识别总会员 included_huiyuan_ids 覆盖子会员

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
XingQue
2026-07-05 18:13:15 +08:00
parent 64db9f52ae
commit 3711b1df3f

View File

@@ -23,9 +23,14 @@ export async function refreshDashouMembership(app) {
return app.globalData.clumber || [];
}
/** 用户是否持有某会员类型(与抢单卡片判断一致) */
/** 用户是否持有某会员类型(与抢单卡片判断一致;支持总会员 covers */
export function userHasHuiyuan(huiyuanList, huiyuanId) {
if (!huiyuanId) return true;
const list = huiyuanList || [];
return list.some((h) => String(h.huiyuanid) === String(huiyuanId));
const req = String(huiyuanId);
return list.some((h) => {
if (String(h.huiyuanid) === req) return true;
const covers = h.included_huiyuan_ids || h.covers || [];
return Array.isArray(covers) && covers.some((id) => String(id) === req);
});
}