forked from fdzcxy212206243/machine
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.
94 lines
1.5 KiB
94 lines
1.5 KiB
2 weeks ago
|
const { request } = require("../utils/request.js")
|
||
|
const { login,baseUrl,banner,goods,hotSearch,search,goodsDetails,cart,addCart,delCart,category,buy } = require("./base")
|
||
|
/**
|
||
|
* 网络请求方法
|
||
|
*/
|
||
|
|
||
|
/**
|
||
|
* get banner data
|
||
|
*/
|
||
|
function getBanner(data){
|
||
|
return request(baseUrl + banner,"GET",data)
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* get goods list data
|
||
|
*/
|
||
|
|
||
|
function getGoods(data){
|
||
|
return request(baseUrl + goods,"GET",data)
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* hot search keywords
|
||
|
*/
|
||
|
function getHotSearch(data){
|
||
|
return request(baseUrl + hotSearch,"GET",data)
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* search
|
||
|
*/
|
||
|
function getSearch(data){
|
||
|
return request(baseUrl + search,"GET",data)
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* goods details
|
||
|
*/
|
||
|
function getGoodsDetails(data){
|
||
|
return request(baseUrl + goodsDetails,"GET",data)
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* cart select
|
||
|
*/
|
||
|
function getCart(data){
|
||
|
return request(baseUrl + cart,"GET",data)
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* cart add
|
||
|
*/
|
||
|
function addGoodsCart(data){
|
||
|
return request(baseUrl + addCart,"GET",data)
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* cart del
|
||
|
*/
|
||
|
function delGoodsCart(data){
|
||
|
return request(baseUrl + delCart,"GET",data)
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* category
|
||
|
*/
|
||
|
function getCategory(data){
|
||
|
return request(baseUrl + category,"GET",data)
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* buy
|
||
|
*/
|
||
|
function getBuy(data){
|
||
|
return request(baseUrl + buy,"GET",data)
|
||
|
}
|
||
|
|
||
|
function getLogin(data){
|
||
|
return request(baseUrl + login,"POST",data)
|
||
|
}
|
||
|
|
||
|
module.exports = {
|
||
|
getBanner,
|
||
|
getGoods,
|
||
|
getHotSearch,
|
||
|
getSearch,
|
||
|
getGoodsDetails,
|
||
|
getCart,
|
||
|
addGoodsCart,
|
||
|
delGoodsCart,
|
||
|
getCategory,
|
||
|
getBuy,
|
||
|
getLogin
|
||
|
}
|