comment.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
  1. <template name="comment">
  2. <view>
  3. <view class='msgs-tabs'>
  4. <view class='tit'>{{name}}</view>
  5. <view class='num'>全部评论(100)</view>
  6. </view>
  7. <view class="living">
  8. <scroll-view class="message" bindscrolltolower="loadmore" scroll-y>
  9. <view class="item" v-for="(v, k) in comments" :key="k">
  10. <view class="user">
  11. <image :src="v.avatar"></image>
  12. </view>
  13. <view class="info clearfix">
  14. <view class="username text-ellipsis">
  15. <text>{{v.username}}</text>
  16. </view>
  17. <view class="txt">
  18. <text>{{v.content}}</text>
  19. </view>
  20. </view>
  21. </view>
  22. </scroll-view>
  23. </view>
  24. </view>
  25. </template>
  26. <script>
  27. export default {
  28. name: "comment",
  29. props: {
  30. type : {
  31. type : String,
  32. value : null
  33. },
  34. type_id : {
  35. type : String,
  36. value : null
  37. },
  38. name : {
  39. type : String,
  40. value : null
  41. },
  42. },
  43. data() {
  44. return {
  45. comments: [
  46. {
  47. id : 1,
  48. avatar : 'https://pic.rmb.bdstatic.com/b9279adf974b78d27201a0b34970c2a9.jpeg',
  49. username : 'rabin',
  50. content : 'dfdfdfdf',
  51. },
  52. {
  53. id : 2,
  54. avatar : 'https://pic.rmb.bdstatic.com/b9279adf974b78d27201a0b34970c2a9.jpeg',
  55. username : 'test',
  56. content : '哈哈哈哈或',
  57. }
  58. ],
  59. loading: false
  60. }
  61. },
  62. methods:{
  63. },
  64. }
  65. </script>
  66. <style>
  67. .msgs-tabs{
  68. line-height: 88rpx;
  69. display: flex;
  70. height: 88rpx;
  71. justify-content: space-between;
  72. box-sizing: border-box;
  73. padding: 0 30rpx;
  74. border-bottom: 1rpx solid #ccc;
  75. }
  76. .msgs-tabs .tit{
  77. font-size: 30rpx;
  78. color: #000;
  79. display: flex;
  80. align-items: center;
  81. overflow: hidden;
  82. }
  83. .msgs-tabs .tit:before{
  84. content: '';
  85. display: inline-block;
  86. width: 6rpx;
  87. height: 30rpx;
  88. margin-right: 10rpx;
  89. background-color: #000;
  90. }
  91. .msgs-tabs .num{
  92. font-size: 22rpx;
  93. color: #999;
  94. overflow: hidden;
  95. }
  96. .living{
  97. margin-bottom:50rpx;
  98. }
  99. .living-tabs{
  100. display: flex;
  101. justify-content: center;
  102. margin-bottom: 36rpx;
  103. }
  104. .living-tabs>view{
  105. font-size: 30rpx;
  106. line-height: 52rpx;
  107. margin: 0 26rpx;
  108. }
  109. .living-tabs>view.cur{
  110. border-bottom: 6rpx solid #000;
  111. }
  112. .living .send{
  113. border-bottom: solid 2rpx #f0f0f0;
  114. padding:0 30rpx 40rpx;
  115. }
  116. .living .send input{
  117. float:left;
  118. box-sizing: border-box;
  119. width:540rpx;
  120. height:60rpx;
  121. border:solid 2rpx #999999;
  122. border-radius: 10rpx;
  123. padding:0 10rpx;
  124. line-height: 60rpx;
  125. font-size: 30rpx;
  126. }
  127. .living .send .button{
  128. float:right;
  129. box-sizing: border-box;
  130. padding:0;
  131. width:130rpx;
  132. min-width: 0;
  133. height:60rpx;
  134. line-height: 60rpx;
  135. }
  136. .living .message{
  137. height:320rpx;
  138. padding:15rpx 0 110rpx;
  139. border-bottom: solid 2rpx #f0f0f0;
  140. }
  141. .living .message .item{
  142. padding:20rpx 35rpx 0;
  143. display: flex;
  144. }
  145. .living .message .user{
  146. float:left;
  147. }
  148. .living .message .user image{
  149. display: block;
  150. width:51rpx;
  151. height:51rpx;
  152. border-radius: 50%;
  153. }
  154. .living .message .info{
  155. position: relative;
  156. margin-left:70rpx;
  157. overflow: visible;
  158. }
  159. .living .message .username{
  160. font-size: 28rpx;
  161. margin-bottom: 13rpx;
  162. }
  163. .living .message .txt{
  164. position: relative;
  165. float:left;
  166. background: #eeeeee;
  167. max-width:400rpx;
  168. border-radius: 15rpx;
  169. padding: 9rpx 18rpx;
  170. font-size: 26rpx;
  171. line-height: 1.8;
  172. color: #666666;
  173. overflow: visible;
  174. }
  175. .living .message .txt:before{
  176. display: block;
  177. position: absolute;
  178. top:0;
  179. left:-14rpx;
  180. width:0;
  181. height:0;
  182. border: solid 14rpx transparent;
  183. border-top: solid 12rpx #eee;
  184. content:'';
  185. }
  186. .living{
  187. margin-bottom: 0;
  188. }
  189. .living .message{
  190. padding:0;
  191. border-bottom: 0;
  192. }
  193. .living .message{
  194. position: absolute;
  195. bottom: 120rpx;
  196. top: 544rpx;
  197. left: 0;
  198. width: 100%;
  199. height: auto;
  200. }
  201. .console{
  202. position: fixed;
  203. bottom:0;
  204. left:0;
  205. width:750rpx;
  206. height:98rpx;
  207. padding-top:20rpx;
  208. z-index: 5;
  209. }
  210. .console .comment{
  211. position: absolute;
  212. top:10rpx;
  213. left:85rpx;
  214. background:url(http://www.huoxingkandiqiu.com/files/img/ico-comment.png) no-repeat;
  215. background-size: 98rpx 98rpx;
  216. width:98rpx;
  217. height:98rpx;
  218. }
  219. .console .thumbup{
  220. position: absolute;
  221. top:10rpx;
  222. right:85rpx;
  223. }
  224. .console .num{
  225. background: #fff;
  226. position: absolute;
  227. top:40rpx;
  228. right:0;
  229. width:100rpx;
  230. height: 40rpx;
  231. line-height: 40rpx;
  232. color: #000;
  233. font-size: 24rpx;
  234. text-align: center;
  235. }
  236. .console .unlike{
  237. background:url(http://www.huoxingkandiqiu.com/files/img/ico-unlike.png) no-repeat;
  238. background-size: 98rpx 98rpx;
  239. width:98rpx;
  240. height:98rpx;
  241. }
  242. .console .like{
  243. background:url(http://www.huoxingkandiqiu.com/files/img/ico-like.png) no-repeat;
  244. background-size: 98rpx 98rpx;
  245. width:98rpx;
  246. height:98rpx;
  247. }
  248. .mask .layer{
  249. padding:40rpx 30rpx;
  250. }
  251. .mask textarea{
  252. margin-bottom: 25rpx;
  253. box-sizing: border-box;
  254. padding:10rpx;
  255. border:solid 2rpx #999999;
  256. border-radius: 10rpx;
  257. width:500rpx;
  258. font-size: 24rpx;
  259. }
  260. .mask .button{
  261. width:300rpx;
  262. }
  263. .share{
  264. position: fixed;
  265. bottom:20rpx;
  266. left:225rpx;
  267. }
  268. .console .edit{
  269. background:url(http://www.huoxingkandiqiu.com/files/img/edit.png) no-repeat;
  270. background-size: 80rpx 80rpx;
  271. width:80rpx;
  272. height:80rpx;
  273. position: absolute;
  274. left: 135rpx;
  275. bottom: 30rpx;
  276. }
  277. .console .edit.left30{
  278. left: 30rpx;
  279. }
  280. </style>