index.js
4.73 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
/*
* @Date: 2023-08-24 09:42:27
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-01-26 13:28:51
* @FilePath: /xysBooking/src/api/index.js
* @Description: 文件描述
*/
import { fn, fetch } from '@/api/fn';
const Api = {
CAN_RESERVE_DATE_LIST: '/srv/?a=api&t=can_reserve_date_list',
CAN_RESERVE_TIME_LIST: '/srv/?a=api&t=can_reserve_time_list',
PERSON_LIST: '/srv/?a=api&t=person_list',
ADD_PERSON: '/srv/?a=api&t=add_person',
DEL_PERSON: '/srv/?a=api&t=del_person',
ADD_RESERVE: '/srv/?a=api&t=add_reserve',
PAY_PREPARE: '/srv/?a=api&t=pay_prepare',
PAY_CALLBACK: '/srv/?a=api&t=pay_callback',
BILL_INFO: '/srv/?a=api&t=bill_info',
ON_AUTH_BILL_INFO: '/srv/?a=no_auth_api&t=bill_info',
QRCODE_LIST: '/srv/?a=api&t=qrcode_list',
QRCODE_STATUS: '/srv/?a=api&t=qrcode_status',
BILL_LIST: '/srv/?a=api&t=bill_list',
ICBC_REFUND: '/srv/?a=icbc_refund',
BILL_PREPARE: '/srv/?a=api&t=bill_person',
BILL_PAY_STATUS: '/srv/?a=api&t=bill_pay_status',
QUERY_QR_CODE: '/srv/?a=api&t=id_number_query_qr_code',
};
/**
* @description: 可预约日期列表
* @param {Array} month 月份,格式yyyy-mm
* @returns
*/
export const canReserveDateListAPI = (params) => fn(fetch.get(Api.CAN_RESERVE_DATE_LIST, params));
/**
* @description: 可预约时段列表
* @param {Array} month_date 日期,格式yyyy-mm-dd
* @returns
*/
export const canReserveTimeListAPI = (params) => fn(fetch.get(Api.CAN_RESERVE_TIME_LIST, params));
/**
* @description: 参观者列表
* @param {String} reserve_date 预约日期,格式 yyyy-mm-dd,没有传入则不查询指定日期是否已预约
* @param {String} begin_time 时段开始时间,格式 hh:mm
* @param {String} end_time 时段结束时间,格式 hh:mm
* @returns
*/
export const personListAPI = (params) => fn(fetch.get(Api.PERSON_LIST, params));
/**
* @description: 添加参观者
* @param {String} name 参观者姓名
* @param {String} id_type 证件类型,1=身份证,3=其他
* @param {String} id_number 证件号
* @returns
*/
export const addPersonAPI = (params) => fn(fetch.post(Api.ADD_PERSON, params));
/**
* @description: 删除参观者
* @param {String} person_id 参观者id
* @returns
*/
export const delPersonAPI = (params) => fn(fetch.post(Api.DEL_PERSON, params));
/**
* @description: 提交预约
* @param {String} reserve_date
* @param {String} begin_time
* @param {String} end_time
* @param {String} person_id_list
* @returns {String} bill_id 预约单id
*/
export const addReserveAPI = (params) => fn(fetch.post(Api.ADD_RESERVE, params));
/**
* @description: 支付准备(模拟)
* @param {String} bill_id
* @returns {String} bill_id 预约单id
*/
export const payPrepareAPI = (params) => fn(fetch.post(Api.PAY_PREPARE, params));
/**
* @description: 支付回调(模拟)
* @param {String} pay_id 预约单支付凭证
* @param {String} pay_status 支付状态,1为成功,0为失败(缺省)
* @returns {String} bill_id 预约单id
*/
export const payCallbackAPI = (params) => fn(fetch.post(Api.PAY_CALLBACK, params));
/**
* @description: 预约单详情,参观者列表
* @param {String} bill_id 预约单id
* @returns {String}
*/
export const billInfoAPI = (params) => fn(fetch.get(Api.BILL_INFO, params));
/**
* @description: 预约单详情,参观者列表 - 免授权接口
* @param {String} bill_id 预约单id
* @returns {String}
*/
export const onAuthBillInfoAPI = (params) => fn(fetch.get(Api.ON_AUTH_BILL_INFO, params));
/**
* @description: 预约码列表
* @returns {String}
*/
export const qrcodeListAPI = (params) => fn(fetch.get(Api.QRCODE_LIST, params));
/**
* @description: 二维码使用状态
* @param {String} qr_code 二维码编号
* @returns {String} status 二维码状态 1=未激活(未支付),3=待使用(已支付),5=被取消,7=已使用
*/
export const qrcodeStatusAPI = (params) => fn(fetch.get(Api.QRCODE_STATUS, params));
/**
* @description: 预约单列表
* @param {String}
* @returns {String}
*/
export const billListAPI = (params) => fn(fetch.get(Api.BILL_LIST, params));
/**
* @description: 取消预约
* @param {String} pay_id
* @returns {String}
*/
export const icbcRefundAPI = (params) => fn(fetch.post(Api.ICBC_REFUND, params));
/**
* @description: 预约单的参观者列表
* @param {String}
* @returns {String}
*/
export const billPersonAPI = (params) => fn(fetch.get(Api.BILL_PREPARE, params));
/**
* @description: 刷新预约单支付状态
* @param {String}
* @returns {String}
*/
export const billPayStatusAPI = (params) => fn(fetch.get(Api.BILL_PAY_STATUS, params));
/**
* @description: 身份证查询预约码
* @param {String}
* @returns {String}
*/
export const queryQrCodeAPI = (params) => fn(fetch.get(Api.QUERY_QR_CODE, params));