playBack.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591
  1. <template>
  2. <!-- 教研室详情 -->
  3. <view class="activityDetailNew">
  4. <statusBar :item="navbar"></statusBar>
  5. <!-- 消息提示 -->
  6. <msgPop></msgPop>
  7. <view class="top">
  8. <template>
  9. <view>
  10. <!-- 只渲染当前视频 -->
  11. <video :src="currentVideoUrl" controls @ended="playNextVideo"
  12. autoplay="true"></video>
  13. </view>
  14. </template>
  15. </view>
  16. <view class="decontent">
  17. <view class="actit">
  18. {{actItemList.acName}}
  19. </view>
  20. <view class="acinfo">
  21. <view class="acinfoAddress">
  22. <view class="acinfoTit">
  23. <text>时</text>
  24. <text>间</text>
  25. </view>:
  26. <text class="inf">{{actItemList.begin_at}}</text>
  27. </view>
  28. <!-- <view class="acinfoAddress">
  29. 地点:<text class="inf">{{actItemList.address}}</text>
  30. </view> -->
  31. <!-- <view class="">
  32. 主办单位:<text class="inf">暂无字段</text>
  33. </view> -->
  34. <view class="acinfoAddress">
  35. <view class="acinfoTit">
  36. <text>活</text>
  37. <text>动</text>
  38. <text>形</text>
  39. <text>式</text>
  40. </view>: <text style="color:rgba(0, 86, 168, 1) ;">{{actItemList.acshape}}</text>
  41. </view>
  42. </view>
  43. </view>
  44. </view>
  45. </template>
  46. <script>
  47. export default {
  48. data() {
  49. return {
  50. navbar: {
  51. title: '查看回放',
  52. btn: 1
  53. },
  54. // 用户openid
  55. oid: '',
  56. // 活动id
  57. acId: '',
  58. stuNum: 0,
  59. // 报名跳转链接
  60. // enrollImg: 'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/file-1719281192664.png',
  61. DigenrollImg: false,
  62. // 参与活动跳转链接
  63. GetInvolved: false,
  64. // 页面数据
  65. actItemList: {},
  66. //回放视频
  67. videoList: [],
  68. currentVideoIndex: 0, // 当前视频索引
  69. currentVideoUrl: '',
  70. // 用户收藏列表
  71. collArr: [],
  72. //报名成功弹窗
  73. showPopupConfirm: false,
  74. //过期日期
  75. dTime: '',
  76. // 查看回放弹框控制
  77. PlaybackDig: false,
  78. // 用户订阅列表
  79. // subArr: [],
  80. uLoading: false,
  81. //弹窗是否过期显示的内容
  82. popupMessage: '',
  83. // 收藏按钮节流
  84. stopTimer: 0,
  85. //控制弹窗
  86. showPopup: false,
  87. // 是否已加入
  88. isSign: 0,
  89. // 判断显示报名弹窗还是取消报名弹窗
  90. isAdd: 0,
  91. // 报名列表
  92. applyUserlist: [],
  93. pic_coll2: 'https://teacherapi.cocorobo.cn/teaching-file/static/mine/Collect_yellow.png',
  94. imgLoading: 'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/file-1712113517547.png'
  95. // nodes: [{
  96. // name: 'div',
  97. // attrs: {
  98. // class: 'div-class',
  99. // style: 'line-height: 60px; color: red; text-align:center;'
  100. // },
  101. // children: [{
  102. // type: 'text',
  103. // text: 'Hello&nbsp;uni-app!'
  104. // }]
  105. // }],
  106. // strings: '<div style="text-align:center;"><img src="https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/uni@2x.png"/></div>'
  107. // pic_sub: 'https://teacherapi.cocorobo.cn/teaching-file/static/yym/Vector (Stroke) (1).png',
  108. // pic_sub2: 'https://teacherapi.cocorobo.cn/teaching-file/static/dingyue_blue.png',
  109. };
  110. },
  111. mounted() {
  112. // 开始播放第一个视频
  113. this.playNextVideo();
  114. },
  115. // onUnload() {
  116. // this.$store.dispatch('asyncDelAll')
  117. // },
  118. computed: {
  119. isExpired() {
  120. let dTime = this.dTime.split(',')
  121. let bint = new Date(dTime[0]).getTime()
  122. let now = new Date().getTime()
  123. // console.log("过期时间",bint);
  124. // console.log("当前日期",now);
  125. return bint < now
  126. }
  127. },
  128. methods: {
  129. playNextVideo() {
  130. // 播放下一个视频
  131. if (this.currentVideoIndex < this.videoList.length) {
  132. this.currentVideoUrl = this.videoList[this.currentVideoIndex];
  133. this.currentVideoIndex++;
  134. } else {
  135. // 当播放到最后一个视频后,回到第一个视频
  136. this.currentVideoIndex = 0;
  137. this.currentVideoUrl = this.videoList[this.currentVideoIndex];
  138. }
  139. },
  140. gotoLink(e) {
  141. let link = e.currentTarget.dataset.link;
  142. uni.navigateTo({
  143. url: "/pages/skipone/skipone?url=" + encodeURIComponent(link),
  144. });
  145. },
  146. // 查看回放
  147. lookPlayback() {
  148. if (!(!!this.actItemList.playback)) {
  149. uni.showToast({
  150. title: "暂无回放",
  151. icon: 'none'
  152. });
  153. return
  154. }
  155. this.PlaybackDig = true
  156. // uni.navigateTo({
  157. // // url: "/pages/skipone/skipone?item=" + encodeURIComponent(JSON.stringify('https://www.yuketang.cn/v2/web/forbidden'))
  158. // url: "/pages/skipone/skipone?item=" + encodeURIComponent(JSON.stringify(this.actItemList
  159. // .playback))
  160. // });
  161. },
  162. // 获取页面数据
  163. getdata() {
  164. this.uLoading = true
  165. let data = {
  166. oid: this.$store.state.user.openid,
  167. acId: this.acId,
  168. }
  169. this.$request('/selectActivityID', "POST", data).then(res => {
  170. console.log('页面数据', res[0][0]);
  171. this.dTime = res[0][0].begin_at;
  172. // console.log('this.dTime',this.dTime);
  173. let video = res[0][0].videolink;
  174. this.videoList = video.split(',')
  175. console.log("this.playbacks", this.videoList)
  176. let srrt = this.datejudge(res[0][0].begin_at)
  177. console.log('srrt', srrt);
  178. res[0][0].begin_at = srrt
  179. this.uLoading = false
  180. this.actItemList = res[0][0]
  181. this.actItemList.brief = this.actItemList.brief.replace(/<img/gi,
  182. '<img style="max-width:100%;height:auto;margin:0 auto;display:block"'
  183. )
  184. })
  185. },
  186. // 处理时间
  187. datejudge(e) {
  188. const dates = e.split(",");
  189. const date1 = new Date(dates[0]);
  190. const date2 = new Date(dates[1]);
  191. const year1 = date1.getFullYear();
  192. const month1 = date1.getMonth();
  193. const day1 = date1.getDate();
  194. const year2 = date2.getFullYear();
  195. const month2 = date2.getMonth();
  196. const day2 = date2.getDate();
  197. if (year1 === year2 && month1 === month2 && day1 === day2) {
  198. const modifiedDate = dates[1].substring(11); // 保留时间部分(小时和分钟)
  199. dates[1] = modifiedDate;
  200. }
  201. const result = dates.join("-");
  202. return result
  203. },
  204. },
  205. onLoad(query) {
  206. this.acId = query.acId
  207. this.oid = this.$store.state.user.openid
  208. // 获取页面数据
  209. this.getdata()
  210. }
  211. }
  212. </script>
  213. <style lang="scss">
  214. video {
  215. width: 100%; /* 设置视频宽度为父元素宽度的百分比 */
  216. max-width: 100%; /* 确保视频不超过其原始尺寸的最大宽度 */
  217. }
  218. .activityDetailNew {
  219. background-color: #fff;
  220. /deep/ .u-image {
  221. height: 300px !important;
  222. // align-items: center !important;
  223. }
  224. /deep/ .u-image__image {
  225. height: 300px !important;
  226. }
  227. .ellone {
  228. /deep/ .u-image {
  229. height: 400px !important;
  230. }
  231. /deep/ .u-image__image {
  232. height: 600px !important;
  233. }
  234. /deep/ .u-modal__content {
  235. flex-direction: column !important;
  236. align-items: center;
  237. height: 450px;
  238. }
  239. }
  240. .popup-container2 {
  241. position: fixed;
  242. top: 50%;
  243. left: 50%;
  244. transform: translate(-50%, -50%);
  245. width: 520rpx;
  246. height: 260rpx;
  247. z-index: 1000;
  248. border-radius: 16rpx;
  249. // display: none;
  250. box-shadow: 0rpx 3rpx 10rpx 5rpx rgba(0, 0, 0, .1);
  251. overflow: hidden;
  252. .popup {
  253. width: 100%;
  254. height: 100%;
  255. display: flex;
  256. flex-direction: column;
  257. background-color: #fff;
  258. border-radius: 16rpx;
  259. overflow: hidden;
  260. .header {
  261. flex: 1;
  262. display: flex;
  263. justify-content: center;
  264. align-items: center;
  265. flex-direction: column;
  266. margin-top: 24px;
  267. font-size: 34rpx;
  268. font-weight: 600;
  269. .imgShade {
  270. width: 170rpx;
  271. height: 170rpx;
  272. display: flex;
  273. justify-content: center;
  274. align-items: center;
  275. border: 10rpx #0056A8 solid;
  276. border-radius: 50%;
  277. box-shadow: 0 0 10rpx #0056A8;
  278. margin-bottom: 10rpx;
  279. }
  280. image {
  281. width: 150rpx;
  282. height: 150rpx;
  283. margin-top: 15px;
  284. margin-bottom: 15px;
  285. }
  286. }
  287. .footer {
  288. width: 100%;
  289. display: flex;
  290. overflow: hidden;
  291. .cancel-btn {
  292. width: 50%;
  293. height: 100rpx;
  294. background-color: #F7F7F7;
  295. color: #000;
  296. font-size: 34rpx;
  297. text-align: center;
  298. border-bottom-left-radius: 16rpx;
  299. line-height: 50px;
  300. }
  301. .confirm-btn {
  302. width: 50%;
  303. height: 100rpx;
  304. background-color: #0081FE;
  305. color: #fff;
  306. font-size: 34rpx;
  307. text-align: center;
  308. line-height: 50px;
  309. }
  310. }
  311. }
  312. }
  313. .top {
  314. width: 750rpx;
  315. position: relative;
  316. .img1 {
  317. display: block;
  318. margin: auto;
  319. width: 750rpx;
  320. }
  321. .img2 {
  322. position: absolute;
  323. width: 100%;
  324. left: 0;
  325. bottom: 0;
  326. }
  327. }
  328. .decontent {
  329. width: 750rpx;
  330. border-top-right-radius: 30rpx;
  331. border-top-left-radius: 30rpx;
  332. background-color: #fff;
  333. padding: 32rpx;
  334. display: flex;
  335. flex-direction: column;
  336. justify-content: flex-start;
  337. border-bottom: 1rpx rgba(231, 231, 231, 1) solid;
  338. .actit {
  339. font-weight: 600;
  340. font-size: 40rpx;
  341. color: rgba(0, 0, 0, 0.8);
  342. line-height: 56rpx;
  343. display: -webkit-box;
  344. word-break: break-all;
  345. text-overflow: ellipsis;
  346. overflow: hidden;
  347. -webkit-box-orient: vertical;
  348. -webkit-line-clamp: 2;
  349. }
  350. .footer {
  351. display: flex;
  352. justify-content: space-between;
  353. color: rgba(0, 0, 0, 0.4);
  354. font-size: 24rpx;
  355. // height: 32rpx;
  356. // line-height: 32rpx;
  357. font-weight: 400;
  358. padding: 20rpx 0;
  359. padding-bottom: 0;
  360. }
  361. .avaList {
  362. display: flex;
  363. justify-content: space-between;
  364. width: 100%;
  365. align-items: center;
  366. padding: 30rpx 0;
  367. border-bottom: 1rpx rgba(231, 231, 231, 1) solid;
  368. margin-bottom: 20rpx;
  369. .ava {
  370. // width: 353rpx;
  371. display: flex;
  372. align-items: center;
  373. }
  374. .cost {
  375. flex: 1;
  376. text-align: right;
  377. font-weight: 700;
  378. font-size: 40rpx;
  379. color: rgba(246, 135, 23, 1);
  380. }
  381. }
  382. .acinfo {
  383. width: 100%;
  384. display: flex;
  385. flex-direction: column;
  386. justify-content: space-between;
  387. font-size: 28rpx;
  388. font-weight: 400;
  389. color: rgba(0, 0, 0, 0.6);
  390. border-bottom: 1rpx rgba(231, 231, 231, 1) solid;
  391. // padding-bottom: 30rpx;
  392. .acinfoAddress {
  393. // padding: 20rpx 0;
  394. display: flex;
  395. padding-bottom: 20rpx;
  396. .acinfoTit {
  397. width: 150rpx;
  398. display: flex;
  399. justify-content: space-between;
  400. // text-align: justify;
  401. .justified-text {
  402. text-align: justify;
  403. text-justify: inter-word;
  404. /* 兼容性写法,用于处理中英文混排时的对齐效果 */
  405. }
  406. }
  407. }
  408. .inf {
  409. color: rgba(0, 0, 0, 0.8);
  410. }
  411. }
  412. .acbrief {
  413. width: 100%;
  414. .britit {
  415. width: 100%;
  416. height: 48rpx;
  417. font-weight: 600;
  418. line-height: 48rpx;
  419. font-size: 32rpx;
  420. color: rgba(0, 0, 0, 0.8);
  421. margin: 30rpx 0;
  422. }
  423. .bricon {
  424. font-weight: 400;
  425. font-size: 28rpx;
  426. line-height: 44rpx;
  427. color: (0, 0, 0, 0.8);
  428. margin-bottom: 30rpx;
  429. }
  430. .briImg {
  431. width: 100%;
  432. }
  433. }
  434. }
  435. .btnBlock {
  436. position: fixed;
  437. bottom: 0;
  438. left: 0;
  439. width: 750rpx;
  440. height: 175rpx;
  441. background-color: #fff;
  442. display: flex;
  443. justify-content: flex-start;
  444. align-items: center;
  445. padding: 30rpx 30rpx;
  446. padding-bottom: 40rpx;
  447. border-top: 1rpx rgba(231, 231, 231, 1) solid;
  448. // padding-bottom: 78rpx;
  449. .icos {
  450. width: 200rpx;
  451. height: 96rpx;
  452. flex-shrink: 0;
  453. margin-right: 30rpx;
  454. display: flex;
  455. justify-content: space-between;
  456. .ico {
  457. width: 100rpx;
  458. display: flex;
  459. flex-direction: column;
  460. justify-content: space-between;
  461. align-items: center;
  462. .imgBlock {
  463. width: 48rpx;
  464. height: 48rpx;
  465. display: flex;
  466. align-items: center;
  467. justify-content: center;
  468. .icoimg {
  469. width: 42rpx;
  470. height: 40rpx;
  471. }
  472. }
  473. .icotxt {
  474. font-size: 24rpx;
  475. height: 40rpx;
  476. line-height: 40rpx;
  477. color: rgba(4, 0, 0, 1);
  478. }
  479. }
  480. }
  481. .rightBtn {
  482. flex: 1;
  483. display: flex;
  484. justify-content: center;
  485. align-items: center;
  486. .btnt {
  487. width: 454rpx;
  488. color: #fff;
  489. font-weight: 400;
  490. font-size: 17px;
  491. height: 96rpx;
  492. background-color: rgba(0, 86, 168, 1);
  493. display: flex;
  494. justify-content: center;
  495. align-items: center;
  496. border-radius: 10rpx;
  497. }
  498. .btnt1 {
  499. width: 454rpx;
  500. font-weight: 400;
  501. font-size: 17px;
  502. height: 96rpx;
  503. background-color: rgb(217, 217, 217);
  504. display: flex;
  505. justify-content: center;
  506. align-items: center;
  507. border-radius: 10rpx;
  508. }
  509. }
  510. }
  511. }
  512. </style>