videopage.vue 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <template>
  2. <view class="container">
  3. <back text="课程回放"></back>
  4. <!-- 视频资源 -->
  5. <view class="video-box">
  6. <video class="video" id="classVideo" :src="videoSrc" controls></video>
  7. </view>
  8. <!-- 信息模块 -->
  9. <view class="info-box">
  10. <view class="flex-box" style="width: 68%;height: 100%;">
  11. <view class="info-name">{{classInfo.title}}</view>
  12. <view style="display: flex;flex-direction: column;">
  13. <view class="info-time">课程时间:</view>
  14. <view style="display: flex;">
  15. <view class="info-msg" style="margin-right: 20rpx;">{{today}}</view>
  16. <view class="info-msg">{{classInfo.time}}</view>
  17. </view>
  18. </view>
  19. </view>
  20. <view class="flex-box" style=" width: 32%;height: 100%;">
  21. <view class="flex">
  22. <view class="block-tag-box">
  23. <view class="block-tag">{{classInfo.name}}</view>
  24. </view>
  25. <view class="block-tag-box">
  26. <view class="block-tag">{{classInfo.teacher}}</view>
  27. </view>
  28. </view>
  29. <view class="flex" style="margin: 0 10rpx;">
  30. <view class="t-icon t-icon-baocun" @click="saveVideo"></view>
  31. <view class="t-icon t-icon-fenxiang" ></view>
  32. </view>
  33. </view>
  34. </view>
  35. <!-- 缺省区域 -->
  36. <view style="margin-top: 150rpx;">
  37. <u-empty mode="data"></u-empty>
  38. </view>
  39. </view>
  40. </template>
  41. <script>
  42. import {
  43. mapState
  44. } from 'vuex'
  45. export default {
  46. computed: {
  47. ...mapState('m_children', ['classList'])
  48. },
  49. data() {
  50. return {
  51. videoSrc: 'https://img.cdn.aliyun.dcloud.net.cn/guide/uniapp/%E7%AC%AC1%E8%AE%B2%EF%BC%88uni-app%E4%BA%A7%E5%93%81%E4%BB%8B%E7%BB%8D%EF%BC%89-%20DCloud%E5%AE%98%E6%96%B9%E8%A7%86%E9%A2%91%E6%95%99%E7%A8%8B@20200317.mp4',
  52. classInfo: '',
  53. today: '',
  54. };
  55. },
  56. onLoad(options) {
  57. this.classInfo = this.classList[options.info]
  58. this.getToday()
  59. this.videoContext = uni.createVideoContext('classVideo')
  60. },
  61. methods: {
  62. getToday() {
  63. this.today = (new Date()).format("yyyy-MM-dd")
  64. },
  65. saveVideo(){
  66. console.log('点击保存');
  67. let that = this
  68. uni.saveVideoToPhotosAlbum({
  69. filePath: that.videoSrc,
  70. success: function() {
  71. console.log('保存成功')
  72. }
  73. })
  74. }
  75. }
  76. }
  77. </script>
  78. <style lang="scss">
  79. @import '@/subpkg/common/videopage.scss';
  80. </style>