소스 검색

fix 随机拍

he2802 3 년 전
부모
커밋
cfde70194e
6개의 변경된 파일58개의 추가작업 그리고 14개의 파일을 삭제
  1. 10 0
      common/httpList/goods.js
  2. 6 3
      pages2/bank/question_detail.vue
  3. 1 1
      pages2/class/questionBank.vue
  4. 3 3
      pages2/learn/my_learn.vue
  5. 22 3
      pages2/wd/class.vue
  6. 16 4
      pages2/wd/course.vue

+ 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,

+ 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

@@ -603,7 +603,7 @@ export default {
 				if (self.goodsDetail.goodsPhotoExamConfig) {
 					let goodsPhotoExamConfig = JSON.parse(self.goodsDetail.goodsPhotoExamConfig);
 					if (goodsPhotoExamConfig.photograph > 0) {
-						// self.needPhoto = true;
+						self.needPhoto = true;
 					}
 				}
 				

+ 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: '学时审核'

+ 22 - 3
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,11 +123,13 @@ export default {
 				pageNum: 1,
 				pageSize: 10
 			},
-			total: 0
+			total: 0,
+			sysTime:0,
 		};
 	},
 	onLoad(option) {
 		this.courseGoodsList();
+		this.commonSystemTime()
 	},
 	onShow() {},
 	onReachBottom() {
@@ -136,6 +139,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 +195,14 @@ export default {
 				}
 			});
 		},
-		studyIn(v,i) {
+		studyIn(v,i,item) {
+			if(this.sysTime <= item.validityStartTime || this.sysTime >= item.validityEndTime) {
+				uni.showToast({
+					icon:'none',
+					title:'不在学习时间,不能进入学习'
+				})
+				return;
+			}
 			this.$navTo.togo(`/pages2/wd/course?id=${v}&gid=${i}`);
 		},
 		appointment(item) {
@@ -235,6 +250,10 @@ page {
 	justify-content: space-between;
 	align-items: center;
 	margin-top: 20rpx;
+	
+	.disabled {
+		opacity: 0.6;
+	}
 }
 .bottomBox {
 	background: #ffffff;

+ 16 - 4
pages2/wd/course.vue

@@ -52,16 +52,28 @@ 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) {
+			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