comment.vue 5.4 KB

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