moment.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. <template name="moment">
  2. <view id="moments">
  3. <view class="home-pic" :style="style">
  4. <view class="home-pic-base">
  5. <view class="top-pic">
  6. <image class="header" :src="item.logo"></image>
  7. </view>
  8. <view class="top-name">{{item.name}}</view>
  9. </view>
  10. </view>
  11. <view style="padding-bottom: 140rpx;">
  12. <view class="moments__post" v-for="(v,k) in fetch.info" :key="k">
  13. <momentItem :item="v" :user="fetch.user" :key="v.server_time"></momentItem>
  14. </view>
  15. </view>
  16. <view class="foot" >
  17. </view>
  18. <y-Fab :bottom="20" :right="140" @click="showModal" bgColor="#0fa5e5" text="发布"></y-Fab>
  19. <block v-if="index == -1">
  20. <y-Fab :bottom="20" :right="20" @click="back" text="返回"></y-Fab>
  21. </block>
  22. <view v-if="showComment">
  23. <dever-publish :title="title" :is_upload="true" @hideModal="hideModal" @getRefresh="getRefresh" :type="type" :type_id="type_id" :api="api"></dever-publish>
  24. </view>
  25. </view>
  26. </template>
  27. <script>
  28. import deverPublish from '@/lib/dever/components/publish.vue';
  29. import momentItem from "@/pages/dream/view/momentItem.vue";
  30. export default {
  31. name: "moment",
  32. props: {
  33. control : {
  34. type : Object,
  35. value : null
  36. },
  37. bottom : {
  38. type : Object,
  39. value : null
  40. },
  41. item : {
  42. type : Object,
  43. value : null
  44. },
  45. index : 0
  46. },
  47. components: {
  48. deverPublish,momentItem
  49. },
  50. data() {
  51. return {
  52. fetch : {
  53. 'info' : [],
  54. },
  55. style : '',
  56. title : '发布新动态',
  57. api : 'app/community/?l=api.addMoment',
  58. type : 3,
  59. type_id : 0,
  60. showComment : false,
  61. }
  62. },
  63. mounted() {
  64. this.bottom[this.index] = this;
  65. this.type_id = this.item.id;
  66. this.style = 'background:url("'+this.item.pic+'");background-size: contain;';
  67. this.getData(1);
  68. },
  69. computed:{
  70. },
  71. methods: {
  72. getData : function(page) {
  73. this.Dever.page([page, 'info'], this, 'app/community/?l=api.moment', {type:this.type,type_id:this.type_id,code:this.Dever.config.code,noloading:1});
  74. },
  75. showModal : function() {
  76. this.showComment = true;
  77. },
  78. hideModal : function() {
  79. this.showComment = false;
  80. },
  81. getRefresh : function(cate_id, type, type_id, content) {
  82. this.getData(1);
  83. this.hideModal();
  84. },
  85. }
  86. }
  87. </script>
  88. <style scoped>
  89. view {
  90. box-sizing: border-box;
  91. }
  92. .header {
  93. width: 100%;
  94. height: 100%;
  95. z-index: 10;
  96. border-radius: 40upx;
  97. }
  98. #moments {
  99. background: #fff;
  100. }
  101. #moments .home-pic {
  102. width: 100%;
  103. /* margin-top: -150upx; */
  104. position: relative;
  105. height: 500upx;
  106. z-index: 5;
  107. background-size: cover;
  108. margin-bottom: 50upx
  109. }
  110. #moments .home-pic-base {
  111. position: absolute;
  112. /*left: -60upx;*/
  113. bottom: -40upx;
  114. width: 100%;
  115. height: 160upx;
  116. padding: 0 30upx;
  117. }
  118. #moments .home-pic-base .top-pic {
  119. width: 360upx;
  120. height: 360upx;
  121. border-radius: 40upx;
  122. -webkit-transform: scale(0.5);
  123. -ms-transform: scale(0.5);
  124. transform: scale(0.5);
  125. -webkit-transform-origin: 100% 0%;
  126. -ms-transform-origin: 100% 0%;
  127. transform-origin: 100% 0%;
  128. background-color: #ffffff;
  129. float: right
  130. }
  131. #moments .home-pic-base .top-name {
  132. position: absolute;
  133. /* left: 20px; */
  134. right: 240upx;
  135. top: 30upx;
  136. font-size: 32upx;
  137. font-weight: 600;
  138. text-align: right;
  139. color: #ffffff;
  140. overflow: hidden
  141. }
  142. #moments .moments__post {
  143. background: #fff;
  144. display: block;
  145. border-bottom: 1px solid #f2eeee;
  146. padding: 30upx 20upx;
  147. position: relative;
  148. display: -webkit-box;
  149. display: -webkit-flex;
  150. display: flex;
  151. }
  152. #moments .moments__post::before {
  153. content: none
  154. }
  155. </style>