moment.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  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" @tap="test"></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" :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. item : {
  38. type : Object,
  39. value : null
  40. },
  41. index : 0
  42. },
  43. components: {
  44. deverPublish,momentItem
  45. },
  46. data() {
  47. return {
  48. fetch : {
  49. 'info' : [],
  50. },
  51. style : '',
  52. title : '发布新动态',
  53. api : 'app/community/?l=api.addMoment',
  54. type : 3,
  55. type_id : 0,
  56. showComment : false,
  57. }
  58. },
  59. mounted() {
  60. this.type_id = this.item.id;
  61. this.style = 'background:url("'+this.item.pic+'");background-size: contain;';
  62. console.info(this.item);
  63. this.getData(1);
  64. },
  65. computed:{
  66. },
  67. methods: {
  68. getData : function(page) {
  69. this.Dever.page([page, 'info'], this, 'app/community/?l=api.moment', {type:this.type,type_id:this.type_id});
  70. },
  71. showModal : function() {
  72. this.showComment = true;
  73. },
  74. hideModal : function() {
  75. this.showComment = false;
  76. },
  77. getRefresh : function(cate_id, type, type_id, content) {
  78. this.getData(1);
  79. this.hideModal();
  80. },
  81. }
  82. }
  83. </script>
  84. <style scoped>
  85. .header {
  86. width: 100%;
  87. height: 100%;
  88. z-index: 10;
  89. border-radius: 40upx;
  90. }
  91. #moments {
  92. background: #fff;
  93. }
  94. #moments .home-pic {
  95. width: 100%;
  96. /* margin-top: -150upx; */
  97. position: relative;
  98. height: 500upx;
  99. z-index: 5;
  100. background-size: cover;
  101. margin-bottom: 50upx
  102. }
  103. #moments .home-pic-base {
  104. position: absolute;
  105. /*left: -60upx;*/
  106. bottom: -40upx;
  107. width: 100%;
  108. height: 160upx;
  109. padding: 0 30upx;
  110. }
  111. #moments .home-pic-base .top-pic {
  112. width: 360upx;
  113. height: 360upx;
  114. border-radius: 40upx;
  115. -webkit-transform: scale(0.5);
  116. -ms-transform: scale(0.5);
  117. transform: scale(0.5);
  118. -webkit-transform-origin: 100% 0%;
  119. -ms-transform-origin: 100% 0%;
  120. transform-origin: 100% 0%;
  121. background-color: #ffffff;
  122. float: right
  123. }
  124. #moments .home-pic-base .top-name {
  125. position: absolute;
  126. /* left: 20px; */
  127. right: 240upx;
  128. top: 30upx;
  129. font-size: 32upx;
  130. font-weight: 600;
  131. text-align: right;
  132. color: #ffffff;
  133. overflow: hidden
  134. }
  135. #moments .moments__post {
  136. background: #fff;
  137. display: block;
  138. border-bottom: 1px solid #f2eeee;
  139. padding: 30upx 20upx;
  140. position: relative;
  141. display: -webkit-box;
  142. display: -webkit-flex;
  143. display: flex;
  144. }
  145. #moments .moments__post::before {
  146. content: none
  147. }
  148. </style>