index.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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="item.videoUrl"></video>
  7. </view>
  8. <view class="item-content" @click="jumpToPlayVideo(item)">
  9. <view>{{item.videoName}}</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. import { getTaskList } from "@/api/system/user"
  18. export default {
  19. data() {
  20. return {
  21. videoList: [{
  22. id: 1,
  23. name: 'ceshi1',
  24. date: '2025-03-23',
  25. status: 1
  26. },
  27. {
  28. id: 2,
  29. name: 'ceshi2',
  30. date: '2025-03-23',
  31. status: 1
  32. },
  33. {
  34. id: 3,
  35. name: 'ceshi3',
  36. date: '2025-03-23',
  37. status: 2
  38. },
  39. {
  40. id: 4,
  41. name: 'ceshi4',
  42. date: '2025-03-23',
  43. status: 1
  44. },
  45. ]
  46. }
  47. },
  48. onLoad() {
  49. getTaskList().then(res=>{
  50. console.log('res',res);
  51. this.videoList=res.data;
  52. });
  53. },
  54. methods: {
  55. jumpToPlayVideo(item) {
  56. if(item.status==0){
  57. uni.navigateTo({
  58. url: 'creatingVideo/creatingVideo'
  59. });
  60. }else{
  61. uni.navigateTo({
  62. url: 'playVideo/playVideo'
  63. });
  64. }
  65. }
  66. }
  67. }
  68. </script>
  69. <style scoped lang="scss">
  70. .list-content {
  71. padding: 20px;
  72. .list-item {
  73. height: 100px;
  74. width: 100%;
  75. background-color: #fff;
  76. border-radius: 4px;
  77. margin-bottom: 20px;
  78. display: flex;
  79. .item-video {
  80. width: 150px;
  81. height: 100px;
  82. .video-player {
  83. width: 100%;
  84. height: 100px;
  85. }
  86. }
  87. .item-content {
  88. display: flex;
  89. flex-direction: column;
  90. justify-content: center;
  91. margin-left: 10px;
  92. color: #333;
  93. view {
  94. height: 30px;
  95. }
  96. }
  97. }
  98. }
  99. </style>