Przeglądaj źródła

fix: 1、节卷不需要拍照 2、拍照弹窗和‘我知道了’弹窗同时出现的情况

xuqiaoying 3 lat temu
rodzic
commit
c197c6c3d3

+ 2 - 2
common/request.js

@@ -6,11 +6,11 @@ var num = 1
 //接口api   
 // export const BASE_URL = 'https://api.xyyxt.net'   //release
 // export const BASE_URL = 'https://test.xyyxt.net'   //预发布
-// export const BASE_URL = 'http://120.79.166.78:19012' // 测试环境
+export const BASE_URL = 'http://120.79.166.78:19012' // 测试环境
 // export const BASE_URL = 'http://42.192.164.187:19005'    //test(后端本地)
 // export const BASE_URL = 'http://192.168.1.222:5055'    //后端本地更新到222
 // export const BASE_URL = 'http://192.168.1.24:5055'    //后端本地
-export const BASE_URL = 'http://192.168.1.7:5055'    //后端本地
+// export const BASE_URL = 'http://192.168.1.7:5055'    //后端本地
 
  //图片上传api
 // export const BASE_IMG_URL = 'https://file.xyyxt.net/'     //release

+ 6 - 6
components/course/courseChapter.vue

@@ -295,7 +295,7 @@ export default {
                 chapterId +
                 "&orderGoodsId=" +
                 this.orderGoodsId +
-				        "&type=1"
+				        "&type=1" + '&learning=' + item.learning
                 ,
             });
             this.studyLog()
@@ -317,7 +317,7 @@ export default {
                 chapterId +
                 "&orderGoodsId=" +
                 this.orderGoodsId +
-				        "&type=1",
+				        "&type=1" + '&learning=' + item.learning,
             });
             this.studyLog()
           } else {
@@ -390,7 +390,7 @@ export default {
                 chapterId +
                 "&orderGoodsId=" +
                 this.orderGoodsId +
-				        "&type=1",
+				        "&type=1" + '&learning=' + item.learning,
             });
             this.studyLog()
             //没有答题次数限制
@@ -411,7 +411,7 @@ export default {
                 chapterId +
                 "&orderGoodsId=" +
                 this.orderGoodsId +
-				        "&type=1",
+				        "&type=1" + '&learning=' + item.learning,
             });
             this.studyLog()
           } else {
@@ -450,7 +450,7 @@ export default {
               chapterId +
               "&orderGoodsId=" +
               this.orderGoodsId +
-              "&type=1",
+              "&type=1" + '&learning=' + item.learning,
           });
           this.studyLog()
           //没有答题次数限制
@@ -471,7 +471,7 @@ export default {
               chapterId +
               "&orderGoodsId=" +
               this.orderGoodsId +
-              "&type=1",
+              "&type=1" + '&learning=' + item.learning,
           });
           this.studyLog()
         } else {

+ 1 - 1
components/course/courseModule.vue

@@ -215,7 +215,7 @@ export default {
 				chapterId +
 				"&orderGoodsId=" +
 				this.orderGoodsId +
-				"&type=3",
+				"&type=3" + '&learning=' + item.learning,
 			})
 		},
 		

+ 19 - 28
pages/index/index.vue

@@ -320,27 +320,28 @@ export default {
 		})
 	},
 	async onShow() {
-		// console.log('-----couIndex', this.couIndex, this.courseId)
+		console.log('-----couIndex', this.couIndex, this.courseId, this.courseName)
 		this.getInfo() // 判断有没有关注公众号		
 		this.isClickOff() //关注公众号,每天最多显示1次;当天学员关闭弹窗后,无需再显示
 		uni.removeStorageSync('goPath')
 		
-		if (this.courseId || this.bankId) {
-			if (this.tabNum == 0) {
-				this.list1 = []
-				this.paramList[0].pageNum = 1
-				this.list1 = await this.getGoodsList(this.courseId, 0)
-			} else {
-				this.list2 = []
-				this.paramList[1].pageNum = 1
-				this.list2 = await this.getGoodsList(this.bankId, 1)
-			}
-		} else {
+		// if (this.courseId || this.bankId) {
+		// 	if (this.tabNum == 0) {
+		// 		this.list1 = []
+		// 		this.paramList[0].pageNum = 1
+		// 		this.list1 = await this.getGoodsList(this.courseId, 0)
+		// 	} else {
+		// 		this.list2 = []
+		// 		this.paramList[1].pageNum = 1
+		// 		this.list2 = await this.getGoodsList(this.bankId, 1)
+		// 	}
+		// } else {
 			this.list1 = []
 			this.list2 = []
+			this.paramList[0].pageNum = 1
+			this.paramList[1].pageNum = 1
 			this.courseLists()
-		}
-		// this.bankList();
+		// }
 		if (uni.getStorageSync('updateHome')){
 			this.init()
 			uni.removeStorageSync('updateHome'); //消费首页刷新事件
@@ -381,9 +382,6 @@ export default {
 		}
 	},
 	async onReachBottom() {
-		// console.log('加载加载--', this.tabNum)
-		// console.log(this.paramList[0].total,'total', this.paramList[1].total)
-		// console.log(this.list1.length,'length', this.list2.length)
 		if (this.tabNum == 0) {
 			if (this.list1.length < this.paramList[0].total) {
 				this.paramList[0].pageNum++
@@ -631,28 +629,21 @@ export default {
 						}
 					});
 					if (this.courseName.length) {
+						let courseId = this.courseId ? this.courseId : this.courseName[0].recommendId
 						this.courseId = this.courseName[0].recommendId
-						let list1 = await this.getGoodsList(this.courseName[0].recommendId, 0)
+						let list1 = await this.getGoodsList(courseId, 0)
 						this.list1.push(...list1)
 					}
 					
 					if (this.bankName.length) {
+						let bankId = this.bankId ? this.bankId : this.bankName[0].recommendId
 						this.bankId = this.bankName[0].recommendId
-						let list2 = await this.getGoodsList(this.bankName[0].recommendId, 1)
+						let list2 = await this.getGoodsList(bankId, 1)
 						this.list2.push(...list2)
 					}
 
 				}
 			});
-			// this.$api.goodsList(param).then(res => {
-			// 	if (res.data.code == 200) {
-			// 		this.list1 = res.data.rows || []
-			// 		this.total1 = res.data.total
-			// 		if (this.list1.length === res.data.total) {
-			// 			this.showStatus1 = true
-			// 		}
-			// 	}
-			// });
 		},
 		getGoodsList(recommendId, num) {	
 			return new Promise((resolve, reject) => {

+ 2 - 2
pages2/bank/question_record.vue

@@ -243,13 +243,13 @@ export default {
 			}
 
 			if (record.courseType == 2) {
-				const {courseId, gradeId, sectionId, examId, orderGoodsId = 0, type} = record
+				const {courseId, gradeId, sectionId, examId, orderGoodsId = 0, type, reportStatus} = record
 				let moduleId = record.moduleId || 0
 				let chapterId = record.chapterId || 0
 				uni.navigateTo({
 					url:"/pages2/class/questionBank?courseId=" + courseId + "&gradeId=" + gradeId + "&isFromVideo=1&id=" + examId +
 					"&goodsid=" + goodsId + "&moduleId=" + moduleId + "&chapterId=" + chapterId + "&sectionId=" + sectionId + "&orderGoodsId=" +
-					orderGoodsId + "&type=" + type,
+					orderGoodsId + "&type=" + type+ '&learning=' + reportStatus,
 				})
 			} else {
 				let moduleId = record.moduleExamId || 0

+ 2 - 2
pages2/bank/question_record_list.vue

@@ -243,13 +243,13 @@ export default {
 				return;
 			}
 			if (this.courseType == 2) {
-				const {courseId, gradeId, sectionId, examId, orderGoodsId = 0, type} = record
+				const {courseId, gradeId, sectionId, examId, orderGoodsId = 0, type, reportStatus} = record
 				let moduleId = record.moduleId || 0
 				let chapterId = record.chapterId || 0
 				uni.navigateTo({
 					url:"/pages2/class/questionBank?courseId=" + courseId + "&gradeId=" + gradeId + "&isFromVideo=1&id=" + examId +
 					"&goodsid=" + goodsId + "&moduleId=" + moduleId + "&chapterId=" + chapterId + "&sectionId=" + sectionId + "&orderGoodsId=" +
-					orderGoodsId + "&type=" + type,
+					orderGoodsId + "&type=" + type+ '&learning=' + reportStatus,
 				})
 			} else {
 				let moduleId = record.moduleExamId || 0

+ 25 - 6
pages2/class/questionBank.vue

@@ -774,7 +774,8 @@
         </view>
       </view>
     </u-popup>
-    <u-mask :show="photoPopup">
+    <!-- 节卷不需要拍照 -->
+    <u-mask :show="examType != 2 && photoPopup">
       <!-- 播放前拍照start -->
       <view
         v-if="photoPopup"
@@ -882,8 +883,20 @@ export default {
       needPhoto: false, //是否需要拍照
       examType: 0, // 3-模块,1-章,2-节
       compareFaceData: 0, // 拍照匹配相似度
+      learning: -1, // 1合格,0不合格
+      originShowDialog: false,
     };
   },
+  watch: {
+    photoPopup(n) {
+      // 拍照弹窗和showDialog同时出现时,先展示拍照弹窗再展示showDialog弹窗
+      if (n) {
+        this.showDialog && (this.showDialog = false)
+      } else {
+        this.originShowDialog && (this.showDialog = true)
+      }
+    }
+  },
   async onLoad(option) {
     this.examType = option.type
     this.id = option.id;
@@ -895,6 +908,8 @@ export default {
     this.isFromVideo = option.isFromVideo || "";
     this.gradeId = option.gradeId || "";
     this.orderGoodsId = Number(option.orderGoodsId);
+    this.learning = option.learning
+    console.log('learning:', this.learning)
     let isBack = option.isback;
 
     let showDialog = uni.getStorageSync("showDialog");
@@ -903,6 +918,7 @@ export default {
       this.showDialog = false;
     } else {
       this.showDialog = true;
+      this.originShowDialog = true
       uni.setStorageSync("showDialog", "1");
     }
 
@@ -919,9 +935,11 @@ export default {
 
       //需要拍没拍过直接弹出摄像头
       if (this.needPhoto && !this.isTakePhoto) {
+        if (this.learning != 1) {
         this.photoPopup = true;
         this.isTaking = true;
         this.avatarUrl = "";
+        }
       } else {
         //不需要拍照
         if (this.lastTime) {
@@ -1209,7 +1227,6 @@ export default {
           // self.submitPhoto();
           this.isTaking = false;
 
-          // self.photoPopup = false;
         },
         fail: (err) => {
           console.log(err);
@@ -1816,7 +1833,6 @@ export default {
      */
     examRecord(hasSpecial) {
       return new Promise((resolve) => {
-        let self = this;
         let questionList = 0;
         // if(!hasSpecial) {
         this.questionList.forEach((item, index) => {
@@ -1845,9 +1861,12 @@ export default {
           .then((res) => {
             this.recordId = res.data.data;
 
-            if (self.needPhoto) {
-              self.photoPopup = true; //拍照
-              this.isTaking = true;
+            if (this.needPhoto) {
+              if (this.learning != 1) {
+                this.photoPopup = true; //拍照
+                this.isTaking = true;
+              }
+              
             } else {
               if (this.lastTime) {
                 this.timer = setInterval(() => {

+ 1 - 1
pages2/class/question_report.vue

@@ -322,7 +322,7 @@ export default {
 				uni.navigateTo({
 					url:"/pages2/class/questionBank?courseId=" + courseId + "&gradeId=" + gradeId + "&isFromVideo=1&id=" + examId +
 					"&goodsid=" + goodsId + "&moduleId=" + moduleId + "&chapterId=" + chapterId + "&sectionId=" + sectionId + "&orderGoodsId=" +
-					this.orderGoodsId + "&type=" + this.examType,
+					this.orderGoodsId + "&type=" + this.examType + '&learning=' + this.reportStatus,
 				})
 			}
 			

+ 1 - 1
pages3/live/detail.vue

@@ -755,7 +755,7 @@ export default {
     ...mapGetters(["userInfo", "playSectionId", "playChannelId", "playVID"]),
   },
   onLoad(option) {
-    console.log('====option', option, this.playChannelId)
+    // console.log('====option', option, this.playChannelId)
     this.options = option
     this.courseId = option.courseId || ''
     this.goodsId = Number(option.goodsId);

+ 0 - 3
pages3/polyv/detail.vue

@@ -1383,8 +1383,6 @@ export default {
      * 模块大节播放完毕,刷新列表
      */
     sectionPlayEnd(isRebuild, index) {
-      console.log("sectionPlayEnd");
-      console.log("isRebuild", isRebuild), console.log("index", index);
       if (this.reMenuList.length > 0) {
         //有重修目录
         if (isRebuild.isRebuild) {
@@ -1397,7 +1395,6 @@ export default {
               gradeId: this.gradeId,
             })
             .then((res) => {
-              console.log("Rebuild1");
               if (res.data.code == 200) {
                 if (res.data.rows.length) {
                   res.data.rows[index].name = res.data.rows[index].menuName;