dream.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  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. <y-Fab :bottom="140" :right="40" :btnList="fabList" @click="handleFab" style="display:none;"/>
  81. </view>
  82. </template>
  83. <script>
  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. item : {
  105. type : Object,
  106. value : null
  107. },
  108. index : {
  109. type : Number,
  110. value : null
  111. },
  112. },
  113. data() {
  114. return {
  115. community : {
  116. name : '区',
  117. show : false,
  118. },
  119. cate : {
  120. name : '选',
  121. show : false,
  122. },
  123. //fab的设置
  124. fabList: [
  125. {
  126. bgColor: '#55ff7f',
  127. text: '选集',
  128. fontSize: 28,
  129. color: '#fff'
  130. },
  131. {
  132. bgColor: '#16C2C2',
  133. text: '御所',
  134. fontSize: 28,
  135. color: '#fff'
  136. },
  137. {
  138. bgColor: '#37b59d',
  139. text: '穿越',
  140. fontSize: 28,
  141. color: '#fff'
  142. }
  143. ]
  144. }
  145. },
  146. methods:{
  147. setShow : function() {
  148. this.cate.show = !this.community.show;
  149. this.community.show = !this.community.show;
  150. },
  151. showCate : function() {
  152. this.$emit('cate');
  153. },
  154. showCommunity : function() {
  155. this.$emit('community');
  156. },
  157. },
  158. components:{
  159. news,pic,picGrid,vod,vodComment,vodShort,audioList,audioComment,liveComment,dialogue,linkView,webView,product
  160. }
  161. }
  162. </script>
  163. <style>
  164. .dream {
  165. width: 100vw;
  166. height: 100vh;
  167. position: relative;
  168. top: 0;
  169. left: 0;
  170. z-index: 1;
  171. }
  172. .swiper{
  173. width: 100vw;
  174. height: 100vh;
  175. position: relative;
  176. top: 0;
  177. left: 0;
  178. z-index: 1;
  179. }
  180. .page-num {
  181. position: fixed;
  182. right: 30rpx;
  183. bottom: 30rpx;
  184. width: 80rpx;
  185. height: 80rpx;
  186. background-color: rgba(0, 0, 0, 0.75);
  187. border-radius: 80rpx;
  188. color: #fff;
  189. font-size: 30rpx;
  190. line-height: 80rpx;
  191. text-align: center;
  192. z-index: 2000;
  193. }
  194. .love {
  195. bottom: 310rpx;
  196. }
  197. .community {
  198. bottom: 220rpx;
  199. background-color: #ff5500;
  200. }
  201. .cate {
  202. bottom: 130rpx;
  203. background-color: #3688ff;
  204. }
  205. </style>