123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- import { httpUrls } from './consts'
- import { RequestService } from './httpRequest'
- import wepy from 'wepy'
- const HOST = httpUrls.baseApi
- function genAPIUrl(action) {
- return HOST + action
- }
- export class httpRequestApi {
- // 请求任务列表
- static getTaskList (pageNo, pageSize) {
- const url = genAPIUrl('wx/joinUser')
- return RequestService.sendRequest().url(url).header({
- uid: wepy.getStorageSync('uid')
- }).data({
- pageNo,
- pageSize,
- uid: wepy.getStorageSync('uid')
- }).send()
- }
- // 列表详情
- static getTaskFile (taskId) {
- const url = genAPIUrl('wx/taskFile')
- return RequestService.sendRequest().url(url).data({
- taskId
- }).send()
- }
- // 删除
- static delFile (id, fileStatus) {
- const url = genAPIUrl('wx/joinUser')
- return RequestService.sendRequest().header({
- uid: wepy.getStorageSync('uid')
- }).url(url).method('PUT').data({
- id,
- fileStatus
- }).send()
- }
- // 添加观看记录
- static addViewLog (fileId, taskId) {
- const url = genAPIUrl('wx/viewLog')
- return RequestService.sendRequest().header({
- uid: wepy.getStorageSync('uid')
- }).url(url).method('POST').data({
- fileId,
- taskId
- }).send()
- }
- // 观看记录列表
- static getLogList (pageNo, pageSize) {
- const url = genAPIUrl('wx/viewLog')
- return RequestService.sendRequest().header({
- uid: wepy.getStorageSync('uid')
- }).data({
- pageNo,
- pageSize
- }).url(url).send()
- }
- }
|