// 活动服务 - 新人大礼包、优惠券等 import { get, post, postL } from './http'; const apis = { NEWBIE_GIFT_BAG: '/api/activity/newbieGiftBag/info', COUPON_LIST_VALID: '/api/coupon/listValidCoupon', COUPON_BATCH_RECEIVE: '/api/coupon/batchReceive', }; // 新人大礼包信息 export const getNewbieGiftBagInfo = async () => { const res = await get(apis.NEWBIE_GIFT_BAG); return res.success && res.data ? res.data : null; }; // 获取可领优惠券列表 export interface CouponItem { id: string; amount: number; fullAmount: number; endTime: string; name?: string; } export const listValidCoupon = async (scene: string, targetObj?: any) => { const res = await post(apis.COUPON_LIST_VALID, { scene, targetObj }); return res.success && res.data ? res.data : []; }; // 一键领取优惠券 export const batchReceiveCoupon = async (ids: string[]) => { const res = await postL(apis.COUPON_BATCH_RECEIVE, { ids }); return res.success; };