y-video-slide.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832
  1. <template>
  2. <view class="widget-video" :style="{height:videoHeight}">
  3. <!-- 下拉刷新 -->
  4. <view v-if="marginTop>0" class="refresh-box">
  5. 松开刷新
  6. </view>
  7. <!-- 视频容器 -->
  8. <view class="scroll-video-box" @touchstart="touchStart" @touchmove="touchMove" @touchend="touchEnd"
  9. :style="{'marginTop':marginTop+'px','transition':transition}">
  10. <view ref="videoItemBox" class="video-item-box" v-for="(item, index) in videoList" :key="index"
  11. :style="{height:videoHeight}">
  12. <video @click="$event => {pauseVideo($event, item)}" :id="item.id" class="fullscreen-video"
  13. :src="item.videoUrl" @error="videoError(item,index)" :poster="item.posterUrl" :controls="false"
  14. :show-progress="false" :show-fullscreen-btn="false" :show-play-btn="false" :loop="true"
  15. :autoplay="index == 0" :show-center-play-btn="false">
  16. </video>
  17. <template v-for="(fabulous, fabulousIndx) in fabulousArr">
  18. <i v-if="fabulous != null" @click="fabulousDbClick" class="iconfont iconxihuan fabulous-item"
  19. :style="{'top':fabulous.top,'left':fabulous.left,'opacity':fabulous.opacity,'transform':fabulous.transform}"></i>
  20. </template>
  21. <i :class="['iconfont iconbofang btn-play',currentStatus == 'pause' && currentIndex == index ? 'show' : '']"
  22. @click="pauseVideo"></i>
  23. <view class="video-info">
  24. <view class="atavar-box">
  25. <image class="atavar-img" :src="item.userHead" mode="widthFix"></image>
  26. <view class="add-follow-btn" @click="followFunc(index,item)">
  27. <i
  28. :class="['iconfont inline-block icon-follow', item.isFollow == 1 ? 'iconduihao' : 'iconjia1']"></i>
  29. </view>
  30. </view>
  31. <view class="icon-box" @click="toggleFabulous(item, index)">
  32. <i :class="['iconfont iconxihuan icon-btn', item.isFabulous ? 'color-red' : '']"></i>
  33. <view class="count-text">{{item.fabulousCount}}</view>
  34. </view>
  35. <view class="icon-box" @click="commontAdd">
  36. <i class="iconfont iconIMliaotian-shixin icon-btn"></i>
  37. <view class="count-text">{{item.commentCount}}</view>
  38. </view>
  39. <view class="icon-box">
  40. <i class="iconfont iconfenxiang icon-btn" @click="shareFunc(item)"></i>
  41. <view class="count-text">{{item.shareCount}}</view>
  42. </view>
  43. </view>
  44. <view class="video-title">
  45. <view class="user-name">@{{item.userNick}}</view>
  46. <view class="video-content">{{item.videoContent}}</view>
  47. </view>
  48. </view>
  49. <view v-if="videoList.length == 0" class="empty-txt">当前没有可播放视频哦~</view>
  50. </view>
  51. <!-- 上拉加载 -->
  52. <view v-if="videoList.length > 0" class="load-more-box">
  53. 加载更多
  54. </view>
  55. <!-- 评论弹窗 -->
  56. <view :class="['commont-box',commontShow ? 'active' : '']">
  57. <view class="commont-title">{{currentComment.count}}条评论</view>
  58. <view class="commont-list">
  59. <view v-for="(item, index) in currentComment.list" :key="index">
  60. <view class="comment-panel">
  61. <image class="first-user" :src="item.userHead" mode="widthFix"></image>
  62. <view class="first-comment">
  63. <view class="comment-name">{{item.userNick}}</view>
  64. <view class="comment-content">{{item.content}}</view>
  65. <view class="time-box">
  66. <text class="inline-block">{{item.time}}</text>
  67. <view class="inline-block reply-btn" @click="reply('first',item,index)">回复</view>
  68. </view>
  69. </view>
  70. <view class="fabulous-box">
  71. <i :class="['iconfont iconxihuan fabulous-btn', item.isFabulous == '1' ? 'color-red' : '']"
  72. @click="commentFabulous('first',item,index)"></i>
  73. <view class="fabulous-text">{{item.fabulousCount}}</view>
  74. </view>
  75. </view>
  76. <view style="padding-left: 70rpx;">
  77. <view class="comment-panel" v-for="(child, childIndex) in item.children">
  78. <image class="first-user" :src="child.userHead" mode="widthFix"></image>
  79. <view class="first-comment">
  80. <view class="comment-name" v-if="child.replyTo == item.userNick">{{child.userNick}}
  81. </view>
  82. <view class="comment-name" v-else>
  83. <span class="inline-block">{{child.userNick}}</span>
  84. <span class="inline-block">
  85. <i class="iconfont iconxiangyou1" style="font-size: 8px;"></i>
  86. </span>
  87. <span class="inline-block">{{child.replyTo}}</span>
  88. </view>
  89. <view class="comment-content">{{child.content}}</view>
  90. <view class="time-box">
  91. <text class="inline-block">{{child.time}}</text>
  92. <view class="inline-block reply-btn"
  93. @click="reply('second',child,index,childIndex)">回复</view>
  94. </view>
  95. </view>
  96. <view class="fabulous-box">
  97. <i :class="['iconfont iconxihuan fabulous-btn', child.isFabulous == '1' ? 'color-red' : '']"
  98. @click="commentFabulous('second',child,index,childIndex)"></i>
  99. <view class="fabulous-text">{{child.fabulousCount}}</view>
  100. </view>
  101. </view>
  102. </view>
  103. </view>
  104. </view>
  105. <!-- 评论输入框 -->
  106. <input class="comment-input" @confirm="commentCommit" @blur="commentBlur" v-model="replyContent"
  107. :focus="showInput" :placeholder="commentPlaceholder" type="text" />
  108. </view>
  109. </view>
  110. </template>
  111. <script>
  112. // #ifdef APP-NVUE
  113. const dom = weex.requireModule('dom');
  114. // #endif
  115. export default {
  116. props: {
  117. // 视频容器高度
  118. videoHeight: {
  119. type: String,
  120. default: '100vh'
  121. },
  122. // 列表数据
  123. data: {
  124. type: Array,
  125. default () {
  126. return []
  127. }
  128. },
  129. // 当前视频下标
  130. videoIndex:{
  131. type:[Number,String],
  132. default:'0'
  133. }
  134. },
  135. data() {
  136. return {
  137. // 视频列表数据
  138. videoList: this.data,
  139. // 视频实际高度,用于滚动计算
  140. videoRealHeight: 0,
  141. // 双击点赞记录
  142. fabulousArr: [],
  143. // 记录点击时间判断单击还是双击,单击暂停,双击点赞
  144. clickTimer: null,
  145. // 记录点击时间
  146. clickTime: 0,
  147. // 屏幕高度
  148. windowHeight: uni.getSystemInfoSync().windowHeight || window.innerHeight,
  149. // 动画效果
  150. transition: 'none',
  151. // 触摸开始值
  152. startY: 0,
  153. // 触摸移动值
  154. moveY: 0,
  155. // 滑动开始时间
  156. startTime: 0,
  157. // 向上滑动距离
  158. marginTop: 0,
  159. // 每次向上滑动的距离
  160. fixMarginTop: 0,
  161. // 滑动方向
  162. moveDirection: '',
  163. // 当前轮播的index
  164. currentIndex: 0,
  165. // 当前页的视频对象
  166. currentVideo: null,
  167. // 当前视频的评论
  168. currentComment: [],
  169. // 视频状态:播放/暂停
  170. currentStatus: 'play',
  171. // 是否显示评论
  172. commontShow: false,
  173. // 爱心动画双击
  174. fabulousTime: 0,
  175. fabulousTimer: null,
  176. // 显示评论输入框
  177. showInput: false,
  178. // 评论提示
  179. commentPlaceholder: '说点好听的~',
  180. // 回复对象
  181. replyType: 'video',
  182. replyObj: {},
  183. replyIndex: 0,
  184. replyParentIndex: 0,
  185. // 评论内容
  186. replyContent: '',
  187. };
  188. },
  189. watch: {
  190. data: {
  191. handler(n) {
  192. this.videoList = n;
  193. },
  194. deep: true
  195. }
  196. },
  197. // #ifdef APP-NVUE
  198. onReady() {
  199. dom.getComponentRect(this.$refs.videoItemBox, option => {
  200. this.videoRealHeight = option.size.height;
  201. });
  202. },
  203. // #endif
  204. mounted() {
  205. // 初始化视频容器计算高度
  206. //#ifdef H5
  207. this.videoRealHeight = this.$refs['videoItemBox'][0].$el.getBoundingClientRect().height;
  208. //#endif
  209. //#ifdef MP-WEIXIN
  210. const query = uni.createSelectorQuery().in(this);
  211. query.select('.video-item-box').boundingClientRect(data => {
  212. this.videoRealHeight = data.height;
  213. }).exec();
  214. //#endif
  215. // 初始化第一个视频播放器
  216. this.currentVideo = uni.createVideoContext(this.videoList[0].id, this);
  217. // 初始化评论
  218. this.currentComment = this.videoList[0].commentObj;
  219. // 定时清除动画元素
  220. this.clearFabulousArr();
  221. },
  222. methods: {
  223. // 视频出错
  224. videoError(item, index) {
  225. uni.showToast({
  226. title: '视频出错了!',
  227. icon: 'none'
  228. })
  229. },
  230. // 触摸开始
  231. touchStart(e) {
  232. this.transition = 'none';
  233. this.startY = e.touches[0].pageY;
  234. this.startTime = new Date().getTime();
  235. },
  236. // 触摸滑动
  237. touchMove(e) {
  238. // 如果评论面板打开,禁止滑动
  239. if (this.commontShow) {
  240. return;
  241. }
  242. this.moveY = e.touches[0].pageY;
  243. if (this.moveY > this.startY) {
  244. // 返回上一个视频
  245. let range = this.fixMarginTop + this.moveY - this.startY;
  246. if (this.currentIndex == 0) {
  247. this.marginTop = range > 50 ? 50 : range;
  248. } else {
  249. this.marginTop = range;
  250. }
  251. this.moveDirection = 'up';
  252. } else {
  253. if (this.videoList.length == 0) {
  254. return;
  255. }
  256. // 查看下一个视频
  257. let range = this.fixMarginTop - this.startY + this.moveY;
  258. if (this.currentIndex == this.videoList.length - 1) {
  259. // 最后一个视频的位置
  260. let lastVideo = -this.currentIndex * this.videoRealHeight + -50;
  261. this.marginTop = range < lastVideo ? lastVideo : range;
  262. } else {
  263. this.marginTop = range;
  264. }
  265. this.moveDirection = 'down';
  266. }
  267. },
  268. // 触摸结束
  269. touchEnd(e) {
  270. this.transition = 'all .2s';
  271. if (this.currentIndex == 0 && this.marginTop >= 45) {
  272. // 下拉刷新
  273. this.$emit('refresh');
  274. this.marginTop = 0;
  275. return;
  276. }
  277. if (this.currentIndex == this.videoList.length - 1 && this.marginTop < (this.fixMarginTop - 45)) {
  278. this.marginTop = this.fixMarginTop;
  279. // 加载更多
  280. this.$emit('loadMore');
  281. return;
  282. }
  283. let millisecond = new Date().getTime() - this.startTime;
  284. let condition1 = this.moveY > 0 && Math.abs(this.moveY - this.startY) > 50 && millisecond < 500;
  285. let condition2 = this.moveY > 0 && Math.abs(this.moveY - this.startY) > this.videoRealHeight / 3;
  286. if (condition1 || condition2) {
  287. if (this.moveDirection == 'up') {
  288. // 返回上一个
  289. if (this.currentIndex == 0) {
  290. this.marginTop = 0;
  291. } else {
  292. this.marginTop = this.fixMarginTop + this.videoRealHeight;
  293. this.currentIndex = this.currentIndex - 1;
  294. this.$emit('update:videoIndex',this.currentIndex);
  295. this.currentComment = this.videoList[this.currentIndex].commentObj;
  296. this.videoPlayChange();
  297. }
  298. } else {
  299. // 查看下一个
  300. if (this.currentIndex == this.videoList.length - 1) {
  301. this.marginTop = this.fixMarginTop;
  302. } else {
  303. this.marginTop = this.fixMarginTop - this.videoRealHeight;
  304. this.currentIndex = this.currentIndex + 1;
  305. this.$emit('update:videoIndex',this.currentIndex);
  306. this.currentComment = this.videoList[this.currentIndex].commentObj;
  307. this.videoPlayChange();
  308. }
  309. }
  310. } else {
  311. this.marginTop = this.fixMarginTop;
  312. }
  313. this.fixMarginTop = this.marginTop;
  314. this.startY = 0;
  315. this.moveY = 0;
  316. },
  317. // 滑动切换
  318. videoPlayChange() {
  319. this.stopOtherVideo();
  320. let video = uni.createVideoContext(this.videoList[this.currentIndex].id, this);
  321. this.currentVideo = video;
  322. this.currentVideo.play();
  323. this.currentStatus = 'play';
  324. },
  325. // 暂停其他视频
  326. stopOtherVideo() {
  327. this.videoList.map(v => {
  328. let video = uni.createVideoContext(v.id, this);
  329. video.seek(1);
  330. video.pause();
  331. })
  332. },
  333. // 暂停/播放视频/双击点赞事件
  334. pauseVideo(e, item) {
  335. // 视频对象为空,返回
  336. if (!this.currentVideo) return;
  337. if (this.commontShow) {
  338. this.commontShow = false;
  339. return;
  340. }
  341. clearTimeout(this.clickTimer);
  342. let currentTime = new Date().getTime();
  343. let timeRange = currentTime - this.clickTime;
  344. if (timeRange < 300) {
  345. // 双击事件
  346. if (!item.isFabulous) {
  347. this.$emit('fabulous', item, true);
  348. }
  349. this.dbClickAnimation(e);
  350. } else {
  351. // 单击事件
  352. this.clickTimer = setTimeout(() => {
  353. e.preventDefault();
  354. e.stopPropagation();
  355. if (this.currentStatus == 'play') {
  356. this.currentVideo.pause();
  357. this.currentStatus = 'pause';
  358. } else {
  359. this.currentVideo.play();
  360. this.currentStatus = 'play';
  361. }
  362. }, 300);
  363. }
  364. this.clickTime = new Date().getTime();
  365. },
  366. // 已有爱心叠加双击事件
  367. fabulousDbClick(e) {
  368. clearTimeout(this.fabulousTimer);
  369. let currentTime = new Date().getTime();
  370. let timeRange = currentTime - this.fabulousTime;
  371. if (timeRange < 300) {
  372. // 双击事件
  373. this.dbClickAnimation(e);
  374. } else {
  375. }
  376. this.fabulousTime = new Date().getTime();
  377. },
  378. // 双击点赞动画
  379. dbClickAnimation(e) {
  380. let deg = Math.round(Math.random() * 40 + 5);
  381. this.fabulousArr.push({
  382. left: e.detail.x - 25 + 'px',
  383. top: e.detail.y - 25 + 'px',
  384. transform: 'rotate(' + (deg % 2 == 0 ? deg : -deg) + 'deg)',
  385. createTime: new Date().getTime()
  386. })
  387. let index = this.fabulousArr.length > 0 ? this.fabulousArr.length - 1 : 0;
  388. setTimeout(() => {
  389. this.$set(this.fabulousArr, index, Object.assign(this.fabulousArr[index], {
  390. opacity: 0,
  391. transform: 'scale(3) ' + this.fabulousArr[index].transform
  392. }))
  393. setTimeout(() => {
  394. this.fabulousArr.splice(index, 1, null);
  395. }, 1000);
  396. }, 500);
  397. if (!this.videoList[this.currentIndex].isFabulous) {
  398. this.$set(this.videoList, this.currentIndex, Object.assign(this.videoList[this.currentIndex], {
  399. isFabulous: 1,
  400. fabulousCount: this.videoList[this.currentIndex].isFabulous + 1
  401. }))
  402. }
  403. },
  404. // 定时清除点赞动画元素
  405. clearFabulousArr() {
  406. const indexArr = this.fabulousArr.map((v, i) => {
  407. if (v.opacity == '0') {
  408. return i;
  409. }
  410. });
  411. indexArr.forEach(v => {
  412. this.fabulousArr.splice(v, 1);
  413. });
  414. },
  415. // 点赞切换
  416. toggleFabulous(item, index) {
  417. this.$emit('fabulous', item, item.isFabulous ? false : true);
  418. this.$set(this.videoList, index, Object.assign(item, {
  419. isFabulous: item.isFabulous ? 0 : 1,
  420. fabulousCount: item.isFabulous ? item.fabulousCount - 1 : item.fabulousCount + 1,
  421. }));
  422. },
  423. // 评论
  424. commontAdd() {
  425. this.commontShow = true;
  426. this.replyType = 'video';
  427. this.replyObj = this.currentVideo;
  428. },
  429. // 分享
  430. shareFunc(item) {
  431. this.$emit('share', item);
  432. },
  433. // 关注
  434. followFunc(index, item) {
  435. let flag = item.isFollow == 1 ? false : true;
  436. if (flag) {
  437. uni.showToast({
  438. title: '关注成功',
  439. icon: 'none'
  440. })
  441. } else {
  442. uni.showToast({
  443. title: '取消关注',
  444. icon: 'none'
  445. })
  446. }
  447. this.$emit('follow', item, flag);
  448. this.$set(this.videoList, index, Object.assign(item, {
  449. isFollow: item.isFollow == 1 ? 0 : 1
  450. }));
  451. },
  452. // 评论点赞
  453. commentFabulous(level, item, index, childIndex) {
  454. const result = item.isFabulous == '1' ? '0' : '1';
  455. item.isFabulous = result;
  456. if (result == '1') {
  457. item.fabulousCount = item.fabulousCount + 1;
  458. } else {
  459. item.fabulousCount = item.fabulousCount - 1;
  460. }
  461. if (level === 'first') {
  462. this.currentComment.list[index] = item;
  463. } else {
  464. this.currentComment.list[index].children[childIndex] = item;
  465. }
  466. this.$emit('commentFabulous', item);
  467. },
  468. // 回复评论
  469. reply(level, item, index, childIndex) {
  470. this.showInput = true;
  471. this.commentPlaceholder = `回复@${item.userNick}`;
  472. this.replyIndex = childIndex;
  473. this.replyType = level;
  474. this.replyParentIndex = index;
  475. this.replyObj = item;
  476. },
  477. // 提交评论
  478. commentCommit() {
  479. this.showInput = false;
  480. if (this.replyType == 'video') {
  481. this.currentComment.list.push({
  482. userHead: 'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fup.enterdesk.com%2Fedpic%2F5e%2F4e%2Ff0%2F5e4ef0e451852e0114d75eac14f60924.jpeg&refer=http%3A%2F%2Fup.enterdesk.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1642669624&t=028d851350e18512dbf4bfe3a86cbfa4',
  483. userNick: 'yjyyyyy',
  484. content: this.replyContent,
  485. fabulousCount: 0,
  486. })
  487. } else if (this.replyType == 'first') {
  488. this.currentComment.list[this.replyParentIndex].children.push({
  489. userHead: 'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fup.enterdesk.com%2Fedpic%2F5e%2F4e%2Ff0%2F5e4ef0e451852e0114d75eac14f60924.jpeg&refer=http%3A%2F%2Fup.enterdesk.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1642669624&t=028d851350e18512dbf4bfe3a86cbfa4',
  490. userNick: 'yjyyyyy',
  491. content: this.replyContent,
  492. fabulousCount: 0,
  493. replyTo: this.replyObj.userNick
  494. });
  495. } else {
  496. this.currentComment.list[this.replyParentIndex].children.push({
  497. userHead: 'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fup.enterdesk.com%2Fedpic%2F5e%2F4e%2Ff0%2F5e4ef0e451852e0114d75eac14f60924.jpeg&refer=http%3A%2F%2Fup.enterdesk.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1642669624&t=028d851350e18512dbf4bfe3a86cbfa4',
  498. userNick: 'yjyyyyy',
  499. content: this.replyContent,
  500. fabulousCount: 0,
  501. replyTo: this.replyObj.userNick
  502. });
  503. }
  504. this.replyContent = '';
  505. },
  506. // 收起键盘
  507. commentBlur() {
  508. this.commentPlaceholder = `说点好听的~`;
  509. this.showInput = false;
  510. this.replyType = 'video';
  511. this.replyObj = this.currentVideo;
  512. }
  513. }
  514. }
  515. </script>
  516. <style lang="scss" scoped>
  517. @import '../../static/css/font.css';
  518. .color-red {
  519. color: #f73b3b;
  520. }
  521. .inline-block {
  522. display: inline-block;
  523. vertical-align: middle;
  524. }
  525. // 喜欢按钮动画
  526. .iconxihuan,
  527. .icon-follow {
  528. transition: all .3s;
  529. }
  530. .iconxihuan:active,
  531. .icon-follow:active {
  532. transform: scale(1.5);
  533. }
  534. @keyframes double-fabulous {
  535. from {
  536. opacity: 1;
  537. transform: scale(1);
  538. }
  539. to {
  540. opacity: 0;
  541. transform: scale(3);
  542. }
  543. }
  544. // 双击点赞样式
  545. .fabulous-item {
  546. position: absolute;
  547. z-index: 99999;
  548. width: 100rpx;
  549. height: 100rpx;
  550. color: #f73b3b;
  551. font-size: 100rpx;
  552. // animation: double-fabulous 5s;
  553. transform-origin: 50% 100%;
  554. transition: opacity .8s, transform .8s;
  555. opacity: 0.8;
  556. }
  557. // 评论框
  558. .commont-box {
  559. position: fixed;
  560. z-index: -1;
  561. left: 0;
  562. bottom: 0;
  563. width: 100%;
  564. height: 60%;
  565. overflow-y: auto;
  566. background-color: #222;
  567. border-top-left-radius: 20rpx;
  568. border-top-right-radius: 20rpx;
  569. transition: all .3s;
  570. transform: translateY(100%);
  571. display: flex;
  572. flex-direction: column;
  573. &.active {
  574. z-index: 9;
  575. transform: translateY(0);
  576. }
  577. .commont-title {
  578. text-align: center;
  579. color: white;
  580. font-size: 24rpx;
  581. margin: 20rpx 0;
  582. font-weight: bold;
  583. }
  584. .commont-list {
  585. flex: 1;
  586. overflow-y: auto;
  587. .comment-panel {
  588. margin: 30rpx 40rpx;
  589. display: flex;
  590. .first-user {
  591. width: 50rpx;
  592. height: 50rpx;
  593. border-radius: 100%;
  594. }
  595. .first-comment {
  596. flex: 1;
  597. margin: 0rpx 20rpx;
  598. .comment-name {
  599. font-size: 24rpx;
  600. font-weight: bold;
  601. color: #999;
  602. }
  603. .comment-content {
  604. color: white;
  605. font-size: 26rpx;
  606. margin-top: 10rpx;
  607. }
  608. .time-box {
  609. margin-top: 10rpx;
  610. font-size: 24rpx;
  611. color: #999;
  612. .reply-btn {
  613. margin-left: 20rpx;
  614. }
  615. }
  616. }
  617. .fabulous-box {
  618. text-align: center;
  619. color: #666;
  620. .fabulous-btn {
  621. font-size: 36rpx;
  622. transition: color .3s;
  623. }
  624. .fabulous-text {
  625. font-size: 24rpx;
  626. color: #999;
  627. }
  628. }
  629. }
  630. }
  631. .comment-input {
  632. display: block;
  633. margin: 10px auto;
  634. box-sizing: border-box;
  635. width: 90%;
  636. height: 70rpx;
  637. padding: 0 20px;
  638. border-radius: 60rpx;
  639. background-color: #4a4a4a;
  640. color: white;
  641. }
  642. }
  643. // 全局容器
  644. .widget-video {
  645. width: 100%;
  646. height: 100%;
  647. overflow: hidden;
  648. position: relative;
  649. .scroll-video-box {
  650. min-height: 100%;
  651. position: relative;
  652. .empty-txt {
  653. position: absolute;
  654. left: 50%;
  655. top: 50%;
  656. transform: translate(-50%, -50%);
  657. }
  658. }
  659. .refresh-box {
  660. position: absolute;
  661. top: 0;
  662. left: 0;
  663. width: 100%;
  664. height: 50px;
  665. display: flex;
  666. justify-content: center;
  667. align-items: center;
  668. }
  669. .load-more-box {
  670. position: absolute;
  671. bottom: 0;
  672. left: 0;
  673. width: 100%;
  674. height: 50px;
  675. display: flex;
  676. justify-content: center;
  677. align-items: center;
  678. }
  679. // 视频容器
  680. .video-item-box {
  681. position: relative;
  682. .btn-play {
  683. font-size: 80rpx;
  684. color: white;
  685. position: absolute;
  686. top: 50%;
  687. left: 50%;
  688. transition: all .3s;
  689. transform: translateX(-50%) translateY(-50%) scale(1.5);
  690. z-index: 8;
  691. opacity: 0;
  692. &.show {
  693. opacity: 0.5;
  694. transform: translateX(-50%) translateY(-50%) scale(1);
  695. }
  696. }
  697. .fullscreen-video {
  698. width: 100%;
  699. height: 100%;
  700. position: relative;
  701. }
  702. .video-info {
  703. width: 100rpx;
  704. position: absolute;
  705. right: 20rpx;
  706. bottom: 100rpx;
  707. display: flex;
  708. flex-direction: column;
  709. justify-content: center;
  710. align-items: center;
  711. .atavar-box {
  712. background-color: white;
  713. padding: 6rpx;
  714. border-radius: 100%;
  715. width: 100rpx;
  716. height: 100rpx;
  717. margin-bottom: 60rpx;
  718. position: relative;
  719. .atavar-img {
  720. width: 100%;
  721. display: block;
  722. border-radius: 100%;
  723. }
  724. .add-follow-btn {
  725. width: 40rpx;
  726. height: 40rpx;
  727. padding: 4rpx;
  728. border-radius: 100%;
  729. color: white;
  730. background-color: #f73b3b;
  731. position: absolute;
  732. bottom: -24rpx;
  733. left: 50%;
  734. transform: translateX(-50%);
  735. font-weight: bold;
  736. text-align: center;
  737. line-height: 32rpx;
  738. .iconjia1 {
  739. font-size: 26rpx;
  740. }
  741. }
  742. }
  743. .icon-box {
  744. width: 100rpx;
  745. height: 100rpx;
  746. margin-top: 30rpx;
  747. display: flex;
  748. align-items: center;
  749. justify-content: space-around;
  750. flex-direction: column;
  751. color: white;
  752. .icon-btn {
  753. font-size: 60rpx;
  754. }
  755. .count-text {
  756. font-size: 24rpx;
  757. }
  758. }
  759. }
  760. .video-title {
  761. position: absolute;
  762. left: 20rpx;
  763. bottom: 20rpx;
  764. width: calc(100% - 160rpx);
  765. color: white;
  766. z-index: 1;
  767. .user-name {
  768. font-weight: bold;
  769. }
  770. .video-content {
  771. font-size: 24rpx;
  772. }
  773. }
  774. }
  775. }
  776. </style>