{"size": 5547, "ext": "js", "max_stars_repo_path": "src/web/apps/sjShop/module/api.js", "max_stars_repo_name": "inzaghihao/WebBuilder", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/web/apps/sjShop/module/api.js", "max_issues_repo_name": "inzaghihao/WebBuilder", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/web/apps/sjShop/module/api.js", "max_forks_repo_name": "inzaghihao/WebBuilder", "max_forks_repo_forks_event_min_datetime": "2021-01-11T07:03:53.000Z", "max_forks_repo_forks_event_max_datetime": "2021-01-11T07:03:53.000Z"}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 37.9931506849, "max_line_length": 96, "alphanum_fraction": 0.6223183703}
const _server = $common.getServer(
    // 成功
    (result, resolve, reject) => {
        result = result.data
        result.code === 200 ? resolve(result.data) : reject(result.message)
    },
    // 失败
    (error, reject) => reject(error.message),
    // 'http://192.168.0.101:80'
    // 'http://192.168.199.100:80'
    'http://10.52.2.35:7001'
)
// ======================================================= 客户
// * 新增客户
export function createCustomer(companyName, companyAddress, contact) {
    let params = { companyName, companyAddress, contact }
    return _server.request('POST', '/sjShop/customer/create', params, $common.getHeaders())
}
// * 获取客户列表
export function getCustomerList() {
    let params = {}
    return _server.request('POST', '/sjShop/customer/list', params, $common.getHeaders())
}
// ======================================================= 订单
// * 新增订单
export function createOrder(houseId, goodList, customerPicked) {
    let params = { houseId, goodList, customerPicked }
    return _server.request('POST', '/sjShop/order/create', params, $common.getHeaders())
}
// * 获取订单列表
export function getOrderList(houseId) {
    let params = { houseId }
    return _server.request('POST', '/sjShop/order/list', params, $common.getHeaders())
}
// * 修改订单状态
export function changeOrderStatus(orderId, goodStatus, priceStatus) {
    let params = { orderId, goodStatus, priceStatus }
    return _server.request('POST', '/sjShop/order/changeStatus', params, $common.getHeaders())
}
// * 库存撤回
export function clearOrderGood(orderId) {
    let params = { orderId }
    return _server.request('POST', '/sjShop/order/clearOrderGood', params, $common.getHeaders())
}
// * 订单修改
export function updateOrder(orderId, goodList) {
    let params = { orderId, goodList }
    return _server.request('POST', '/sjShop/order/updateOrder', params, $common.getHeaders())
}
// ======================================================= 标签
// * 新增标签
export function createTag(goodId, name, value) {
    let params = { goodId, name, value }
    return _server.request('POST', '/sjShop/tag/create', params, $common.getHeaders())
}
// * 获取标签列表
export function getPlugTagList(goodId) {
    let params = { goodId }
    return _server.request('POST', '/sjShop/tag/plugList', params, $common.getHeaders())
}
// * 删除标签
export function deleteTag(tagId) {
    let params = { tagId }
    return _server.request('POST', '/sjShop/tag/delete', params, $common.getHeaders())
}
// ======================================================= 商品
// * 新增商品
export function createGood(byHouseId, name, plugList, countList, cost, tip) {
    let params = { byHouseId, name, plugList, countList, cost, tip }
    return _server.request('POST', '/sjShop/good/create', params, $common.getHeaders())
}
// * 获取商品列表
export function getGoodList(byHouseId) {
    let params = { byHouseId }
    return _server.request('POST', '/sjShop/good/list', params, $common.getHeaders())
}
// * 删除商品
export function deleteGood(houseId, goodId) {
    let params = { houseId, goodId }
    return _server.request('POST', '/sjShop/good/delete', params, $common.getHeaders())
}
// * 编辑商品
export function editGood(houseId, _id, name, plugList, countList, cost, tip) {
    let params = { houseId, _id, name, plugList, countList, cost, tip }
    return _server.request('POST', '/sjShop/good/edit', params, $common.getHeaders())
}
// ======================================================= 员工
// * 店铺新增员工
export function createEmployee(phone, shopId) {
    let params = { phone, shopId }
    return _server.request('POST', '/sjShop/employee/create', params, $common.getHeaders())
}
// * 店铺员工列表
export function getEmployeeList(shopId) {
    let params = { shopId }
    return _server.request('POST', '/sjShop/employee/list', params, $common.getHeaders())
}
// * 店铺删除员工
export function deleteEmployee(employeeId) {
    let params = { employeeId }
    return _server.request('POST', '/sjShop/employee/delete', params, $common.getHeaders())
}
// ======================================================= 仓库
// * 新开仓库
export function createHouse(shopId, name) {
    let params = { shopId: shopId, name: name }
    return _server.request('POST', '/sjShop/house/create', params, $common.getHeaders())
}
// * 获取我管理的仓库列表
export function getHouseList(shopId) {
    let params = { shopId }
    return _server.request('POST', '/sjShop/house/list', params, $common.getHeaders())
}
// * 仓库删除
// export function deleteShopWareHouse(shopId, wareHouseId) {
//     let params = { shopId, wareHouseId }
//     return _server.request('POST', '/sjShop/house/delete', params, $common.getHeaders())
// }
// ======================================================= 店铺
// * 新开店铺
export function createShop(name) {
    let params = { name: name }
    return _server.request('POST', '/sjShop/shop/create', params, $common.getHeaders())
}
// * 获取我管理的店铺列表
export function getShopList() {
    let params = {}
    return _server.request('GET', '/sjShop/shop/list', params, $common.getHeaders())
}
// * 店铺删除
export function deleteShop(shopId) {
    let params = { shopId }
    return _server.request('POST', '/sjShop/shop/delete', params, $common.getHeaders())
}
// ======================================================= 用户
// * 获取用户信息
export function getUserInfo() {
    let params = {}
    return _server.request('GET', '/sjShop/user/info', params, $common.getHeaders())
}
// * 用户注册/登录
export function shopUserLogin(name, phone, password) {
    let params = { name, phone, password }
    return _server.request('POST', '/sjShop/user/login', params)
}
