vodComment.vue 6.3 KB

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