courseSection.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <template>
  2. <view style="display: flex;justify-content: space-between;align-items: center;" @click="getVideo">
  3. <view style="display: flex;align-items: center;margin: 20rpx 0;">
  4. <view class="tag tagColor1" v-if="menuItem.sectionType==1">录播</view>
  5. <view class="tag tagColor2" v-if="menuItem.sectionType==2">直播</view>
  6. <view class="tag tagColor3" v-if="menuItem.sectionType==3">回放</view>
  7. <view class="t_content">
  8. <view>{{menuItem.name}}</view>
  9. <view style="font-size: 20rpx;color: #FF3B30;" v-if="menuItem.liveStartTime">
  10. <view v-if="menuItem.liveStartTime>nowTime">
  11. <text>{{$method.timestampToTime(menuItem.liveStartTime)}}</text>-
  12. <text>{{$method.timestampToTime(menuItem.liveEndTime)}}</text>
  13. </view>
  14. <view v-if="menuItem.liveStartTime<=nowTime&&menuItem.liveEndTime>nowTime">
  15. <text>直播中</text>
  16. </view>
  17. <view v-if="menuItem.liveEndTime<nowTime">
  18. <text>回放</text>
  19. </view>
  20. </view>
  21. </view>
  22. </view>
  23. <view v-if="menuItem.tryListen" class="tryBox">
  24. 试看
  25. </view>
  26. </view>
  27. </template>
  28. <script>
  29. import eventHub from '@/common/eventHub.js'
  30. export default {
  31. name: 'courseSection',
  32. props: {
  33. menuItem: {
  34. type: Object,
  35. default: {}
  36. }
  37. },
  38. data() {
  39. return {
  40. nowTime:0
  41. };
  42. },
  43. onLoad() {},
  44. created() {
  45. },
  46. mounted() {
  47. this.nowTime = Number(new Date().getTime()/1000).toFixed(0)
  48. },
  49. methods: {
  50. getVideo(){
  51. eventHub.$emit('getSection', this.menuItem.recordingUrl)
  52. }
  53. }
  54. };
  55. </script>
  56. <style scoped>
  57. .tryBox{
  58. width: 96rpx;
  59. height: 48rpx;
  60. background: #007AFF;
  61. border-radius: 24rpx;
  62. color: #FFFFFF;
  63. font-size: 30rpx;
  64. line-height: 48rpx;
  65. text-align: center;
  66. }
  67. .icon_up{
  68. width: 24rpx;
  69. height: 24rpx;
  70. }
  71. .t_content3{
  72. color: #007AFF;
  73. }
  74. .t_content2{
  75. color: #007AFF;
  76. }
  77. .t_content1{
  78. color: #007AFF;
  79. }
  80. .t_content{
  81. margin-left: 10rpx;
  82. color: #666666;
  83. white-space:nowrap;
  84. overflow:hidden;
  85. text-overflow:ellipsis;
  86. }
  87. .tagColor3{
  88. border: 2rpx solid #FF9500;
  89. color: #FF9500;
  90. }
  91. .tagColor2{
  92. border: 2rpx solid #FF3B30;
  93. color: #FF3B30;
  94. }
  95. .tagColor1{
  96. border: 2rpx solid #007AFF;
  97. color: #007AFF;
  98. }
  99. .tag{
  100. border-radius: 8rpx;
  101. font-size: 20rpx;
  102. padding: 5rpx;
  103. }
  104. </style>