vodComment.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353
  1. <template name="vodComment">
  2. <view>
  3. <view class="topbanner">
  4. <video
  5. :src="item.video"
  6. preload
  7. :show-play-btn="true"
  8. :show-center-play-btn="false"
  9. :controls="true"
  10. :loop="true"
  11. :id="id()"
  12. objectFit="fill"
  13. :enable-progress-gesture="false"
  14. @click="start"
  15. ref="video_url"
  16. play-btn-position="center"
  17. class="video"
  18. :poster="item.pic">
  19. </video>
  20. <cover-image
  21. class="ico-video-play" v-if="show_play"
  22. @tap="start"></cover-image>
  23. </view>
  24. <view class='msgs-tabs'>
  25. <view class='tit'>{{item.name}}</view>
  26. <view class='num'>全部评论(100)</view>
  27. </view>
  28. <view class="living">
  29. <scroll-view class="message" bindscrolltolower="loadmore" scroll-y>
  30. <view class="item" v-for="(v, k) in comments">
  31. <view class="user">
  32. <image :src="v.avatar"></image>
  33. </view>
  34. <view class="info clearfix">
  35. <view class="username text-ellipsis">
  36. <text>{{v.username}}</text>
  37. </view>
  38. <view class="txt">
  39. <text>{{v.content}}</text>
  40. </view>
  41. </view>
  42. </view>
  43. </scroll-view>
  44. </view>
  45. </view>
  46. </template>
  47. <script>
  48. export default {
  49. name: "vodComment",
  50. props: {
  51. config : {
  52. type : Object,
  53. value : null
  54. },
  55. item : {
  56. type : Object,
  57. value : null
  58. },
  59. },
  60. data() {
  61. return {
  62. show_play: true,
  63. videoCtx : false,
  64. comments: [
  65. {
  66. id : 1,
  67. avatar : 'https://yt3.ggpht.com/a/AATXAJxSSAfjWzxQAkDei2MeIPc6WqlO2FG-gOSpZQ=s48-c-k-c0xffffffff-no-rj-mo',
  68. username : 'rabin',
  69. content : 'dfdfdfdf',
  70. },
  71. {
  72. id : 2,
  73. avatar : 'https://pic.rmb.bdstatic.com/b9279adf974b78d27201a0b34970c2a9.jpeg',
  74. username : 'test',
  75. content : '哈哈哈哈或',
  76. }
  77. ],
  78. loading: false
  79. }
  80. },
  81. methods:{
  82. id : function() {
  83. var video_id = this.item.id;
  84. return 'video_comment_' + video_id;
  85. },
  86. start : function() {
  87. this.config.stop[this.config.page] = this;
  88. var id = this.id();
  89. if (!this.videoCtx) {
  90. this.videoCtx = uni.createVideoContext(id, this);
  91. }
  92. if (this.show_play) {
  93. this.videoCtx.play();
  94. this.show_play = false;
  95. } else {
  96. this.videoCtx.pause();
  97. this.show_play = true;
  98. }
  99. },
  100. stop : function() {
  101. var id = this.id();
  102. if (!this.videoCtx) {
  103. this.videoCtx = uni.createVideoContext(id, this);
  104. }
  105. this.videoCtx.pause();
  106. this.show_play = true;
  107. },
  108. },
  109. }
  110. </script>
  111. <style>
  112. .topbanner{
  113. position: relative;
  114. }
  115. .topbanner image,.topbanner video,.topbanner live-player{
  116. width: 750rpx;
  117. height: 422rpx;
  118. display: block;
  119. }
  120. .topbanner .media-cover,.topbanner video,.topbanner live-player{
  121. height: 422rpx;
  122. }
  123. .living{
  124. margin-bottom:50rpx;
  125. }
  126. .living-tabs{
  127. display: flex;
  128. justify-content: center;
  129. margin-bottom: 36rpx;
  130. }
  131. .living-tabs>view{
  132. font-size: 30rpx;
  133. line-height: 52rpx;
  134. margin: 0 26rpx;
  135. }
  136. .living-tabs>view.cur{
  137. border-bottom: 6rpx solid #000;
  138. }
  139. .living .send{
  140. border-bottom: solid 2rpx #f0f0f0;
  141. padding:0 30rpx 40rpx;
  142. }
  143. .living .send input{
  144. float:left;
  145. box-sizing: border-box;
  146. width:540rpx;
  147. height:60rpx;
  148. border:solid 2rpx #999999;
  149. border-radius: 10rpx;
  150. padding:0 10rpx;
  151. line-height: 60rpx;
  152. font-size: 30rpx;
  153. }
  154. .living .send .button{
  155. float:right;
  156. box-sizing: border-box;
  157. padding:0;
  158. width:130rpx;
  159. min-width: 0;
  160. height:60rpx;
  161. line-height: 60rpx;
  162. }
  163. .living .message{
  164. height:320rpx;
  165. padding:15rpx 0 110rpx;
  166. border-bottom: solid 2rpx #f0f0f0;
  167. }
  168. .living .message .item{
  169. padding:20rpx 35rpx 0;
  170. }
  171. .living .message .user{
  172. float:left;
  173. }
  174. .living .message .user image{
  175. display: block;
  176. width:51rpx;
  177. height:51rpx;
  178. border-radius: 50%;
  179. }
  180. .living .message .info{
  181. position: relative;
  182. margin-left:70rpx;
  183. overflow: visible;
  184. }
  185. .living .message .username{
  186. font-size: 28rpx;
  187. margin-bottom: 13rpx;
  188. }
  189. .living .message .txt{
  190. position: relative;
  191. float:left;
  192. background: #eeeeee;
  193. max-width:400rpx;
  194. border-radius: 15rpx;
  195. padding: 9rpx 18rpx;
  196. font-size: 26rpx;
  197. line-height: 1.8;
  198. color: #666666;
  199. overflow: visible;
  200. }
  201. .living .message .txt:before{
  202. display: block;
  203. position: absolute;
  204. top:0;
  205. left:-14rpx;
  206. width:0;
  207. height:0;
  208. border: solid 14rpx transparent;
  209. border-top: solid 12rpx #eee;
  210. content:'';
  211. }
  212. .msgs-tabs{
  213. line-height: 88rpx;
  214. display: flex;
  215. height: 88rpx;
  216. justify-content: space-between;
  217. box-sizing: border-box;
  218. padding: 0 30rpx;
  219. border-bottom: 1rpx solid #ccc;
  220. }
  221. .msgs-tabs .tit{
  222. font-size: 30rpx;
  223. color: #000;
  224. display: flex;
  225. align-items: center;
  226. overflow: hidden;
  227. }
  228. .msgs-tabs .tit:before{
  229. content: '';
  230. display: inline-block;
  231. width: 6rpx;
  232. height: 30rpx;
  233. margin-right: 10rpx;
  234. background-color: #000;
  235. }
  236. .msgs-tabs .num{
  237. font-size: 22rpx;
  238. color: #999;
  239. overflow: hidden;
  240. }
  241. .living{
  242. margin-bottom: 0;
  243. }
  244. .living .message{
  245. padding:0;
  246. border-bottom: 0;
  247. }
  248. .console{
  249. z-index: 5;
  250. }
  251. .living .message{
  252. position: absolute;
  253. bottom: 120rpx;
  254. top: 544rpx;
  255. left: 0;
  256. width: 100%;
  257. height: auto;
  258. }
  259. .ico-video-play{
  260. background: url(@/static/icon/ico-video-play.png) no-repeat;
  261. background-size: cover;
  262. width: 100rpx;
  263. height: 100rpx;
  264. position: absolute;
  265. left: 50%;
  266. top: 50%;
  267. transform: translate3d(-50%,-50%,0);
  268. }
  269. .console{
  270. position: fixed;
  271. bottom:0;
  272. left:0;
  273. width:750rpx;
  274. height:98rpx;
  275. padding-top:20rpx;
  276. }
  277. .console .comment{
  278. position: absolute;
  279. top:10rpx;
  280. left:85rpx;
  281. background:url(http://www.huoxingkandiqiu.com/files/img/ico-comment.png) no-repeat;
  282. background-size: 98rpx 98rpx;
  283. width:98rpx;
  284. height:98rpx;
  285. }
  286. .console .thumbup{
  287. position: absolute;
  288. top:10rpx;
  289. right:85rpx;
  290. }
  291. .console .num{
  292. background: #fff;
  293. position: absolute;
  294. top:40rpx;
  295. right:0;
  296. width:100rpx;
  297. height: 40rpx;
  298. line-height: 40rpx;
  299. color: #000;
  300. font-size: 24rpx;
  301. text-align: center;
  302. }
  303. .console .unlike{
  304. background:url(http://www.huoxingkandiqiu.com/files/img/ico-unlike.png) no-repeat;
  305. background-size: 98rpx 98rpx;
  306. width:98rpx;
  307. height:98rpx;
  308. }
  309. .console .like{
  310. background:url(http://www.huoxingkandiqiu.com/files/img/ico-like.png) no-repeat;
  311. background-size: 98rpx 98rpx;
  312. width:98rpx;
  313. height:98rpx;
  314. }
  315. .mask .layer{
  316. padding:40rpx 30rpx;
  317. }
  318. .mask textarea{
  319. margin-bottom: 25rpx;
  320. box-sizing: border-box;
  321. padding:10rpx;
  322. border:solid 2rpx #999999;
  323. border-radius: 10rpx;
  324. width:500rpx;
  325. font-size: 24rpx;
  326. }
  327. .mask .button{
  328. width:300rpx;
  329. }
  330. .share{
  331. position: fixed;
  332. bottom:20rpx;
  333. left:225rpx;
  334. }
  335. .console .edit{
  336. background:url(http://www.huoxingkandiqiu.com/files/img/edit.png) no-repeat;
  337. background-size: 80rpx 80rpx;
  338. width:80rpx;
  339. height:80rpx;
  340. position: absolute;
  341. left: 135rpx;
  342. bottom: 30rpx;
  343. }
  344. .console .edit.left30{
  345. left: 30rpx;
  346. }
  347. </style>