11wqe1 1 سال پیش
والد
کامیت
ed3ed2e209
2فایلهای تغییر یافته به همراه117 افزوده شده و 37 حذف شده
  1. 42 14
      pages/activityDetailNew/activityDetailNew.vue
  2. 75 23
      pages/playBack/playBack.vue

+ 42 - 14
pages/activityDetailNew/activityDetailNew.vue

@@ -273,7 +273,7 @@
 				let dTime = this.dTime.split(',')
 				let bint = new Date(dTime[1]).getTime()
 				let now = new Date().getTime()
-				console.log(dTime,bint,now);
+				console.log(dTime, bint, now);
 				return bint < now
 			}
 		},
@@ -285,13 +285,13 @@
 			// 	});
 			// },
 			//跳转到第三方链接
-			gotoLink(e) {
+			// gotoLink(e) {
 
-				let link = e.currentTarget.dataset.link;
-				uni.navigateTo({
-					url: "/pages/skipone/skipone?url=" + encodeURIComponent(link),
-				});
-			},
+			// 	let link = e.currentTarget.dataset.link;
+			// 	uni.navigateTo({
+			// 		url: "/pages/skipone/skipone?url=" + encodeURIComponent(link),
+			// 	});
+			// },
 			// 查看回放
 			lookPlayback() {
 				if (!(!!this.actItemList.videolink)) {
@@ -350,10 +350,10 @@
 					dates[1] = modifiedDate;
 				}
 
-				const result = dates.join("-");
+				const result = dates.join(" - ");
 				return result
 			},
-			// 申请加入弹窗
+			// 立即报名弹窗
 			applyAdd() {
 				const value = this.$store.state.user.openid;
 				if (!value) {
@@ -418,21 +418,23 @@
 					this.showPopupConfirm = true
 					this.btnEnroll()
 					this.getUsers()
+
 					setTimeout(() => {
 						this.showPopupConfirm = false
-						if (this.actItemList.qrlink) {
+						if (JSON.stringify(this.actItemList.qrlink).length > 40) {
 							this.DigenrollImg = true
 						}
-						if (this.isExpired) {
-							this.lookPlayback()
-						}
 					}, 1500)
 				})
 			},
 			// 参与活动操作
 			Attend() {
 				if (this.actItemList.qrlink) {
-					this.GetInvolved = true
+					if (JSON.stringify(this.actItemList.qrlink).length > 40) {
+						this.GetInvolved = true
+					} else {
+						this.attendMett(this.actItemList.qrlink)
+					}
 				} else {
 					uni.showToast({
 						title: '此活动无链接',
@@ -440,6 +442,32 @@
 					})
 				}
 			},
+			attendMett(val) {
+				// return console.log(val.cod,val.psd);
+				let meetData = val.split(',')
+				// return console.log(meetData);
+				const meetingCode = meetData[0];
+				const password = meetData[1];
+				const channel = '腾讯会议';
+				const nickname = encodeURIComponent(this.$store.state.user.username);
+				let path = `pages/index/index?chn=${channel}&code=${meetingCode}&pwd=${password}&nm=${nickname}`;
+
+				wx.navigateToMiniProgram({
+					appId: 'wx33fd6cdc62520063',
+					path: path, // 跳转到的页面路径
+					extraData: {},
+					envVersion: 'release', // 是指要打开的小程序的版本,默认为'release'
+					success(res) {
+						// 打开成功
+						console.log('打开成功', res)
+					},
+					fail(err) {
+						// 打开失败
+						console.log('打开失败', err)
+						console.error(`launch Tencent WeMeet Miniprogram failed: ${err.errMsg}`);
+					},
+				})
+			},
 			// 添加消息页面系统通知提示报名成功
 			addMessage() {
 				let data = {

+ 75 - 23
pages/playBack/playBack.vue

@@ -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;