瀏覽代碼

Merge branch 'master' into stage-4

chenxiong 3 年之前
父節點
當前提交
c5df1d16bc

+ 10 - 0
common/httpList/goods.js

@@ -10,6 +10,16 @@ export default {
 			noToken: true
 		})
 	},
+	
+	commonSystemTime() {
+		return myRequest({
+			url: '/app/common/system/dict/data/sys/time',
+			method: 'get',
+			noToken: true
+		})
+	},
+	
+	
 	commonGoodsDetail(data) {
 		return myRequest({
 			url: '/app/common/goods/'+ data,

+ 2 - 2
components/course/courseSection.vue

@@ -11,8 +11,8 @@
 				<view v-if="menuItem.sectionType==3" :class="playSectionId==newId?'color3':''">{{menuItem.name}}</view>
 					<view style="font-size: 20rpx;color: #FF3B30;" v-if="menuItem.liveStartTime">
 						<view v-if="menuItem.liveStartTime>nowTime">
-							<text>{{$method.timestampToTime(menuItem.liveStartTime)}}</text>-
-							<text>{{$method.timestampToTime(menuItem.liveEndTime)}}</text>
+							<text>{{$method.timestampToTime(menuItem.liveStartTime, isDay =false)}}</text>-
+							<text>{{$method.timestampToTime(menuItem.liveEndTime, isDay =false).substr(11,9)}}</text>
 						</view>
 						<view v-if="menuItem.liveStartTime<=nowTime&&menuItem.liveEndTime>nowTime">
 							<text>直播中</text>

+ 6 - 3
pages2/bank/question_detail.vue

@@ -311,7 +311,8 @@ export default {
 
 			this.$api
 				.goodsChapterList({
-					moduleExamId: id
+					moduleExamId: id,
+					goodsId:this.id
 				})
 				.then(res => {
 					this.$set(this.bankList[index], 'showList', true);
@@ -327,7 +328,8 @@ export default {
 
 				this.$api
 					.bankExamExamList({
-						chapterExamId: id
+						chapterExamId: id,
+						goodsId:this.id
 					})
 					.then(res => {
 						this.$set(this.bankList[index1].list[index2], 'showList', true);
@@ -341,7 +343,8 @@ export default {
 
 				this.$api
 					.bankExamExamList({
-						chapterExamId: id
+						chapterExamId: id,
+						goodsId: this.id
 					})
 					.then(res => {
 						this.$set(this.bankList[index1], 'showList', true);

+ 1 - 1
pages2/class/questionBank.vue

@@ -1973,7 +1973,7 @@ export default {
 
 	&.checked {
 		color: #fff;
-		background: blue;
+		background: #007AFF;
 	}
 }
 

+ 3 - 3
pages2/learn/my_learn.vue

@@ -77,7 +77,7 @@
 			</template>
 			<template v-if="current === 1">
 				<view class="noData">您暂无相关学习凭证记录哦~</view>
-				<view class="learnItem card">
+				<!-- <view class="learnItem card">
 					<view class="title">2020年二建建筑工程管理与实补这是商品名称</view>
 					<view class="number">
 						<text class="label">编号:</text>
@@ -87,7 +87,7 @@
 						<view class="btn" @click="showPhoto">电子照片</view>
 						<view class="btn" @click="downloadCard">下载凭证</view>
 					</view>
-				</view>
+				</view> -->
 			</template>
 		</view>
 	</view>
@@ -99,7 +99,7 @@ export default {
 	components: {},
 	data() {
 		return {
-			current: 1,
+			current: 0,
 			list: [
 				{
 					name: '学时审核'

+ 42 - 1
pages2/plan/create.vue

@@ -134,6 +134,7 @@ export default {
 			calendar_show: false,
 			maxDate: '2023-01-01',
 			minDate: '',
+			businessId:'',
 			list3: [
 				{
 					name: '一',
@@ -378,10 +379,49 @@ export default {
 				this.form.category = this.list[0].educationName + '-' + this.list[0].projectName + '-' + this.list[0].businessName;
 			}
 		},
-		checkboxChange(e) {},
+		checkboxChange(e) {
+			let goodsId = e.name;
+			if(e.value) { //勾选
+				this.businessId = this.list2.find(listItem => listItem.goodsId == goodsId).businessId;
+				this.list2.forEach(listItem => {
+					if(listItem.businessId != this.businessId) {
+						listItem.disabled = true;
+					}
+				})
+			} else { //取消
+				this.$nextTick(() => {
+					let checkedNum = this.list2.filter(listItem => {
+						if(listItem.checked) {
+							return true;
+						} else {
+							if(this.list.length) {
+								return true;
+							} else {
+								return false;
+							}
+						}
+					}).length;
+					
+					if(checkedNum == 0) { //全部取消,且没有已选择的
+						this.businessId = '';
+						this.list2.forEach(listItem => {
+							console.log(listItem)
+							listItem.disabled = false;
+						})
+					}
+				})
+				
+			}
+			
+		},
 		checkSameItem() {
 			this.list2.map(val => {
 				val.disabled = false;
+				if(this.businessId) {
+					if(val.businessId != this.businessId) {
+						val.disabled = true;
+					}
+				}
 				this.list.map(val1 => {
 					if (val.goodsId == val1.goodsId) {
 						val.disabled = true;
@@ -393,6 +433,7 @@ export default {
 		delItem(index) {
 			this.list.splice(index, 1);
 			if (this.list.length === 0) {
+				this.businessId = '';
 				this.form.category = '';
 			} else {
 				this.form.category = this.list[0].educationName + '-' + this.list[0].projectName + '-' + this.list[0].businessName;

+ 1 - 1
pages2/subject/collectBank.vue

@@ -159,7 +159,7 @@
 					<!-- 案例题 -->
 					<template v-if="bank.type == 4">
 						<view class="tabs">
-							<view class="tab" :class="{current:tabIndex == bank.current}" :key="tabIndex" v-for="(tab,tabIndex) in bank.jsonStr" @click="tabSelect(tabIndex,bankIndex)">问题{{tabIndex}}</view>
+							<view class="tab" :class="{current:tabIndex == bank.current}" :key="tabIndex" v-for="(tab,tabIndex) in bank.jsonStr" @click="tabSelect(tabIndex,bankIndex)">问题{{tabIndex+1}}</view>
 						</view>
 						<view v-for="(ansItem,ansIndex) in bank.jsonStr" v-if="bank.current == ansIndex" :key="ansIndex">
 							<template v-if="ansItem.type == 1">

+ 1 - 1
pages2/subject/collectTypeBank.vue

@@ -160,7 +160,7 @@
 					<!-- 案例题 -->
 					<template v-if="bank.type == 4">
 						<view class="tabs">
-							<view class="tab" :class="{current:tabIndex == bank.current}" :key="tabIndex" v-for="(tab,tabIndex) in bank.jsonStr" @click="tabSelect(tabIndex,bankIndex)">问题{{tabIndex}}</view>
+							<view class="tab" :class="{current:tabIndex == bank.current}" :key="tabIndex" v-for="(tab,tabIndex) in bank.jsonStr" @click="tabSelect(tabIndex,bankIndex)">问题{{tabIndex+1}}</view>
 						</view>
 						<view v-for="(ansItem,ansIndex) in bank.jsonStr" v-if="bank.current == ansIndex" :key="ansIndex">
 							<template v-if="ansItem.type == 1">

+ 1 - 1
pages2/subject/wrongBank.vue

@@ -159,7 +159,7 @@
 					<!-- 案例题 -->
 					<template v-if="bank.type == 4">
 						<view class="tabs">
-							<view class="tab" :class="{current:tabIndex == bank.current}" :key="tabIndex" v-for="(tab,tabIndex) in bank.jsonStr" @click="tabSelect(tabIndex,bankIndex)">问题{{tabIndex}}</view>
+							<view class="tab" :class="{current:tabIndex == bank.current}" :key="tabIndex" v-for="(tab,tabIndex) in bank.jsonStr" @click="tabSelect(tabIndex,bankIndex)">问题{{tabIndex+1}}</view>
 						</view>
 						<view v-for="(ansItem,ansIndex) in bank.jsonStr" v-if="bank.current == ansIndex" :key="ansIndex">
 							<template v-if="ansItem.type == 1">

+ 1 - 1
pages2/subject/wrongTypeBank.vue

@@ -159,7 +159,7 @@
 					<!-- 案例题 -->
 					<template v-if="bank.type == 4">
 						<view class="tabs">
-							<view class="tab" :class="{current:tabIndex == bank.current}" :key="tabIndex" v-for="(tab,tabIndex) in bank.jsonStr" @click="tabSelect(tabIndex,bankIndex)">问题{{tabIndex}}</view>
+							<view class="tab" :class="{current:tabIndex == bank.current}" :key="tabIndex" v-for="(tab,tabIndex) in bank.jsonStr" @click="tabSelect(tabIndex,bankIndex)">问题{{tabIndex+1}}</view>
 						</view>
 						<view v-for="(ansItem,ansIndex) in bank.jsonStr" v-if="bank.current == ansIndex" :key="ansIndex">
 							<template v-if="ansItem.type == 1">

+ 33 - 4
pages2/wd/class.vue

@@ -42,7 +42,8 @@
 				</view>
 				<view class="box_progress">
 					<view style="width: 60%;"><u-line-progress :showText="false" height="22" active-color="#ff9900" :show-percent="false" :percent="(item.stuAllNum / item.secAllNum) * 100"></u-line-progress></view>
-					<view><u-button type="warning" size="mini" @click.stop="studyIn(item.goodsId,item.gradeId)">进入学习</u-button></view>
+					
+					<view><u-button :class="{disabled:sysTime <= item.validityStartTime || sysTime >= item.validityEndTime}" type="warning" size="mini" @click.stop="studyIn(item.goodsId,item.gradeId,item)">进入学习</u-button></view>
 				</view>
 				<view class="box_progress" v-if="item.applyStatus === 1">
 					<view style="width: 60%;">
@@ -122,13 +123,17 @@ export default {
 				pageNum: 1,
 				pageSize: 10
 			},
-			total: 0
+			total: 0,
+			sysTime:0,
 		};
 	},
 	onLoad(option) {
+		
+	},
+	onShow() {
 		this.courseGoodsList();
+		this.commonSystemTime()
 	},
-	onShow() {},
 	onReachBottom() {
 		if (this.goodsList.length < this.total) {
 			this.param.pageNum++;
@@ -136,6 +141,11 @@ export default {
 		}
 	},
 	methods: {
+		commonSystemTime() {
+			this.$api.commonSystemTime().then(res => {
+				this.sysTime = res.data.data;
+			})
+		},
 		selectClass(item) {
 			console.log(item)
 			this.selectClassModal = true;
@@ -187,7 +197,22 @@ export default {
 				}
 			});
 		},
-		studyIn(v,i) {
+		studyIn(v,i,item) {
+			if(this.sysTime <= item.validityStartTime || this.sysTime >= item.validityEndTime) {
+				uni.showToast({
+					icon:'none',
+					title:'不在学习时间,不能进入学习'
+				})
+				return;
+			}
+			
+			if(item.rebuildStatus == 0) {
+				this.$navTo.togo('/pages2/learn/details', {
+					gradeId:item.gradeId,
+					goodsId: item.goodsId
+				});
+				return;
+			}
 			this.$navTo.togo(`/pages2/wd/course?id=${v}&gid=${i}`);
 		},
 		appointment(item) {
@@ -235,6 +260,10 @@ page {
 	justify-content: space-between;
 	align-items: center;
 	margin-top: 20rpx;
+	
+	.disabled {
+		opacity: 0.6;
+	}
 }
 .bottomBox {
 	background: #ffffff;

+ 17 - 5
pages2/wd/course.vue

@@ -52,17 +52,29 @@ export default {
 	},
 	methods: {
 		jump(item) {
-			/* this.$navTo.togo('/pages2/class/detail', {
-				id: item.courseId,
-				goodsId: this.goodsId,
-			}); */
+			if(item.rebuild === 0) {  //未重修
+				this.$navTo.togo('/pages2/learn/details', {
+					id: item.courseId,
+					gradeId:item.gradeId,
+					goodsId: this.goodsId
+				});
+				return;
+			}
 			 this.$navTo.togo('/pages3/polyv/detail', {
 				id: item.courseId,
 				goodsId: this.goodsId,
 			}); 
 		},
 		studyIn(item) {
-			this.$navTo.togo('/pages2/class/detail', {
+			if(item.rebuild === 0) {  //未重修
+				this.$navTo.togo('/pages2/learn/details', {
+					id: item.courseId,
+					gradeId:item.gradeId,
+					goodsId: this.goodsId
+				});
+				return;
+			}
+			this.$navTo.togo('/pages3/polyv/detail', {
 				id: item.courseId,
 				goodsId: this.goodsId
 			});

+ 26 - 20
pages3/polyv/detail.vue

@@ -45,7 +45,7 @@
 			</view>
 			<u-line color="#D6D6DB" />
 			<view style="display: flex;justify-content: center;">
-				<view><u-tabs :list="list" font-size="24" bar-width="80" :current="current" @change="change" active-color="#007AFF"></u-tabs></view>
+				<view><u-tabs :list="list" font-size="24" bar-width="24" :current="current" @change="change" active-color="#007AFF"></u-tabs></view>
 			</view>
 			<u-line color="#D6D6DB" />
 		</view>
@@ -398,6 +398,8 @@ export default {
 		uni.$on('getSection', item => {
 			//清除直播
 			this.$store.commit('setPlayChannelId', { playChannelId: 0 });
+			//获取拍照历史
+			this.getPhotoLastRecord()
 			this.playVideo(item);
 		});
 		uni.$on('levelId', item => {
@@ -440,6 +442,7 @@ export default {
 				currentTime = polyvPlayerContext.getCurrentTime();
 			}
 			let self = this;
+			let photoIndex = self.photoIndex-1
 			let data = {
 				photo: self.ossAvatarUrl,
 				sectionId: parseInt(self.playSectionId),
@@ -447,7 +450,7 @@ export default {
 				courseId: parseInt(self.courseId),
 				photoTime: parseInt(currentTime > 0 ? currentTime : 0),
 				gradeId: parseInt(self.gradeId),
-				photoIndex: parseInt(self.photoIndex-1),//从0算起
+				photoIndex: parseInt(photoIndex),//从0算起
 				photoNum:parseInt(self.photoNum)
 			};
 			console.log('提交接口', data);
@@ -484,25 +487,30 @@ export default {
 					this.photoNum = 1 //只要设置,至少拍一次
 					spaceTime = totalVideoTime
 				}
-				let initSpace = 2
+				let initSpace = 0
 				this.photoList = []
 				for(let i=0;i<this.photoNum;i++){
 					let s = this.randomNum(initSpace,initSpace+spaceTime)
 					if(s>totalVideoTime){
 						s = totalVideoTime-1
 					}
+					if(s<2){
+						s =1
+					}
 					this.photoList.push(s)
 					initSpace+=spaceTime
 				}
-				console.log(this.photoList,"随机拍时间数组")
+				console.log(this.photoList,"随机拍时间数组",this.photoNum)
 				//兼容已有观看历史
 				for(let i=0;i<this.photoList.length-1;i++){
 					if(this.photoList[i]<duration&&this.photoList[i+1]>duration){
 						this.photoIndex = i+1
+						console.log("我的修改了photoIndex")
 						break
 					}
 					if(duration>this.photoList[this.photoList.length-1]){
 						this.photoIndex = this.photoList.length-1 //取最后一个下标
+						console.log("1我的修改了photoIndex")
 						break
 					}
 				}
@@ -522,8 +530,8 @@ export default {
 		timeEventLiving() {
 			if (plv != null) {
 				if(this.livePlay){
-					this.liveDuration = this.liveDuration +1.5 //每隔1.5
-					if(this.liveDuration==1.5){ //第6秒拍照
+					this.liveDuration = this.liveDuration +1 //每隔1秒
+					if(this.liveDuration==2){ //直播第2秒拍照
 						if(this.goodsPhotographConfig){
 							if(this.goodsPhotographConfig.livephotograph==1){
 								//开启直播拍照
@@ -545,12 +553,13 @@ export default {
 			  	clearInterval(this.timer);
 			  }
 			  this.livePlay = true
-			  this.timer = setInterval(this.timeEventLiving, 1500); //定时器
+			  this.timer = setInterval(this.timeEventLiving, 1000); //定时器
 		    }
 		    if (status === 'end') {
 				this.livePlay = false
 		      // 未开始
 		      console.log('结束直播');
+			  this.postStudyRecord(1);
 		    }
 		},
 		closePlv(){
@@ -856,10 +865,12 @@ export default {
 			let currentTime = 0;
 			var polyvPlayerContext = this.selectComponent('#playerVideo');
 			if (polyvPlayerContext) {
-				currentTime = polyvPlayerContext.getCurrentTime();
+				currentTime = polyvPlayerContext.getCurrentTime(); //录播回放
+			}
+			if(this.playChannelId>0){
+				currentTime = 2;//直播无法获取,无论开始结束都传2秒
 			}
 			let self = this;
-			console.log(self.ossAvatarUrl,"准备提交,照片地址")
 			let data = {
 				photo: self.ossAvatarUrl,
 				sectionId: parseInt(sectionId),
@@ -870,10 +881,7 @@ export default {
 				chapterId: parseInt(self.chapterId),
 				moduleId: parseInt(self.moduleId)
 			};
-			if (data.studyDuration <= 5) {
-				//5秒内不上传记录
-				return;
-			}
+			
 			if (status > 0) {
 				data.status = status;
 			}
@@ -982,15 +990,15 @@ export default {
 						if(nextIndex<this.photoList.length){
 							nextTime = Number(this.photoList[nextIndex]); //获取下次拍照秒数
 						}
-						
 						if (photoTime < this.playTime) {
 							if(this.photoHistoryList.indexOf(this.photoIndex)<0){ //不存在拍照历史则拍照
 								//启动拍照
 								//暂停
 								polyvPlayerContext.exitFullScreen();
 								polyvPlayerContext.pause();
-								this.openPhoto();
 								this.photoIndex++;
+								this.openPhoto();
+								
 							}
 							
 							
@@ -1002,8 +1010,6 @@ export default {
 		},
 		onStateChange(newstate, oldstate) {
 			if (newstate.detail.newstate == 'playing') {
-				//获取拍照历史
-				this.getPhotoLastRecord()
 				if (this.needSeek) {   
 					var polyvPlayerContext = this.selectComponent('#playerVideo');
 					polyvPlayerContext.seek(this.recordObj.studyDuration);
@@ -1014,7 +1020,7 @@ export default {
 				if (this.timer) {
 					clearInterval(this.timer);
 				}
-				this.timer = setInterval(this.timeEvent, 1500); //定时器
+				this.timer = setInterval(this.timeEvent, 1000); //定时器
 			}
 			if (newstate.detail.newstate == 'pause') {
 				//暂停提交记录
@@ -1044,7 +1050,7 @@ export default {
 			if (polyvPlayerContext != null) {
 				polyvPlayerContext.play();
 			}
-			console.log(this.ossAvatarUrl, '拍照完成456');
+			
 		},
 		//确认拍照
 		takePhoto() {
@@ -1114,7 +1120,7 @@ export default {
 		},
 		getAnswerList() {
 			let self = this;
-			this.$api.answerList({ courseId: this.courseId }).then(res => {
+			this.$api.answerList({ courseId: this.courseId,goodsId: this.goodsId }).then(res => {
 				if (res.data.code == 200) {
 					self.answerList = res.data.rows;
 				}