You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

114 lines
2.4 KiB

10 months ago
import {CartAdd, CartCount, CollectPro, CouponListQuery, ProductIds, ReplyConfig, ReplyList} from '~/types/goods'
import {ItemObject, PageQuery} from "~/types/global";
/**
*
*
*/
export const productDetailApi = (data: FromData) => {
return $request.get({ url: `front/product/detail/${data.id}?type=${data.type}` })
}
/**
*
*
*/
export const productReplyConfigApi = (id: number) => {
return $request.get<ReplyConfig>({ url: `front/product/reply/config/${id}` })
}
/**
*
*
*/
export const categoryTreeApi = () => {
return $request.get({ url: `front/product/category/get/tree` })
}
/**
*
*
*/
export const searcKeywordApi = () => {
return $request.get({ url: `front/index/search/keyword` })
}
/**
*
*
*/
export const indexProductListApi = (params: PageQuery) => {
return $request.get({ url: `front/index/product/list`, params })
}
/**
*
*
*/
export const cartCountApi = (params: CartCount) => {
return $request.get({ url: `front/cart/count`, params })
}
/**
*
*
*/
export const cartAddApi = (params: CartAdd) => {
return $request.post({ url: `front/cart/add`, params })
}
/**
*
*
*/
export const replyListApi = (id: number,params:PageQuery) => {
return $request.get<ReplyList>({ url: `front/product/reply/list/${id}`, params })
}
/**
*
*
*/
export const collectAddApi = (params:CollectPro) => {
return $request.post({ url: `front/collect/add/product`, params })
}
/**
*
*
*/
export const collectCancelApi = (params:ProductIds) => {
return $request.post({ url: `front/collect/cancel/product`, params })
}
/**
*
*
*/
export const couponListApi = (params:CouponListQuery) => {
return $request.get({ url: `front/coupon/page/list`, params })
}
/**
*
*
*/
export const productListApi = (params: PageQuery) => {
return $request.get({ url: `front/product/list`, params })
}
/**
*
*
*/
export const productRecommendListApi = (params: PageQuery) => {
return $request.get({ url: `front/product/recommend/list`, params })
}
/**
*
*
*/
export const productListBeforeApi = (params: ItemObject) => {
return $request.get({ url: `front/product/list/before`, params })
}