caichengyu 5 maanden geleden
bovenliggende
commit
09c1e32999
8 gewijzigde bestanden met toevoegingen van 327 en 121 verwijderingen
  1. 1 0
      common/config.js
  2. 22 0
      common/httpList/course.js
  3. 5 1
      components/popup/index.vue
  4. 1 0
      components/popup/media.vue
  5. 1 1
      manifest.json
  6. 251 117
      pages/learn/index.vue
  7. 32 2
      pages3/course/detail.vue
  8. 14 0
      pages3/polyv/detail.vue

+ 1 - 0
common/config.js

@@ -20,6 +20,7 @@ const set = [
 	// 祥粤云学堂
 	{
 		BASE_URL: "https://api.xyyxt.net",
+		// BASE_URL: "https://api.gdzckj.net",
 		BASE_IMG_URL: "https://file.xyyxt.net/",
 		tenantId: "867735392558919680",
 		appid: "wxd3c8ae80cf43a305",

+ 22 - 0
common/httpList/course.js

@@ -293,4 +293,26 @@ export default {
 			data: data
 		})
 	},
+	abnormal(data) {
+		return myRequest({
+			url: '/study/record/abnormal',
+			method: 'post',
+			data: data
+		})
+	},
+	sys_study_prompt(data) {
+		return myRequest({
+			url: '/app/common/prompt',
+			method: 'get',
+			noToken: true,
+			data: data,
+		})
+	},
+	//课程是否允许购买
+	ordercheckbuy(data) {
+		return myRequest({
+			url: "/order/check/buy/" + data,
+			method: "get",
+		});
+	},
 };

+ 5 - 1
components/popup/index.vue

@@ -8,10 +8,14 @@
                 <view class="warn">温馨提示</view>
                 <view class="contents">
                     <view class="words">1、请保证摄像头正对自己,避免头像偏左或者偏右。并离远一点拍照,肩膀要拍到。</view>
-                    <view class="words">2、请保证拍照环境光线充足(照片太暗或曝光会降低验证通过率)。</view>
+                    <view class="words">2、请勿在灯光昏暗处进行学习,保证拍照环境光线充足(照片太暗或曝光会降低验证通过率)。</view>
                     <view class="words">3、请保证整个头像在人脸识别区域内,脸部无遮挡装饰物(佩戴眼镜会降低通过率)。</view>
                     <view class="words">4、拍照时不要开启背景虚化,保证背景清晰。</view>
                     <view class="words">5、如果下面视频中出现黑屏,摄像头可能被其他进程占用,请关闭其他调用摄像头的程序,重新刷新当前页面重新拍照识别。</view>
+                    <view class="words">6、勿拉进度条或倍数观看。</view>
+                    <view class="words">7、勿使用照片进行识别。</view>
+                    <view class="words">8、规范学习,勿在开车过程进行学习。</view>
+                    <view class="words"  style="color: red;">学习过程如出现违规现象,一律打回重修。</view>
                 </view>
                 <view class="take_photo" @click="toTakePhoto()">
                     去拍照

+ 1 - 0
components/popup/media.vue

@@ -172,6 +172,7 @@
 				this.isShow = false;
 				this.showSet = false;
 				this.popupPhotoShow = false;
+				this.status=1;
 			},
 
 			openCamera() {

+ 1 - 1
manifest.json

@@ -1,6 +1,6 @@
 {
     "name" : "Applet",
-    "appid" : "__UNI__75DC42D",
+    "appid" : "__UNI__F6C950F",
     "description" : "",
     "versionName" : "1.0.0",
     "versionCode" : "100",

+ 251 - 117
pages/learn/index.vue

@@ -328,7 +328,8 @@
                   item.classEndTime < sysTime &&
                   (item.periodStatus == 0 || item.periodStatus == -1)
                 ">
-								<span v-if="item.studyCount > 0&&userInfo.studentRestudy!=1">温馨提示:班级已过期,如需重新学习,请点击右侧“选班重学”按钮。</span>
+								<span
+									v-if="item.studyCount > 0&&userInfo.studentRestudy!=1">温馨提示:班级已过期,如需重新学习,请点击右侧“选班重学”按钮。</span>
 								<span v-else>温馨提示:班级已过期,您的重学次数已用完,如有疑问请联系{{
                     eduPhone
                   }}</span>
@@ -1158,122 +1159,255 @@
 						noLoading: true,
 					}).then((res) => {
 						if (res.data.code == 200) {
-							if (res.data.total > 1) {
-								// if (playSource == 2) {
-								// 	// #ifdef H5
-								// 	uni.navigateTo({
-								// 		url: `/pages3/polyv/detail?id=''&goodsId=${
-								// 		          item.goodsId
-								// 		        }&orderGoodsId=${item.orderGoodsId}&gradeId=${
-								// 		          item.gradeId
-								// 		        }&periodWaitTime=${item.periodWaitTime ? 1 : ""}&isQ=${
-								// 		          item.orderYear ? 1 : ""
-								// 		        }`,
-								// 	});
-								// 	// #endif
-								// 	// #ifdef MP-WEIXIN
-								// 	this.$api
-								// 		.courseSkipPort()
-								// 		.then((res) => {
-								// 			console.log("请求的域名", res.data.data.domain)
-								// 			let obj = {
-								// 				id: '',
-								// 				goodsId: item.goodsId,
-								// 				orderGoodsId: item.orderGoodsId,
-								// 				gradeId: item.gradeId,
-								// 				periodWaitTime: item.periodWaitTime ? 1 : "",
-								// 				isQ: item.orderYear ? 1 : "",
-								// 				skipPort: res.data.data.skipPort
-								// 			}
-								// 			let webViewUrl = encodeURIComponent(
-								// 				res.data.data.domain +
-								// 				'/pages3/polyv/detail?obj=' +
-								// 				JSON.stringify(obj))
-								// 			uni.navigateTo({
-								// 				url: `/pages5/webview/detaillink?url=${webViewUrl}`
-								// 			})
-								// 		})
-								// 	// #endif
-								// } else {
-								// 	uni.navigateTo({
-								// 		url: `/pages3/polyv/detail?id=''&goodsId=${
-								// 		          item.goodsId
-								// 		        }&orderGoodsId=${item.orderGoodsId}&gradeId=${
-								// 		          item.gradeId
-								// 		        }&periodWaitTime=${item.periodWaitTime ? 1 : ""}&isQ=${
-								// 		          item.orderYear ? 1 : ""
-								// 		        }`,
-								// 	});
-								// }
-								uni.navigateTo({
-									url: `/pages3/polyv/detail?id=''&goodsId=${
-                  item.goodsId
-                }&orderGoodsId=${item.orderGoodsId}&gradeId=${
-                  item.gradeId
-                }&periodWaitTime=${item.periodWaitTime ? 1 : ""}`,
-								});
-							} else if (res.data.total == 1) {
-								// if (playSource == 2) {
-								// 	// #ifdef H5
-								// 	uni.navigateTo({
-								// 		url: ` / pages3 / polyv / detail ? id = $ {
-								// 		          res.data.rows[0].courseId
-								// 		        }&goodsId=${item.goodsId}&orderGoodsId=${
-								// 		          item.orderGoodsId
-								// 		        }&gradeId=${item.gradeId}&periodWaitTime=${
-								// 		          item.periodWaitTime ? "" : 1
-								// 		        }&isQ=${item.orderYear ? 1 : ""}`,
-								// 	});
-								// 	// #endif
-								// 	// #ifdef MP-WEIXIN
-								// 	this.$api
-								// 		.courseSkipPort()
-								// 		.then((resForDetail) => {
-								// 			console.log("请求的域名", resForDetail.data.data.domain)
-								// 			let obj = {
-								// 				id: res.data.rows[0].courseId,
-								// 				goodsId: item.goodsId,
-								// 				orderGoodsId: item.orderGoodsId,
-								// 				gradeId: item.gradeId,
-								// 				periodWaitTime: item.periodWaitTime ? "" : 1,
-								// 				isQ: item.orderYear ? 1 : "",
-								// 				skipPort: resForDetail.data.data.skipPort
-								// 			}
-								// 			let webViewUrl = encodeURIComponent(
-								// 				resForDetail.data.data.domain +
-								// 				'/pages3/polyv/detail?obj=' +
-								// 				JSON.stringify(obj))
-								// 			uni.navigateTo({
-								// 				url: `/pages5/webview/detaillink?url=${webViewUrl}`
-								// 			})
-								// 		})
-								// 	// #endif
-								// } else {
-								// 	uni.navigateTo({
-								// 		url: `/pages3/polyv/detail?id=${
-								// 		          res.data.rows[0].courseId
-								// 		        }&goodsId=${item.goodsId}&orderGoodsId=${
-								// 		          item.orderGoodsId
-								// 		        }&gradeId=${item.gradeId}&periodWaitTime=${
-								// 		          item.periodWaitTime ? "" : 1
-								// 		        }&isQ=${item.orderYear ? 1 : ""}`,
-								// 	});
-								// }
-								uni.navigateTo({
-									url: `/pages3/polyv/detail?id=${
-                  res.data.rows[0].courseId
-                }&goodsId=${item.goodsId}&orderGoodsId=${
-                  item.orderGoodsId
-                }&gradeId=${item.gradeId}&periodWaitTime=${
-                  item.periodWaitTime ? "" : 1
-                }`,
-								});
-							} else {
-								uni.showToast({
-									icon: "none",
-									title: "暂无可观看的视频课程",
-								});
-							}
+							this.$api
+								.sys_study_prompt()
+								.then((resss) => {
+						console.log("213", resss)
+									if (resss.data.code == 200 && resss.data.data) {
+										uni.showModal({
+											title: "提示",
+											content:resss.data.data ,
+											success: (res2) => {
+												if (res2.confirm) {
+													if (res.data.total > 1) {
+														// if (playSource == 2) {
+														// 	// #ifdef H5
+														// 	uni.navigateTo({
+														// 		url: `/pages3/polyv/detail?id=''&goodsId=${
+														// 		          item.goodsId
+														// 		        }&orderGoodsId=${item.orderGoodsId}&gradeId=${
+														// 		          item.gradeId
+														// 		        }&periodWaitTime=${item.periodWaitTime ? 1 : ""}&isQ=${
+														// 		          item.orderYear ? 1 : ""
+														// 		        }`,
+														// 	});
+														// 	// #endif
+														// 	// #ifdef MP-WEIXIN
+														// 	this.$api
+														// 		.courseSkipPort()
+														// 		.then((res) => {
+														// 			console.log("请求的域名", res.data.data.domain)
+														// 			let obj = {
+														// 				id: '',
+														// 				goodsId: item.goodsId,
+														// 				orderGoodsId: item.orderGoodsId,
+														// 				gradeId: item.gradeId,
+														// 				periodWaitTime: item.periodWaitTime ? 1 : "",
+														// 				isQ: item.orderYear ? 1 : "",
+														// 				skipPort: res.data.data.skipPort
+														// 			}
+														// 			let webViewUrl = encodeURIComponent(
+														// 				res.data.data.domain +
+														// 				'/pages3/polyv/detail?obj=' +
+														// 				JSON.stringify(obj))
+														// 			uni.navigateTo({
+														// 				url: `/pages5/webview/detaillink?url=${webViewUrl}`
+														// 			})
+														// 		})
+														// 	// #endif
+														// } else {
+														// 	uni.navigateTo({
+														// 		url: `/pages3/polyv/detail?id=''&goodsId=${
+														// 		          item.goodsId
+														// 		        }&orderGoodsId=${item.orderGoodsId}&gradeId=${
+														// 		          item.gradeId
+														// 		        }&periodWaitTime=${item.periodWaitTime ? 1 : ""}&isQ=${
+														// 		          item.orderYear ? 1 : ""
+														// 		        }`,
+														// 	});
+														// }
+														uni.navigateTo({
+															url: `/pages3/polyv/detail?id=''&goodsId=${
+																			                  item.goodsId
+																			                }&orderGoodsId=${item.orderGoodsId}&gradeId=${
+																			                  item.gradeId
+																			                }&periodWaitTime=${item.periodWaitTime ? 1 : ""}`,
+														});
+													} else if (res.data.total == 1) {
+														// if (playSource == 2) {
+														// 	// #ifdef H5
+														// 	uni.navigateTo({
+														// 		url: ` / pages3 / polyv / detail ? id = $ {
+														// 		          res.data.rows[0].courseId
+														// 		        }&goodsId=${item.goodsId}&orderGoodsId=${
+														// 		          item.orderGoodsId
+														// 		        }&gradeId=${item.gradeId}&periodWaitTime=${
+														// 		          item.periodWaitTime ? "" : 1
+														// 		        }&isQ=${item.orderYear ? 1 : ""}`,
+														// 	});
+														// 	// #endif
+														// 	// #ifdef MP-WEIXIN
+														// 	this.$api
+														// 		.courseSkipPort()
+														// 		.then((resForDetail) => {
+														// 			console.log("请求的域名", resForDetail.data.data.domain)
+														// 			let obj = {
+														// 				id: res.data.rows[0].courseId,
+														// 				goodsId: item.goodsId,
+														// 				orderGoodsId: item.orderGoodsId,
+														// 				gradeId: item.gradeId,
+														// 				periodWaitTime: item.periodWaitTime ? "" : 1,
+														// 				isQ: item.orderYear ? 1 : "",
+														// 				skipPort: resForDetail.data.data.skipPort
+														// 			}
+														// 			let webViewUrl = encodeURIComponent(
+														// 				resForDetail.data.data.domain +
+														// 				'/pages3/polyv/detail?obj=' +
+														// 				JSON.stringify(obj))
+														// 			uni.navigateTo({
+														// 				url: `/pages5/webview/detaillink?url=${webViewUrl}`
+														// 			})
+														// 		})
+														// 	// #endif
+														// } else {
+														// 	uni.navigateTo({
+														// 		url: `/pages3/polyv/detail?id=${
+														// 		          res.data.rows[0].courseId
+														// 		        }&goodsId=${item.goodsId}&orderGoodsId=${
+														// 		          item.orderGoodsId
+														// 		        }&gradeId=${item.gradeId}&periodWaitTime=${
+														// 		          item.periodWaitTime ? "" : 1
+														// 		        }&isQ=${item.orderYear ? 1 : ""}`,
+														// 	});
+														// }
+														uni.navigateTo({
+															url: `/pages3/polyv/detail?id=${
+																			                  res.data.rows[0].courseId
+																			                }&goodsId=${item.goodsId}&orderGoodsId=${
+																			                  item.orderGoodsId
+																			                }&gradeId=${item.gradeId}&periodWaitTime=${
+																			                  item.periodWaitTime ? "" : 1
+																			                }`,
+														});
+													} else {
+														uni.showToast({
+															icon: "none",
+															title: "暂无可观看的视频课程",
+														});
+													}
+												}
+											},
+										});
+									} else {
+										if (res.data.total > 1) {
+											// if (playSource == 2) {
+											// 	// #ifdef H5
+											// 	uni.navigateTo({
+											// 		url: `/pages3/polyv/detail?id=''&goodsId=${
+											// 		          item.goodsId
+											// 		        }&orderGoodsId=${item.orderGoodsId}&gradeId=${
+											// 		          item.gradeId
+											// 		        }&periodWaitTime=${item.periodWaitTime ? 1 : ""}&isQ=${
+											// 		          item.orderYear ? 1 : ""
+											// 		        }`,
+											// 	});
+											// 	// #endif
+											// 	// #ifdef MP-WEIXIN
+											// 	this.$api
+											// 		.courseSkipPort()
+											// 		.then((res) => {
+											// 			console.log("请求的域名", res.data.data.domain)
+											// 			let obj = {
+											// 				id: '',
+											// 				goodsId: item.goodsId,
+											// 				orderGoodsId: item.orderGoodsId,
+											// 				gradeId: item.gradeId,
+											// 				periodWaitTime: item.periodWaitTime ? 1 : "",
+											// 				isQ: item.orderYear ? 1 : "",
+											// 				skipPort: res.data.data.skipPort
+											// 			}
+											// 			let webViewUrl = encodeURIComponent(
+											// 				res.data.data.domain +
+											// 				'/pages3/polyv/detail?obj=' +
+											// 				JSON.stringify(obj))
+											// 			uni.navigateTo({
+											// 				url: `/pages5/webview/detaillink?url=${webViewUrl}`
+											// 			})
+											// 		})
+											// 	// #endif
+											// } else {
+											// 	uni.navigateTo({
+											// 		url: `/pages3/polyv/detail?id=''&goodsId=${
+											// 		          item.goodsId
+											// 		        }&orderGoodsId=${item.orderGoodsId}&gradeId=${
+											// 		          item.gradeId
+											// 		        }&periodWaitTime=${item.periodWaitTime ? 1 : ""}&isQ=${
+											// 		          item.orderYear ? 1 : ""
+											// 		        }`,
+											// 	});
+											// }
+											uni.navigateTo({
+												url: `/pages3/polyv/detail?id=''&goodsId=${
+																                  item.goodsId
+																                }&orderGoodsId=${item.orderGoodsId}&gradeId=${
+																                  item.gradeId
+																                }&periodWaitTime=${item.periodWaitTime ? 1 : ""}`,
+											});
+										} else if (res.data.total == 1) {
+											// if (playSource == 2) {
+											// 	// #ifdef H5
+											// 	uni.navigateTo({
+											// 		url: ` / pages3 / polyv / detail ? id = $ {
+											// 		          res.data.rows[0].courseId
+											// 		        }&goodsId=${item.goodsId}&orderGoodsId=${
+											// 		          item.orderGoodsId
+											// 		        }&gradeId=${item.gradeId}&periodWaitTime=${
+											// 		          item.periodWaitTime ? "" : 1
+											// 		        }&isQ=${item.orderYear ? 1 : ""}`,
+											// 	});
+											// 	// #endif
+											// 	// #ifdef MP-WEIXIN
+											// 	this.$api
+											// 		.courseSkipPort()
+											// 		.then((resForDetail) => {
+											// 			console.log("请求的域名", resForDetail.data.data.domain)
+											// 			let obj = {
+											// 				id: res.data.rows[0].courseId,
+											// 				goodsId: item.goodsId,
+											// 				orderGoodsId: item.orderGoodsId,
+											// 				gradeId: item.gradeId,
+											// 				periodWaitTime: item.periodWaitTime ? "" : 1,
+											// 				isQ: item.orderYear ? 1 : "",
+											// 				skipPort: resForDetail.data.data.skipPort
+											// 			}
+											// 			let webViewUrl = encodeURIComponent(
+											// 				resForDetail.data.data.domain +
+											// 				'/pages3/polyv/detail?obj=' +
+											// 				JSON.stringify(obj))
+											// 			uni.navigateTo({
+											// 				url: `/pages5/webview/detaillink?url=${webViewUrl}`
+											// 			})
+											// 		})
+											// 	// #endif
+											// } else {
+											// 	uni.navigateTo({
+											// 		url: `/pages3/polyv/detail?id=${
+											// 		          res.data.rows[0].courseId
+											// 		        }&goodsId=${item.goodsId}&orderGoodsId=${
+											// 		          item.orderGoodsId
+											// 		        }&gradeId=${item.gradeId}&periodWaitTime=${
+											// 		          item.periodWaitTime ? "" : 1
+											// 		        }&isQ=${item.orderYear ? 1 : ""}`,
+											// 	});
+											// }
+											uni.navigateTo({
+												url: `/pages3/polyv/detail?id=${
+																                  res.data.rows[0].courseId
+																                }&goodsId=${item.goodsId}&orderGoodsId=${
+																                  item.orderGoodsId
+																                }&gradeId=${item.gradeId}&periodWaitTime=${
+																                  item.periodWaitTime ? "" : 1
+																                }`,
+											});
+										} else {
+											uni.showToast({
+												icon: "none",
+												title: "暂无可观看的视频课程",
+											});
+										}
+									}
+								})
+								.finally((e) => {});
 						}
 					});
 				});

+ 32 - 2
pages3/course/detail.vue

@@ -828,10 +828,38 @@
 				}
 				return str;
 			},
-			buy() {
+			ordercheckbuy(id) {
+				return new Promise((resolve) => {
+					this.$api
+						.ordercheckbuy(id)
+						.then((res) => {
+							console.log(res);
+							if (res.data.data) {
+								uni.showModal({
+									title: "提示",
+									content: "当前课程已满员,详情请联系客服电话:020-87085983",
+									cancelText: "取消",
+									confirmText: "确定",
+									success: (res) => {},
+								});
+							}
+							resolve(!res.data.data);
+						})
+						.catch((err) => {
+							this.$message({
+								type: "warning",
+								message: err.msg,
+							});
+							resolve(true);
+						});
+				});
+			},
+			async buy() {
 				if (this.$method.isGoLogin()) {
 					return;
 				}
+				let canbuy = await this.ordercheckbuy(this.detail.goodsId);
+				if (!canbuy) return;
 				// 判断有没有规格选择
 				if (this.detail.specTemplateId) {
 					this.isCarOrBuy = 2;
@@ -874,10 +902,12 @@
 						}
 					});
 			},
-			addCart() {
+			async addCart() {
 				if (this.$method.isGoLogin()) {
 					return;
 				}
+				let canbuy = await this.ordercheckbuy(this.detail.goodsId);
+				if (!canbuy) return;
 				// 判断有没有规格选择
 				if (this.detail.specTemplateId) {
 					this.isCarOrBuy = 1;

+ 14 - 0
pages3/polyv/detail.vue

@@ -1583,6 +1583,7 @@
 								this.closeCamera();
 								return
 							} else if (code == 557 || code == 5581 || code == 5591) {
+								this.abnormal(data);
 								this.refPlv.playPause();
 								this.refPlv.exitFullScreen();
 								this.CountTo2 = 180;
@@ -1602,6 +1603,7 @@
 								}, 1000);
 								return
 							} else if (code == 558) {
+								this.abnormal(data);
 								this.CountTo1 = msg.split(",")[1];
 								this.noticeShow1 = true;
 								var timer = setInterval(() => {
@@ -1621,6 +1623,7 @@
 									duration: 2000,
 								});
 								if (code == 559) {
+									this.abnormal(data);
 									this.isReach = true;
 									this.openCamera()
 								}
@@ -1632,6 +1635,17 @@
 							this.studyRecordMenuAllList();
 						});
 				});
+			},
+			 //异常记录
+			abnormal(data) {
+				this.$api
+					.abnormal(data)
+					.then((res) => {
+						
+					})
+					.catch((err) => {
+						 console.log(err, "err");
+					});
 			},
 			resetSection() {
 				if (this.CountTo2Times) {