courseSection.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <template>
  2. <view style="display: flex;justify-content: space-between;align-items: center;">
  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. export default {
  30. name: 'courseSection',
  31. props: {
  32. menuItem: {
  33. type: Object,
  34. default: {}
  35. }
  36. },
  37. data() {
  38. return {
  39. nowTime:0
  40. };
  41. },
  42. onLoad() {},
  43. created() {
  44. },
  45. mounted() {
  46. this.nowTime = Number(new Date().getTime()/1000).toFixed(0)
  47. },
  48. methods: {
  49. }
  50. };
  51. </script>
  52. <style scoped>
  53. .tryBox{
  54. width: 96rpx;
  55. height: 48rpx;
  56. background: #007AFF;
  57. border-radius: 24rpx;
  58. color: #FFFFFF;
  59. font-size: 30rpx;
  60. line-height: 48rpx;
  61. text-align: center;
  62. }
  63. .icon_up{
  64. width: 24rpx;
  65. height: 24rpx;
  66. }
  67. .t_content3{
  68. color: #007AFF;
  69. }
  70. .t_content2{
  71. color: #007AFF;
  72. }
  73. .t_content1{
  74. color: #007AFF;
  75. }
  76. .t_content{
  77. margin-left: 10rpx;
  78. color: #666666;
  79. white-space:nowrap;
  80. overflow:hidden;
  81. text-overflow:ellipsis;
  82. }
  83. .tagColor3{
  84. border: 2rpx solid #FF9500;
  85. color: #FF9500;
  86. }
  87. .tagColor2{
  88. border: 2rpx solid #FF3B30;
  89. color: #FF3B30;
  90. }
  91. .tagColor1{
  92. border: 2rpx solid #007AFF;
  93. color: #007AFF;
  94. }
  95. .tag{
  96. border-radius: 8rpx;
  97. font-size: 20rpx;
  98. padding: 5rpx;
  99. }
  100. </style>