dream.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <template name="dream">
  2. <!--文章-->
  3. <view v-if="item.type == 1">
  4. <news :item="item.data" :config="config"></news>
  5. </view>
  6. <!--普通图片-->
  7. <view v-else-if="item.type == 10">
  8. <pic :item="item.data" :config="config"></pic>
  9. </view>
  10. <!--多张图片-->
  11. <view v-else-if="item.type == 11">
  12. <swiper class="swiper" autoplay="false" vertical="true" interval="990000">
  13. <swiper-item v-for="(v, k) in item.data">
  14. <pic :item="v" :config="config"></pic>
  15. </swiper-item>
  16. </swiper>
  17. </view>
  18. <!--四宫格图片-->
  19. <view v-else-if="item.type == 12">
  20. <picGrid :item="item.data" :config="config"></picGrid>
  21. </view>
  22. <!--多张四宫格图片-->
  23. <view v-else-if="item.type == 13">
  24. <swiper class="swiper" autoplay="false" vertical="true" interval="990000">
  25. <swiper-item v-for="(v, k) in item.data">
  26. <picGrid :item="v" :config="config"></picGrid>
  27. </swiper-item>
  28. </swiper>
  29. </view>
  30. <!--视频-->
  31. <view v-else-if="item.type == 20">
  32. <swiper class="swiper" autoplay="false" vertical="true" interval="990000">
  33. <swiper-item v-for="(v, k) in item.data">
  34. <vod :item="v" :config="config"></vod>
  35. </swiper-item>
  36. </swiper>
  37. </view>
  38. <!--短视频-->
  39. <view v-else-if="item.type == 21">
  40. <vodShort :item="item.data" :config="config"></vodShort>
  41. </view>
  42. <!--留言视频-->
  43. <view v-else-if="item.type == 22">
  44. <vodComment :item="item.data" :config="config"></vodComment>
  45. </view>
  46. <!--单个链接-->
  47. <view v-else-if="item.type == 80">
  48. <linkView :item="item.data" :config="config"></linkView>
  49. </view>
  50. <!--单页面-->
  51. <view v-else-if="item.type == 82">
  52. <webView :item="item.data" :config="config"></webView>
  53. </view>
  54. </template>
  55. <script>
  56. import news from "@/pages/dream/view/news.vue";
  57. import pic from "@/pages/dream/view/pic.vue";
  58. import picGrid from "@/pages/dream/view/picGrid.vue";
  59. import vod from "@/pages/dream/view/vod.vue";
  60. import vodComment from "@/pages/dream/view/vodComment.vue";
  61. import vodShort from "@/pages/dream/view/vodShort.vue";
  62. import linkView from "@/pages/dream/view/linkView.vue";
  63. import webView from "@/pages/dream/view/webView.vue";
  64. export default {
  65. name: "dream",
  66. props: {
  67. config : {
  68. type : Object,
  69. value : null
  70. },
  71. item : {
  72. type : Object,
  73. value : null
  74. },
  75. },
  76. methods:{
  77. stopFun : function(){return false;}
  78. },
  79. components:{
  80. news,pic,picGrid,vod,vodComment,vodShort,linkView,webView
  81. }
  82. }
  83. </script>
  84. <style>
  85. .swiper{
  86. width: 100vw;
  87. height: 100vh;
  88. position: fixed;
  89. top: 0;
  90. left: 0;
  91. }
  92. </style>