import { request } from 'umi';

export default {
  //获取所有门店
  GetAllStore() {
    return request('/kitchen/api/StoreHelper/GetAllStore', {
      method: 'GET',
      headers: {
        TenantId: ''
      }
    });
  },

  //获取会员分页
  GetMemberListByPage(data) {
    return request('/kitchen/api/member/member-page-query', {
      method: 'POST',
      data
    });
  },

  //绑定会员
  OnBindMember(data) {
    return request('/kitchen/api/member/member-binding-cards', {
      method: 'POST',
      data
    });
  },

  //查询会员账户/卡号消费记录
  GetMemberAccountCardConsRecord(data) {
    return request('/kitchen/api/member/member-account-amount-page', {
      method: 'POST',
      data
    });
  },

  /**
   * 获取会员消费记录总次数和总人数
   * @param {*} data
   * @returns
   */
  GetMemberAccountRecordTotal(data) {
    return request('/kitchen/api/member/member-account-record-total', {
      method: 'POST',
      data
    });
  },

  /** 档口管理：Start */
  // 新增档口
  AddGate(data) {
    return request(`/kitchen/api/GateInfo/add`, {
      method: 'POST',
      data
    });
  },

  //档口状态修改
  EnableGate(data, TenantId = '') {
    return request(`/kitchen/api/GateInfo/Enable`, {
      method: 'POST',
      data,
      headers: {
        TenantId: TenantId
      }
    });
  },

  //根据门店ID查询 档口分页列表
  GetGateListByStorePage(StoreId, Current, PageSize, TenantId = '') {
    return request(`/kitchen/api/GateInfo/gatelist?StoreId=${StoreId}&Current=${Current}&PageSize=${PageSize}`, {
      method: 'GET',
      headers: {
        TenantId: TenantId
      }
    });
  },

  //根据门店ID查询 档口分页列表
  GetGateListByStorePageNew(StoreId, Current, PageSize, TenantId = '') {
    return request(`/kitchen/api/one-card/gate-list?StoreId=${StoreId}&Current=${Current}&PageSize=${PageSize}`, {
      method: 'GET',
      headers: {
        TenantId: TenantId
      }
    });
  },

  //根据门店ID查询 档口列表
  GetGateListByStoreList(StoreId) {
    return request(`/kitchen/api/GateInfo/gatealllist?StoreId=${StoreId}`, {
      method: 'GET'
    });
  },

  //更新档口信息
  UpdateGateInfo(data, TenantId = '') {
    return request(`/kitchen/api/GateInfo/Update`, {
      method: 'POST',
      data,
      headers: {
        TenantId: TenantId
      }
    });
  },

  UpdateGateInfoNew(data, TenantId = '') {
    return request(`/kitchen/api/one-card`, {
      method: 'PUT',
      data,
      headers: {
        TenantId: TenantId
      }
    });
  },

  /** 档口管理：End */

  /** 刷卡机管理：Start */
  //  新增刷卡机
  PayCardAdd(data) {
    return request(`/kitchen/api/PayCard/add`, {
      method: 'POST',
      data
    });
  },

  //刷卡机状态更改
  PayCardEnable(data) {
    return request(`/kitchenapi/PayCard/enable`, {
      method: 'POST',
      data
    });
  },

  //根据档口信息查询刷卡机列表
  PayCardByGateId(GateId, Current, PageSize) {
    return request(`/kitchen/api/PayCard/gateList?GateId=${GateId}&Current=${Current}&PageSize=${PageSize}`, {
      method: 'GET'
    });
  },

  //更新刷卡机信息
  UpdatePayCardInfo(data) {
    return request(`/kitchen/api/PayCard/update`, {
      method: 'POST',
      data
    });
  },
  /** 刷卡机管理：End */

  GetCosRequestURL(data) {
    return request(`/kitchen/api/systemconfig/GetCosRequestSignURL`, {
      method: 'POST',
      data: data,
    });
  },



  /** 会员账户管理： Start */
  //获取会员账户列表
  GetMemberAccountPageList(data) {
    return request(`/kitchen/api/member/member-account-page-list`, {
      method: 'POST',
      data: data,
    });
  },

  //更新会员账户状态
  UpdateMemberAccountStatus(data) {
    return request(`/kitchen/api/member/member-account-status`, {
      method: 'POST',
      data: data,
    });
  },
  /** 会员账户管理： End */

  //获取会员储值卡列表
  GetMemberCardPageList(data) {
    return request(`/kitchen/api/member/mmenber-card-page`, {
      method: 'POST',
      data: data,
    });
  },

  //添加会员储值卡
  AddMemberCard(data) {
    return request(`/kitchen/api/member/mmenber-card`, {
      method: 'POST',
      data: data,
    });
  },

  //修改会员卡状态
  UpdateMemberCardState(data) {
    return request(`/kitchen/api/member/mmenber-card-state`, {
      method: 'PUT',
      data: data,
    });
  },
  //获取数据
  GetDicList(TypeCode) {
    return request(`/kitchen/api/dict-data/dic-list/${TypeCode}`, {
      method: 'Get',
    });
  },
  AddGateSetUp(data) {
    return request(`/kitchen/api/GateInfo/AddGateSetUp`, {
      method: 'POST',
      data
    });
  },
  GetFoodList(TypeCode) {
    return request(`/kitchen/api/dict-data/dic-list/${TypeCode}`, {
      method: 'Get',
    });
  },
  AddGateFood(data) {
    return request(`/kitchen/api/GateInfo/AddGateFood`, {
      method: 'POST',
      data
    });
  },
  GetGoodsByMenuIdPage(params) {
    return request('/kitchen/api/FoodMenu/GetGoodsByMenuIdPage', {
      method: 'POST',
      data: {
        ...params,
      },
    });
  }
}
