2021-05-13 11:03:32 +08:00
|
|
|
|
/**
|
|
|
|
|
* 商品相关API
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
import { http, Method } from "@/utils/request.js";
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 从ES中获取相关商品品牌名称,分类名称及属性
|
|
|
|
|
*/
|
|
|
|
|
export function getGoodsMessage(goodsId) {
|
|
|
|
|
return http.request({
|
2022-02-10 18:57:17 +08:00
|
|
|
|
url: `/goods/goods/get/${goodsId}`,
|
2021-05-13 11:03:32 +08:00
|
|
|
|
method: Method.GET,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 从ES中获取相关商品品牌名称,分类名称及属性
|
|
|
|
|
*/
|
|
|
|
|
export function getGoodsRelated(params) {
|
|
|
|
|
return http.request({
|
2022-02-10 18:57:17 +08:00
|
|
|
|
url: `/goods/goods/es/related`,
|
2021-05-13 11:03:32 +08:00
|
|
|
|
method: Method.GET,
|
|
|
|
|
params,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取商品详情
|
|
|
|
|
* @param skuId 商品ID
|
|
|
|
|
* @returns {AxiosPromise}
|
|
|
|
|
*/
|
2021-05-21 16:47:26 +08:00
|
|
|
|
export function getGoods(skuId, goodsId) {
|
2021-05-13 11:03:32 +08:00
|
|
|
|
return http.request({
|
2022-02-10 18:57:17 +08:00
|
|
|
|
url: `/goods/goods/sku/${goodsId}/${skuId}`,
|
2021-05-13 11:03:32 +08:00
|
|
|
|
method: Method.GET,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2021-05-21 16:47:26 +08:00
|
|
|
|
/**
|
|
|
|
|
* 获取商品分销
|
|
|
|
|
* @param distributionId 商品分销ID
|
|
|
|
|
*/
|
|
|
|
|
export function getGoodsDistribution(distributionId) {
|
|
|
|
|
return http.request({
|
|
|
|
|
url: `/distribution/bindingDistribution/${distributionId}`,
|
|
|
|
|
method: Method.GET,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2021-05-13 11:03:32 +08:00
|
|
|
|
/**
|
|
|
|
|
* 获取商品列表
|
|
|
|
|
* @param params
|
|
|
|
|
* @returns {AxiosPromise}
|
|
|
|
|
*/
|
|
|
|
|
export function getGoodsList(params) {
|
|
|
|
|
return http.request({
|
2022-02-10 18:57:17 +08:00
|
|
|
|
url: "/goods/goods/es",
|
2021-05-13 11:03:32 +08:00
|
|
|
|
method: Method.GET,
|
|
|
|
|
params,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取上新商品列表
|
|
|
|
|
* @param params
|
|
|
|
|
* @returns {AxiosPromise}
|
|
|
|
|
*/
|
|
|
|
|
export function getGoodsListUplog(params) {
|
|
|
|
|
return http.request({
|
|
|
|
|
url: "goods/search/uplog",
|
|
|
|
|
method: Method.GET,
|
|
|
|
|
params,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取标签商品
|
|
|
|
|
* @param storeId 卖家id
|
|
|
|
|
* @param mark 标签 hot:热卖 new:新品 recommend:推荐
|
|
|
|
|
* @param num 获取个数
|
|
|
|
|
*/
|
|
|
|
|
export function getTagGoods(storeId, mark = "hot", num = 5) {
|
|
|
|
|
return http.request({
|
|
|
|
|
url: `goods/tags/${mark}/goods`,
|
|
|
|
|
method: Method.GET,
|
|
|
|
|
loading: false,
|
|
|
|
|
params: {
|
|
|
|
|
storeId,
|
|
|
|
|
mark,
|
|
|
|
|
num,
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* 获取标签商品
|
|
|
|
|
*/
|
|
|
|
|
export function getPlateformTagGoods(tag_id) {
|
|
|
|
|
return http.request({
|
|
|
|
|
url: `goods/tags/byid/${tag_id}`,
|
|
|
|
|
method: Method.GET,
|
|
|
|
|
loading: false,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取首页商品分类 左侧列表
|
|
|
|
|
* @param parent_id
|
|
|
|
|
*/
|
|
|
|
|
export function getCategoryList(id) {
|
|
|
|
|
return http.request({
|
2022-02-10 18:57:17 +08:00
|
|
|
|
url: `/goods/category/get/${id}`,
|
2021-05-13 11:03:32 +08:00
|
|
|
|
method: Method.GET,
|
|
|
|
|
loading: false,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取当前会员的分销商信息 可根据分销商信息查询待提现金额以及冻结金额等信息
|
|
|
|
|
*/
|
|
|
|
|
export function distribution() {
|
|
|
|
|
return http.request({
|
|
|
|
|
url: `/distribution`,
|
|
|
|
|
method: Method.GET,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 申请分销商
|
|
|
|
|
*/
|
|
|
|
|
export function applyDistribution(params) {
|
|
|
|
|
return http.request({
|
|
|
|
|
url: `/distribution`,
|
|
|
|
|
method: Method.POST,
|
|
|
|
|
params,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 分销商提现
|
|
|
|
|
*/
|
|
|
|
|
export function cash(params) {
|
|
|
|
|
return http.request({
|
|
|
|
|
url: `/distribution/cash`,
|
|
|
|
|
method: Method.POST,
|
|
|
|
|
params,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 分销商提现历史
|
|
|
|
|
*/
|
2021-08-26 09:31:57 +08:00
|
|
|
|
export function cashLog(params) {
|
2021-05-13 11:03:32 +08:00
|
|
|
|
return http.request({
|
|
|
|
|
url: `/distribution/cash`,
|
|
|
|
|
method: Method.GET,
|
2021-08-26 09:31:57 +08:00
|
|
|
|
params
|
|
|
|
|
|
2021-05-13 11:03:32 +08:00
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取分销商分页订单列表
|
|
|
|
|
*/
|
2021-08-26 09:31:57 +08:00
|
|
|
|
export function distributionOrderList(params) {
|
2021-05-13 11:03:32 +08:00
|
|
|
|
return http.request({
|
|
|
|
|
url: `/distribution/distributionOrder`,
|
|
|
|
|
method: Method.GET,
|
2021-08-26 09:31:57 +08:00
|
|
|
|
params
|
2021-05-13 11:03:32 +08:00
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取分销商商品列表
|
|
|
|
|
*/
|
|
|
|
|
export function distributionGoods(params) {
|
|
|
|
|
return http.request({
|
|
|
|
|
url: `/distributionGoods`,
|
|
|
|
|
method: Method.GET,
|
|
|
|
|
params,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* 选择分销商品 分销商品id
|
|
|
|
|
*/
|
2021-07-01 11:16:46 +08:00
|
|
|
|
export function checkedDistributionGoods(params) {
|
2021-05-13 11:03:32 +08:00
|
|
|
|
return http.request({
|
2021-07-01 11:16:46 +08:00
|
|
|
|
url: `/distributionGoods/checked/${params.id}`,
|
2021-05-13 11:03:32 +08:00
|
|
|
|
method: Method.GET,
|
2021-07-01 11:16:46 +08:00
|
|
|
|
params
|
2021-05-13 11:03:32 +08:00
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取 小程序码
|
|
|
|
|
*/
|
|
|
|
|
export function getMpCode(params){
|
|
|
|
|
return http.request({
|
|
|
|
|
url:`/mini-program/mp/unlimited`,
|
|
|
|
|
method:Method.GET,
|
|
|
|
|
params
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 根据shortlink 获取页面参数
|
|
|
|
|
*/
|
|
|
|
|
export function getMpScene(id){
|
|
|
|
|
return http.request({
|
|
|
|
|
url:`/mini-program/mp/unlimited/scene?id=${id}`,
|
|
|
|
|
method:Method.GET,
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
}
|