index.js
1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*
* @Date: 2023-08-24 09:42:27
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2023-08-24 12:52:26
* @FilePath: /front/src/api/index.js
* @Description: 文件描述
*/
import { fn, fetch } from '@/api/fn';
const Api = {
ORDER_REST_COUNT: '/srv/?a=order_rest_count',
ORDER_INFO: '/srv/?a=order_info',
ORDER_DETAIL_MY_LAST: '/srv/?a=order_detail_my_last',
ORDER_ADD: '/srv/?a=order_add',
ORDER_CANCEL: '/srv/?a=order_cancel',
};
/**
* @description: 剩余预约数量列表
* @param {Array} dates 查询日期
* @returns
*/
export const orderRestCountAPI = (params) => fn(fetch.get(Api.ORDER_REST_COUNT, params));
/**
* @description: 查询预约信息
* @param {String} id 预约订单ID
* @returns
*/
export const orderInfoAPI = (params) => fn(fetch.get(Api.ORDER_INFO, params));
/**
* @description: 我的预约信息
* @returns
*/
export const orderDetailMyLastAPI = (params) => fn(fetch.get(Api.ORDER_DETAIL_MY_LAST, params));
/**
* @description: 保存预约信息
* @param {Array} dates 日期列表
* @param {Array} details
* @returns
*/
export const orderAddAPI = (params) => fn(fetch.post(Api.ORDER_ADD, params));
/**
* @description: 取消预约
* @param {String} id 预约订单的ID
* @returns
*/
export const orderCancelAPI = (params) => fn(fetch.post(Api.ORDER_CANCEL, params));