Files
lgp-wx-plus/api/page/package.js
2026-08-19 08:17:18 +08:00

29 lines
890 B
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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)
}