import request from '@/utils/request';
import config from '@/../config/env.config';

const { kdspApi, goodsApi } = config;

/**
 * 获取企业外卖商品列表
 * http://yapi.quantgroups.com/project/389/interface/api/64794
 */
export async function apiTakeawayList(param) {
  return request.post('/api/consoles/product/enterprise/main/pageList', {
    data: param,
    prefix: goodsApi,
  });
}
/**
 * 获取企业虚拟商品列表
 * http://yapi.quantgroups.com/project/389/interface/api/64794
 */
export async function apiVirtualList(param) {
  return request.post('/api/consoles/product/enterprise/virtual/pageList', {
    data: param,
    prefix: goodsApi,
  });
}
/**
 * 企业客户列表
 * http://yapi.quantgroups.com/project/389/interface/api/65324
 */
export async function apiEnterpriseList(param) {
  return request.post('/api/consoles/enterprise/pageList', {
    data: param,
    prefix: goodsApi,
  });
}
/**
 * 模糊查询店铺列表
 * http://yapi.quantgroups.com/project/389/interface/api/65289
 */
export async function apiShopList(param) {
  return request.post('/api/consoles/shops/getListByName', {
    data: param,
    prefix: goodsApi,
  });
}
/**
 * 企业团餐-查询餐段配置
 * http://yapi.quantgroups.com/project/389/interface/api/65444
 */
export async function apiMealTimePeriod(param) {
  return request.post('/api/consoles/product/enterprise/getMealTimePeriod', {
    data: param,
    prefix: goodsApi,
  });
}
/**
 * 企业团餐->信息修改
 * http://yapi.quantgroups.com/project/389/interface/api/65099
 */
export async function apiMealInfoUpdate(param) {
  return request.post('/api/consoles/product/enterprise/main/update', {
    data: param,
    prefix: goodsApi,
  });
}
/**
 * 企业团餐->删除
 * http://yapi.quantgroups.com/project/389/interface/api/65109
 */
export async function apiMealInfoDel(param) {
  return request.post('/api/consoles/product/enterprise/main/deleteById', {
    data: param,
    prefix: goodsApi,
  });
}
/**
 * 企业团餐->根据企业ID查询已选择自提点
 * http://yapi.quantgroups.com/project/389/interface/api/65449
 */
export async function apiSelPickSelfList(param) {
  return request.post('/api/consoles/product/enterprise/queryByEnterpriseId', {
    data: param,
    prefix: goodsApi,
  });
}
/**
 * 企业团餐->查询外卖商品 - 选择商品弹窗
 * http://yapi.quantgroups.com/project/389/interface/api/65479
 */
export async function apiSelGoodsList(param) {
  return request.post('/api/consoles/product/enterprise/sku/page', {
    data: param,
    prefix: goodsApi,
  });
}
/**
 * 企业团餐->查询商品 - 选择虚拟商品弹窗
 * http://yapi.quantgroups.com/project/389/interface/api/65479
 */
export async function apiSelVirtualGoodsList(param) {
  return request.post('/api/consoles/product/enterprise/virtual/sku/page', {
    data: param,
    prefix: goodsApi,
  });
}
/**
 * 企业团餐->添加外卖商品保存
 * http://yapi.quantgroups.com/project/389/interface/api/65094
 */
export async function apiSaveGoodsList(param) {
  return request.post('/api/consoles/product/enterprise/add', {
    data: param,
    prefix: goodsApi,
  });
}
/**
 * 企业团餐->添加虚拟商品保存
 * http://yapi.quantgroups.com/project/389/interface/api/65484
 */
export async function apiSaveVirtualGoodsList(param) {
  return request.post('/api/consoles/products/enterprise/virtual/add', {
    data: param,
    prefix: goodsApi,
  });
}
/**
 * 企业团餐->虚拟品->根据企业ID查询店铺列表
 * http://yapi.quantgroups.com/project/389/interface/api/65504
 */
export async function apiShopListByEnterpriseID(param) {
  return request.post('/api/consoles/product/enterprise/virtual/shops', {
    data: param,
    prefix: goodsApi,
  });
}
/**
 * 企业团餐->根据企业ID+自提点列表查询店铺列表
 * http://yapi.quantgroups.com/project/389/interface/api/65539
 */
export async function apiShopListByPickSelfID(param) {
  return request.post('/api/consoles/product/enterprise/queryByEnterpriseIdAndPickSelfId', {
    data: param,
    prefix: goodsApi,
  });
}
