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.
288 lines
4.3 KiB
288 lines
4.3 KiB
import request from "@/utils/request"; |
|
|
|
/* |
|
* 新增店铺 |
|
* */ |
|
export function addStore(data) { |
|
return request.post("/store/newStore", data, { |
|
login: true |
|
}); |
|
} |
|
/* |
|
* 店铺数据 |
|
* */ |
|
export function myStore(data) { |
|
return request.get("/store/myStore", data, { |
|
login: true |
|
}); |
|
} |
|
/* |
|
* 新增商品 |
|
* */ |
|
export function addProduct(data) { |
|
return request.post("/product/save", data, { |
|
login: true |
|
}); |
|
} |
|
/* |
|
* 修改商品 |
|
* */ |
|
export function editProduct(data) { |
|
return request.post("/product/edit", data, { |
|
login: true |
|
}); |
|
} |
|
// sku属性集合 |
|
export function getFormatAttr(data) { |
|
return request.post("/getFormatAttr", data, { |
|
login: true |
|
}); |
|
} |
|
|
|
/* |
|
* 商品发货 |
|
* */ |
|
export function delivery(data) { |
|
return request.post("/admin/order/delivery/keep", data, { |
|
login: true |
|
}); |
|
} |
|
/* |
|
* 获取快递列表 |
|
* */ |
|
export function getExpress(data) { |
|
return request.get("/logistics", data, { |
|
login: false |
|
}); |
|
} |
|
|
|
/* |
|
* 商品分类 |
|
* */ |
|
export function getCategory() { |
|
return request.get("/category", {}, { |
|
login: false |
|
}); |
|
} |
|
|
|
/* |
|
* 商品详情 |
|
* */ |
|
export function getProductDetail(id, data) { |
|
return request.get("/product/detail?id=" + id, data, { |
|
login: true |
|
}); |
|
} |
|
|
|
/* |
|
* 商品分销二维码 |
|
* */ |
|
export function getProductCode(id) { |
|
return request.get("/product/code/" + id, {}, { |
|
login: true |
|
}); |
|
} |
|
|
|
/* |
|
* 商品列表 |
|
* */ |
|
export function getProducts(q) { |
|
return request.get("/products", q, { |
|
login: true |
|
}); |
|
} |
|
|
|
|
|
/* |
|
* 商品详情 |
|
* */ |
|
export function getProductInfo(data) { |
|
return request.post("/product/info?id=" + data.id, { |
|
login: true |
|
}); |
|
} |
|
|
|
/* |
|
* 商品上下架 |
|
* */ |
|
export function prodcutShow(data) { |
|
return request.post("prodcut/show", data,{ |
|
login: true |
|
}); |
|
} |
|
/* |
|
* 商品删除 |
|
* */ |
|
export function prodcutDel(data) { |
|
return request.get("product/del", data,{ |
|
login: true |
|
}); |
|
} |
|
|
|
|
|
/* |
|
* 积分商品列表 |
|
* */ |
|
export function getProductsIntegral(q) { |
|
return request.get("/products/integral", q, { |
|
login: false |
|
}); |
|
} |
|
|
|
/* |
|
* 购物车数量 |
|
* */ |
|
export function getCartNum() { |
|
return request.get("/cart/count"); |
|
} |
|
|
|
/* |
|
* 添加收藏 |
|
* */ |
|
export function toCollect(id, category) { |
|
return request.get("/collect/add/" + id + "/" + category); |
|
} |
|
|
|
/* |
|
* 为你推荐 |
|
* */ |
|
export function getHostProducts(page, limit) { |
|
return request.get( |
|
"/product/hot", { |
|
page: page, |
|
limit: limit |
|
}, { |
|
login: false |
|
} |
|
); |
|
} |
|
|
|
/* |
|
* 精品、热门、首发列表 |
|
* */ |
|
export function getGroomList(type) { |
|
return request.get("/groom/list/" + type, {}, { |
|
login: true |
|
}); |
|
} |
|
/* |
|
* 获取商品海报 |
|
* */ |
|
export function getProductPoster(id, data) { |
|
return request.get("/product/poster/" + id, data, { |
|
login: true |
|
}); |
|
} |
|
|
|
/* |
|
* 购物车 添加 |
|
* */ |
|
export function postCartAdd(data) { |
|
return request.post("/cart/add", data); |
|
} |
|
|
|
/* |
|
* 购物车列表 |
|
* */ |
|
export function getCartList() { |
|
return request.get("/cart/list"); |
|
} |
|
|
|
/* |
|
* 购物车 删除 |
|
* */ |
|
export function postCartDel(ids) { |
|
return request.post("/cart/del", { |
|
ids |
|
}); |
|
} |
|
|
|
/* |
|
* 购物车 获取数量 |
|
* */ |
|
export function getCartCount(data) { |
|
return request.get("/cart/count", data); |
|
} |
|
|
|
/* |
|
* 购物车 修改商品数量 |
|
* */ |
|
export function changeCartNum(id, number) { |
|
return request.post("/cart/num", { |
|
id, |
|
number |
|
}); |
|
} |
|
|
|
/** |
|
* 搜索推荐关键字 |
|
*/ |
|
export function getSearchKeyword() { |
|
return request.get("/search/keyword", {}, { |
|
login: false |
|
}); |
|
} |
|
|
|
/** |
|
* 产品评论列表 |
|
*/ |
|
export function getReplyList(id, q) { |
|
return request.get("/reply/list/" + id, q, { |
|
login: true |
|
}); |
|
} |
|
|
|
/** |
|
* 产品评价数量和好评度 |
|
*/ |
|
export function getReplyConfig(id) { |
|
return request.get("/reply/config/" + id, {}, { |
|
login: true |
|
}); |
|
} |
|
|
|
/** |
|
* 评价页面获取单个产品详情 |
|
*/ |
|
export function postOrderProduct(unique) { |
|
return request.post("/order/product", { |
|
unique |
|
}, { |
|
login: true |
|
}); |
|
} |
|
|
|
/** |
|
* 提交评价页面; |
|
*/ |
|
export function postOrderComment(data) { |
|
return request.post("/order/comment", data, { |
|
login: true |
|
}); |
|
} |
|
|
|
export function storeListApi(data) { |
|
return request.get("store_list", data, { |
|
login: false |
|
}); |
|
} |
|
|
|
|
|
|
|
/* |
|
* 文章列表 |
|
* */ |
|
export function getArticle(q) { |
|
return request.get("/article/list", q, { |
|
login: false |
|
}); |
|
} |
|
|
|
/* |
|
* 文章详情 |
|
* */ |
|
export function getArticleDetail(q) { |
|
return request.get("/article/details/" + q.id,{ |
|
login: false |
|
}); |
|
} |