Bläddra i källkod

Merge branch 'master' of https://gitee.com/he2802/saas_applet

Tang 3 år sedan
förälder
incheckning
93f949adf2

+ 6 - 0
common/httpList/grade.js

@@ -8,6 +8,12 @@ export default {
 			method: 'get',
 			data: data
 		})
+	},
+	goodsGradeInfo(data) {
+		return myRequest({
+			url: '/grade/grade/'+data,
+			method: 'get'
+		})
 	}
 	
 }

+ 30 - 8
components/course/courseChapter.vue

@@ -7,14 +7,22 @@
 		</view>
 		<view v-if="!down">
 			<view v-for="(itemM,indexM) in list" >
-				<courseSection :courseId="courseId"  :goodsId="goodsId" :isBuy="isBuy" :isRebuild="isRebuild" :gradeId="gradeId" :menuItem="itemM" :levelId="levelId+'-'+itemM.sectionId"></courseSection>
-				<u-line v-if="indexM<list.length-1"></u-line>
-			</view>
-			<u-line v-if="examList.length>0"></u-line>
-			<view class="exam" v-for="(exam,index) in examList" :key="index" @click="toDo(exam.examId,goodsId,exam.moduleId,exam.chapterId)">
-				<view class="eTag">{{exam.doType==1?'练习':'考试'}}</view>
-				<view style="margin-left: 15rpx;">{{exam.examName}}</view>
+				<view v-if="itemM.type!=2">
+					<courseSection :courseId="courseId"  :goodsId="goodsId" :isBuy="isBuy" :isRebuild="isRebuild" :gradeId="gradeId" :menuItem="itemM" :levelId="levelId+'-'+itemM.sectionId"></courseSection>
+					<u-line v-if="indexM<list.length-1"></u-line>
+				</view>
+				<view v-if="itemM.type==2">
+					<u-line ></u-line>
+					<view class="examBox"  @click="toDo(itemM.typeId,goodsId,itemM.moduleId,itemM.chapterId)">
+						<view class="exam">
+							<view class="eTag">{{itemM.doType==1?'练习':'考试'}}</view>
+							<view style="margin-left: 15rpx;">{{itemM.name}}</view>
+						</view>
+						<view v-if="itemM.learning==1" class="tagGreen">已做完</view>
+					</view>
+				</view>
 			</view>
+			
 		</view>
 	</view>
 </template>
@@ -92,7 +100,7 @@ export default {
 						this.getReSectionList(item.id,item.courseId,moduleId)
 					}else{
 						this.getBuySectionList(item.id,item.courseId,moduleId)
-						this.getMenuExamList(item.id,item.courseId,moduleId)
+		//				this.getMenuExamList(item.id,item.courseId,moduleId)
 					}
 				}else{
 					this.getSectionList(item.id)
@@ -164,6 +172,15 @@ export default {
 </script>
 
 <style scoped>
+	.tagGreen{
+		width: 80rpx;
+		height: 28rpx;
+		background: #34C759;
+		border-radius: 8rpx;
+		font-size: 20rpx;
+		color: #FFFFFF;
+		text-align: center;
+	}
 	.eTag{
 		width: 56rpx;
 		height: 28rpx;
@@ -174,6 +191,11 @@ export default {
 		text-align: center;
 		line-height: 28rpx;
 	}
+	.examBox{
+		display: flex;
+		align-items: center;
+		justify-content: space-between;
+	}
 	.exam{
 		display: flex;
 		align-items: center;

+ 1 - 0
pages2/bank/questionBank.vue

@@ -481,6 +481,7 @@ export default {
 		};
 	},
 	onLoad(option) {
+		this.current = +option.current || 0
 		this.id = option.id;
 		this.goodsId = option.goodsid;
 		this.chapterId = option.chapterId;

+ 30 - 0
pages2/bank/question_report.vue

@@ -69,6 +69,13 @@
 						<view class="title">答题时长</view>
 						<canvas canvas-id="Canvas2"></canvas>
 					</view>
+					
+					<view class="item" v-show="reportdata.score">
+						<view class="title">试卷得分
+							<text>(含简答和案例题)</text>
+						</view>
+						<canvas canvas-id="Canvas3"></canvas>
+					</view>
 				</view>
 			</view>
 		</view>
@@ -159,6 +166,29 @@ export default {
 							context2.draw();
 						}
 						
+						if(this.reportdata.score) {
+							var context3 = uni.createCanvasContext('Canvas3');
+							this.context3 = context3;
+							context3.setStrokeStyle('#EEEEEE');
+							context3.setLineWidth(caculateX * 20);
+							context3.arc(caculateX * 90, caculateX * 90, caculateX * 80, 0, 2 * Math.PI, true);
+							context3.stroke();
+							context3.beginPath();
+							context3.setStrokeStyle('#32D74B');
+							context3.setFillStyle('#32D74B');
+							context3.setTextAlign('center');
+							context3.setTextBaseline('middle');
+							context3.setLineCap('round');
+							context3.setFontSize(caculateX * 64);
+							context3.fillText((this.reportdata.performance + this.reportdata.score), caculateX * 90, caculateX * 90, caculateX * 180);
+							context3.setFillStyle('#999999');
+							context3.setFontSize(caculateX * 20);
+							context3.fillText(`满分${this.reportdata.totalScore}`, caculateX * 90, caculateX * 130, caculateX * 180);
+							context3.arc(caculateX * 90, caculateX * 90, caculateX * 80, -Math.PI/2, -Math.PI/2 + ((this.reportdata.performance + this.reportdata.score) / this.reportdata.totalScore) * 2 * Math.PI, false);
+							context3.stroke();
+							context3.draw();
+						}
+						
 						
 					});
 			}

+ 38 - 3
pages2/class/detail.vue

@@ -233,7 +233,9 @@ export default {
 			noteValue: '',
 			noteId: 0,
 			recordObj: 0,
-			needSeek: false //第一次播放是否需要跳转
+			gradeDetail:{},
+			needSeek: false, //第一次播放是否需要跳转
+			needProfileModal:false //是否需要资料审核弹框
 		};
 	},
 	computed: { ...mapGetters(['userInfo', 'playSectionId']) },
@@ -260,14 +262,14 @@ export default {
 		var self = this;
 		//相机授权
 		this.getCameraSetting()
-		return
 		this.$api.getbaseprofiletplists({ goodsId: self.goodsId }).then(res => {
 			if (res.data.code === 200 && res.data.rows.length) {
 				if (res.data.rows[0].keyValue) {
 					self.$api.getbaseprofiletpgetInfo({ goodsId: self.goodsId }).then(result => {
 						if (result.data.code === 200) {
-							if (!result.data.data || (result.data.data.status === 3 && result.data.data.changeStatus === 1)) {
+							if (!result.data.data || (result.data.data.status === 3 && result.data.data.changeStatus === 1)) {								
 								if (!result.data.data) {
+									self.needProfileModal = true
 									uni.showModal({
 										content: '请前往填写资料',
 										cancelText: '返回',
@@ -283,6 +285,7 @@ export default {
 										}
 									});
 								} else {
+									self.needProfileModal = true
 									uni.showModal({
 										content: '资料审核不通过,请前往重新填写',
 										cancelText: '返回',
@@ -303,6 +306,7 @@ export default {
 									if (k.data.code === 200) {
 										if (!k.data.data || (k.data.data.status === 3 && k.data.data.changeStatus === 1)) {
 											if (!k.data.data) {
+												self.needProfileModal = true
 												uni.showModal({
 													cancelText: '返回',
 													content: '请前往填写盖章资料',
@@ -318,6 +322,7 @@ export default {
 													}
 												});
 											} else {
+												self.needProfileModal = true
 												uni.showModal({
 													cancelText: '返回',
 													content: '资料盖章审核不通过,请前往重新填写',
@@ -524,6 +529,35 @@ export default {
 				}
 			});
 		},
+		getGradeInfo() {
+			let self = this;
+			
+			this.$api.goodsGradeInfo(this.gradeId).then(res => {
+				if (res.data.code == 200) {
+					self.gradeDetail = res.data.data;
+					if(self.gradeDetail.learningStatus==2){
+						uni.showModal({
+							showCancel:false,
+							cancelText: '返回',
+							content: '当前课程正在申请中,请耐心等待',
+							success: function(resultst) {
+								uni.navigateBack();
+							}
+						});
+					}
+					if(self.gradeDetail.learningStatus==3&&(Number(self.gradeDetail.learningTimeStart)>Number((new Date())/1000))){
+						uni.showModal({
+							showCancel:false,
+							cancelText: '返回',
+							content: '当前课程正在申请中,请耐心等待',
+							success: function(resultst) {
+								uni.navigateBack();
+							}
+						});
+					}
+				}
+			});
+		},
 		getNoteList() {
 			let self = this;
 			self.noteList = [];
@@ -799,6 +833,7 @@ export default {
 				console.log(self.gradeId, 698);
 				self.getMenuList();
 				self.getReMenuList(); //获取重修目录
+				self.getGradeInfo()
 				//获取节笔记
 				this.getNoteList();
 				if (self.goodsData.goodsPlayConfig) {

+ 1 - 1
pages2/class/questionBank.vue

@@ -1187,7 +1187,7 @@ export default {
 				})
 				.then(res => {
 					this.recordId = res.data.data;
-					// self.photoPopup = true; //拍照
+					self.photoPopup = true; //拍照
 				});
 			
 		},

+ 8 - 3
pages2/msg/detail.vue

@@ -20,10 +20,10 @@
 				<view class="lsow" style="border-bottom: 1rpx solid #eee;margin-top: 10rpx;" v-for="(item, index) in listData.informVo.informExamVo" :key="index">
 					<view class="h4">{{ item.goodsName }}</view>
 					<view class="h33">{{ item.moduleName ? '/' + item.moduleName : '' }}{{ item.chapterName ? '/' + item.chapterName : '' }}{{ item.examName }}</view>
-					<view style="display: flex;align-items: center;margin:28rpx 0rpx;">
+					<view style="display: flex;align-items: center;margin:28rpx 0rpx;"  @click="jumpExam(item)">
 						<image style="width: 35rpx;height: 35rpx;" src="@/static/examIcon.png" mode=""></image>
 						<text class="timeStys">第{{ item.topicNum }}道题</text>
-						<text class="aSty" @click="jumpExam(item)">点击可直接跳转</text>
+						<text class="aSty">点击可直接跳转</text>
 					</view>
 				</view>
 			</view>
@@ -66,6 +66,7 @@ export default {
 	methods: {
 		//跳转页面
 		jumpFuns(item) {
+			
 			switch (item.remindId) {
 				case 1:
 				case 3:
@@ -76,7 +77,8 @@ export default {
 				case 21:
 				case 22:
 					this.$navTo.togo('/pages2/wd/course', {
-						id: item.goodsId
+						id: item.goodsId,
+						gid:item.gradeId
 					});
 					// arsty = '立刻学习';
 					break;
@@ -133,6 +135,9 @@ export default {
 		//跳转题库题目
 		jumpExam(item) {
 			console.log(item);
+			uni.navigateTo({
+				url:'/pages2/bank/questionBank?current='+(item.topicNum-1)+'&id='+item.examId+'&goodsid='+item.goodsId+'&chapterId='+item.moduleId+'&moduleId='+item.moduleId
+			})
 		},
 		isOk() {
 			this.$api.courseappinformUser({ id: this.listData.id, receiptStatus: 1 }).then(res => {

+ 5 - 3
pages2/plan/index.vue

@@ -231,7 +231,6 @@ export default {
 			let item = this.listItem.calendarStudyVo[this.monthIndex];
 			this.calendarStudyVo = item;
 			this.workList = this.calendarStudyVo.goodsVos;
-			console.log(this.monthIndex,98)
 			if (this.monthIndex > 0) {
 				this.havePreviousMonth = true;
 			}
@@ -252,7 +251,6 @@ export default {
 					if (item.month == currentMonth) {
 						this.monthIndex = i;
 						this.calendarStudyVo = item;
-
 						if (i > 0) {
 							this.havePreviousMonth = true;
 						}
@@ -274,8 +272,12 @@ export default {
 			this.calendarStudyVo.miniDayStudyList = []; //创建缩放的数组
 			let date = new Date();
 			let num = date.getDate();
-			
+			//如果不是当前月,默认显示第一周
+			if ((date.getMonth() + 1) != this.calendarStudyVo.month) {
+				num = 1;
+			}
 			 for (let i = 0; i < firstItem.studyDay; i++) {
+				 //补齐1号前的日数凑满一周
 				this.calendarStudyVo.dayStudyList.unshift({ date: 0 });
 			} 
 			let todayIndex;