76 lines
1.6 KiB
JavaScript
76 lines
1.6 KiB
JavaScript
import http from "../http";
|
|
import config from "../config";
|
|
|
|
export default class IndexServer {
|
|
//首页
|
|
async getIndex(data = {}, header = {}) {
|
|
return await http.get({
|
|
url: config.apiList.index,
|
|
data: data,
|
|
header: header
|
|
});
|
|
}
|
|
|
|
//搜索
|
|
async search(data = {}, header = {}) {
|
|
return await http.post({
|
|
url: config.apiList.search,
|
|
data: data,
|
|
header: header
|
|
});
|
|
}
|
|
|
|
//用户手机号码(个人中心)
|
|
async tell(data = {}, header = {}) {
|
|
return await http.post({
|
|
url: config.apiList.tell,
|
|
data: data,
|
|
header: header
|
|
});
|
|
}
|
|
//商品详情
|
|
async goodsDetail(data = {}, header = {}) {
|
|
return await http.post({
|
|
url: config.apiList.x_goodsDetail,
|
|
data: data,
|
|
header: header
|
|
});
|
|
}
|
|
//登录
|
|
async login (data = {}, header = {}) {
|
|
return await http.post({
|
|
url: config.apiList.login,
|
|
data: data,
|
|
headers: header
|
|
});
|
|
}
|
|
//注册
|
|
async reg (data = {}, header = {}) {
|
|
return await http.post({
|
|
url: config.apiList.x_register,
|
|
data: data,
|
|
headers: header
|
|
});
|
|
}
|
|
|
|
// //活动详情
|
|
async getActivity(data = {}, header = {}) {
|
|
return await http.get({
|
|
url: config.apiList.activity,
|
|
data: data,
|
|
header: header
|
|
});
|
|
}
|
|
|
|
//购物车
|
|
async cartList(data = {}, header = {}) {
|
|
return await http.post({
|
|
url: config.apiList.cart,
|
|
data: data,
|
|
header: header
|
|
});
|
|
}
|
|
|
|
|
|
}
|