comment.vue 6.0 KB

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