first commit

This commit is contained in:
编码猿
2024-09-27 02:06:13 +08:00
commit 852d94fbb9
36760 changed files with 3274413 additions and 0 deletions

View File

@@ -0,0 +1,126 @@
import http from "../http";
import config from "../config";
export default class IndexService {
async home(data = {}, header = {}) {
var res = await http.post({
url: config.ApiList.index,
data: data,
headers: header,
});
res.forEach((v) => {
v.wares_masterimg = JSON.parse(v.wares_masterimg);
});
return res;
}
async activity(data = {}, header = {}) {
var res = await http.post({
url: config.ApiList.activity,
data: data,
headers: header,
});
res.forEach((v) => {
v.wares_masterimg = JSON.parse(v.wares_masterimg);
});
return res;
}
async info(data = {}, header = {}) {
var res = await http.post({
url: config.ApiList.info,
data: data,
headers: header,
});
res.wares_masterimg = JSON.parse(res.wares_masterimg);
res.wares_infoimg = JSON.parse(res.wares_infoimg);
return res;
}
async checkCar(data = {}, header = {}) {
return await http.post({
url: config.ApiList.checkCar,
data: data,
headers: header,
});
}
async addCar(data = {}, header = {}) {
return await http.post({
url: config.ApiList.addCar,
data: data,
headers: header,
});
}
async deleteCar(data = {}, header = {}) {
return await http.post({
url: config.ApiList.deleteCar,
data: data,
headers: header,
});
}
async getCarList(data = {}, header = {}) {
let res = await http.post({
url: config.ApiList.getCarList,
data: data,
headers: header,
});
res.forEach((v) => {
v.wares_masterimg = JSON.parse(v.wares_masterimg);
});
return res;
}
//提交购物车
async submitCar(data = {}, header = {}) {
return await http.post({
url: config.ApiList.submitCar,
data: data,
headers: header,
});
}
//订单页面购买支付后需要用的接口,更改订单状态为待发货
async buyOrder(data = {}, header = {}) {
return await http.post({
url: config.ApiList.buyOrder,
data: data,
headers: header,
});
}
async search(data = {}, header = {}) {
let res = await http.post({
url: config.ApiList.search,
data: data,
headers: header,
});
res.forEach((v) => {
v.wares_masterimg = JSON.parse(v.wares_masterimg);
});
return res;
}
//获取不同状态的订单
async allOrder(data = {}, header = {}) {
let res = await http.post({
url: config.ApiList.allOrder,
data: data,
headers: header,
});
if (Object.keys(res).length != 0) {
res.forEach((v) => (v.wares_masterimg = JSON.parse(v.wares_masterimg)));
return res;
} else {
return [];
}
}
}

View File

@@ -0,0 +1,13 @@
import http from '../http'
import config from '../config'
export default class TypeService {
async type (data = {}, header = {}) {
return await http.post({
url: config.ApiList.type,
data: data,
headers: header
})
}
}

View File

@@ -0,0 +1,20 @@
import http from '../http'
import config from '../config'
export default class UserService {
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.reg,
data: data,
headers: header
})
}
}

View File

@@ -0,0 +1,9 @@
import IndexService from './IndexService'
import UserService from './UserService'
import TypeService from './TypeService'
export default {
index: new IndexService(),
user: new UserService(),
type: new TypeService(),
}