index.vue 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <template>
  2. <view class="list-content">
  3. <view class="list-item" v-for="item in videoList" :key="item.id">
  4. <view class="item-video">
  5. <video class="video-player" :controls="false" @play.prevent id="myVideo"
  6. src="@/static/videos/86e914d805fe8578f8258d21eeac7ddc.mp4"></video>
  7. </view>
  8. <view class="item-content" @click="jumpToPlayVideo(item)">
  9. <view>{{item.name}}</view>
  10. <view>{{item.date}}</view>
  11. <view :style="{color:item.status==0?'#DE868F':'#333'}">{{item.status==0?'视频生成中':'已生成'}}</view>
  12. </view>
  13. </view>
  14. </view>
  15. </template>
  16. <script>
  17. export default {
  18. data() {
  19. return {
  20. videoList: [{
  21. id: 1,
  22. name: 'ceshi1',
  23. date: '2025-03-23',
  24. status: 0
  25. },
  26. {
  27. id: 2,
  28. name: 'ceshi2',
  29. date: '2025-03-23',
  30. status: 1
  31. },
  32. {
  33. id: 3,
  34. name: 'ceshi3',
  35. date: '2025-03-23',
  36. status: 2
  37. },
  38. {
  39. id: 4,
  40. name: 'ceshi4',
  41. date: '2025-03-23',
  42. status: 0
  43. },
  44. ]
  45. }
  46. },
  47. methods: {
  48. jumpToPlayVideo(item) {
  49. if(item.status==0){
  50. uni.navigateTo({
  51. url: 'creatingVideo/creatingVideo'
  52. });
  53. }else{
  54. uni.navigateTo({
  55. url: 'playVideo/playVideo'
  56. });
  57. }
  58. }
  59. }
  60. }
  61. </script>
  62. <style scoped lang="scss">
  63. .list-content {
  64. padding: 20px;
  65. .list-item {
  66. height: 100px;
  67. width: 100%;
  68. background-color: #fff;
  69. border-radius: 4px;
  70. margin-bottom: 20px;
  71. display: flex;
  72. .item-video {
  73. width: 150px;
  74. height: 100px;
  75. .video-player {
  76. width: 100%;
  77. height: 100px;
  78. }
  79. }
  80. .item-content {
  81. display: flex;
  82. flex-direction: column;
  83. justify-content: center;
  84. margin-left: 10px;
  85. color: #333;
  86. view {
  87. height: 30px;
  88. }
  89. }
  90. }
  91. }
  92. </style>