dream.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  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 == 51">
  65. <moment :index="index" :item="item.data" :control="control" :bottom="bottom"></moment>
  66. </view>
  67. <!--对话-->
  68. <view v-else-if="item.type == 60">
  69. <dialogue :index="index" :item="item.data" :control="control" :bottom="bottom"></dialogue>
  70. </view>
  71. <!--电商单个产品-->
  72. <view v-else-if="item.type == 70">
  73. <product :index="index" :item="item.data" :control="control" :bottom="bottom"></product>
  74. </view>
  75. <!--单个链接-->
  76. <view v-else-if="item.type == 80">
  77. <linkView :index="index" :item="item.data" :control="control" :bottom="bottom"></linkView>
  78. </view>
  79. <!--单页面-->
  80. <view v-else-if="item.type == 82">
  81. <webView :index="index" :item="item.data" :control="control" :bottom="bottom"></webView>
  82. </view>
  83. <!--<view class="page-num" @click="setShow" v-if="index != -1">P{{index+1}}</view>-->
  84. </view>
  85. </template>
  86. <script>
  87. import cover from "@/pages/dream/view/cover.vue";
  88. import news from "@/pages/dream/view/news.vue";
  89. import pic from "@/pages/dream/view/pic.vue";
  90. import picGrid from "@/pages/dream/view/picGrid.vue";
  91. import vod from "@/pages/dream/view/vod.vue";
  92. import vodComment from "@/pages/dream/view/vodComment.vue";
  93. import audioList from "@/pages/dream/view/audioList.vue";
  94. import audioComment from "@/pages/dream/view/audioComment.vue";
  95. import liveComment from "@/pages/dream/view/liveComment.vue";
  96. import vodShort from "@/pages/dream/view/vodShort.vue";
  97. import dialogue from "@/pages/dream/view/dialogue.vue";
  98. import linkView from "@/pages/dream/view/linkView.vue";
  99. import webView from "@/pages/dream/view/webView.vue";
  100. import product from "@/pages/dream/view/product.vue";
  101. import moment from "@/pages/dream/view/moment.vue";
  102. export default {
  103. name: "dream",
  104. props: {
  105. control : {
  106. type : Object,
  107. value : null
  108. },
  109. bottom : {
  110. type : Object,
  111. value : null
  112. },
  113. item : {
  114. type : Object,
  115. value : null
  116. },
  117. index : 0
  118. },
  119. data() {
  120. return {
  121. }
  122. },
  123. methods:{
  124. getData : function(page) {
  125. },
  126. showDrawer : function(key) {
  127. if (key) {
  128. this.$emit('showDrawer', key);
  129. } else {
  130. this.Dever.alert('您点错了吧~');
  131. }
  132. },
  133. handle : function(e) {
  134. this.showDrawer(this.button[e.index].key);
  135. }
  136. },
  137. components:{
  138. cover,news,pic,picGrid,vod,vodComment,vodShort,audioList,audioComment,liveComment,dialogue,linkView,webView,product,moment
  139. }
  140. }
  141. </script>
  142. <style>
  143. .dream {
  144. width: 100vw;
  145. height: 100vh;
  146. position: relative;
  147. top: 0;
  148. left: 0;
  149. z-index: 1;
  150. }
  151. .swiper{
  152. width: 100vw;
  153. height: 100vh;
  154. position: relative;
  155. top: 0;
  156. left: 0;
  157. z-index: 1;
  158. }
  159. .page-num {
  160. position: fixed;
  161. right: 30rpx;
  162. bottom: 30rpx;
  163. width: 80rpx;
  164. height: 80rpx;
  165. background-color: rgba(0, 0, 0, 0.75);
  166. border-radius: 80rpx;
  167. color: #fff;
  168. font-size: 30rpx;
  169. line-height: 80rpx;
  170. text-align: center;
  171. z-index: 2000;
  172. }
  173. .love {
  174. bottom: 310rpx;
  175. }
  176. .community {
  177. bottom: 220rpx;
  178. background-color: #ff5500;
  179. }
  180. .cate {
  181. bottom: 130rpx;
  182. background-color: #3688ff;
  183. }
  184. </style>