live copy.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932
  1. <template>
  2. <view class="">
  3. <u-navbar
  4. bgColor="transparent"
  5. leftIconColor="#fff"
  6. :fixed="true"
  7. leftIconSize="48"
  8. :autoBack="true"
  9. >
  10. </u-navbar>
  11. <swiper
  12. style="height: 100vh"
  13. :current="currentIndex"
  14. :vertical="true"
  15. @change="changeplay"
  16. @touchstart="touchStart"
  17. @touchend="touchEnd"
  18. >
  19. <swiper-item
  20. class="video-main flex-center"
  21. v-for="(item, index) in videoList"
  22. :key="index"
  23. >
  24. <video
  25. id="myVideo"
  26. class="video"
  27. ref="video"
  28. :src="item.video[0].video"
  29. :show-center-play-btn="false"
  30. :controls="true"
  31. poster="/static/image/common/video-list-bg.png"
  32. @loadedmetadata="videometa"
  33. :autoplay="autoplay"
  34. :enable-play-gesture="true"
  35. play-btn-position="center"
  36. :show-fullscreen-btn="false"
  37. objectFit="cover"
  38. @click="suspendChecked = !suspendChecked"
  39. :index="index"
  40. ></video>
  41. <view class="foot" style="position: absolute">
  42. <view class="foot-info flex-start">
  43. <image
  44. :src="
  45. item.avatar || '/static/image/common/teams_avatar_ico@2x.png'
  46. "
  47. mode=""
  48. ></image>
  49. <text style="padding: 0 40rpx">{{ item.user_nickname }}</text>
  50. <text
  51. class="btn"
  52. v-if="userId != info.uid"
  53. :class="{ active: item.is_attention == 1 }"
  54. @click="attention(item.is_attention)"
  55. >{{ item.is_attention == 1 ? $t('video.lab4') : $t('video.lab5') }}</text
  56. >
  57. </view>
  58. <view class="content text-clamp2 font28">
  59. {{ item.title }}
  60. </view>
  61. </view>
  62. <view class="meun">
  63. <view class="" @click="setVideoLike(item.is_likes)">
  64. <image
  65. :src="
  66. item.is_likes == 1
  67. ? '/static/image/videos/video4.png'
  68. : '/static/image/videos/video3.png'
  69. "
  70. mode=""
  71. ></image>
  72. <view class="font24">
  73. {{ numberToK(item.likes) }}
  74. </view>
  75. </view>
  76. <view class="" @click="openComment()">
  77. <image src="/static/image/videos/video2.png" mode=""></image>
  78. <view class="font24">
  79. {{ item.comment_count }}
  80. </view>
  81. </view>
  82. <view class="" @click="show = true">
  83. <image
  84. src="/static/image/videos/video1.png"
  85. mode=""
  86. open=""
  87. ></image>
  88. <view class="font24">
  89. <!-- more -->
  90. {{ $t('video.lab6') }}
  91. </view>
  92. </view>
  93. </view>
  94. <image
  95. @click="videoPlay(index)"
  96. v-if="suspendChecked"
  97. class="suspend"
  98. src="../../static/image/live/suspend.png"
  99. ></image>
  100. <!-- <view>{{item.video}}</view>
  101. -->
  102. <!-- </view> -->
  103. <!-- <image style="width: 100%;" @click="everythingPlayVideo()" class="video"
  104. :src="item.video[0].img"></image> -->
  105. </swiper-item>
  106. </swiper>
  107. <!-- 举报弹窗 -->
  108. <u-popup
  109. :show="reportShow"
  110. :round="20"
  111. mode="center"
  112. @close="reportShow = false"
  113. >
  114. <view class="report-buttom" style="padding: 0 60rpx">
  115. <view style="line-height: 88rpx" @click="report"
  116. >
  117. <!-- Sensitive information -->
  118. {{ $t('video.lab7') }}
  119. </view
  120. >
  121. <view style="line-height: 88rpx" @click="report">
  122. <!-- User Privacy -->
  123. {{ $t('video.lab16') }}
  124. </view>
  125. <view style="line-height: 88rpx" @click="report"
  126. >
  127. <!-- Suspected of fraud -->
  128. {{ $t('video.lab8') }}
  129. </view
  130. >
  131. <view style="line-height: 88rpx" @click="report">
  132. <!-- legal Crime -->
  133. {{ $t('video.lab17') }}
  134. </view>
  135. </view>
  136. </u-popup>
  137. <view class="menues">
  138. <u-popup :show="show" :round="20" mode="bottom" @close="close">
  139. <view class="">
  140. <view class="justify-between more-popup" style="text-align: center">
  141. <view class="">
  142. <image
  143. src="../../static/image/videos/more-Collection.png"
  144. mode=""
  145. ></image>
  146. <view class="c3" @click="collection">Collection</view>
  147. </view>
  148. <view class="" @click="saveVideo">
  149. <image
  150. src="../../static/image/videos/more-Preservation.png"
  151. mode=""
  152. ></image>
  153. <view class="c3">
  154. <!-- Save -->
  155. {{ $t('video.lab10') }}
  156. </view>
  157. </view>
  158. <view class="" @click="reportClick">
  159. <image
  160. src="../../static/image/videos/more-Report.png"
  161. mode=""
  162. ></image>
  163. <view class="c3">
  164. <!-- Report -->
  165. {{ $t('video.lab11') }}
  166. </view>
  167. </view>
  168. <view class="" @click="shareLive">
  169. <image
  170. src="../../static/image/videos/more-Share.png"
  171. mode=""
  172. ></image>
  173. <view class="c3">
  174. <!-- Share -->
  175. {{ $t('video.lab12') }}
  176. </view>
  177. </view>
  178. </view>
  179. <view class="c3 Bold more-cancel">
  180. <text @click="show = false">
  181. <!-- Cancel -->
  182. {{ $t('video.lab13') }}
  183. </text>
  184. </view>
  185. </view>
  186. </u-popup>
  187. </view>
  188. <!-- <view class="Open" @click="setVoice()" v-if="isVoice1">
  189. Open the voice
  190. </view> -->
  191. <u-popup
  192. :show="showMask"
  193. :round="20"
  194. mode="bottom"
  195. @close="showMask = false"
  196. >
  197. <view class="comment-box">
  198. <comment-video
  199. ref="hbComment"
  200. @add="add"
  201. @like="like"
  202. :deleteTip="$t('common.delete1')"
  203. :cmData="commentData"
  204. >
  205. </comment-video>
  206. <view class="comment-input">
  207. <view class="flex-start" @click="setEg()">
  208. <image src="/static/image/news/topic9.png" mode=""></image>
  209. <text>{{ $t("news.input") }}</text>
  210. </view>
  211. </view>
  212. </view>
  213. </u-popup>
  214. <u-toast ref="uToast"></u-toast>
  215. </view>
  216. </template>
  217. <script>
  218. /* 分享组件*/
  219. // import NativeShare from 'nativeshare'
  220. import { numberToK } from '@/utils/util'
  221. import commentVideo from "@/components/comment-eg/comment-video.vue";
  222. import install from "@/components/install/install.vue";
  223. var time = null;
  224. export default {
  225. components: {
  226. commentVideo,
  227. install,
  228. },
  229. data() {
  230. return {
  231. show: false,
  232. currentIndex: 2,
  233. id: 0,
  234. index: 0,
  235. videoId: 0,
  236. showMask: false,
  237. reportShow: false,
  238. suspendChecked: false,
  239. reqFlag: false, // 请求标志,防止重复操作,true表示请求中
  240. comment: [],
  241. commentData: {},
  242. videoPlays: true,
  243. info: {},
  244. height: 0,
  245. width: 0,
  246. muted: true,
  247. isVoice1: false,
  248. videoContext: null,
  249. userId: "",
  250. reportId: "",
  251. touchStartX: 0, // 触屏起始点x
  252. touchStartY: 0, // 触屏起始点y
  253. delta: 50, // 滑动要大于这个值
  254. videoList: [],
  255. pageStatrY: 0,
  256. autoplay: false,
  257. pageEndY: 0,
  258. page: 0,
  259. videoContext: undefined, //全局定义视频API变量
  260. time1: null,
  261. };
  262. },
  263. computed: {
  264. isLogin() {
  265. return this.$store.state.isLogin;
  266. },
  267. isVoice() {
  268. return this.$store.state.isVoice;
  269. },
  270. system() {
  271. return this.$store.state.system;
  272. },
  273. },
  274. onLoad(option) {
  275. // uni.setNavigationBarTitle({ title: this.title })
  276. let information = uni.getStorage("information");
  277. let watchingOutSign = localStorage.getItem('watchingOutSign')
  278. // if (watchingOutSign && this.isLogin != 1) {
  279. // this.$r.loginBox()
  280. // this.$store.state.loginShowSign = true
  281. // this.$store.state.loginShowCloseSign = false;
  282. // } else {
  283. this.getIsLogin()
  284. // }
  285. uni.getStorage({
  286. key: "information", // 储存在本地的变量名
  287. success: (res) => {
  288. this.userId = res.data.id;
  289. console.log(this.userId);
  290. },
  291. });
  292. this.id = option.id;
  293. this.getList();
  294. this.getComment(option.id);
  295. this.currentIndex = option.index;
  296. // this.info = this.$common.get('videoInfo');
  297. this.getVideo(option.id);
  298. this.reportId = option.id;
  299. uni.$u.http
  300. .post("api/Video/getVideoInfo", {
  301. id: option.id,
  302. })
  303. .then((res) => {
  304. this.info = res;
  305. // 设置下载视频视频标题
  306. uni.setNavigationBarTitle({
  307. title: this.info.title,
  308. });
  309. })
  310. .catch((res) => {});
  311. uni.getSystemInfo({
  312. success: (res) => {
  313. //console.log(res)
  314. this.windowWidth = res.windowWidth;
  315. this.windowHeight = res.windowHeight;
  316. },
  317. });
  318. },
  319. onReady: function (res) {
  320. // 获取 video 上下文 videoContext 对象
  321. this.videoContext = uni.createVideoContext("myVideo");
  322. setTimeout(() => {
  323. this.auto();
  324. }, 500);
  325. // 进入全屏状态
  326. // this.videoContext.requestFullScreen()
  327. // setTimeout(res=>{
  328. // this.videoContext.load()
  329. // this.videoContext.play();
  330. // },2000)
  331. },
  332. onUnload() {
  333. this.time1 && clearInterval(this.time1);
  334. this.videoContext = null;
  335. },
  336. methods: {
  337. // 首视频自动播放
  338. auto() {
  339. if (this.index === 0) {
  340. this.$refs.video[this.currentIndex].play();
  341. }
  342. },
  343. //上下滑动触发事件
  344. changeplay(res) {
  345. let that = this;
  346. clearTimeout(time);
  347. that.page = res.detail.current;
  348. console.log(that.page, res, 111);
  349. time = setTimeout(() => {
  350. if (that.pageStatrY < that.pageEndY) {
  351. setTimeout(() => {
  352. console.error(that.page);
  353. that.$refs.video[that.page].play();
  354. }, 20);
  355. that.$refs.video[that.page + 1].pause();
  356. that.pageStatrY = 0;
  357. that.pageEndY = 0;
  358. } else {
  359. setTimeout(() => {
  360. console.error(that.page);
  361. that.$refs.video[that.page].play();
  362. }, 20);
  363. that.$refs.video[that.page - 1].pause();
  364. that.pageStatrY = 0;
  365. that.pageEndY = 0;
  366. }
  367. }, 1);
  368. },
  369. //获取向下滑动的值
  370. touchStart(res) {
  371. this.pageStatrY = res.changedTouches[0].pageY;
  372. },
  373. //获取向上滑动的值
  374. touchEnd(res) {
  375. this.pageEndY = res.changedTouches[0].pageY;
  376. },
  377. // 视频列表数据
  378. getList() {
  379. // 设置状态为加载中
  380. this.status = "loading";
  381. uni.$u.http
  382. .get("/api/Video/getList", {
  383. params: {
  384. page: 1,
  385. type: 1,
  386. },
  387. })
  388. .then((res) => {
  389. // 获取到的数据,请注意数据结构
  390. // 第一页数据执行以下代码
  391. this.videoList = res.data;
  392. })
  393. .catch((res) => {});
  394. },
  395. reportClick() {
  396. if (this.$store.state.isLogin != 1) {
  397. this.$toUrl('/pages/login/login')
  398. return
  399. }
  400. this.reportShow = true;
  401. this.show = false;
  402. },
  403. // 举报成功
  404. report() {
  405. // 这个举报的接口我用了post和get请求传视频id过去给你都不行
  406. uni.$u.http
  407. .get("api/Reportuser/insert", {
  408. id: this.reportId,
  409. })
  410. .then((res) => {
  411. this.$refs.uToast.show({
  412. type: "success",
  413. title: "默认主题",
  414. message: this.$t('video.lab14'),
  415. iconUrl: "",
  416. });
  417. console.log(res);
  418. })
  419. .catch((res) => {});
  420. this.reportShow = false;
  421. },
  422. // 收藏
  423. collection() {
  424. if (this.$store.state.isLogin != 1) {
  425. this.$toUrl('/pages/login/login')
  426. return
  427. }
  428. this.$refs.uToast.show({
  429. type: "success",
  430. title: "默认主题",
  431. message: this.$t('video.lab15'),
  432. iconUrl: "",
  433. });
  434. },
  435. // 分享
  436. shareLive() {
  437. var ua = navigator.userAgent.toLowerCase();
  438. if (ua.match(/MicroMessenger/i) == "micromessenger") {
  439. alert("Please click [Open in Browser] in the upper right corner");
  440. } else {
  441. // var nativeShare = new NativeShare()
  442. // var shareData = {
  443. // title: '名字',
  444. // desc: '介绍',
  445. // link: 'https://m.onecric.tv/',
  446. // icon: '图标预留',
  447. // success: function() {
  448. // console.log('分享成功')
  449. // },
  450. // fail: function() {
  451. // console.log('分享失败')
  452. // }
  453. // }
  454. // nativeShare.setShareData(shareData)
  455. // this.shareNative() //调用分享回调
  456. navigator.share({
  457. title: "",
  458. text: "",
  459. url: "https://m.onecric.tv/",
  460. }); // 分享 MDN 的 URL
  461. }
  462. },
  463. // 分享回调
  464. shareNative() {
  465. try {
  466. nativeShare.call(command);
  467. } catch (err) {
  468. // 如果不支持,你可以在这里做降级处理
  469. alert(err.message);
  470. }
  471. },
  472. // 下载视频
  473. saveVideo() {
  474. var ua = navigator.userAgent.toLowerCase();
  475. if (ua.match(/MicroMessenger/i) == "micromessenger") {
  476. alert("Please click [Open in Browser] in the upper right corner");
  477. } else {
  478. this.downLoad(); //调用下载函数
  479. this.showVideo = false;
  480. uni.showLoading({
  481. title: "Downloading",
  482. });
  483. }
  484. },
  485. downLoad() {
  486. //测试发现,在pc端正常下载; 在移动端 qq浏览器,safari浏览器不能下载
  487. let that = this;
  488. let url = that.info.video[0].video;
  489. //**调用download.js下载,下载速度相对快一些**
  490. let downjs = require("./download.js"); //引用当前目录下的自定义函数
  491. let x = new XMLHttpRequest();
  492. x.open("GET", url, true);
  493. x.responseType = "blob";
  494. x.onload = function (e) {
  495. downjs(x.response, `${that.info.title}.mp4`, "video/mp4");
  496. uni.hideLoading();
  497. that.showVideo = true;
  498. };
  499. x.send();
  500. },
  501. // 关闭弹窗
  502. close() {
  503. console.log(11);
  504. this.show = false;
  505. },
  506. videometa: function (e) {
  507. var that = this;
  508. console.log(e);
  509. //获取系统信息
  510. wx.getSystemInfo({
  511. success(res) {
  512. //视频的高
  513. var height = e.detail.height;
  514. //视频的宽
  515. var width = e.detail.width;
  516. //算出视频的比例
  517. var proportion = height / width;
  518. //res.windowWidth为手机屏幕的宽。
  519. var windowWidth = res.windowWidth;
  520. //算出当前宽度下高度的数值
  521. that.height = proportion * windowWidth;
  522. that.width = windowWidth;
  523. },
  524. });
  525. var u = navigator.userAgent;
  526. var isAndroid = u.indexOf("Android") > -1 || u.indexOf("Adr") > -1; //android终端
  527. var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
  528. if (isAndroid) {
  529. this.muted = false;
  530. }
  531. if (isiOS) {
  532. /* 需要弹窗提示 播放声音 全局配置*/
  533. if (!this.isVoice) {
  534. this.isVoice1 = true;
  535. } else {
  536. // this.videoContext.muted(false)
  537. this.muted = false;
  538. this.isVoice1 = false;
  539. }
  540. }
  541. },
  542. numberToK(v) {
  543. return numberToK(v)
  544. },
  545. setVoice() {
  546. this.muted = false;
  547. this.isVoice1 = false;
  548. this.$store.state.isVoice = true;
  549. },
  550. setEg() {
  551. this.$refs.hbComment.commentInput();
  552. },
  553. like(commentId) {
  554. if (this.$store.state.isLogin != 1) {
  555. this.$toUrl('/pages/login/login')
  556. return
  557. }
  558. if (this.reqFlag) {
  559. uni.showToast({
  560. title: this.$t('common.frequent'),
  561. duration: 1000,
  562. });
  563. return;
  564. }
  565. this.reqFlag = true;
  566. uni.$u.http
  567. .post("api/Video_user/commentLikes", {
  568. id: commentId,
  569. })
  570. .then((res) => {
  571. this.$refs.hbComment.likeComplete(commentId);
  572. this.reqFlag = false;
  573. })
  574. .catch((res) => {
  575. this.reqFlag = false;
  576. });
  577. },
  578. add(req) {
  579. if (this.$store.state.isLogin != 1) {
  580. this.$toUrl('/pages/login/login')
  581. return
  582. }
  583. if (this.reqFlag) {
  584. uni.showToast({
  585. title: this.$t('common.frequent'),
  586. duration: 1000,
  587. });
  588. return;
  589. }
  590. this.reqFlag = true;
  591. // TODO 接入真实接口
  592. let params = {
  593. id: this.id,
  594. cid: req.pId,
  595. content: req.content,
  596. };
  597. uni.$u.http
  598. .post("api/Video_user/comment", params)
  599. .then((res) => {
  600. this.getComment(this.id);
  601. this.$refs.hbComment.addComplete();
  602. this.reqFlag = false;
  603. })
  604. .catch((res) => {
  605. this.reqFlag = false;
  606. });
  607. },
  608. getComment(articleId) {
  609. uni.$u.http
  610. .get("/api/Video/commentOneList", {
  611. params: {
  612. id: articleId,
  613. },
  614. })
  615. .then((res) => {
  616. this.commentData = {
  617. readNumer: 0,
  618. commentSize: res.total,
  619. comment: this.getTree(res.data),
  620. };
  621. this.info.comment_count = res.total;
  622. });
  623. },
  624. openComment() {
  625. this.showMask = true;
  626. },
  627. /* 播放视频 */
  628. videoPlay(index) {
  629. this.suspendChecked = false;
  630. if (this.videoPlays == false) {
  631. // this.videoindex = index
  632. // uni.createVideoContext(`myVideo$`).requestFullScreen()
  633. this.$refs.video[index].play();
  634. this.videoPlays = true;
  635. } else {
  636. this.suspendChecked = true;
  637. this.$refs.video[index].pause();
  638. this.videoPlays = false;
  639. }
  640. },
  641. // 列表按照父子转换成树
  642. getTree(data) {
  643. let result = [];
  644. let map = {};
  645. data.forEach((item) => {
  646. map[item.id] = item;
  647. });
  648. data.forEach((item) => {
  649. let parent = map[item.parentId];
  650. if (parent) {
  651. (parent.children || (parent.children = [])).push(item);
  652. } else {
  653. result.push(item);
  654. }
  655. });
  656. return result;
  657. },
  658. getVideo(item) {
  659. /* 添加视频观看量 */
  660. // uni.$u.http.get('/api/Video/getList',{params:{page:item.page}}).then(res=>{
  661. // res.data.filter(item1=>{
  662. // console.log(item1.id,item.id);
  663. // if(item1.id == item.id) {
  664. // console.log(item1);
  665. // }
  666. // })
  667. // // console.log(arr);
  668. // }).catch(res=>{})
  669. uni.$u.http
  670. .get("api/Video/addView", {
  671. params: {
  672. id: item,
  673. },
  674. })
  675. .then((res) => {
  676. let pages = getCurrentPages();
  677. let prevPage = pages[pages.length - 2]; //上一页页面实例
  678. prevPage.$vm.waterfall.list[0].likes = 100;
  679. })
  680. .catch((res) => {});
  681. },
  682. /* 关注 */
  683. attention(type) {
  684. if (this.$store.state.isLogin != 1) {
  685. this.$toUrl('/pages/login/login')
  686. return
  687. }
  688. uni.showLoading({
  689. title: this.$t('common.lab'),
  690. });
  691. uni.$u.http
  692. .post("/api/Member/attention", {
  693. id: this.info.uid,
  694. })
  695. .then((res) => {
  696. uni.hideLoading();
  697. this.getList();
  698. this.info.is_attention = type == 1 ? (type = 0) : (type = 1);
  699. });
  700. },
  701. /* 判断是否登录 未登录情况下只能停留3分钟 180秒 */
  702. getIsLogin() {
  703. let that = this;
  704. if (this.isLogin == 1) return;
  705. uni.$u.http.get('/api/universal/getHot', {}).then(res => {
  706. this.$store.state.system = res;
  707. if (!this.system.login_remind || Number(this.system.login_remind) > 5000) return;
  708. this.time1 = setTimeout((res) => {
  709. if (this.isLogin == 1) {
  710. return
  711. }
  712. localStorage.setItem('watchingOutSign', true)
  713. this.$toast("Please log in to continue watching the live broadcast");
  714. setTimeout((res1) => {
  715. this.$toUrl('/pages/login/login')
  716. }, 1500);
  717. }, this.system.login_remind * 60000);
  718. })
  719. },
  720. /* 视频点赞 */
  721. setVideoLike(type) {
  722. if (this.$store.state.isLogin != 1) {
  723. this.$toUrl('/pages/login/login')
  724. return
  725. }
  726. uni.showLoading({
  727. title: this.$t('common.lab'),
  728. });
  729. uni.$u.http
  730. .post("api/Video_user/likes", {
  731. id: this.id,
  732. })
  733. .then((res) => {
  734. this.info.is_likes = type == 1 ? 0 : 1;
  735. type == 1 ? this.info.likes-- : this.info.likes++;
  736. uni.hideLoading();
  737. // let pages = getCurrentPages();
  738. // let prevPage = pages[pages.length - 2]; //上一页页面实例
  739. // prevPage.$vm.waterfall.list[] = 1;
  740. })
  741. .catch((res) => {});
  742. },
  743. },
  744. };
  745. </script>
  746. <style lang="scss">
  747. page {
  748. background-color: #000;
  749. }
  750. #myVideo {
  751. width: 100%;
  752. // top: -100rpx;
  753. }
  754. #myVideo::v-deep .uni-video-control-button {
  755. display: none !important;
  756. }
  757. #myVideo::v-deep .uni-video-bar.uni-video-bar-full {
  758. position: absolute;
  759. bottom: 0px;
  760. }
  761. .Open {
  762. position: fixed;
  763. top: 50%;
  764. left: 50%;
  765. margin-left: -150rpx;
  766. z-index: 9999;
  767. color: #fff;
  768. width: 300rpx;
  769. // height: 100rpx;
  770. padding: 40rpx 0;
  771. text-align: center;
  772. border-radius: 10rpx;
  773. background-color: #dc3c23;
  774. }
  775. .video-main {
  776. height: 100vh;
  777. .suspend {
  778. position: absolute;
  779. width: 100rpx;
  780. height: 100rpx;
  781. }
  782. }
  783. .comment-box {
  784. height: 50vh;
  785. padding-bottom: 118rpx;
  786. position: relative;
  787. }
  788. .comment-input {
  789. position: absolute;
  790. bottom: 0;
  791. right: 0;
  792. left: 0;
  793. z-index: 99;
  794. background-color: white;
  795. padding: 18rpx 28rpx;
  796. image {
  797. width: 60rpx;
  798. height: 60rpx;
  799. margin-left: 16rpx;
  800. }
  801. text {
  802. color: #999;
  803. }
  804. view {
  805. color: #999;
  806. font-size: 28rpx;
  807. border-radius: 12rpx;
  808. padding: 22rpx 32rpx;
  809. background-color: #f5f5f5;
  810. image {
  811. width: 28rpx;
  812. height: 28rpx;
  813. margin-right: 32rpx;
  814. }
  815. }
  816. }
  817. .menues {
  818. color: #fff;
  819. width: 72rpx;
  820. image {
  821. width: 72rpx;
  822. height: 72rpx;
  823. margin-top: 30rpx;
  824. }
  825. .font24 {
  826. margin-top: 10rpx;
  827. text-align: center;
  828. }
  829. .more-popup {
  830. font-size: 12rpx;
  831. padding: 16rpx 32rpx;
  832. }
  833. .more-cancel {
  834. text-align: center;
  835. margin-top: 12rpx;
  836. margin-bottom: 30rpx;
  837. font-size: 14rpx;
  838. }
  839. }
  840. .meun {
  841. color: #fff;
  842. position: absolute;
  843. // bottom: 30%;
  844. right: 34rpx;
  845. width: 72rpx;
  846. image {
  847. width: 72rpx;
  848. height: 72rpx;
  849. margin-top: 30rpx;
  850. }
  851. .font24 {
  852. margin-top: 10rpx;
  853. text-align: center;
  854. }
  855. .more-popup {
  856. font-size: 12rpx;
  857. padding: 16rpx 32rpx;
  858. }
  859. .more-cancel {
  860. text-align: center;
  861. margin-top: 12rpx;
  862. margin-bottom: 30rpx;
  863. font-size: 14rpx;
  864. }
  865. }
  866. .foot {
  867. color: #fff;
  868. position: fixed;
  869. bottom: 120rpx;
  870. right: 24rpx;
  871. left: 24rpx;
  872. image {
  873. width: 72rpx;
  874. height: 72rpx;
  875. border-radius: 50%;
  876. }
  877. .btn {
  878. font-size: 24rpx;
  879. padding: 8rpx 26rpx;
  880. border-radius: 6px 6px 6px 6px;
  881. background: linear-gradient(90deg, #dc3c23 0%, #dc3c23 100%);
  882. }
  883. .active {
  884. background: #ccc;
  885. }
  886. .content {
  887. margin-top: 24rpx;
  888. -webkit-line-clamp: 4;
  889. // padding-bottom: 60rpx;
  890. }
  891. }
  892. </style>