浏览代码

联调接口

Limengbo 5 年之前
父节点
当前提交
a1dafd64b9

+ 1 - 1
project.config.json

@@ -7,7 +7,7 @@
     "minified": false
   },
   "compileType": "miniprogram",
-  "appid": "touristappid",
+  "appid": "wxf6c32ab700fa5842",
   "projectname": "y",
   "miniprogramRoot": "./dist"
 }

+ 38 - 27
src/app.wpy

@@ -17,6 +17,9 @@ import 'wepy-async-function'
 import { setStore } from 'wepy-redux'
 import configStore from './store'
 
+import { RequestService } from './util/httpRequest'
+import { httpUrls } from './util/consts'
+
 const store = configStore()
 setStore(store)
 
@@ -35,40 +38,48 @@ export default class extends wepy.app {
   }
 
   globalData = {
-    userInfo: null
-  }
-
-  constructor () {
-    super()
-    this.use('requestfix')
-  }
-
-  onLaunch() {
-    this.testAsync()
+    userInfo: null,
+    errMsg: true,
+    scene: ''
   }
 
-  sleep (s) {
-    return new Promise((resolve, reject) => {
-      setTimeout(() => {
-        resolve('promise resolved')
-      }, s * 1000)
+  async onLaunch() {
+    await wepy.login({
+      success (res) {
+        console.log(res.code)
+        const code = res.code
+        RequestService.sendRequest().url(`${httpUrls.baseApi}wx/user/openId`).data({
+          code
+        }).success(res => {
+          console.log(JSON.parse(res.data))
+          // console.log(this.globalData.session_key)
+          const sessionKey = JSON.parse(res.data).session_key
+          this.getUserInfo(code, sessionKey)
+        }).send()
+      }
     })
   }
 
-  async testAsync () {
-    const data = await this.sleep(3)
-    console.log(data)
-  }
-
-  getUserInfo(cb) {
-    const that = this
-    if (this.globalData.userInfo) {
-      return this.globalData.userInfo
-    }
+  getUserInfo (code, sessionKey) {
+    console.log(this.globalData.scene)
     wepy.getUserInfo({
       success (res) {
-        that.globalData.userInfo = res.userInfo
-        cb && cb(res.userInfo)
+        RequestService.sendRequest().url(`${httpUrls.baseApi}wx/user`).header({
+          'content-type': 'application/x-www-form-urlencoded; charset=UTF-8'
+        }).method('POST').data({
+          scene: this.globalData.scene,
+          sessionKey,
+          iv: res.iv,
+          encryptedData: res.encryptedData
+        }).success(res => {
+          console.log('用户', res)
+          wepy.setStorageSync('uid', res.data.data.id)
+          wepy.setStorageSync('user', res.data.data)
+        }).send()
+      },
+      fail (res) {
+        console.log(res)
+        this.globalData.errMsg = false
       }
     })
   }

+ 43 - 20
src/components/allFile.wpy

@@ -11,10 +11,15 @@
   display: flex;
   justify-content: space-between;
   align-items: center;
-  image {
-    width: 44rpx;
-    height: 10rpx;
+  .dian {
+    width:100rpx;
+    height: 60rpx;
+    image {
+      width: 44rpx;
+      height: 10rpx;
+    }
   }
+
   .file {
     display: flex;
     image {
@@ -41,43 +46,61 @@
 <template>
   <view class="all-file">
       <repeat for="{{fileList}}" key="index" index="index" item="item">
-        <view class="file-item" @tap="detail">
+        <view class="file-item" wx:if="{{item.task}}" @tap="detail({{item.task}})">
           <view class="file">
             <image src="../static/img/file.png"></image>
             <view class="file-explain">
-              <text class="title">双十一,庆功会讨论</text>
-              <text class="time">2018-10-11 10:00</text>
+              <text class="title">{{item.task.title}}</text>
+              <text class="time">{{timeList[index]}}</text>
             </view>
           </view>
-          <image src="../static/img/dian.png"></image>
+          <view class="dian"  @tap.stop="operation({{index}})">
+            <image src="../static/img/dian.png"></image>
+          </view>
+
         </view>
       </repeat>
   </view>
+  <del :syncFlag.sync="flag" :index="index"/>
 </template>
 <script>
   import wepy from 'wepy'
+  import Del from './del'
+  import { httpRequestApi } from '../util/httpRequestApi'
 
   export default class AllFile extends wepy.component {
     data = {
-      fileList: [
-        {
-          id: '0',
-          title: 'loading'
-        },
-        {
-          id: '0',
-          title: 'loading'
-        }
-      ]
+      fileList: [],
+      flag: 'false',
+      timeList: [],
+      index: 0
+    }
+    components = {
+      del: Del
     }
-
     methods = {
-      detail () {
-        this.$root.$navigate('/pages/detail')
+      detail (task) {
+        const id = task.id ? task.id : ''
+        const title = task.title ? task.title : ''
+        this.$root.$navigate(`/pages/detail?id=${id}&title=${title}`)
+      },
+      operation (ind) {
+        this.flag = 'true'
+        this.index = ind
       }
     }
 
     onLoad () {
+      httpRequestApi.getTaskList().success(res => {
+        console.log('任务列表', res)
+        this.fileList = res.data.data.list
+        res.data.data.list.forEach(item => {
+          if (item.task) {
+            this.timeList.push(new Date(item.task.gmtCreated).toLocaleString())
+          }
+        })
+        this.$apply()
+      })
     }
   }
 </script>

+ 162 - 10
src/components/browse.wpy

@@ -1,28 +1,180 @@
 <style lang="less">
+  .log {
+    width: 100%;
+    height: 100%;
+  }
+  .file-box {
+    width: 100%;
+    background: #fff;
+    padding: 0 59rpx 0 35rpx;
+    box-sizing: border-box;
+  }
+  .file-title {
+    height: 80rpx;
+    width: 100%;
+    font-size: 32rpx;
+    line-height: 80rpx;
+    color: #848993;
+    margin-left: 33rpx;
+  }
+  .file-item {
+    width: 100%;
+    height: 140rpx;
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    .file {
+      display: flex;
+      image {
+        width:74rpx;
+        height: 76rpx;
+        margin-right: 26rpx;
+      }
+      .file-explain {
+        display: flex;
+        flex-direction: column;
+        justify-content: center;
+        .title {
+          font-size:28rpx;
+          font-weight: bolder;
+        }
+        .time {
+          font-size: 24rpx;
+          color: #909090;
+        }
+      }
+    }
+  }
+  .back {
+    position: fixed;
+    left: 40rpx;
+    bottom: 32rpx;
+    width:77rpx;
+    height: 76rpx;
+    image {
+      width: 100%;
+      height: 100%;
+    }
+  }
 </style>
 <template>
-  <view class="my">
-    浏览文件
+  <view class="log">
+    <view class="file-title">文档资料</view>
+    <view class="file-box">
+      <repeat for="{{localFile}}" key="index" index="index" item="item">
+        <view class="file-item" @tap="preview({{item.path}}, {{index}})">
+          <view class="file">
+            <image src="../static/img/{{listType[index]}}.png"></image>
+            <view class="file-explain">
+              <text class="title">{{item.fileName}}</text>
+              <text class="time">{{localFileTime[index]}}</text>
+            </view>
+          </view>
+        </view>
+      </repeat>
+    </view>
+    <view class="file-title">白板截图</view>
+    <view class="file-box">
+      <repeat for="{{screenshot}}" key="index" index="index" item="item">
+        <view class="file-item" @tap="previewImg({{item.path}}, {{index}})">
+          <view class="file">
+            <image src="{{item.path}}" style="width: 104rpx;height: 76rpx;"></image>
+            <view class="file-explain">
+              <text class="title">{{item.fileName}}</text>
+              <text class="time">{{screenshotTime[index]}}</text>
+            </view>
+          </view>
+        </view>
+      </repeat>
+    </view>
   </view>
 </template>
+
 <script>
   import wepy from 'wepy'
+  import { httpRequestApi } from '../util/httpRequestApi'
+
+  export default class Detail extends wepy.page {
+    components = {
+
+    }
 
-  export default class Browse extends wepy.component {
     data = {
-      list: [
-        {
-          id: '0',
-          title: 'loading'
-        }
-      ]
+      localFile: [],
+      screenshot: [],
+      localFileTime: [],
+      screenshotTime: [],
+      listType: []
+    }
+
+    computed = {
+
     }
 
     methods = {
+      preview (url, index) {
+        wx.showLoading({
+          title: '加载中'
+        })
+        wx.downloadFile({
+          url: url,
+          success: (res) => {
+            console.log(res.tempFilePath)
+            wx.openDocument({
+              filePath: res.tempFilePath,
+              success: (res) => {
+                wx.hideLoading()
+                console.log('打开文档成功')
+                const fileId = this.localFile[index].id
+                const taskId = this.localFile[index].taskId
+                httpRequestApi.addViewLog(fileId, taskId).success(res => {
+                  console.log('添加文档')
+                })
+              }
+            })
+          }
+        })
+      },
+      previewImg (url, index) {
+        wx.previewImage({
+          current: 'url', // 当前显示图片的http链接
+          urls: [url], // 需要预览的图片http链接列表
+          success: res => {
+            const fileId = this.screenshot[index].id
+            const taskId = this.screenshot[index].taskId
+            httpRequestApi.addViewLog(fileId, taskId).success(res => {
+              console.log('添加文档')
+            })
+          }
+        })
+      }
+    }
 
+    events = {
+    }
+
+    CompileTime (list, type) {
+      let arr = []
+      list.forEach(item => {
+        if (type) {
+          arr.push(item.path.substr(item.path.lastIndexOf('.') + 1))
+        } else {
+          arr.push(new Date(item.gmtCreated).toLocaleString())
+        }
+      })
+      return arr
     }
 
-    onLoad () {
+    onLoad(params) {
+      httpRequestApi.getLogList().success(res => {
+        console.log('记录', res)
+        // this.screenshot = res.data.data.screenshot
+        // this.localFile = res.data.data.localFile
+        // this.localFileTime = this.CompileTime(res.data.data.localFile)
+        // this.screenshotTime = this.CompileTime(res.data.data.screenshot)
+        // this.listType = this.CompileTime(res.data.data.localFile, true)
+        // this.$apply()
+      })
     }
   }
 </script>

+ 85 - 0
src/components/del.wpy

@@ -0,0 +1,85 @@
+<style lang="less">
+  .del {
+    position: absolute;
+    left: 0;
+    top: 0;
+    width: 100%;
+    height: 100%;
+    background: rgba(0, 0, 0, .3);
+    view {
+      position: fixed;
+      left: 10%;
+      width: 80%;
+      height: 100rpx;
+      background: #fff;
+      border-radius: 20rpx;
+      text-align: center;
+      line-height: 100rpx;
+      font-size: 36rpx;
+    }
+    .delete {
+      bottom: 147rpx;
+    }
+    .cancel {
+      bottom: 36rpx;
+    }
+    .btn-slect {
+      color: #F86363;
+    }
+  }
+</style>
+<template>
+  <view class="del" wx:if="{{syncFlag == 'true'}}">
+    <view class="delete {{slectFlag ? 'btn-slect' : ''}}" @tap="del">删除</view>
+    <view class="cancel {{slectFlag ? '' : 'btn-slect'}}"  @tap="hide">取消</view>
+  </view>
+</template>
+<script>
+  import wepy from 'wepy'
+  import { httpRequestApi } from '../util/httpRequestApi'
+
+  export default class Del extends wepy.component {
+    data = {
+      slectFlag: false
+    }
+
+    props = {
+      syncFlag: {
+        type: String,
+        default: 'null',
+        twoWay: true
+      },
+      index: {
+        type: Number,
+        default: 'null'
+      }
+    }
+
+    methods = {
+      del () {
+        this.slectFlag = !this.slectFlag
+        this.syncFlag = 'false'
+        const taskJoinUser = this.$parent.$data.fileList[this.index].taskJoinUser
+        const id = taskJoinUser.id ? taskJoinUser.id : ''
+        httpRequestApi.delFile(id, 'CLOSE').success(res => {
+          console.log(res)
+          wx.showToast({
+            title: '成功',
+            icon: 'success',
+            duration: 2000
+          })
+        })
+        this.$apply()
+      },
+      hide () {
+        this.slectFlag = !this.slectFlag
+        this.syncFlag = 'false'
+        this.$apply()
+      }
+    }
+
+    onLoad () {
+      console.log(this.syncFlag)
+    }
+  }
+</script>

+ 17 - 14
src/components/mys.wpy

@@ -1,7 +1,7 @@
 <style lang="less">
   .my {
     width: 100%;
-    height: 90%;
+    height: 100%;
     background: #F0F0F0;
     padding-top: 10rpx;
     box-sizing: border-box;
@@ -72,10 +72,10 @@
       justify-content: space-between;
       align-items: center;
       .txt {
-          font-size: 28rpx;
+          font-size: 24rpx;
           image {
-            width: 60rpx;
-            height: 60rpx;
+            width: 30rpx;
+            height: 30rpx;
             vertical-align: middle;
             margin-right: 17rpx;
           }
@@ -83,7 +83,7 @@
             vertical-align: middle;
           }
           .bold {
-            font-size:32rpx;
+            font-size: 28rpx;
             font-weight: bolder;
           }
       }
@@ -112,18 +112,21 @@
 <template>
   <view class="my">
     <view class="user">
-      <image src="../static/img/vip.png"></image>
+      <image src="{{avatar}}"></image>
       <view class="con">
         <view class="name">
-          <text>孙志雷</text>
-          <image src="../static/img/vip.png"></image>
+          <text>{{nickName}}</text>
+          <!--<image src="../static/img/vip.png"></image>-->
         </view>
+        <!--
         <view class="progress-bar">
           <view class="top"></view>
         </view>
         <view class="capacity">容量(1.96G/3.4G)</view>
+        -->
       </view>
     </view>
+    <!--
     <view class="other">
       <view class="other-item">
         <view class="txt">
@@ -143,6 +146,7 @@
         <image src="../static/img/guanggao.png"></image>
       </view>
     </view>
+    -->
   </view>
 </template>
 <script>
@@ -150,12 +154,8 @@
 
   export default class Mys extends wepy.component {
     data = {
-      list: [
-        {
-          id: '0',
-          title: 'loading'
-        }
-      ]
+      avatar: '',
+      nickName: ''
     }
 
     methods = {
@@ -163,6 +163,9 @@
     }
 
     onLoad () {
+      this.avatar = wepy.getStorageSync('user').avatar
+      this.nickName = wepy.getStorageSync('user').nickName
+      this.$apply()
     }
   }
 </script>

+ 75 - 28
src/pages/detail.wpy

@@ -24,10 +24,6 @@
     display: flex;
     justify-content: space-between;
     align-items: center;
-    image {
-      width: 44rpx;
-      height: 10rpx;
-    }
     .file {
       display: flex;
       image {
@@ -66,31 +62,29 @@
   <view class="container">
     <view class="file-title">文档资料</view>
     <view class="file-box">
-      <repeat for="{{fileList}}" key="index" index="index" item="item">
-        <view class="file-item">
+      <repeat for="{{localFile}}" key="index" index="index" item="item">
+        <view class="file-item" @tap="preview({{item.path}}, {{index}})">
           <view class="file">
-            <image src="../static/img/EXCEL.png"></image>
+            <image src="../static/img/{{listType[index]}}.png"></image>
             <view class="file-explain">
-              <text class="title">双十一,庆功会讨论</text>
-              <text class="time">2018-10-11 10:00</text>
+              <text class="title">{{item.fileName}}</text>
+              <text class="time">{{localFileTime[index]}}</text>
             </view>
           </view>
-          <image src="../static/img/dian.png"></image>
         </view>
       </repeat>
     </view>
     <view class="file-title">白板截图</view>
     <view class="file-box">
-      <repeat for="{{fileList}}" key="index" index="index" item="item">
-        <view class="file-item">
+      <repeat for="{{screenshot}}" key="index" index="index" item="item">
+        <view class="file-item" @tap="previewImg({{item.path}}, {{index}})">
           <view class="file">
-            <image src="../static/img/EXCEL.png"></image>
+            <image src="{{item.path}}" style="width: 104rpx;height: 76rpx;"></image>
             <view class="file-explain">
-              <text class="title">双十一,庆功会讨论</text>
-              <text class="time">2018-10-11 10:00</text>
+              <text class="title">{{item.fileName}}</text>
+              <text class="time">{{screenshotTime[index]}}</text>
             </view>
           </view>
-          <image src="../static/img/dian.png"></image>
         </view>
       </repeat>
     </view>
@@ -102,6 +96,7 @@
 
 <script>
   import wepy from 'wepy'
+  import { httpRequestApi } from '../util/httpRequestApi'
 
   export default class Detail extends wepy.page {
     components = {
@@ -109,16 +104,11 @@
     }
 
     data = {
-      fileList: [
-        {
-          id: '0',
-          title: 'loading'
-        },
-        {
-          id: '0',
-          title: 'loading'
-        }
-      ]
+      localFile: [],
+      screenshot: [],
+      localFileTime: [],
+      screenshotTime: [],
+      listType: []
     }
 
     computed = {
@@ -130,15 +120,72 @@
         this.$redirect({
           url: './index'
         })
+      },
+      preview (url, index) {
+        wx.showLoading({
+          title: '加载中'
+        })
+        wx.downloadFile({
+          url: url,
+          success: (res) => {
+            console.log(res.tempFilePath)
+            wx.openDocument({
+              filePath: res.tempFilePath,
+              success: (res) => {
+                wx.hideLoading()
+                console.log('打开文档成功')
+                const fileId = this.localFile[index].id
+                const taskId = this.localFile[index].taskId
+                httpRequestApi.addViewLog(fileId, taskId).success(res => {
+                  console.log('添加文档')
+                })
+              }
+            })
+          }
+        })
+      },
+      previewImg (url, index) {
+        wx.previewImage({
+          current: 'url', // 当前显示图片的http链接
+          urls: [url], // 需要预览的图片http链接列表
+          success: res => {
+            const fileId = this.screenshot[index].id
+            const taskId = this.screenshot[index].taskId
+            httpRequestApi.addViewLog(fileId, taskId).success(res => {
+              console.log('添加文档')
+            })
+          }
+        })
       }
     }
 
     events = {
     }
 
-    onLoad() {
+    CompileTime (list, type) {
+      let arr = []
+      list.forEach(item => {
+        if (type) {
+          arr.push(item.path.substr(item.path.lastIndexOf('.') + 1))
+        } else {
+          arr.push(new Date(item.gmtCreated).toLocaleString())
+        }
+      })
+      return arr
+    }
+
+    onLoad(params) {
       wepy.setNavigationBarTitle({
-        title: '当前页面'
+        title: params.title
+      })
+      httpRequestApi.getTaskFile(params.id).success(res => {
+        console.log(res)
+        this.screenshot = res.data.data.screenshot
+        this.localFile = res.data.data.localFile
+        this.localFileTime = this.CompileTime(res.data.data.localFile)
+        this.screenshotTime = this.CompileTime(res.data.data.screenshot)
+        this.listType = this.CompileTime(res.data.data.localFile, true)
+        this.$apply()
       })
     }
   }

+ 24 - 4
src/pages/index.wpy

@@ -1,5 +1,12 @@
 <style lang="less">
+  .container {
+      padding-top: 110rpx;
+      box-sizing: border-box;
+  }
   .tabar {
+    position: absolute;
+    left: 0;
+    top: 0;
     display: flex;
     align-items:center;
     width: 100%;
@@ -23,6 +30,13 @@
       border-bottom: 4rpx solid #3687FF;
     }
   }
+  .content {
+    height: 100%;
+    overflow-y: scroll;
+  }
+  .content::-webkit-scrollbar{
+    width: 0;
+  }
 </style>
 <template>
   <view class="container">
@@ -34,9 +48,12 @@
         </view>
       </repeat>
     </view>
-    <allFile wx:if="{{selectInd == 0}}"/>
-    <browse wx:if="{{selectInd == 1}}"/>
-    <my wx:if="{{selectInd == 2}}"/>
+    <view class="content">
+      <allFile wx:if="{{selectInd == 0}}" :syncFlag.sync="flag"/>
+      <browse wx:if="{{selectInd == 1}}"/>
+      <my wx:if="{{selectInd == 2}}"/>
+    </view>
+    <!--<button open-type="getUserInfo">授权登录</button>-->
   </view>
 </template>
 
@@ -83,7 +100,10 @@
     events = {
     }
 
-    onLoad() {
+    onLoad(params, data) {
+      console.log(params)
+      console.log(this.$parent.globalData.errMsg)
+      this.$parent.globalData.scene = params.scene
     }
   }
 </script>

二进制
src/static/img/pdf.png


二进制
src/static/img/pptx.png


二进制
src/static/img/xlsx.png


+ 4 - 0
src/util/consts.js

@@ -0,0 +1,4 @@
+const httpUrls = {
+  baseApi: 'http://schedule-test.api.efunbox.cn/'
+}
+export { httpUrls }

+ 108 - 0
src/util/httpRequest.js

@@ -0,0 +1,108 @@
+import wepy from 'wepy'
+/** wx.request服务封装 */
+export class RequestService {
+  /**
+   * create by wq
+   * info 错误信息
+   * callBack 回调函数
+   * errTip 自定义错误信息
+   */
+  static httpHandlerError(info, callBack, errTip) {
+    wepy.hideLoading()
+    /** 请求成功,退出该函数 */
+    if (info.statusCode === 200) {
+      return false
+    } else {
+      /** 401 没有权限时,重新登录 */
+      if (info.data.status === 401) {
+        wepy.redirectTo({
+          url: 'index'
+        })
+      }
+      /** 判断是否有自定义错误信息,如果有,优先使用自定义错误信息,其次曝出后台返回错误信息 */
+      let errorInfo = ''
+      if (errTip) {
+        errorInfo = errTip
+      } else {
+        if (info.data.errMsg) {
+          errorInfo = info.data.errMsg
+        } else {
+          errorInfo = '也许服务器忙!'
+        }
+      }
+      wepy.showToast({
+        title: errorInfo,
+        icon: 'loading',
+        duration: 3000
+      })
+      /** 发生错误信息时,如果有回调函数,则执行回调 */
+      if (callBack) {
+        callBack()
+      }
+      return true
+    }
+  }
+  /**
+   * create by wq
+   *请求封装
+   *method 请求方式
+   *data 发送请求数据
+   *url 请求路径
+   *fail 请求失败,执行该函数
+   *success 请求成功,执行该函数
+   */
+  static sendRequest() {
+    const that = this
+    return {
+      _sucCallback: null,
+      _failCallback: null,
+      _method: 'GET',
+      _data: {},
+      _header: {'content-type': 'application/json'},
+      _url: '',
+      send: function() {
+        wepy.request({
+          /** header 如果需要验证token 可封装另外的getHeaders函数获取本地缓存token */
+          // header: this.getHeaders(),
+          header: this._header,
+          data: this._data,
+          url: this._url,
+          method: this._method,
+          success: (res) => {
+            let error = that.httpHandlerError(res, this._failCallback)
+            if (error) return
+            this._sucCallback(res)
+          },
+          fail: (res) => {
+            this._failCallback()
+          }
+        })
+        return this
+      },
+      success: function(callback) {
+        this._sucCallback = callback
+        return this
+      },
+      fail: function(callback) {
+        this._failCallback = callback
+        return this
+      },
+      url: function(url) {
+        this._url = url
+        return this
+      },
+      data: function(data) {
+        this._data = data
+        return this
+      },
+      header: function(header) {
+        this._header = header
+        return this
+      },
+      method: function(method) {
+        this._method = method
+        return this
+      }
+    }
+  }
+}

+ 53 - 0
src/util/httpRequestApi.js

@@ -0,0 +1,53 @@
+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 () {
+    const url = genAPIUrl('wx/joinUser')
+    return RequestService.sendRequest().url(url).header({
+      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).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 () {
+    const url = genAPIUrl('wx/viewLog')
+    return RequestService.sendRequest().header({
+      uid: wepy.getStorageSync('uid')
+    }).url(url).send()
+  }
+}