coach.js
3.89 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
import request from '@/sheep/request';
const CoachApi = {
// 获取常约教练开关
getCoachesOftenSwitch: () => {
return request({
url: '/app/coaches/oftenSwitch',
method: 'GET',
custom: {
loadingMsg: '加载中',
},
});
},
// 修改常约教练开关
updateCoachesOftenSwitch: (status) => {
return request({
url: '/app/coaches/updateOftenSwitch',
method: 'POST',
data: {
status
},
custom: {
ShowSuccess: true,
successMsg: '修改成功',
},
});
},
// 获取教练可选择门店
getCoachSelectStore: (params) => {
return request({
url: '/app/coursePt/selectStore',
method: 'GET',
params: {
...params,
},
custom: {
loadingMsg: '加载中',
},
});
},
// 教练约课-团课日期查询-根据教练id
getCoachCourseDate: (id) => {
return request({
url: `/app/courseLeague/coachScheduleDate`,
method: 'GET',
params: {
id,
},
});
},
// 教练约课-团课列表-根据教练id
getCoachCourseList: (params) => {
return request({
url: `/app/courseLeague/coachSchedule`,
method: 'GET',
params: {
...params,
},
});
},
// 教练详情
getCoachDetail: (id) => {
return request({
url: `/app/coaches/detail/${id}`,
method: 'GET',
custom: {
loadingMsg: '加载中',
},
});
},
// 教练动态-增加转发次数
addCoachDynamicForward: (data) => {
return request({
url: '/app/coaches/forward',
method: 'POST',
data,
});
},
// 教练动态-点赞
likeCoachDynamic: (data) => {
return request({
url: '/app/coaches/like',
method: 'POST',
data,
});
},
// 教练动态-全屏刷分页
CoachDynamicVideoPage: (params) => {
return request({
url: '/app/coaches/videoPage',
method: 'GET',
params: {
...params,
},
});
},
// 教练动态分页(全部数据)
getCoachDynamicAll: (params) => {
return request({
url: '/app/coaches/trendsPage',
method: 'GET',
params: {
...params,
},
});
},
// 教练动态分页(少量数据)
getCoachDynamic: (params) => {
return request({
url: '/app/coaches/trendsSimplePage',
method: 'GET',
params: {
...params,
},
});
},
// 教练动态详情
getCoachDynamicDetail: (id) => {
return request({
url: `/app/coaches/trendsDetail/${id}`,
method: 'GET',
custom: {
loadingMsg: '加载中',
},
});
},
// 用户关注的教练分页
coachesFollowPage: (params) => {
return request({
url: '/app/coaches/followPage',
method: 'GET',
params: {
...params,
},
custom: {
loadingMsg: '加载中',
},
});
},
// 置顶教练
coachesTop: (data) => {
return request({
url: '/app/coaches/top',
method: 'POST',
data,
custom: {
showSuccess: true,
successMsg: data.status == 1 ? '置顶成功' : '取消置顶',
},
});
},
// 关注教练
followCoach: (data) => {
return request({
url: `/app/coaches/follow`,
method: 'POST',
data,
custom: {
showSuccess: true,
successMsg: data.status == 1 ? '关注成功' : '取消关注',
},
});
},
// 当前用户是否关注了教练-教练id
isFollowCoach: (id) => {
return request({
url: `/app/coaches/isFollow`,
method: 'GET',
params: {
id,
},
});
},
// 我要当教练
applyCoach: (data) => {
return request({
url: '/app/home/wannaCoach',
method: 'POST',
data: data,
custom: {
showSuccess: true,
successMsg: '提交成功',
},
});
},
};
export default CoachApi;