he2802 пре 3 година
родитељ
комит
583f20c589

+ 5 - 1
components/course/courseModule.vue

@@ -7,7 +7,7 @@
 		</view>
 		<view v-if="!down">
 			<view v-for="(itemM,indexM) in list" >
-				<courseChapter :courseId="courseId" :goodsId="goodsId" :isBuy="isBuy" :gradeId="gradeId" :isRebuild="isRebuild"  :menuItem="itemM" :levelId="levelId+'-'+itemM.chapterId"></courseChapter>
+				<courseChapter :courseId="courseId" :learningOrder="learningOrder" :goodsId="goodsId" :isBuy="isBuy" :gradeId="gradeId" :isRebuild="isRebuild"  :menuItem="itemM" :levelId="levelId+'-'+itemM.chapterId"></courseChapter>
 				<u-line v-if="indexM<list.length-1"></u-line>
 			</view>
 		</view>
@@ -19,6 +19,10 @@ import courseChapter from '@/components/course/courseChapter.vue';
 export default {
 	name: 'courseModule',
 	props: {
+		learningOrder:{ //是否设置学习顺序 1 设置 0不设置
+			type:String,
+			defaule:'0'
+		},
 		menuItem: {
 			type: Object,
 			default: {}

+ 1 - 1
pages2/class/questionBank.vue

@@ -467,7 +467,7 @@
 					<view style="width: 100%; height: 979rpx;position: fixed;" v-if="photoPopup">
 						<camera device-position="front" flash="off" @error="error" style="width: 100%; height: 100%;" ></camera>
 					</view>
-					<view class="custom"><image src="@/pages2/static/zhezhao.png" mode=""></image></view>
+					<view class="custom"><image src="/static/zhezhao.png" mode=""></image></view>
 				</view>
 				<view class="btnResult" @click="takePhoto">拍照</view>
 			</view>

+ 12 - 0
pages2/order/confirm_list.vue

@@ -52,6 +52,7 @@
 											<u-radio
 												shape="circle"
 												:name="index"
+												:disabled="item.studentNum > 0 && item.studentNum == item.studentUpper"
 											>
 												<view :class="item.checked?'white-box blue-box':'white-box'" >
 													<view>
@@ -300,12 +301,23 @@ export default {
 			this.$api.goodsGradeList({goodsId:this.id}).then(res => {
 				if(res.data.code==200){
 					self.gradeList = res.data.rows
+					
 					if(self.gradeList.length==0){
 						let item = {
 							className:'系统分班',
 							gradeId:0
 						}
 						self.gradeList.push(item)
+					} else {
+						let isGradeFull = self.gradeList.every(item => (item.studentNum > 0 && item.studentNum == item.studentUpper))
+						//所有班级都满了
+						if(isGradeFull) {
+							let item = {
+								className:'系统分班',
+								gradeId:0
+							}
+							self.gradeList.unshift(item)
+						}
 					}
 				}
 			});

+ 72 - 11
pages2/plan/index.vue

@@ -7,27 +7,27 @@
 					<text style="padding: 0 15rpx;">{{ calendarStudyVo.year }}年 {{ calendarStudyVo.month }}月</text>
 					<u-icon name="arrow-right" size="28" v-if="haveNextMonth" @click="swipeMonth(1)"></u-icon>
 				</view>
-				<view style="width: 100%;display: flex;justify-content:center;margin-top: 20rpx;">
+				<view style="width: 100%;margin-top: 20rpx;">
 					<view v-for="(item, index) in date" :key="index" class="card_date">{{ item }}</view>
 				</view>
 				<view style="width: 100%;margin-top: 20rpx;">
 					<view v-for="(item, index) in showDayList" :key="index" class="date_num">
-						<view v-if="item.color == 0" class="date_num_color0" v-show="item.date > 0">
+						<view v-if="item.color == 0" @click="itemClick(item,index)" class="date_num_color0" :class="{active_color:item.date == activeDate}" v-show="item.date > 0">
 							{{ item.date }}
 							<view v-if="item.note > 0" class="date_note">{{ item.note }}</view>
 							<view v-if="item.dot" class="date_dot"></view>
 						</view>
-						<view v-if="item.color == 1" class="date_num_color1">
+						<view v-if="item.color == 1" @click="itemClick(item,index)" class="date_num_color1"  :class="{active_color:item.date == activeDate}">
 							{{ item.date }}
 							<view v-if="item.note > 0" class="date_note">{{ item.note }}</view>
 							<view v-if="item.dot" class="date_dot"></view>
 						</view>
-						<view v-if="item.color == 2" class="date_num_color2">
+						<view v-if="item.color == 2" @click="itemClick(item,index)" class="date_num_color2"  :class="{active_color:item.date == activeDate}">
 							{{ item.date }}
 							<view v-if="item.note > 0" class="date_note">{{ item.note }}</view>
 							<view v-if="item.dot" class="date_dot"></view>
 						</view>
-						<view v-if="item.color == 3" class="date_num_color3">
+						<view v-if="item.color == 3" @click="itemClick(item,index)" class="date_num_color3"  :class="{active_color:item.date == activeDate}">
 							{{ item.date }}
 							<view v-if="item.note > 0" class="date_note">{{ item.note }}</view>
 							<view v-if="item.dot" class="date_dot"></view>
@@ -178,6 +178,7 @@ export default {
 					}
 				}
 			],
+			activeDate:'',
 			dayStudyList: [],
 			listItem: {},
 			currentMonth: 0,
@@ -197,6 +198,32 @@ export default {
 		this.getList();
 	},
 	methods: {
+		itemClick(item,index) {
+			// console.log(item)
+			this.activeDate = item.date;
+			this.workList = this.getStudyCourseByDay();
+		},
+		/**
+		 * 根据选中日期获取需要学习的课程
+		 */
+		getStudyCourseByDay() {
+			let courseList = [];
+			this.showDayList.forEach(day => {
+				if(day.date == this.activeDate) {
+					if(day.daySectionList) {
+						day.daySectionList.forEach(section => {
+							this.listItem.goodsVos.forEach(vos => {
+								if(vos.goodsId == section.goodsId) {
+									courseList.push(vos)
+								}
+							})
+						})
+					}
+				}
+			})
+			
+			return courseList;
+		},
 		planNow(){
 			uni.switchTab({
 			    url: '/pages/course/index'
@@ -230,7 +257,9 @@ export default {
 			this.currentMonth = this.currentMonth + index;
 			let item = this.listItem.calendarStudyVo[this.monthIndex];
 			this.calendarStudyVo = item;
-			this.workList = this.calendarStudyVo.goodsVos;
+			this.activeDate = '';
+			// this.workList = this.calendarStudyVo.goodsVos;
+			this.workList = this.getStudyCourseByDay();
 			if (this.monthIndex > 0) {
 				this.havePreviousMonth = true;
 			}
@@ -244,7 +273,8 @@ export default {
 			let currentMonth = date.getMonth() + 1;
 			this.haveNextMonth = false;
 			this.havePreviousMonth = false;
-			this.workList = this.listItem.goodsVos;
+			this.workList = this.getStudyCourseByDay();
+			// this.workList = this.listItem.goodsVos;
 			if (this.listItem !== undefined) {
 				for (let i = 0; i < this.listItem.calendarStudyVo.length; i++) {
 					let item = this.listItem.calendarStudyVo[i];
@@ -263,6 +293,7 @@ export default {
 			}
 		},
 		openEdit(item) {
+			this.activeDate = '';
 			this.listItem = item;
 			this.isOpen = false;
 			this.dealMonth();
@@ -555,6 +586,7 @@ export default {
 	border-radius: 50%;
 	width: 29rpx;
 	height: 29rpx;
+	line-height: 25rpx;
 	border: 1px solid #ffcc00;
 	font-size: 18rpx;
 	color: #ffcc00;
@@ -599,26 +631,55 @@ export default {
 	margin-top: 20rpx;
 }
 .date_num_color0 {
+	display: inline-block;
+	width: 48rpx;
+	height: 48rpx;
+	line-height: 48rpx;
+	text-align: center;
 	color: #32467b;
 }
 .date_num_color1 {
+	display: inline-block;
+	width: 48rpx;
+	height: 48rpx;
+	line-height: 48rpx;
+	text-align: center;
 	color: #34c759;
 }
 .date_num_color2 {
+	display: inline-block;
+	width: 48rpx;
+	height: 48rpx;
+	line-height: 48rpx;
+	text-align: center;
 	color: #ff3b30;
 }
 .date_num_color3 {
-	color: #ffffff;
-	background-color: #ffcc00;
+	color: #007AFF;
+	background-color: rgba(229,241,255,1);
 	border-radius: 50%;
-	width: 40rpx;
-	height: 40rpx;
+	width: 48rpx;
+	height: 48rpx;
+	line-height: 48rpx;
+	text-align: center;
+	display: inline-block;
+}
+.active_color{
+	color: #fff;
+	background-color: #007AFF;
+	border-radius: 50%;
+	width: 48rpx;
+	height: 48rpx;
+	line-height: 48rpx;
+	text-align: center;
 	display: inline-block;
 }
 .card_date {
 	width: 14%;
 	text-align: center;
 	color: #7f8caf;
+    position: relative;
+    display: inline-block;
 }
 .date_t1 {
 	font-size: 24rpx;