dream.vue 5.1 KB

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