dream.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. <template name="dream">
  2. <view class="dream">
  3. <!--封面-->
  4. <view v-if="item.type == -1">
  5. <cover :index="index" :item="item" :control="control" :bottom="bottom" @showDrawer="showDrawer"></cover>
  6. </view>
  7. <!--文章-->
  8. <view v-if="item.type == 1">
  9. <news :index="index" :item="item.data" :control="control" :bottom="bottom"></news>
  10. </view>
  11. <!--普通图片-->
  12. <view v-else-if="item.type == 10">
  13. <pic :index="index" :item="item.data" :control="control" :bottom="bottom"></pic>
  14. </view>
  15. <!--多张图片-->
  16. <view v-else-if="item.type == 11">
  17. <swiper class="swiper" autoplay="false" vertical="true" interval="990000">
  18. <swiper-item v-for="(v, k) in item.data" :key="k">
  19. <pic :index="index" :item="v" :control="control" :bottom="bottom"></pic>
  20. </swiper-item>
  21. </swiper>
  22. </view>
  23. <!--四宫格图片-->
  24. <view v-else-if="item.type == 12">
  25. <picGrid :index="index" :item="item.data" :control="control" :bottom="bottom"></picGrid>
  26. </view>
  27. <!--多张四宫格图片-->
  28. <view v-else-if="item.type == 13">
  29. <swiper class="swiper" autoplay="false" vertical="true" interval="990000">
  30. <swiper-item v-for="(v, k) in item.data" :key="k">
  31. <picGrid :index="index" :item="v" :control="control" :bottom="bottom"></picGrid>
  32. </swiper-item>
  33. </swiper>
  34. </view>
  35. <!--视频-->
  36. <view v-else-if="item.type == 20">
  37. <swiper class="swiper" autoplay="false" vertical="true" interval="990000">
  38. <swiper-item v-for="(v, k) in item.data" :key="k">
  39. <vod :index="index" :item="v" :control="control" :bottom="bottom"></vod>
  40. </swiper-item>
  41. </swiper>
  42. </view>
  43. <!--短视频-->
  44. <view v-else-if="item.type == 21">
  45. <vodShort :index="index" :item="item.data" :control="control" :bottom="bottom"></vodShort>
  46. </view>
  47. <!--留言视频-->
  48. <view v-else-if="item.type == 22">
  49. <vodComment :index="index" :item="item.data" :control="control" :bottom="bottom"></vodComment>
  50. </view>
  51. <!--音频播放-->
  52. <view v-else-if="item.type == 30">
  53. <audioList :index="index" :item="item.data" :control="control" :bottom="bottom"></audioList>
  54. </view>
  55. <!--留言音频-->
  56. <view v-else-if="item.type == 31">
  57. <audioComment :index="index" :item="item.data" :control="control" :bottom="bottom"></audioComment>
  58. </view>
  59. <!--直播-->
  60. <view v-else-if="item.type == 40">
  61. <liveComment :index="index" :item="item.data" :control="control" :bottom="bottom"></liveComment>
  62. </view>
  63. <!--对话-->
  64. <view v-else-if="item.type == 60">
  65. <dialogue :index="index" :item="item.data" :control="control" :bottom="bottom"></dialogue>
  66. </view>
  67. <!--电商单个产品-->
  68. <view v-else-if="item.type == 70">
  69. <product :index="index" :item="item.data" :control="control" :bottom="bottom"></product>
  70. </view>
  71. <!--单个链接-->
  72. <view v-else-if="item.type == 80">
  73. <linkView :index="index" :item="item.data" :control="control" :bottom="bottom"></linkView>
  74. </view>
  75. <!--单页面-->
  76. <view v-else-if="item.type == 82">
  77. <webView :index="index" :item="item.data" :control="control" :bottom="bottom"></webView>
  78. </view>
  79. <!--<view class="page-num" @click="setShow" v-if="index != -1">P{{index+1}}</view>-->
  80. </view>
  81. </template>
  82. <script>
  83. import cover from "@/pages/dream/view/cover.vue";
  84. import news from "@/pages/dream/view/news.vue";
  85. import pic from "@/pages/dream/view/pic.vue";
  86. import picGrid from "@/pages/dream/view/picGrid.vue";
  87. import vod from "@/pages/dream/view/vod.vue";
  88. import vodComment from "@/pages/dream/view/vodComment.vue";
  89. import audioList from "@/pages/dream/view/audioList.vue";
  90. import audioComment from "@/pages/dream/view/audioComment.vue";
  91. import liveComment from "@/pages/dream/view/liveComment.vue";
  92. import vodShort from "@/pages/dream/view/vodShort.vue";
  93. import dialogue from "@/pages/dream/view/dialogue.vue";
  94. import linkView from "@/pages/dream/view/linkView.vue";
  95. import webView from "@/pages/dream/view/webView.vue";
  96. import product from "@/pages/dream/view/product.vue";
  97. export default {
  98. name: "dream",
  99. props: {
  100. control : {
  101. type : Object,
  102. value : null
  103. },
  104. bottom : {
  105. type : Object,
  106. value : null
  107. },
  108. item : {
  109. type : Object,
  110. value : null
  111. },
  112. index : 0
  113. },
  114. data() {
  115. return {
  116. }
  117. },
  118. methods:{
  119. getData : function(page) {
  120. },
  121. showDrawer : function(key) {
  122. if (key) {
  123. this.$emit('showDrawer', key);
  124. } else {
  125. this.Dever.alert('您点错了吧~');
  126. }
  127. },
  128. handle : function(e) {
  129. this.showDrawer(this.button[e.index].key);
  130. }
  131. },
  132. components:{
  133. cover,news,pic,picGrid,vod,vodComment,vodShort,audioList,audioComment,liveComment,dialogue,linkView,webView,product
  134. }
  135. }
  136. </script>
  137. <style>
  138. .dream {
  139. width: 100vw;
  140. height: 100vh;
  141. position: relative;
  142. top: 0;
  143. left: 0;
  144. z-index: 1;
  145. }
  146. .swiper{
  147. width: 100vw;
  148. height: 100vh;
  149. position: relative;
  150. top: 0;
  151. left: 0;
  152. z-index: 1;
  153. }
  154. .page-num {
  155. position: fixed;
  156. right: 30rpx;
  157. bottom: 30rpx;
  158. width: 80rpx;
  159. height: 80rpx;
  160. background-color: rgba(0, 0, 0, 0.75);
  161. border-radius: 80rpx;
  162. color: #fff;
  163. font-size: 30rpx;
  164. line-height: 80rpx;
  165. text-align: center;
  166. z-index: 2000;
  167. }
  168. .love {
  169. bottom: 310rpx;
  170. }
  171. .community {
  172. bottom: 220rpx;
  173. background-color: #ff5500;
  174. }
  175. .cate {
  176. bottom: 130rpx;
  177. background-color: #3688ff;
  178. }
  179. </style>