Files

29 lines
890 B
JavaScript
Raw Permalink Normal View History

2026-08-19 08:17:18 +08:00
import { get, post } from '../request'
const prefix = 'package/'
/** 首页热门套餐 */
export const getPackageHotApi = async () => {
return await get(`${prefix}hot`)
}
/** 套餐 tab 列表 */
export const getPackageListApi = async (params = {}) => {
return await get(`${prefix}list`, params)
}
/** 套餐详情(含搭配与价格);p_user_id 为代理商分享来源,和商品详情同一套 */
export const getPackageDetailApi = async (id, p_user_id = 0) => {
return await get(`${prefix}detail`, { id, p_user_id })
}
/**
* 一件加入清单。不传 list_id 时后端按套餐名新建。
* 必须走这个接口,不能循环 toCart,否则会丢掉套餐价快照。
*/
export const packageToListApi = async (packageId, listId) => {
const body = { package_id: packageId }
if (listId) body.list_id = listId
return await post(`${prefix}to-list`, body)
}