"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.goodsList = goodsList;
exports.orderList = orderList;
exports.apply = apply;
exports.applyreal = applyreal;
exports.cancel = cancel;
exports.advance = advance;
exports.skip = skip;
exports.nextone = nextone;
exports.applyrang = applyrang;
exports.getAPPUser = getAPPUser;
exports.getAPPToken = getAPPToken;
exports.getAPPUserDetail = getAPPUserDetail;
exports.getRule = getRule;
exports.upRule = upRule;
exports.menulist = menulist;
exports.jsonDataRanking = jsonDataRanking;
exports.infoDate = infoDate;
exports.getCoffeeGoods = getCoffeeGoods;
exports.getCoffeeTypes = getCoffeeTypes;

var _request = _interopRequireDefault(require("../utils/request.js"));

var _requestOrther = _interopRequireDefault(require("../utils/requestOrther.js"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

/**
 * 商品列表
 * @returns {AjaxPromise}
 */
function goodsList(data) {
  return (0, _request["default"])({
    url: "/goods/list",
    method: "get",
    data: data
  });
}
/**
 * 排队列表
 * @returns {AjaxPromise}
 */


function orderList(data) {
  return (0, _request["default"])({
    url: "/orders/queue",
    method: "get",
    data: data
  });
}
/**
 * 预约
 * @returns {AjaxPromise}
 */


function apply(data) {
  return (0, _request["default"])({
    url: "/orders/add-app",
    method: "post",
    data: data
  });
}

function applyreal(data) {
  return (0, _request["default"])({
    url: "/orders/add-house",
    method: "post",
    data: data
  });
}
/**
 * 取消预约
 * @returns {AjaxPromise}
 */


function cancel(data) {
  return (0, _request["default"])({
    url: "/orders/cancel",
    method: "get",
    data: data
  });
}
/**
 * 取消预约
 * @returns {AjaxPromise}
 */


function advance(data) {
  return (0, _request["default"])({
    url: "/orders/to-house",
    method: "get",
    data: data
  });
}
/**
 * 跳过
 * @returns {AjaxPromise}
 */


function skip(data) {
  return (0, _request["default"])({
    url: "/orders/skip",
    method: "GET",
    data: data
  });
}
/**
 * 下一个
 * @returns {AjaxPromise}
 */


function nextone(data) {
  return (0, _request["default"])({
    url: "/orders/finish",
    method: "GET",
    data: data
  });
}
/**
 * 预约时段
 * @returns {AjaxPromise}
 */


function applyrang(data) {
  return (0, _request["default"])({
    url: "/time-segment/list",
    method: "GET",
    data: data
  });
}
/**
 * 获取app用户名
 * @returns {AjaxPromise}
 */


function getAPPUser(data, header) {
  return (0, _requestOrther["default"])({
    url: "/seeyon/thirdpartyController.do",
    method: "GET",
    header: header,
    data: data
  });
}
/**
 * 获取apptoken
 * @returns {AjaxPromise}
 */


function getAPPToken(urldata) {
  return (0, _requestOrther["default"])({
    url: "/seeyon/rest/token/" + urldata,
    method: "GET"
  });
}
/**
 * 获取app登录人员信息
 * @returns {AjaxPromise}
 */


function getAPPUserDetail(data) {
  return (0, _requestOrther["default"])({
    url: "/seeyon/rest/orgMember",
    method: "GET",
    data: data
  });
}
/**
 * 获取当前打烊规则
 * @returns {AjaxPromise}
 */


function getRule(data) {
  return (0, _request["default"])({
    url: "/stop-rule/list",
    method: "POST",
    data: data
  });
}
/**
 * 更新当前打烊规则
 * @returns {AjaxPromise}
 */


function upRule(data) {
  return (0, _request["default"])({
    url: "/stop-rule/edit",
    method: "POST",
    data: data
  });
}
/**
 * 菜单列表
 * @returns {AjaxPromise}
 */


function menulist(data) {
  return (0, _request["default"])({
    urlType: "menuURL",
    url: "/menu/recently",
    method: "GET",
    data: data
  });
}

function jsonDataRanking(data) {
  return (0, _request["default"])({
    urlType: "dataJSON",
    url: "/data/oa-rank/".concat(data.url, ".json"),
    method: "GET",
    data: data.data || undefined
  });
}

function infoDate() {
  return (0, _request["default"])({
    urlType: "dataJSON",
    url: "/data/oa-rank/info.json",
    method: "GET"
  });
}

function getCoffeeGoods(data) {
  return (0, _request["default"])({
    urlType: "coffee",
    url: "/getGoods?".concat(data || ''),
    method: "GET"
  });
}

function getCoffeeTypes() {
  return (0, _request["default"])({
    urlType: "coffee",
    url: "/getTypes",
    method: "GET"
  });
}