En route před 2 roky
rodič
revize
8b9805ad49
4 změnil soubory, kde provedl 331 přidání a 249 odebrání
  1. 13 13
      http/http.js
  2. 1 1
      manifest.json
  3. 136 74
      pages/certificate/index.vue
  4. 181 161
      pages/live/index.vue

+ 13 - 13
http/http.js

@@ -1,32 +1,32 @@
-const base_url = 'https://api.xyyxt.net'  //release
+const base_url = 'https://api.xyyxt.net' //release
 // const base_url = 'http://42.192.164.187:19005'  //test
 // export const base_url = 'http://api.xyyxt.net:19009'   //
 // export const base_url = 'https://test.xyyxt.net'   //预发布
-// const base_url = 'http://192.168.1.7:5055'  //dev
+// const base_url = 'http://192.168.1.24:5055'  //dev
 // export const base_url = 'http://120.79.166.78:19012' // 测试环境
 
 
-export const BASE_IMG_URL = 'https://file.xyyxt.net/'     //release
+export const BASE_IMG_URL = 'https://file.xyyxt.net/' //release
 // export const BASE_IMG_URL = 'https://file-dev.xyyxt.net/'  //test
-const tenantId = '471722209971055962' // 祥粤云学堂:867735392558919680,祥粤学堂:667735392758919630,中建云学堂-567735392758918520,中正-141250585240548145,山西-471722209971055962
+const tenantId = uni.getStorageSync('tid') // 祥粤云学堂:867735392558919680,祥粤学堂:667735392758919630,中建云学堂-567735392758918520,中正-141250585240548145,山西-471722209971055962
 export const http = (option) => {
-	if(option.loading) {
+	if (option.loading) {
 		uni.showLoading({
-			mask:true,
+			mask: true,
 			title: '拼命加载中...'
 		})
 	}
-	
-	return new Promise((resolve,reject) => {
+
+	return new Promise((resolve, reject) => {
 		let token = uni.getStorageSync('token')
 		uni.request({
-			url:base_url + option.url,
-			data:option.data,
-			method:option.method || 'get',
+			url: base_url + option.url,
+			data: option.data,
+			method: option.method || 'get',
 			header: {
-				TenantId:tenantId,
+				TenantId: option.tenantIdHide ? '' : uni.getStorageSync('tid'),
 				// 'Content-Type': 'application/json',
-				AuthorizationToken: token ? 'WX '+ token : '',
+				AuthorizationToken: token ? 'WX ' + token : '',
 			},
 			success: (res) => {
 				if (res.data.code == 401) {

+ 1 - 1
manifest.json

@@ -1,6 +1,6 @@
 {
     "name" : "web",
-    "appid" : "__UNI__EDA56D7",
+    "appid" : "__UNI__F5DD0A8",
     "description" : "",
     "versionName" : "1.0.0",
     "versionCode" : "100",

+ 136 - 74
pages/certificate/index.vue

@@ -1,81 +1,111 @@
 <template>
 	<view class="container">
-			
-			<template v-if="studyData.keyValue == 'certificate01' || studyData.keyValue == 'certificate02'" >
-				
-				<uni-list>
-					<uni-list-item>
-						<text slot="body">学习编号:{{studyData.certificateCode}}</text>
-					</uni-list-item>
-					<uni-list-item >
-						<text slot="body">姓名:{{studyData.realname}}</text>
-					</uni-list-item>
-					<uni-list-item >
-						<text slot="body">证件:{{studyData.idCard}}</text>
-					</uni-list-item>
-					<uni-list-item>
-						<text slot="body">学时:{{studyData.classHours}}</text>
-					</uni-list-item>
-					<uni-list-item>
-						<text slot="body">年份:{{studyData.year}}</text>
-					</uni-list-item>
-					<uni-list-item>
-						<text slot="body">时间:{{studyData.pushDate}}</text>
-					</uni-list-item>
-			
-				</uni-list>
-				
-				<uni-title class="title" title="学习内容"></uni-title>
-				<uni-list class="content">
-					<uni-list-item ellipsis="1" :key="index" v-for="(item,index) in studyData.chapterList">
-						<text slot="body">{{item.name}}</text>
-					</uni-list-item>
-				</uni-list>
-			</template>
-			
-			
-			<template v-if="studyData.keyValue == 'certificate03' || studyData.keyValue == 'certificate04' || studyData.keyValue == 'certificate05' || studyData.keyValue == 'certificate06' || studyData.keyValue == 'certificate07'">
-				
-				<uni-list>
+
+		<template v-if="studyData.keyValue == 'certificate01' || studyData.keyValue == 'certificate02'">
+
+			<uni-list>
+				<uni-list-item>
+					<text slot="body">学习编号:{{studyData.certificateCode}}</text>
+				</uni-list-item>
+				<uni-list-item>
+					<text slot="body">姓名:{{studyData.realname}}</text>
+				</uni-list-item>
+				<uni-list-item>
+					<text slot="body">证件:{{studyData.idCard}}</text>
+				</uni-list-item>
+				<uni-list-item>
+					<text slot="body">学时:{{studyData.classHours}}</text>
+				</uni-list-item>
+				<uni-list-item>
+					<text slot="body">年份:{{studyData.year}}</text>
+				</uni-list-item>
+				<uni-list-item>
+					<text slot="body">时间:{{studyData.pushDate}}</text>
+				</uni-list-item>
+
+			</uni-list>
+
+			<uni-title class="title" title="学习内容"></uni-title>
+			<uni-list class="content">
+				<uni-list-item ellipsis="1" :key="index" v-for="(item,index) in studyData.chapterList">
+					<text slot="body">{{item.name}}</text>
+				</uni-list-item>
+			</uni-list>
+		</template>
+
+
+		<template
+			v-if="studyData.keyValue == 'certificate03' || studyData.keyValue == 'certificate04' || studyData.keyValue == 'certificate05' || studyData.keyValue == 'certificate06' || studyData.keyValue == 'certificate07' || studyData.keyValue == 'certificate09' || studyData.keyValue == 'certificate10' || studyData.keyValue == 'certificate11'">
+
+			<uni-list>
+				<uni-list-item>
+					<text slot="body">姓名:{{studyData.realname}}</text>
+				</uni-list-item>
+				<uni-list-item>
+					<text slot="body">证件:{{studyData.idCard}}</text>
+				</uni-list-item>
+				<uni-list-item>
+					<text slot="body">专业类型:{{studyData.majorType}}</text>
+				</uni-list-item>
+				<template v-if="studyData.keyValue == 'certificate09'">
 					<uni-list-item>
-						<text slot="body">姓名:{{studyData.realname}}</text>
-					</uni-list-item>
-					<uni-list-item >
-						<text slot="body">证件:{{studyData.idCard}}</text>
+						<text slot="body">总学时:{{computedTime(studyData.publicClassHours,studyData.classHours)}}</text>
 					</uni-list-item>
 					<uni-list-item>
-						<text slot="body">专业类型:一级注册建造师{{isMust(studyData.keyValue) ? '必修' : '选修'}}</text>
+						<text slot="body">公共学时:{{studyData.publicClassHours?studyData.publicClassHours:0}}</text>
 					</uni-list-item>
 					<uni-list-item>
-						<text slot="body">必修学时:{{isMust(studyData.keyValue) ? getSectionNum(studyData.chapterList) : 0}}</text>
+						<text slot="body">非公共学时:{{studyData.classHours?studyData.classHours:0}}</text>
 					</uni-list-item>
-					
+				</template>
+				<template v-else>
 					<uni-list-item>
-						<text slot="body">选修学时:{{isMust(studyData.keyValue) ? 0 : getSectionNum(studyData.chapterList)}}</text>
+						<text slot="body">必修学时:{{isMust(studyData.keyValue) ? studyData.classHours : 0}}</text>
 					</uni-list-item>
-					
+
 					<uni-list-item>
-						<text slot="body">证明编号:{{studyData.certificateCode}}</text>
+						<text slot="body">选修学时:{{isMust(studyData.keyValue) ? 0 : studyData.classHours}}</text>
 					</uni-list-item>
-					
-					<uni-list-item>
-						<text slot="body">培训时间:{{studyData.trainStartTime}} 至 {{studyData.trainEndTime}}</text>
+				</template>
+
+				<uni-list-item>
+					<text slot="body">证明编号:{{studyData.certificateCode}}</text>
+				</uni-list-item>
+
+				<uni-list-item>
+					<text
+						slot="body">培训时间:{{`${$method.timestampToTime(studyData.trainStartTime)}至 ${$method.timestampToTime(studyData.trainEndTime)}`}}</text>
+				</uni-list-item>
+
+				<uni-list-item>
+					<text slot="body">学习内容:
+						<text :key="index" v-for="(item,index) in studyData.chapterList">{{item.name}}、</text>
+					</text>
+				</uni-list-item>
+			</uni-list>
+			<template v-if="studyData.keyValue == 'certificate09'">
+				<uni-title class="title" title="公共课程" v-if="chapterList1.length > 0"></uni-title>
+				<uni-list class="content" v-if="chapterList1.length > 0">
+					<uni-list-item ellipsis="1" :key="index" v-for="(item,index) in chapterList1">
+						<text slot="body">{{item.name}} (学时:{{computerTotalTime(item.totalTime)}})</text>
 					</uni-list-item>
-					
-					<uni-list-item>
-						<text slot="body">学习内容: 
-							<text :key="index" v-for="(item,index) in studyData.chapterList">{{item.name}}、</text>
-						</text>
+				</uni-list>
+				<uni-title class="title" title="专业课程" v-if="chapterList2.length > 0"></uni-title>
+				<uni-list class="content" v-if="chapterList2.length > 0">
+					<uni-list-item ellipsis="1" :key="index" v-for="(item,index) in chapterList2">
+						<text slot="body">{{item.name}} (学时:{{computerTotalTime(item.totalTime)}})</text>
 					</uni-list-item>
 				</uni-list>
-				
-				<uni-title class="title" :title="'一级注册建造师继续教育'+isMust(studyData.keyValue) ? '必修' : '选修'+'课'"></uni-title>
+			</template>
+			<template v-else>
+				<uni-title class="title" :title="isMust(studyData.keyValue) ? '必修' : '选修'"></uni-title>
 				<uni-list class="content">
 					<uni-list-item ellipsis="1" :key="index" v-for="(item,index) in studyData.chapterList">
-						<text slot="body">{{item.name}} (学时:{{item.sectionNum}})</text>
+						<text slot="body">{{item.name}} (学时:{{computerTotalTime(item.totalTime)}})</text>
 					</uni-list-item>
 				</uni-list>
 			</template>
+		</template>
 	</view>
 </template>
 
@@ -83,9 +113,18 @@
 	export default {
 		data() {
 			return {
-				code:'',
-				studyData:{
-					chapterList:[]
+				code: '',
+				studyData: {
+					chapterList: []
+				},
+				chapterList1: [],
+				chapterList2: [],
+			}
+		},
+		computed: {
+			computedTime: function() {
+				return function(n1 = 0, n2 = 0) {
+					return n1 + n2
 				}
 			}
 		},
@@ -94,27 +133,50 @@
 			this.getData();
 		},
 		methods: {
+			computerTotalTime(num) {
+				if (!num) {
+					return 0
+				} else {
+					return (parseInt(num) / 45 / 60).toFixed(0)
+				}
+			},
 			getData() {
 				this.$http({
-					loading:true,
-					url:'/app/common/certificate/detail',
-					data:{
-						certificateCode:this.code
+					loading: true,
+					url: '/app/common/certificate/detail',
+					tenantIdHide: true,
+					data: {
+						certificateCode: this.code
 					}
 				}).then(res => {
+					if (res.data.code !== 200) {
+						uni.showModal({
+							content: res.data.msg,
+							showCancel: false
+						})
+						return
+					}
 					this.studyData = res.data.data;
+					if (res.data.data.keyValue == 'certificate09') {
+						this.chapterList1 = res.data.data.chapterList.filter(i => i.commonSign == 1)
+						this.chapterList2 = res.data.data.chapterList.filter(i => i.commonSign != 1)
+					}
 				})
 			},
 			/**
 			 * 是否是必修
 			 */
 			isMust(keyValue) {
-				let num = keyValue.replace(/[^0-9]/g,"")
-				
-				if(num == '04' || num == '05' || num == '06' || num == '07') {
+				let num = keyValue.replace(/[^0-9]/g, "")
+
+				if (num == '04' || num == '05' || num == '06' || num == '07') {
 					return false
-				} else if(num == '03') {
+				} else if (num == '03') {
+					return true
+				} else if ((num == '10' || num == '11') && this.studyData.major == '必修') {
 					return true
+				} else {
+					return false
 				}
 			},
 			/**
@@ -123,13 +185,13 @@
 			 */
 			getSectionNum(chapterList) {
 				let num = 0;
-				
+
 				chapterList.forEach(item => {
-					if(item.sectionNum) {
+					if (item.sectionNum) {
 						num += item.sectionNum;
 					}
 				})
-				
+
 				return num;
 			}
 		}
@@ -138,6 +200,6 @@
 
 <style lang="scss" scoped>
 	.title {
-		padding-left:40rpx;
+		padding-left: 40rpx;
 	}
-</style>
+</style>

+ 181 - 161
pages/live/index.vue

@@ -8,7 +8,7 @@
 				<div class="plv-watch-mobile-chatroom plv-skin--dark" id="plv-mobile-chat"></div>
 			</div>
 		</div>
-		
+
 		<div class="sign-modal" v-if="signModal">
 			<div class="sign-modal__content">
 				<img class="img" src="@/static/sign-img.png" alt="">
@@ -18,7 +18,7 @@
 				</div>
 			</div>
 		</div>
-		
+
 		<div class="sign-success" v-if="signSuccess">
 			<div class="sign-success__content">
 				<img class="img" src="@/static/sign-success.png" alt="">
@@ -29,15 +29,15 @@
 </template>
 
 <script>
-import "@/static/chatroom.css";
-import "@/static/mobile.css";
-import "@/static/tool.css";
-import "@/static/public.css"; 
+	import "@/static/chatroom.css";
+	import "@/static/mobile.css";
+	import "@/static/tool.css";
+	import "@/static/public.css";
 	export default {
 		data() {
 			return {
-				signModal:false,
-				signSuccess:false,
+				signModal: false,
+				signSuccess: false,
 				playerJs: "https://player.polyv.net/livesdk/polyv-live.min.js",
 				chatroomJs: "https://player.polyv.net/jssdk/polyv-chatroom.min.js",
 				uidzb: "egsxlptzdq",
@@ -48,20 +48,20 @@ import "@/static/public.css";
 				mediaChannelKey: "",
 				changeState: false,
 				liveSdk: null,
-				userInfo:{},
-				token:'',
+				userInfo: {},
+				token: '',
 				sectionId: 0,
 				goodsId: 0,
 				courseId: 0,
-				orderGoodsId:0,
+				orderGoodsId: 0,
 				gradeId: 0,
 				chapterId: 0,
 				moduleId: 0,
-				playTime:0,
-				duraing:0,
-				timer:null,
-				isFirst:true,
-				isEnd:false,
+				playTime: 0,
+				duraing: 0,
+				timer: null,
+				isFirst: true,
+				isEnd: false,
 				plv: {
 					liveSdk: null, // 保存直播 JS-SDK 实例
 					socket: null, // 保存 WebSocket 实例
@@ -74,10 +74,14 @@ import "@/static/public.css";
 				vid: '', // 回放的id
 			}
 		},
-		mounted() {
-			
-			console.log('直播间参数',this.$route.query)
-			const { buyCourse, ident, sectionType, vid } = this.$route.query
+		async mounted() {
+			console.log('直播间参数', this.$route.query)
+			const {
+				buyCourse,
+				ident,
+				sectionType,
+				vid
+			} = this.$route.query
 			console.log('sectionType:', sectionType, vid)
 			this.buyCourse = buyCourse
 			this.identification = ident
@@ -91,29 +95,45 @@ import "@/static/public.css";
 			this.chapterId = this.$route.query.chapterId;
 			this.moduleId = this.$route.query.moduleId;
 			this.channelId = this.$route.query.channelId;
-			this.userInfo = this.$route.query.userInfo ? JSON.parse(this.$route.query.userInfo) : {
-				userAccount:parseInt(Math.random() * 100000),
-				realname:'匿名' + parseInt(Math.random() * 100000)
+			if (this.$route.query.tid) {
+				await this.setStorageAwait('tid', this.$route.query.tid)
+			}
+			this.userInfo = this.$route.query.userInfo && this.$route.query.userInfo !== 'null' ? JSON.parse(this
+				.$route
+				.query.userInfo) : {
+				userAccount: parseInt(Math.random() * 100000),
+				realname: '匿名' + parseInt(Math.random() * 100000)
 			}
 			let token = this.$route.query.token;
-			
-			
-			if(token) {
-				uni.setStorageSync('token',token)
+
+
+			if (token) {
+				uni.setStorageSync('token', token)
 			}
 			this.playVideo();
-			if(this.sectionId && this.sectionType != 3) {
+			if (this.sectionId && this.sectionType != 3) {
 				this.studyRecordGetLastLive();
 			}
-			
+
 		},
 		methods: {
+			setStorageAwait() {
+				return new Promise(resolve => {
+					uni.setStorage({
+						key: 'tid',
+						data: this.$route.query.tid,
+						success: function() {
+							resolve()
+						}
+					});
+				})
+			},
 			close() {
 				this.signModal = false;
 				this.signSuccess = true;
 				setTimeout(() => {
 					this.signSuccess = false;
-				},1000)
+				}, 1000)
 			},
 			/**
 			 * 获取上次观看的直播
@@ -121,13 +141,13 @@ import "@/static/public.css";
 			studyRecordGetLastLive() {
 				if (!this.gradeId) {
 					this.$http({
-							url:'/study/record/queryLiveLast',
-							data:{
-								orderGoodsId: this.orderGoodsId,
-								courseId: this.courseId,
-							}
-					}).then( res => {
-						if(res.data.code == 200) {
+						url: '/study/record/queryLiveLast',
+						data: {
+							orderGoodsId: this.orderGoodsId,
+							courseId: this.courseId,
+						}
+					}).then(res => {
+						if (res.data.code == 200) {
 							if (!res.data.data) {
 								this.signModal = true;
 							}
@@ -137,40 +157,39 @@ import "@/static/public.css";
 			},
 			polyvLivesign() {
 				this.$http({
-						loading:true,
-						url:'/polyv/live/sign',
-						data:{
-							channelId: this.channelId,
-						}
-				}).then( res => {
+					loading: true,
+					url: '/polyv/live/sign',
+					data: {
+						channelId: this.channelId,
+					}
+				}).then(res => {
 					if (res.data.code == 200) {
-					this.sign = res.data.data.sign;
-					this.token = res.data.data.token;
-					this.mediaChannelKey = res.data.data.mediaChannelKey;
-					this.timestamp = res.data.data.timestamp;
-					this.appId = res.data.data.appId;
-					
-					this.loadPlayerzb();
+						this.sign = res.data.data.sign;
+						this.token = res.data.data.token;
+						this.mediaChannelKey = res.data.data.mediaChannelKey;
+						this.timestamp = res.data.data.timestamp;
+						this.appId = res.data.data.appId;
+
+						this.loadPlayerzb();
 					} else {
 						uni.showToast({
 							title: res.data.msg,
 							icon: 'none'
 						})
 					}
-				}).catch((err) => {
-				})
+				}).catch((err) => {})
 			},
-			
-			studyRecord(status,duraing) {
-				
-				if(!this.sectionId) {
+
+			studyRecord(status, duraing) {
+
+				if (!this.sectionId) {
 					return;
 				}
 				let self = this;
 				this.$http({
-					load:false,
-					url:'/study/record',
-					data:{
+					load: false,
+					url: '/study/record',
+					data: {
 						buyCourse: this.buyCourse,
 						identification: this.identification,
 						sectionId: parseInt(this.sectionId),
@@ -182,12 +201,12 @@ import "@/static/public.css";
 						chapterId: parseInt(self.chapterId),
 						moduleId: parseInt(self.moduleId),
 						videoCurrentTime: parseInt(
-							 2
+							2
 						),
-						status:status,
+						status: status,
 						fromPlat: 1,
 					},
-					method:'POST'
+					method: 'POST'
 				})
 			},
 
@@ -198,7 +217,7 @@ import "@/static/public.css";
 				console.log('this.userInfo', this.userInfo);
 				this.polyvLivesign();
 			},
-			
+
 			jquery() {
 				return new Promise((resolve) => {
 					if (!window.polyvLivePlayer) {
@@ -213,29 +232,25 @@ import "@/static/public.css";
 			},
 
 			loadPlayerzb() {
-				
 				var els = {
-						playerEl: '', // 播放器容器选择器, 移动端和PC的el参数设置不
-						pptEl: '', // 文档容器选择器, 普通直播不需要设置pptEl
-						controllerEl: '', // 三分屏控制栏的容器选择器, pc三分屏的场景才需要设置controllerEl,
-						chatContainer: '' ,// 聊天室的容器选择器
-						pptEl: '#tab-ppt'
-					};
-					
+					playerEl: '', // 播放器容器选择器, 移动端和PC的el参数设置不
+					pptEl: '', // 文档容器选择器, 普通直播不需要设置pptEl
+					controllerEl: '', // 三分屏控制栏的容器选择器, pc三分屏的场景才需要设置controllerEl,
+					chatContainer: '', // 聊天室的容器选择器
+					pptEl: '#tab-ppt'
+				};
+
 				$('.plv-watch-mobile').css('display', '');
 				els.playerEl = '#plv-mobile-player'; // 讲师区域元素
 				els.chatContainer = '#plv-mobile-chat'; // DOM选择器,HTML元素,用于渲染聊天室
 				els.pptEl = '#tab-ppt'; // ppt文档元素选择器,非云课堂可不填
-				console.log(this,'this')
-				console.log(this.$method.splitImgHost(this.userInfo.avatar, true),'this.$method.splitImgHost(this.userInfo.avatar, true)')
 				var chatroom = new PolyvChatRoom({
 					//实例聊天室SDK
 					roomId: this.channelId,
 					userId: this.userInfo.userAccount,
 					nick: this.userInfo.realname,
-					accountId: this.userInfo.userAccount ,
-					pic:
-						this.$method.splitImgHost(this.userInfo.avatar, true) ||
+					accountId: this.userInfo.userAccount,
+					pic: this.$method.splitImgHost(this.userInfo.avatar, true) ||
 						"http://livestatic.videocc.net/assets/wimages/missing_face.png",
 					container: els.chatContainer,
 					userType: "slice",
@@ -247,22 +262,21 @@ import "@/static/public.css";
 					enableWelcome: true, // 是否开启欢迎语,默认为true
 					enableFlower: true, // 是否开启送花功能,默认为true
 					mediaChannelKey: this.mediaChannelKey,
-					tabData: [
-							{
-								name: "文档",
-								type: "ppt",
-							},
-							{
-								name: "聊天", // 菜单栏名称
-								type: "chat", // 菜单栏类型, 有3个已有的内置类型(chat, user-list, ask),详情请参考文档
-							},
-							{
-								name: "提问",
-								type: "ask",
-							}
-						],
+					tabData: [{
+							name: "文档",
+							type: "ppt",
+						},
+						{
+							name: "聊天", // 菜单栏名称
+							type: "chat", // 菜单栏类型, 有3个已有的内置类型(chat, user-list, ask),详情请参考文档
+						},
+						{
+							name: "提问",
+							type: "ask",
+						}
+					],
 					roomMessage: (data) => {
-						console.log(data,'data')
+						console.log(data, 'data')
 						// data为聊天室socket消息,当有聊天室消息时会触发此方法
 						if (this.liveSdk && this.liveSdk.player) {
 							var event = data.EVENT;
@@ -292,23 +306,22 @@ import "@/static/public.css";
 					user: {
 						userId: this.userInfo.userAccount,
 						userName: this.userInfo.realname,
-						pic:
-							this.$method.splitImgHost(this.userInfo.avatar, true) ||
+						pic: this.$method.splitImgHost(this.userInfo.avatar, true) ||
 							"http://livestatic.videocc.net/assets/wimages/missing_face.png",
 					},
 				});
-				
+
 				// 监听流状态变化刷新播放器
-			 this.plv.liveSdk.on(PolyvLiveSdk.EVENTS.STREAM_UPDATE, (event,status)=> {
-				 console.log(status,'STREAM_UPDATE')
-				 if(status == 'end') {
-					 clearInterval(this.timer)
-					 let duraing = this.playTime - this.duraing;
-					 this.duraing = 0;
-					 this.isEnd = true;
-					 this.studyRecord(1,duraing)
-				 }
-			 }); // 监听流状态变化
+				this.plv.liveSdk.on(PolyvLiveSdk.EVENTS.STREAM_UPDATE, (event, status) => {
+					console.log(status, 'STREAM_UPDATE')
+					if (status == 'end') {
+						clearInterval(this.timer)
+						let duraing = this.playTime - this.duraing;
+						this.duraing = 0;
+						this.isEnd = true;
+						this.studyRecord(1, duraing)
+					}
+				}); // 监听流状态变化
 
 
 				// 第四步:监听频道信息读取完成事件,初始化播放器
@@ -332,7 +345,7 @@ import "@/static/public.css";
 					// sessionId: undefined, // 回放场次id,回放模式必填
 					// vid: undefined,  // 回放id,回放模式下传入该参数,可不传fileId、url、sessionId
 					options.type = 'vod',
-					options.vid = this.vid
+						options.vid = this.vid
 				}
 				console.log('options', options)
 				this.plv.liveSdk.on(PolyvLiveSdk.EVENTS.CHANNEL_DATA_INIT, (event, data) => {
@@ -350,7 +363,7 @@ import "@/static/public.css";
 					this.plv.liveSdk.player.on("switchMainScreen", (main) => {
 						console.log("切换主讲位置,当前主屏为", main); // 'player'|'ppt'
 					});
-					
+
 					// this.plv.liveSdk.player.on("ended", (state) => {
 					// 	console.log(state,'ended')
 					// 	clearInterval(this.timer)
@@ -358,31 +371,31 @@ import "@/static/public.css";
 					// 	this.duraing = 0;
 					// 	this.studyRecord(1,duraing)
 					// })
-					
+
 					this.plv.liveSdk.player.on("pause", (state) => {
-						console.log(state,'pause')
+						console.log(state, 'pause')
 						let duraing = this.playTime - this.duraing;
 						this.duraing = 0;
-						if(!this.isEnd) {
-							this.studyRecord(0,duraing)
+						if (!this.isEnd) {
+							this.studyRecord(0, duraing)
 						}
-						
+
 						clearInterval(this.timer)
 					})
-					
+
 					this.plv.liveSdk.player.on("loadedmetadata", (state) => {
-						if(this.isFirst) {
-							this.studyRecord(0,0)
+						if (this.isFirst) {
+							this.studyRecord(0, 0)
 							this.isFirst = false;
 						}
 						this.isEnd = false;
 						clearInterval(this.timer)
 						this.timer = setInterval(() => {
-							this.studyRecord(0,20)
+							this.studyRecord(0, 20)
 							this.duraing += 20;
-						},20000)
+						}, 20000)
 					})
-					
+
 					this.plv.liveSdk.player.on("timeupdate", (time) => {
 						this.playTime = time;
 					})
@@ -424,40 +437,44 @@ import "@/static/public.css";
 
 <style lang="scss" scoped>
 	.mobile-wrap .polyv-chat-input input {
-	    width: 100%;
-	    height: 100%;
-	    padding: 0 5px;
-	    color: #212121;
-	    border: none;
-	    border-radius: 4px;
-	    background: #fafafa;
-	    outline: none;
-	    border: 1px solid #ecf0f1;
+		width: 100%;
+		height: 100%;
+		padding: 0 5px;
+		color: #212121;
+		border: none;
+		border-radius: 4px;
+		background: #fafafa;
+		outline: none;
+		border: 1px solid #ecf0f1;
 	}
-	
+
 	.sign-modal {
-		position:fixed;
-		left:0;
-		top:0;
-		width:100%;
-		height:100%;
+		position: fixed;
+		left: 0;
+		top: 0;
+		width: 100%;
+		height: 100%;
 		z-index: 999;
-		background: rgba(0,0,0,0.3);
+		background: rgba(0, 0, 0, 0.3);
+
 		&__content {
-			position:absolute;
-			left:50%;
-			top:50%;
-			transform: translate3d(-50%,-50%,0);
+			position: absolute;
+			left: 50%;
+			top: 50%;
+			transform: translate3d(-50%, -50%, 0);
 			border-radius: 24rpx;
-				overflow: hidden;
+			overflow: hidden;
+
 			.img {
-				width:640rpx;
+				width: 640rpx;
 				display: block;
 			}
+
 			.box {
 				background: #fff;
-				padding:20rpx 0;
+				padding: 20rpx 0;
 				overflow: hidden;
+
 				.title {
 					font-size: 30rpx;
 					font-family: PingFang SC;
@@ -466,50 +483,53 @@ import "@/static/public.css";
 					line-height: 48rpx;
 					text-align: center;
 				}
-				
+
 				.btn {
-					margin:40rpx auto 0;
+					margin: 40rpx auto 0;
 					width: 528rpx;
 					height: 80rpx;
 					background: #007AFF;
 					border-radius: 40rpx;
 					line-height: 80rpx;
 					text-align: center;
-					color:#fff;
+					color: #fff;
 					font-size: 30rpx;
 				}
 			}
 		}
 	}
-	
+
 	.sign-success {
-		position:fixed;
-		left:0;
-		top:0;
-		width:100%;
-		height:100%;
+		position: fixed;
+		left: 0;
+		top: 0;
+		width: 100%;
+		height: 100%;
 		z-index: 999;
-		background: rgba(0,0,0,0.3);
+		background: rgba(0, 0, 0, 0.3);
+
 		&__content {
-			position:absolute;
-			left:50%;
-			top:50%;
-			transform: translate3d(-50%,-50%,0);
+			position: absolute;
+			left: 50%;
+			top: 50%;
+			transform: translate3d(-50%, -50%, 0);
 			border-radius: 24rpx;
 			width: 640rpx;
 			height: 324rpx;
 			background: #FFFFFF;
 			border-radius: 24rpx;
+
 			.img {
-				position:absolute;
-				left:50%;
-				margin-left:-140rpx;
-				top:-72rpx;
-				width:280rpx;
+				position: absolute;
+				left: 50%;
+				margin-left: -140rpx;
+				top: -72rpx;
+				width: 280rpx;
 				display: block;
 			}
+
 			.title {
-				margin-top:200rpx;
+				margin-top: 200rpx;
 				font-size: 30rpx;
 				font-family: PingFang SC;
 				font-weight: bold;
@@ -519,4 +539,4 @@ import "@/static/public.css";
 			}
 		}
 	}
-</style>
+</style>