index.js
4.55 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-29 17:26:42
* @FilePath: /xyxBooking-weapp/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',
ICBC_ORDER_QRY: '/srv/?a=icbc_orderqry',
};
/**
* @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: 扫码核销二维码列表
* @returns
*/
export const qrcodeListAPI = (params) => fn(fetch.get(Api.QRCODE_LIST, params));
/**
* @description: 扫码核销二维码状态
* @returns
*/
export const qrcodeStatusAPI = (params) => fn(fetch.get(Api.QRCODE_STATUS, params));
/**
* @description: 预约单列表
* @returns
*/
export const billListAPI = (params) => fn(fetch.get(Api.BILL_LIST, params));
/**
* @description: 退款
* @returns
*/
export const icbcRefundAPI = (params) => fn(fetch.post(Api.ICBC_REFUND, params));
/**
* @description: 支付前准备(获取支付参数等)
* @returns
*/
export const billPrepareAPI = (params) => fn(fetch.post(Api.BILL_PREPARE, params));
/**
* @description: 支付状态查询
* @returns
*/
export const billPayStatusAPI = (params) => fn(fetch.get(Api.BILL_PAY_STATUS, params));
/**
* @description: 证件号查询二维码
* @returns
*/
export const queryQrCodeAPI = (params) => fn(fetch.get(Api.QUERY_QR_CODE, params));
/**
* @description: 订单查询
* @returns
*/
export const icbcOrderQryAPI = (params) => fn(fetch.get(Api.ICBC_ORDER_QRY, params));
/**
* @description: 授权前订单详情查询
* @returns
*/
export const onAuthBillInfoAPI = (params) => fn(fetch.get(Api.ON_AUTH_BILL_INFO, params));