community.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. <template>
  2. <view class="community">
  3. <view class="item" v-for="(item,index) in list" :key="index">
  4. <view class="author-info">
  5. <image class="head" :src="item.head" mode=""></image>
  6. <view class="name">
  7. {{item.name}}
  8. </view>
  9. </view>
  10. <view class="title">
  11. {{item.content}}
  12. </view>
  13. <u-album :urls="item.imgList" space="20rpx" multipleSize="190" maxCount="3" ></u-album>
  14. <view class="handle-box">
  15. <view class="btn">
  16. <image class="icon" src="../static/zan.png" mode=""></image>
  17. 点赞
  18. </view>
  19. <view class="btn" @click="showComment">
  20. <image class="icon" src="../static/pinglun.png" mode=""></image>
  21. 评论
  22. </view>
  23. </view>
  24. </view>
  25. <image class="send-btn" src="../static/send.png" @click="send" mode=""></image>
  26. <!-- 评论区 -->
  27. <u-popup :show="show" :round="16" closeable mode="bottom" @close="close" @open="open">
  28. <view class="comment-box">
  29. <view class="comment-title">
  30. 评论
  31. </view>
  32. <view class="comment-item" v-for="(item,index) in commentList" :key="index">
  33. <image class="head" src="https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fsafe-img.xhscdn.com%2Fbw1%2F1e0466ff-3a60-4544-9630-318439662daf%3FimageView2%2F2%2Fw%2F1080%2Fformat%2Fjpg&refer=http%3A%2F%2Fsafe-img.xhscdn.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1695371853&t=0d9cf33ea0b96e7e0d2778264668a623" mode=""></image>
  34. <view class="info">
  35. <view class="user-name">
  36. {{item.name}}
  37. </view>
  38. <view class="content">
  39. {{item.content}}
  40. </view>
  41. <view class="time">
  42. {{item.time}}
  43. </view>
  44. </view>
  45. </view>
  46. </view>
  47. </u-popup>
  48. </view>
  49. </template>
  50. <script>
  51. export default {
  52. data() {
  53. return {
  54. show:false,
  55. albumWidth: 0,
  56. // 论坛列表
  57. list:[
  58. {
  59. head:'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fsafe-img.xhscdn.com%2Fbw1%2F1e0466ff-3a60-4544-9630-318439662daf%3FimageView2%2F2%2Fw%2F1080%2Fformat%2Fjpg&refer=http%3A%2F%2Fsafe-img.xhscdn.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1695371853&t=0d9cf33ea0b96e7e0d2778264668a623',
  60. name:'李老师',
  61. content:'总算结束了一天的课程,又是元气满满的一天',
  62. imgList:[
  63. 'https://gd-hbimg.huaban.com/0703ff963e28a9bb8084926380fd632c9f981e30c6581-Aa0GcN_fw658webp',
  64. 'https://gd-hbimg.huaban.com/7454f225f6174f65f0584eab4be2a7699d140aa917da0-Qsm2AY_fw658webp',
  65. 'https://gd-hbimg.huaban.com/54c90225377e9ddb9aa260a735f429edf15309361cb73-QCueku_fw658webp',
  66. 'https://gd-hbimg.huaban.com/b1a17ed6f8c2b6510b9b2fae0a24720142b7082753e46-eswEfR_fw658webp',
  67. 'https://gd-hbimg.huaban.com/cd497f0ac15a9724439e8a166550c5704970a44914ebbf-N5Buhq_fw658webp'
  68. ],
  69. },
  70. {
  71. head:'https://gd-hbimg.huaban.com/39f79920b96a969e257370a97d6408c95326707cc241-wlRfjI_fw658webp',
  72. name:'白老师',
  73. content:'总算结束了一天的课程,又是元气满满的一天',
  74. imgList:[
  75. 'https://gd-hbimg.huaban.com/5519accd3d95a5f992bd2f485fa5ca04c9af67be56754-gus75N_fw658webp',
  76. 'https://gd-hbimg.huaban.com/1f80d1853ac691d48d1ce16d07f0b34cba1aa13ebcf1-xDl3c3_fw658webp',
  77. 'https://gd-hbimg.huaban.com/114b9fd15abef0d506b89311ecad91897c31cf7885c0-YDYx4A_fw658webp',
  78. 'https://gd-hbimg.huaban.com/cd497f0ac15a9724439e8a166550c5704970a44914ebbf-N5Buhq_fw658webp'
  79. ],
  80. },
  81. {
  82. head:'https://gd-hbimg.huaban.com/ccd8ea8cd52d82b9ced4e8d2e2a48462827ce8b5d503-ELfVHW_fw658webp',
  83. name:'张老师',
  84. content:'总算结束了一天的课程,又是元气满满的一天',
  85. imgList:[
  86. 'https://gd-hbimg.huaban.com/e1dff5990532ceefe53fbab078101782d089733d178e7-PrqgOk_fw658webp',
  87. 'https://gd-hbimg.huaban.com/811a433a12a73ff1ecae6e0e06b2c8d0a32326b713fa1-uE04AT_fw658webp',
  88. 'https://gd-hbimg.huaban.com/f2bb5d1d714c08ac4e976eabf6b2f7a402152ab320bec4-7gy06Q_fw658webp',
  89. ],
  90. }
  91. ],
  92. // 评论列表
  93. commentList:[
  94. {
  95. name:'李老师',
  96. head:'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fsafe-img.xhscdn.com%2Fbw1%2F1e0466ff-3a60-4544-9630-318439662daf%3FimageView2%2F2%2Fw%2F1080%2Fformat%2Fjpg&refer=http%3A%2F%2Fsafe-img.xhscdn.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1695371853&t=0d9cf33ea0b96e7e0d2778264668a623',
  97. content:'继续加油哦,看好你!',
  98. time:'8-29 21:13'
  99. },
  100. {
  101. name:'洋洋小小',
  102. head:'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fsafe-img.xhscdn.com%2Fbw1%2F1e0466ff-3a60-4544-9630-318439662daf%3FimageView2%2F2%2Fw%2F1080%2Fformat%2Fjpg&refer=http%3A%2F%2Fsafe-img.xhscdn.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1695371853&t=0d9cf33ea0b96e7e0d2778264668a623',
  103. content:'明天也会是美好的一天,以后都会是',
  104. time:'8-29 21:18'
  105. },
  106. {
  107. name:'吾煎榴莲',
  108. head:'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fsafe-img.xhscdn.com%2Fbw1%2F1e0466ff-3a60-4544-9630-318439662daf%3FimageView2%2F2%2Fw%2F1080%2Fformat%2Fjpg&refer=http%3A%2F%2Fsafe-img.xhscdn.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1695371853&t=0d9cf33ea0b96e7e0d2778264668a623',
  109. content:'哈哈哈哈,要幸福',
  110. time:'8-29 21:32'
  111. }
  112. ]
  113. }
  114. },
  115. methods: {
  116. showComment(){
  117. this.show = true
  118. },
  119. send() {
  120. uni.navigateTo({
  121. url:'./publish'
  122. })
  123. },
  124. close(){
  125. this.show = false
  126. },
  127. open(){
  128. },
  129. },
  130. created() {
  131. }
  132. }
  133. </script>
  134. <style lang="scss" >
  135. //评论区关闭按钮
  136. .community .uicon-close{
  137. font-size: 30rpx!important;
  138. }
  139. .community{
  140. padding:30rpx;
  141. background: #F9F9F9;
  142. border-radius: 16rpx;
  143. min-height: 100vh;
  144. .item{
  145. padding: 30rpx;
  146. background: #fff;
  147. margin-bottom: 30rpx;
  148. border-radius: 16rpx;
  149. .author-info{
  150. display: flex;
  151. align-items: center;
  152. .head{
  153. width: 64rpx;
  154. height: 64rpx;
  155. border-radius: 50%;
  156. background: #999;
  157. }
  158. .name{
  159. font-size: 24rpx;
  160. font-weight: 400;
  161. color: #999999;
  162. margin-left: 10rpx;
  163. }
  164. }
  165. .title{
  166. margin: 24rpx 0;
  167. }
  168. .handle-box{
  169. display: flex;
  170. align-items: center;
  171. margin-top: 30rpx;
  172. .btn{
  173. margin-right: 80rpx;
  174. .icon{
  175. width: 33rpx;
  176. height: 35rpx;
  177. margin-right: 15rpx;
  178. }
  179. }
  180. }
  181. }
  182. .send-btn{
  183. position: fixed;
  184. bottom: 150rpx;
  185. right: 30rpx;
  186. width: 88rpx;
  187. height: 88rpx;
  188. }
  189. .comment-box{
  190. padding: 30rpx;
  191. .comment-title{
  192. font-size: 28rpx;
  193. font-weight: bold;
  194. color: #0F0F0F;
  195. margin-bottom: 20rpx;
  196. }
  197. .comment-item{
  198. display: flex;
  199. margin-bottom: 30rpx;
  200. .head{
  201. width: 64rpx;
  202. height: 64rpx;
  203. border-radius: 50%;
  204. }
  205. .info{
  206. margin-left: 20rpx;
  207. .user-name{
  208. font-size: 24rpx;
  209. color: #999999;
  210. }
  211. .content{
  212. font-size: 24rpx;
  213. color: #333333;
  214. margin: 10rpx 0 20rpx;
  215. }
  216. .time{
  217. font-size: 24rpx;
  218. color: #999999;
  219. }
  220. }
  221. }
  222. }
  223. }
  224. </style>