playBack.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564
  1. <template>
  2. <!-- 教研室详情 -->
  3. <view class="activityDetailNew">
  4. <statusBar :item="navbar"></statusBar>
  5. <view class="top">
  6. <template>
  7. <view>
  8. <!-- 只渲染当前视频 -->
  9. <video :src="currentVideoUrl" show-loading show-play-btn
  10. show-center-play-btn controls></video>
  11. </view>
  12. </template>
  13. </view>
  14. <view class="vioList">
  15. <view @click="cutVio(index)" :class="['vioBlo',currentVideoIndex == index?'vioBlo2':'']"
  16. v-for="(i,index) in videoList" :key="index">
  17. 视频{{index + 1}}
  18. </view>
  19. </view>
  20. <view class="decontent">
  21. <view class="actit">
  22. {{actItemList.acName}}
  23. </view>
  24. <view class="acinfo">
  25. <view class="acinfoAddress">
  26. <view class="acinfoTit">
  27. <text>时</text>
  28. <text>间</text>
  29. </view>:
  30. <text class="inf">{{actItemList.begin_at}}</text>
  31. </view>
  32. <view class="acinfoAddress">
  33. <view class="acinfoTit">
  34. <text>活</text>
  35. <text>动</text>
  36. <text>形</text>
  37. <text>式</text>
  38. </view>: <text style="color:rgba(0, 86, 168, 1) ;">{{actItemList.acshape}}</text>
  39. </view>
  40. </view>
  41. </view>
  42. </view>
  43. </template>
  44. <script>
  45. export default {
  46. data() {
  47. return {
  48. navbar: {
  49. title: '查看回放',
  50. btn: 1
  51. },
  52. // 用户openid
  53. oid: '',
  54. // 活动id
  55. acId: '',
  56. // 页面数据
  57. actItemList: {},
  58. //回放视频
  59. videoList: [],
  60. currentVideoIndex: 0, // 当前视频索引
  61. currentVideoUrl: '',
  62. // 用户收藏列表
  63. collArr: [],
  64. //报名成功弹窗
  65. showPopupConfirm: false,
  66. // 查看回放弹框控制
  67. PlaybackDig: false,
  68. };
  69. },
  70. mounted() {
  71. // this.$nextTick(()=>{
  72. // })
  73. // 开始播放第一个视频
  74. setTimeout(() => {
  75. this.playVideo();
  76. }, 1500)
  77. },
  78. methods: {
  79. cutVio(val) {
  80. this.currentVideoIndex = val
  81. this.currentVideoUrl = this.videoList[val];
  82. },
  83. playVideo() {
  84. this.currentVideoUrl = this.videoList[this.currentVideoIndex];
  85. },
  86. // playNextVideo() {
  87. // // 播放下一个视频
  88. // if (this.currentVideoIndex+1 < this.videoList.length) {
  89. // this.currentVideoUrl = this.videoList[this.currentVideoIndex];
  90. // this.currentVideoIndex++;
  91. // }
  92. // // else {
  93. // // this.currentVideoIndex = 0;
  94. // // this.currentVideoUrl = this.videoList[this.currentVideoIndex];
  95. // // }
  96. // },
  97. // 获取页面数据
  98. getdata() {
  99. this.uLoading = true
  100. let data = {
  101. oid: this.$store.state.user.openid,
  102. acId: this.acId,
  103. }
  104. this.$request('/selectActivityID', "POST", data).then(res => {
  105. let video = res[0][0].videolink;
  106. let allVio = video.split(',')
  107. // allVio.forEach(e => {
  108. // e = this.convertUrl(e)
  109. // })
  110. // for (let var1 in allVio) {
  111. // allVio[var1] = this.convertUrl(allVio[var1])
  112. // }
  113. this.videoList = allVio
  114. console.log("this.playbacks", this.videoList)
  115. let srrt = this.datejudge(res[0][0].begin_at)
  116. res[0][0].begin_at = srrt
  117. this.actItemList = res[0][0]
  118. })
  119. },
  120. // 视频地址中带中文,将中文转码转码
  121. convertUrl(originalUrl) {
  122. const urlParts = originalUrl.split('/');
  123. const protocol = urlParts[0];
  124. const host = urlParts[2];
  125. const path = urlParts.slice(3).join('/');
  126. const encodedPath = encodeURIComponent(path);
  127. const newUrl = `${protocol}//${host}/${encodedPath.replace(/%2F/g, '/')}`;
  128. return newUrl;
  129. },
  130. // 处理时间
  131. datejudge(e) {
  132. const dates = e.split(",");
  133. const date1 = new Date(dates[0]);
  134. const date2 = new Date(dates[1]);
  135. const year1 = date1.getFullYear();
  136. const month1 = date1.getMonth();
  137. const day1 = date1.getDate();
  138. const year2 = date2.getFullYear();
  139. const month2 = date2.getMonth();
  140. const day2 = date2.getDate();
  141. if (year1 === year2 && month1 === month2 && day1 === day2) {
  142. const modifiedDate = dates[1].substring(11); // 保留时间部分(小时和分钟)
  143. dates[1] = modifiedDate;
  144. }
  145. const result = dates.join("-");
  146. return result
  147. },
  148. },
  149. onLoad(query) {
  150. this.acId = query.acId
  151. this.oid = this.$store.state.user.openid
  152. // 获取页面数据
  153. this.getdata()
  154. }
  155. }
  156. </script>
  157. <style lang="scss">
  158. video {
  159. width: 100%;
  160. /* 设置视频宽度为父元素宽度的百分比 */
  161. max-width: 100%;
  162. /* 确保视频不超过其原始尺寸的最大宽度 */
  163. }
  164. .vioList {
  165. min-width: 100%;
  166. display: flex;
  167. justify-content: flex-start;
  168. overflow: auto;
  169. padding: 0 10px;
  170. margin-top: 10px;
  171. .vioBlo {
  172. width: 120px;
  173. border-radius: 3px;
  174. background-color: #ccc;
  175. padding: 5px 10px;
  176. flex-shrink: 0;
  177. text-align: center;
  178. box-sizing: border-box;
  179. margin-right: 5px;
  180. }
  181. .vioBlo2 {
  182. background-color: #3C9CFF;
  183. color: #fff
  184. }
  185. }
  186. .activityDetailNew {
  187. background-color: #fff;
  188. /deep/ .u-image {
  189. height: 300px !important;
  190. // align-items: center !important;
  191. }
  192. /deep/ .u-image__image {
  193. height: 300px !important;
  194. }
  195. .ellone {
  196. /deep/ .u-image {
  197. height: 400px !important;
  198. }
  199. /deep/ .u-image__image {
  200. height: 600px !important;
  201. }
  202. /deep/ .u-modal__content {
  203. flex-direction: column !important;
  204. align-items: center;
  205. height: 450px;
  206. }
  207. }
  208. .popup-container2 {
  209. position: fixed;
  210. top: 50%;
  211. left: 50%;
  212. transform: translate(-50%, -50%);
  213. width: 520rpx;
  214. height: 260rpx;
  215. z-index: 1000;
  216. border-radius: 16rpx;
  217. // display: none;
  218. box-shadow: 0rpx 3rpx 10rpx 5rpx rgba(0, 0, 0, .1);
  219. overflow: hidden;
  220. .popup {
  221. width: 100%;
  222. height: 100%;
  223. display: flex;
  224. flex-direction: column;
  225. background-color: #fff;
  226. border-radius: 16rpx;
  227. overflow: hidden;
  228. .header {
  229. flex: 1;
  230. display: flex;
  231. justify-content: center;
  232. align-items: center;
  233. flex-direction: column;
  234. margin-top: 24px;
  235. font-size: 34rpx;
  236. font-weight: 600;
  237. .imgShade {
  238. width: 170rpx;
  239. height: 170rpx;
  240. display: flex;
  241. justify-content: center;
  242. align-items: center;
  243. border: 10rpx #0056A8 solid;
  244. border-radius: 50%;
  245. box-shadow: 0 0 10rpx #0056A8;
  246. margin-bottom: 10rpx;
  247. }
  248. image {
  249. width: 150rpx;
  250. height: 150rpx;
  251. margin-top: 15px;
  252. margin-bottom: 15px;
  253. }
  254. }
  255. .footer {
  256. width: 100%;
  257. display: flex;
  258. overflow: hidden;
  259. .cancel-btn {
  260. width: 50%;
  261. height: 100rpx;
  262. background-color: #F7F7F7;
  263. color: #000;
  264. font-size: 34rpx;
  265. text-align: center;
  266. border-bottom-left-radius: 16rpx;
  267. line-height: 50px;
  268. }
  269. .confirm-btn {
  270. width: 50%;
  271. height: 100rpx;
  272. background-color: #0081FE;
  273. color: #fff;
  274. font-size: 34rpx;
  275. text-align: center;
  276. line-height: 50px;
  277. }
  278. }
  279. }
  280. }
  281. .top {
  282. width: 750rpx;
  283. position: relative;
  284. .img1 {
  285. display: block;
  286. margin: auto;
  287. width: 750rpx;
  288. }
  289. .img2 {
  290. position: absolute;
  291. width: 100%;
  292. left: 0;
  293. bottom: 0;
  294. }
  295. }
  296. .decontent {
  297. width: 750rpx;
  298. border-top-right-radius: 30rpx;
  299. border-top-left-radius: 30rpx;
  300. background-color: #fff;
  301. padding: 32rpx;
  302. display: flex;
  303. flex-direction: column;
  304. justify-content: flex-start;
  305. border-bottom: 1rpx rgba(231, 231, 231, 1) solid;
  306. .actit {
  307. font-weight: 600;
  308. font-size: 40rpx;
  309. color: rgba(0, 0, 0, 0.8);
  310. line-height: 56rpx;
  311. margin-bottom: 20rpx;
  312. display: -webkit-box;
  313. word-break: break-all;
  314. text-overflow: ellipsis;
  315. overflow: hidden;
  316. -webkit-box-orient: vertical;
  317. -webkit-line-clamp: 2;
  318. }
  319. .footer {
  320. display: flex;
  321. justify-content: space-between;
  322. color: rgba(0, 0, 0, 0.4);
  323. font-size: 24rpx;
  324. // height: 32rpx;
  325. // line-height: 32rpx;
  326. font-weight: 400;
  327. padding: 20rpx 0;
  328. padding-bottom: 0;
  329. }
  330. .avaList {
  331. display: flex;
  332. justify-content: space-between;
  333. width: 100%;
  334. align-items: center;
  335. padding: 30rpx 0;
  336. border-bottom: 1rpx rgba(231, 231, 231, 1) solid;
  337. margin-bottom: 20rpx;
  338. .ava {
  339. // width: 353rpx;
  340. display: flex;
  341. align-items: center;
  342. }
  343. .cost {
  344. flex: 1;
  345. text-align: right;
  346. font-weight: 700;
  347. font-size: 40rpx;
  348. color: rgba(246, 135, 23, 1);
  349. }
  350. }
  351. .acinfo {
  352. width: 100%;
  353. display: flex;
  354. flex-direction: column;
  355. justify-content: space-between;
  356. font-size: 28rpx;
  357. font-weight: 400;
  358. color: rgba(0, 0, 0, 0.6);
  359. border-bottom: 1rpx rgba(231, 231, 231, 1) solid;
  360. // padding-bottom: 30rpx;
  361. .acinfoAddress {
  362. // padding: 20rpx 0;
  363. display: flex;
  364. padding-bottom: 20rpx;
  365. .acinfoTit {
  366. width: 150rpx;
  367. display: flex;
  368. justify-content: space-between;
  369. // text-align: justify;
  370. .justified-text {
  371. text-align: justify;
  372. text-justify: inter-word;
  373. /* 兼容性写法,用于处理中英文混排时的对齐效果 */
  374. }
  375. }
  376. }
  377. .inf {
  378. color: rgba(0, 0, 0, 0.8);
  379. }
  380. }
  381. .acbrief {
  382. width: 100%;
  383. .britit {
  384. width: 100%;
  385. height: 48rpx;
  386. font-weight: 600;
  387. line-height: 48rpx;
  388. font-size: 32rpx;
  389. color: rgba(0, 0, 0, 0.8);
  390. margin: 30rpx 0;
  391. }
  392. .bricon {
  393. font-weight: 400;
  394. font-size: 28rpx;
  395. line-height: 44rpx;
  396. color: (0, 0, 0, 0.8);
  397. margin-bottom: 30rpx;
  398. }
  399. .briImg {
  400. width: 100%;
  401. }
  402. }
  403. }
  404. .btnBlock {
  405. position: fixed;
  406. bottom: 0;
  407. left: 0;
  408. width: 750rpx;
  409. height: 175rpx;
  410. background-color: #fff;
  411. display: flex;
  412. justify-content: flex-start;
  413. align-items: center;
  414. padding: 30rpx 30rpx;
  415. padding-bottom: 40rpx;
  416. border-top: 1rpx rgba(231, 231, 231, 1) solid;
  417. // padding-bottom: 78rpx;
  418. .icos {
  419. width: 200rpx;
  420. height: 96rpx;
  421. flex-shrink: 0;
  422. margin-right: 30rpx;
  423. display: flex;
  424. justify-content: space-between;
  425. .ico {
  426. width: 100rpx;
  427. display: flex;
  428. flex-direction: column;
  429. justify-content: space-between;
  430. align-items: center;
  431. .imgBlock {
  432. width: 48rpx;
  433. height: 48rpx;
  434. display: flex;
  435. align-items: center;
  436. justify-content: center;
  437. .icoimg {
  438. width: 42rpx;
  439. height: 40rpx;
  440. }
  441. }
  442. .icotxt {
  443. font-size: 24rpx;
  444. height: 40rpx;
  445. line-height: 40rpx;
  446. color: rgba(4, 0, 0, 1);
  447. }
  448. }
  449. }
  450. .rightBtn {
  451. flex: 1;
  452. display: flex;
  453. justify-content: center;
  454. align-items: center;
  455. .btnt {
  456. width: 454rpx;
  457. color: #fff;
  458. font-weight: 400;
  459. font-size: 17px;
  460. height: 96rpx;
  461. background-color: rgba(0, 86, 168, 1);
  462. display: flex;
  463. justify-content: center;
  464. align-items: center;
  465. border-radius: 10rpx;
  466. }
  467. .btnt1 {
  468. width: 454rpx;
  469. font-weight: 400;
  470. font-size: 17px;
  471. height: 96rpx;
  472. background-color: rgb(217, 217, 217);
  473. display: flex;
  474. justify-content: center;
  475. align-items: center;
  476. border-radius: 10rpx;
  477. }
  478. }
  479. }
  480. }
  481. </style>