user.js
5.3 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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
const http = uni.$u.http
/**
* 登录
* @param {
account: 用户名,
password: 密码
}
*/
export const userLogin = (data, config= {}) => http.post('/login', data, config)
/**
* 注册
* @param {
account: 用户名,
password: 密码
}
*/
export const userReg = (data, config= {}) => http.post('/users/register', data, config)
/**
* 微信登陆授权
* @param {
returnUrl: 请求地址
}
*/
export const userWXLogin = (data) => http.get('/weChatLogin/authorize', {params: data })
/**
* 通过openid登陆
* @param {
openid: 前端传入用户openid
type: 0公众号授权1小程序授权
}
*/
export const userOpenIdLogin = (data) => http.get('/weChatLogin/authorize', {params: data })
/**
* 获取用户信息
*/
export const getUserInfo = () => http.get('/system/user/profile', {custom: {auth: true}})
/**
* 修改用户信息
*/
export const updateUserInfo = (data) => http.put('/system/user/profile', data, {custom: {auth: true}})
/**
* 修改用户密码
*/
export const updateUserPwd = (data) => http.put('/system/user/profile/updatePwd', {}, {params: data, custom: {auth: true}})
/**
* 商家注册
* @param {
username: "用户名",
password: "密码",
businessName: "商家名称",
businessLicenseNo: "统一社会信用代码",
gymName: "球馆名称",
contacts: "联系人",
contactsPhone: "联系人电话",
province: "省",
city: "市",
county: "县",
address: "地址",
gymPicture: "球馆图片"
}
*/
export const businessReg = (data, config={}) => http.post('/ground-business/business/register',data, config)
/**
* 查询可提现金额
* * @returns 返回信息对象:{msg, code, data}
*/
export const getAmount = (data, config= {}) => http.get('/ground-business/cash/cashAvaliable', {params: data, custom: {auth: true} })
/**
* 申请提现
* * @param {
cashoutAmount: 提现金额
}
*/
export const cashAmout = (data) => http.post('/ground-business/cash/cashApply', data, {custom: {auth: true}})
/**
* 添加提现账户
* * @param {
account: "卡号",
accountName: "开户名称",
accountBank: "开户行"
}
*/
export const addBank = (data) => http.post('/ground-business/account', data, {custom: {auth: true} })
/**
* 修改提现账户
* * @param {
account: "卡号",
accountName: "开户名称",
accountBank: "开户行"
}
*/
export const updateBank = (data) => http.put('/ground-business/account', data, {custom: {auth: true} })
/**
* 删除提现账户(解除绑定银行卡)
* * @param {
account: "卡号",
accountName: "开户名称",
accountBank: "开户行"
}
*/
export const deleteBank = (accountIds) => http.delete(`/ground-business/account/${accountIds}`,{}, {custom: {auth: true} })
/**
* 根据businessId获取商家提现账户信息
* * @param {
businessId: "商家ID"
}
*/
export const getBank = (businessId) => http.get(`/ground-business/account/${businessId}`, {custom: {auth: true} })
/**
* 查询当前用户钱包余额
* @returns 返回信息对象:{msg, code, data: {walletId, money: '金额', username: '用户名'}}
*/
export const getUserAmout = () => http.get('/ground-business/wallet/balance', {custom: {auth: true} })
/**
* 钱包充值
* @param {
amount:充值金额,
type: 0公众号1小程序
}
* @returns 返回信息对象:{appId, nonceStr, paySign, signType, prepayId, timeStamp, packageValue }
*/
export const recharge = (data) => http.get('/ground-business/wallet/charge', {params: data, custom: {auth: true} })
/**
* 获取当前商家
* @returns 返回信息对象:{
businessId: "商家ID",
businessName: "商家名称",
businessLicenseNo: "统一社会信用代码",
gymName: "球馆名称",
contacts: "联系人",
contactsPhone: "联系人电话",
province: "省",
city: "市",
county: "县",
address: "地址",
gymNum: "球馆号",
serviceCharge: "支付手续费",
commission: "佣金",
username: "用户名",
businessLicensePicture: "商家许可证照片"
gymPicture: "球馆图片",
latitude: null
longitude: null
order: null
orderDate: null
orderEndTime: null
orderStartTime: null
params: {}
province: "广西壮族自治区"
remark: null
searchValue: null
serviceCharge: 0
sportsRange: "篮球,足球"
updateBy: null
updateTime: null
username: "我是测试"
* }
*/
export const getBusinessInfo = (data) => http.get('/ground-business/business/currentBusiness', {params: data, custom: {auth: true} })
/**
* 修改当前商家信息
* @param {
businessId: "商家ID",
businessName: "商家名称",
businessLicenseNo: "统一社会信用代码",
gymName: "球馆名称",
contacts: "联系人",
contactsPhone: "联系人电话",
province: "省",
city: "市",
county: "县",
address: "地址",
gymNum: "球馆号",
serviceCharge: "支付手续费",
commission: "佣金",
username: "用户名",
businessLicensePicture: "商家许可证照片"
gymPicture: "球馆图片",
latitude: null
longitude: null
order: null
orderDate: null
orderEndTime: null
orderStartTime: null
params: {}
province: "广西壮族自治区"
remark: null
searchValue: null
serviceCharge: 0
sportsRange: "篮球,足球"
updateBy: null
updateTime: null
username: "我是测试"
}
*/
export const updateBusinessInfo = (data) => http.put('/ground-business/business', data, {custom: {auth: true} })