feat: 抢单页识别总会员 included_huiyuan_ids 覆盖子会员
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -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);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user