|
@@ -7,11 +7,17 @@
|
|
|
<template>
|
|
|
<view>
|
|
|
<!-- 只渲染当前视频 -->
|
|
|
- <video :src="currentVideoUrl" show-loading show-play-btn show-center-play-btn controls
|
|
|
- @ended="playNextVideo"></video>
|
|
|
+ <video :src="currentVideoUrl" show-loading show-play-btn
|
|
|
+ show-center-play-btn controls @ended="playNextVideo"></video>
|
|
|
</view>
|
|
|
</template>
|
|
|
</view>
|
|
|
+ <view class="vioList">
|
|
|
+ <view @click="cutVio(index)" :class="['vioBlo',currentVideoIndex == index?'vioBlo2':'']"
|
|
|
+ v-for="(i,index) in videoList" :key="index">
|
|
|
+ 视频{{index + 1}}
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
|
|
|
<view class="decontent">
|
|
|
<view class="actit">
|
|
@@ -70,34 +76,35 @@
|
|
|
},
|
|
|
|
|
|
mounted() {
|
|
|
+ // this.$nextTick(()=>{
|
|
|
+ // })
|
|
|
// 开始播放第一个视频
|
|
|
- // setTimeout(() => {
|
|
|
- this.playNextVideo();
|
|
|
- // wx.createVideoContext('myVideo').pause();
|
|
|
- // }, 500)
|
|
|
+ setTimeout(() => {
|
|
|
+ this.playVideo();
|
|
|
+ }, 1500)
|
|
|
},
|
|
|
|
|
|
|
|
|
methods: {
|
|
|
+ cutVio(val) {
|
|
|
+ this.currentVideoIndex = val
|
|
|
+ this.currentVideoUrl = this.videoList[val];
|
|
|
+ },
|
|
|
+ playVideo() {
|
|
|
+ this.currentVideoUrl = this.videoList[this.currentVideoIndex];
|
|
|
+ },
|
|
|
playNextVideo() {
|
|
|
// 播放下一个视频
|
|
|
- if (this.currentVideoIndex < this.videoList.length) {
|
|
|
+ if (this.currentVideoIndex+1 < this.videoList.length) {
|
|
|
this.currentVideoUrl = this.videoList[this.currentVideoIndex];
|
|
|
this.currentVideoIndex++;
|
|
|
- } else {
|
|
|
- // 当播放到最后一个视频后,回到第一个视频
|
|
|
- this.currentVideoIndex = 0;
|
|
|
- this.currentVideoUrl = this.videoList[this.currentVideoIndex];
|
|
|
- }
|
|
|
+ }
|
|
|
+ // else {
|
|
|
+ // this.currentVideoIndex = 0;
|
|
|
+ // this.currentVideoUrl = this.videoList[this.currentVideoIndex];
|
|
|
+ // }
|
|
|
},
|
|
|
|
|
|
- gotoLink(e) {
|
|
|
-
|
|
|
- let link = e.currentTarget.dataset.link;
|
|
|
- uni.navigateTo({
|
|
|
- url: "/pages/skipone/skipone?url=" + encodeURIComponent(link),
|
|
|
- });
|
|
|
- },
|
|
|
|
|
|
// 获取页面数据
|
|
|
getdata() {
|
|
@@ -109,7 +116,18 @@
|
|
|
this.$request('/selectActivityID', "POST", data).then(res => {
|
|
|
|
|
|
let video = res[0][0].videolink;
|
|
|
- this.videoList = video.split(',')
|
|
|
+
|
|
|
+ let allVio = video.split(',')
|
|
|
+
|
|
|
+ // allVio.forEach(e => {
|
|
|
+ // e = this.convertUrl(e)
|
|
|
+ // })
|
|
|
+
|
|
|
+ // for (let var1 in allVio) {
|
|
|
+ // allVio[var1] = this.convertUrl(allVio[var1])
|
|
|
+ // }
|
|
|
+
|
|
|
+ this.videoList = allVio
|
|
|
console.log("this.playbacks", this.videoList)
|
|
|
|
|
|
let srrt = this.datejudge(res[0][0].begin_at)
|
|
@@ -120,6 +138,16 @@
|
|
|
})
|
|
|
|
|
|
},
|
|
|
+ // 视频地址中带中文,将中文转码转码
|
|
|
+ convertUrl(originalUrl) {
|
|
|
+ const urlParts = originalUrl.split('/');
|
|
|
+ const protocol = urlParts[0];
|
|
|
+ const host = urlParts[2];
|
|
|
+ const path = urlParts.slice(3).join('/');
|
|
|
+ const encodedPath = encodeURIComponent(path);
|
|
|
+ const newUrl = `${protocol}//${host}/${encodedPath.replace(/%2F/g, '/')}`;
|
|
|
+ return newUrl;
|
|
|
+ },
|
|
|
// 处理时间
|
|
|
datejudge(e) {
|
|
|
const dates = e.split(",");
|
|
@@ -151,10 +179,9 @@
|
|
|
onLoad(query) {
|
|
|
this.acId = query.acId
|
|
|
this.oid = this.$store.state.user.openid
|
|
|
-
|
|
|
// 获取页面数据
|
|
|
this.getdata()
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -168,6 +195,31 @@
|
|
|
/* 确保视频不超过其原始尺寸的最大宽度 */
|
|
|
}
|
|
|
|
|
|
+ .vioList {
|
|
|
+ min-width: 100%;
|
|
|
+ display: flex;
|
|
|
+ justify-content: flex-start;
|
|
|
+ overflow: auto;
|
|
|
+ padding: 0 10px;
|
|
|
+ margin-top: 10px;
|
|
|
+
|
|
|
+ .vioBlo {
|
|
|
+ width: 120px;
|
|
|
+ border-radius: 3px;
|
|
|
+ background-color: #ccc;
|
|
|
+ padding: 5px 10px;
|
|
|
+ flex-shrink: 0;
|
|
|
+ text-align: center;
|
|
|
+ box-sizing: border-box;
|
|
|
+ margin-right: 5px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .vioBlo2 {
|
|
|
+ background-color: #3C9CFF;
|
|
|
+ color: #fff
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
.activityDetailNew {
|
|
|
background-color: #fff;
|
|
|
|
|
@@ -312,7 +364,7 @@
|
|
|
font-size: 40rpx;
|
|
|
color: rgba(0, 0, 0, 0.8);
|
|
|
line-height: 56rpx;
|
|
|
-
|
|
|
+ margin-bottom: 20rpx;
|
|
|
display: -webkit-box;
|
|
|
word-break: break-all;
|
|
|
text-overflow: ellipsis;
|