Quellcode durchsuchen

Merge branch 'dev' of http://120.79.166.78:19005/zhongzheng-edu/saas_miniprogram into dev

xiexaing vor 1 Jahr
Ursprung
Commit
c0c1531be7
4 geänderte Dateien mit 359 neuen und 333 gelöschten Zeilen
  1. 1 1
      common/compressPhoto.js
  2. 17 13
      components/popup/camera.vue
  3. 17 14
      pages/course/index.vue
  4. 324 305
      pages2/learn/details.vue

+ 1 - 1
common/compressPhoto.js

@@ -77,7 +77,7 @@ function myCompressImage(url, limitSize = 2048) {
     }
     const size = url.size;
     if (size < limitSize) {
-      return _resolve(url);
+      return _resolve(url.path);
     }
     num++;
     const quality = limitSize / size;

+ 17 - 13
components/popup/camera.vue

@@ -8,9 +8,9 @@
 				<view class="photoCenter">
 					<view class="center_camera" v-if="isTaking">
 						<!-- #ifdef MP-WEIXIN -->
-						<camera device-position="front" flash="off" @error="error" style="width: 100%; height: 100%">
+						<camera device-position="front" flash="off" @error="error" style="width: 400px; height: 400px;margin: 0 auto;">
 							<!-- 加人脸框 -->
-							<cover-view class="head_take">
+							<cover-view class="head_take" v-if="false">
 								<cover-view class="headTake_up color"></cover-view>
 								<cover-view class="headTake_minddle">
 									<cover-view class="min_left color"></cover-view>
@@ -22,8 +22,8 @@
 						</camera>
 						<!-- #endif -->
 						<!-- #ifdef H5 -->
-						<video :controls="false" id="video" width="400" height="300" class="photo_v"></video>
-						<view class="mask"></view>
+						<video :controls="false" id="video" width="400" height="400" class="photo_v"></video>
+						<view class="mask" v-if="false"></view>
 						<!-- #endif -->
 					</view>
 					<view class="custom" v-if="!isTaking">
@@ -122,7 +122,7 @@
 				this.uploadLock = true;
 				let imgUrl = await this.imageInfos()
 				let compareFaceData = await this.faceRecognition(imgUrl);
-				if (compareFaceData >= 80) {
+				if (compareFaceData >= 70) {
 					this.$emit("submitPhoto",imgUrl, compareFaceData);
 				} else {
 					uni.showToast({
@@ -201,7 +201,7 @@
 					this.getUserMedia({
 							video: {
 								width: 400,
-								height: 300,
+								height: 400,
 								facingMode: "user",
 							},
 						},
@@ -280,7 +280,7 @@
 				this.getUserMedia({
 						video: {
 							width: 400,
-							height: 300,
+							height: 400,
 							facingMode: "user",
 						},
 					},
@@ -472,7 +472,7 @@
 				width: 100%;
 				height: 75vh;
 				position: fixed;
-
+				background-color: rgba(0,0,0,.8);
 				.head_take {
 					width: 100%;
 					height: 75vh;
@@ -511,8 +511,10 @@
 				}
 
 				.photo_v {
-					width: 100%;
-					height: 100%;
+					display: block;
+					margin: 0 auto;
+					width: 400px;
+					height: 400px;
 				}
 
 				.mask {
@@ -535,10 +537,12 @@
 				z-index: 1000;
 				top: 0;
 				left: 0;
-
+				background-color: rgba(0,0,0,.8);
 				image {
-					width: 100%;
-					height: 100%;
+					display: block;
+					margin: 0 auto;
+					width: 400px;
+					height: 400px;
 				}
 			}
 		}

+ 17 - 14
pages/course/index.vue

@@ -75,7 +75,7 @@
 		},
 		data() {
 			return {
-				backTopBtn:false,
+				backTopBtn: false,
 				scrollTop: 0,
 				courseLists: [{
 						name: "课程",
@@ -125,6 +125,9 @@
 			// }, 500);
 		},
 		onLoad(option) {
+			if (option.current) {
+				this.$store.state.current = Number(option.current)
+			}
 			uni.hideTabBar();
 			this.initList()
 			uni.$on('backTop', res => {
@@ -155,11 +158,11 @@
 			}
 		},
 		computed: {
-			...mapGetters(["current","hideBuyState"])
+			...mapGetters(["current", "hideBuyState"])
 		},
 		methods: {
 			backFunc(item) {
-				console.log('asd',item)
+				console.log('asd', item)
 				this.activeData = item
 				this.search()
 			},
@@ -196,17 +199,17 @@
 				this.$store.state.current = e
 			},
 			initList() {
-				if(!this.hideBuyState){
-				this.$api.goodsList({
-					...this.formData,
-					...this.activeData,
-					educationTypeId: this.activeData.educationId,
-					goodsName: this.formData.goodsName,
-					goodsType: this.courseLists[this.$store.state.current].type
-				}).then((res) => {
-					this.goodsList = this.goodsList.concat(res.data.rows)
-					this.total = res.data.total
-				});
+				if (!this.hideBuyState) {
+					this.$api.goodsList({
+						...this.formData,
+						...this.activeData,
+						educationTypeId: this.activeData.educationId,
+						goodsName: this.formData.goodsName,
+						goodsType: this.courseLists[this.$store.state.current].type
+					}).then((res) => {
+						this.goodsList = this.goodsList.concat(res.data.rows)
+						this.total = res.data.total
+					});
 				}
 			},
 

+ 324 - 305
pages2/learn/details.vue

@@ -1,23 +1,18 @@
 <template>
-  <view class="safeArea">
-    <nav-bar title="详情"></nav-bar>
-    <view class="detailsWrap">
-      <view class="topTitle">
-        <u-icon
-          name="info-circle-fill"
-          style="color: #ff3b30; margin-right: 8rpx"
-        ></u-icon>
-        <text
-          >您的学时审核不通过,不通过原因如下,请查阅,并重学不通过的课程内容。</text
-        >
-        <!-- <view style="margin-left:34rpx;">致电<text @click="call">020-87085982</text>咨询</view> -->
-      </view>
-      <view class="detailsItem" v-for="(item, index) in listData" :key="index">
-        <view class="head">
-          <view class="tap">{{ getTypeName(item.sectionType) }}</view>
-          <view class="title">{{ item.name }}</view>
-        </view>
-        <!-- <u-line color="#EEEEEE" />
+	<view class="safeArea">
+		<nav-bar title="详情"></nav-bar>
+		<view class="detailsWrap">
+			<view class="topTitle">
+				<u-icon name="info-circle-fill" style="color: #ff3b30; margin-right: 8rpx"></u-icon>
+				<text>您的学时审核不通过,不通过原因如下,请查阅,并重学不通过的课程内容。</text>
+				<!-- <view style="margin-left:34rpx;">致电<text @click="call">020-87085982</text>咨询</view> -->
+			</view>
+			<view class="detailsItem" v-for="(item, index) in listData" :key="index">
+				<view class="head">
+					<view class="tap">{{ getTypeName(item.sectionType) }}</view>
+					<view class="title">{{ item.name }}</view>
+				</view>
+				<!-- <u-line color="#EEEEEE" />
 				<view class="info">
 					<view class="item" v-for="(items, indexs) in item.userStudyRecordPhoto" :key="indexs">
 						<view class="imgbox">
@@ -26,300 +21,324 @@
 						<view class="time">{{ $method.timestampToTime(items.createTime, false) }}</view>
 					</view>
 				</view> -->
-        <u-line color="#EEEEEE" />
-        <view class="reason">
-          <view class="label">原因:</view>
-          <view class="val">{{ item.auditReason }}</view>
-        </view>
-      </view>
-    </view>
-    <view class="btn" @click="getBtn" v-if="rebuildShow">确认已阅读</view>
-  </view>
+				<u-line color="#EEEEEE" />
+				<view class="reason">
+					<view class="label">原因:</view>
+					<view class="val">{{ item.auditReason }}</view>
+				</view>
+			</view>
+		</view>
+		<view class="btn" @click="getBtn" v-if="rebuildShow">确认已阅读</view>
+	</view>
 </template>
 
 <script>
-import { mapGetters } from "vuex";
-export default {
-  components: {},
-  data() {
-    return {
-      goodsId: null,
-      gradeId: null,
-      listData: [],
-      orderGoodsId: "",
-      rebuildShow: false,
-      lock: false,
-    };
-  },
-  onLoad(option) {
-    this.orderGoodsId = option.orderGoodsId || "";
-    this.goodsId = Number(option.goodsId);
-    this.gradeId = Number(option.gradeId);
-  },
-  onShow() {
-    if (this.$method.isGoLogin()) {
-      // 从公众号消息进来的没登录需要跳到登录页,登录后返回
-      return;
-    }
-    this.getInfo();
-    this.orderInfo();
-  },
-  methods: {
-    orderInfo() {
-      this.$api
-        .orderInfo({
-          orderGoodsId: this.orderGoodsId,
-        })
-        .then((res) => {
-          console.log(res);
-          if (res.data.code == 200) {
-            let sysTime = this.$method.timest();
-            console.log(res.data.data.serviceEndTime);
-            console.log(sysTime);
+	import {
+		mapGetters
+	} from "vuex";
+	export default {
+		components: {},
+		data() {
+			return {
+				goodsId: null,
+				gradeId: null,
+				listData: [],
+				orderGoodsId: "",
+				rebuildShow: false,
+				lock: false,
+			};
+		},
+		onLoad(option) {
+			this.orderGoodsId = option.orderGoodsId || "";
+			this.goodsId = Number(option.goodsId);
+			this.gradeId = Number(option.gradeId);
+		},
+		onShow() {
+			if (this.$method.isGoLogin()) {
+				// 从公众号消息进来的没登录需要跳到登录页,登录后返回
+				return;
+			}
+			this.getInfo();
+			this.orderInfo();
+		},
+		methods: {
+			orderInfo() {
+				this.$api
+					.orderInfo({
+						orderGoodsId: this.orderGoodsId,
+					})
+					.then((res) => {
+						console.log(res);
+						if (res.data.code == 200) {
+							let sysTime = this.$method.timest();
+							console.log(res.data.data.serviceEndTime);
+							console.log(sysTime);
 
-            if (
-              res.data.data.serviceEndTime &&
-              res.data.data.serviceEndTime > +sysTime
-            ) {
-              //学习有效期范围内
-              this.rebuildShow = true;
-            } else {
-              //不在学校有效期范围内隐藏
-              this.rebuildShow = false;
-              return;
-            }
+							if (
+								res.data.data.serviceEndTime &&
+								res.data.data.serviceEndTime > +sysTime
+							) {
+								//学习有效期范围内
+								this.rebuildShow = true;
+							} else {
+								//不在学校有效期范围内隐藏
+								this.rebuildShow = false;
+								return;
+							}
 
-            if (res.data.data.classEndTime) {
-              //配了班级有效期
+							if (res.data.data.classEndTime) {
+								//配了班级有效期
 
-              if (res.data.data.classEndTime > +sysTime) {
-                //班级有效期没过期
-                this.rebuildShow = true;
-              } else {
-                //过期
-                this.rebuildShow = false;
-                return;
-              }
-            } else {
-              //没配按学习有效期
-            }
-          }
-        });
-    },
-    seePhoto(option, index) {
-      var arrays = option.map((item, indexs) => {
-        return this.$method.splitImgHost(item.photo) + `?${indexs}`;
-      });
-      uni.previewImage({
-        current: index,
-        urls: arrays,
-      });
-    },
-    getInfo() {
-      this.$api
-        .getcourseperiodcheat({
-          goodsId: this.goodsId,
-          gradeId: this.gradeId,
-          orderGoodsId: this.orderGoodsId,
-        })
-        .then((res) => {
-          if (res.data.code === 200) {
-            this.listData = res.data.rows;
-          }
-        });
-    },
-    //重学
-    getBtn() {
-      if (this.lock) {
-        return;
-      }
-      this.lock = true;
-      var self = this;
-      self.$api
-        .courseperiodrebuild({
-          goodsId: self.goodsId,
-          gradeId: self.gradeId,
-          orderGoodsId: self.orderGoodsId,
-        })
-        .then((res) => {
-          if (res.data.code === 200) {
-            this.$http({
-              url: "/course/courseList",
-              method: "get",
-              data: {
-                pageNum: 1,
-                pageSize: 100,
-                goodsId: this.goodsId,
-                gradeId: this.gradeId,
-                orderGoodsId: this.orderGoodsId,
-              },
-            }).then((res) => {
-              this.lock = false;
-              if (res.data.code == 200) {
-                if (res.data.total > 1) {
-                  uni.redirectTo({
-                    url: `/pages3/polyv/detail?id=''&goodsId=${this.goodsId}&orderGoodsId=${this.orderGoodsId}&gradeId=${this.gradeId}`,
-                  });
-                } else if (res.data.total == 1) {
-                  uni.redirectTo({
-                    url: `/pages3/polyv/detail?id=${res.data.rows[0].courseId}&goodsId=${this.goodsId}&orderGoodsId=${this.orderGoodsId}&gradeId=${this.gradeId}`,
-                  });
-                } else {
-                  uni.showToast({
-                    icon: "none",
-                    title: "暂无可观看的视频课程",
-                  });
-                }
-              }
-            });
-            // uni.navigateTo({
-            //   url: `/pages3/polyv/detail?id=''&goodsId=${this.goodsId}&orderGoodsId=${this.orderGoodsId}&gradeId=${this.gradeId}`
-            // })
-          }
-        })
-        .catch((err) => {
-          this.lock = false;
-        }); // uni.showModal({
-      // 	title:"注意",
-      // 	content:`如对审核结果有异议,请勿点击确认重学。致电020-87085982咨询`,
-      // 	confirmText:"确认重学",
-      // 	success:function(res){
-      // 		if(res.confirm){
-      // 			self.$api.courseperiodrebuild({
-      // 				goodsId: self.goodsId,
-      // 				gradeId: self.gradeId,
-      // 				orderGoodsId:self.orderGoodsId
-      // 			}).then(res => {
-      // 				if(res.data.code === 200){
-      // 					uni.redirectTo({
-      // 						url: '/pages2/wd/course?gid='+self.gradeId+'&id=' + self.goodsId+'&orderGoodsId='+ self.orderGoodsId
-      // 					})
-      // 				}
-      // 			})
-      // 		}
-      // 	}
-      // })
-    },
-    getTypeName(int) {
-      if (int === 0) {
-        return "试卷";
-      }
-      if (int === 1) {
-        return "视频";
-      }
-      if (int === 2) {
-        return "直播";
-      }
-      if (int === 3) {
-        return "回放";
-      }
-    },
-    call() {
-      uni.makePhoneCall({
-        phoneNumber: "020-87085982",
-      });
-    },
-  },
-  onReachBottom() {},
-  computed: { ...mapGetters(["userInfo"]) },
-};
+								if (res.data.data.classEndTime > +sysTime) {
+									//班级有效期没过期
+									this.rebuildShow = true;
+								} else {
+									//过期
+									this.rebuildShow = false;
+									return;
+								}
+							} else {
+								//没配按学习有效期
+							}
+						}
+					});
+			},
+			seePhoto(option, index) {
+				var arrays = option.map((item, indexs) => {
+					return this.$method.splitImgHost(item.photo) + `?${indexs}`;
+				});
+				uni.previewImage({
+					current: index,
+					urls: arrays,
+				});
+			},
+			getInfo() {
+				this.$api
+					.getcourseperiodcheat({
+						goodsId: this.goodsId,
+						gradeId: this.gradeId,
+						orderGoodsId: this.orderGoodsId,
+					})
+					.then((res) => {
+						if (res.data.code === 200) {
+							this.listData = res.data.rows;
+						}
+					});
+			},
+			//重学
+			getBtn() {
+				if (this.lock) {
+					return;
+				}
+				this.lock = true;
+				var self = this;
+				self.$api
+					.courseperiodrebuild({
+						goodsId: self.goodsId,
+						gradeId: self.gradeId,
+						orderGoodsId: self.orderGoodsId,
+					})
+					.then((res) => {
+						if (res.data.code === 200) {
+							this.$http({
+								url: "/course/courseList",
+								method: "get",
+								data: {
+									pageNum: 1,
+									pageSize: 100,
+									goodsId: this.goodsId,
+									gradeId: this.gradeId,
+									orderGoodsId: this.orderGoodsId,
+								},
+							}).then((result) => {
+								this.lock = false;
+								if (result.data.code == 200) {
+									if (result.data.total > 1) {
+										uni.redirectTo({
+											url: `/pages3/polyv/detail?id=''&goodsId=${this.goodsId}&orderGoodsId=${this.orderGoodsId}&gradeId=${this.gradeId}`,
+										});
+									} else if (result.data.total == 1) {
+										uni.redirectTo({
+											url: `/pages3/polyv/detail?id=${result.data.rows[0].courseId}&goodsId=${this.goodsId}&orderGoodsId=${this.orderGoodsId}&gradeId=${this.gradeId}`,
+										});
+									} else {
+										uni.showToast({
+											icon: "none",
+											title: "暂无可观看的视频课程",
+										});
+									}
+								}
+							});
+							// uni.navigateTo({
+							//   url: `/pages3/polyv/detail?id=''&goodsId=${this.goodsId}&orderGoodsId=${this.orderGoodsId}&gradeId=${this.gradeId}`
+							// })
+						} else {
+							uni.showModal({
+								showCancel: false,
+								title: "提示",
+								content: res.data.msg,
+								success: (resultst) => {
+									uni.navigateBack();
+								},
+							});
+							this.lock = false;
+						}
+					})
+					.catch((err) => {
+						this.lock = false;
+					}); // uni.showModal({
+				// 	title:"注意",
+				// 	content:`如对审核结果有异议,请勿点击确认重学。致电020-87085982咨询`,
+				// 	confirmText:"确认重学",
+				// 	success:function(res){
+				// 		if(res.confirm){
+				// 			self.$api.courseperiodrebuild({
+				// 				goodsId: self.goodsId,
+				// 				gradeId: self.gradeId,
+				// 				orderGoodsId:self.orderGoodsId
+				// 			}).then(res => {
+				// 				if(res.data.code === 200){
+				// 					uni.redirectTo({
+				// 						url: '/pages2/wd/course?gid='+self.gradeId+'&id=' + self.goodsId+'&orderGoodsId='+ self.orderGoodsId
+				// 					})
+				// 				}
+				// 			})
+				// 		}
+				// 	}
+				// })
+			},
+			getTypeName(int) {
+				if (int === 0) {
+					return "试卷";
+				}
+				if (int === 1) {
+					return "视频";
+				}
+				if (int === 2) {
+					return "直播";
+				}
+				if (int === 3) {
+					return "回放";
+				}
+			},
+			call() {
+				uni.makePhoneCall({
+					phoneNumber: "020-87085982",
+				});
+			},
+		},
+		onReachBottom() {},
+		computed: {
+			...mapGetters(["userInfo"])
+		},
+	};
 </script>
 <style>
-page {
-  background: #eaeef1;
-}
+	page {
+		background: #eaeef1;
+	}
 </style>
 <style scoped lang="scss">
-.detailsWrap {
-  padding: 8rpx 8rpx 140rpx;
-}
-.topTitle {
-  border-radius: 24rpx;
-  background-color: #ffebea;
-  padding: 10rpx 24rpx;
-  color: #ff3b30;
-  font-size: 24rpx;
-  margin-bottom: 8rpx;
-}
-.detailsItem {
-  background: #ffffff;
-  border-radius: 16rpx;
-  margin-bottom: 16rpx;
-  .head {
-    padding: 26rpx 24rpx;
-    display: flex;
-    font-size: 30rpx;
-    font-family: PingFang SC;
-    font-weight: bold;
-    color: #666666;
-    .tap {
-      width: 56rpx;
-      height: 28rpx;
-      line-height: 26rpx;
-      text-align: center;
-      border: 2rpx solid #666666;
-      border-radius: 8rpx;
-      font-size: 20rpx;
-      font-family: PingFang SC;
-      font-weight: 400;
-      color: #666666;
-      margin-right: 8rpx;
-      flex-shrink: 0;
-      position: relative;
-      top: 6rpx;
-    }
-  }
-  .info {
-    padding: 17rpx 24rpx;
-    display: flex;
-    flex-wrap: wrap;
-    .item {
-      width: 160rpx;
-      font-size: 20rpx;
-      font-family: PingFang SC;
-      font-weight: 500;
-      color: #666666;
-      margin: 0 8rpx 16rpx 0;
-      .imgbox {
-        width: 160rpx;
-        height: 160rpx;
-        border-radius: 8px;
-        overflow: hidden;
-        margin-bottom: 7rpx;
-      }
-    }
-  }
-  .reason {
-    display: flex;
-    padding: 21rpx 24rpx;
-    font-size: 30rpx;
-    font-family: PingFang SC;
-    font-weight: 500;
-    color: #333333;
-    .label {
-      color: #666666;
-    }
+	.detailsWrap {
+		padding: 8rpx 8rpx 140rpx;
+	}
 
-    .val {
-      flex: 1;
-    }
-  }
-}
-.btn {
-  width: 526rpx;
-  height: 80rpx;
-  background: #007aff;
-  border-radius: 40rpx;
-  font-size: 30rpx;
-  font-family: PingFang SC;
-  font-weight: bold;
-  color: #ffffff;
-  display: flex;
-  justify-content: center;
-  align-items: center;
-  position: fixed;
-  left: 50%;
-  margin-left: -263rpx;
-  bottom: 50rpx;
-}
-</style>
+	.topTitle {
+		border-radius: 24rpx;
+		background-color: #ffebea;
+		padding: 10rpx 24rpx;
+		color: #ff3b30;
+		font-size: 24rpx;
+		margin-bottom: 8rpx;
+	}
+
+	.detailsItem {
+		background: #ffffff;
+		border-radius: 16rpx;
+		margin-bottom: 16rpx;
+
+		.head {
+			padding: 26rpx 24rpx;
+			display: flex;
+			font-size: 30rpx;
+			font-family: PingFang SC;
+			font-weight: bold;
+			color: #666666;
+
+			.tap {
+				width: 56rpx;
+				height: 28rpx;
+				line-height: 26rpx;
+				text-align: center;
+				border: 2rpx solid #666666;
+				border-radius: 8rpx;
+				font-size: 20rpx;
+				font-family: PingFang SC;
+				font-weight: 400;
+				color: #666666;
+				margin-right: 8rpx;
+				flex-shrink: 0;
+				position: relative;
+				top: 6rpx;
+			}
+		}
+
+		.info {
+			padding: 17rpx 24rpx;
+			display: flex;
+			flex-wrap: wrap;
+
+			.item {
+				width: 160rpx;
+				font-size: 20rpx;
+				font-family: PingFang SC;
+				font-weight: 500;
+				color: #666666;
+				margin: 0 8rpx 16rpx 0;
+
+				.imgbox {
+					width: 160rpx;
+					height: 160rpx;
+					border-radius: 8px;
+					overflow: hidden;
+					margin-bottom: 7rpx;
+				}
+			}
+		}
+
+		.reason {
+			display: flex;
+			padding: 21rpx 24rpx;
+			font-size: 30rpx;
+			font-family: PingFang SC;
+			font-weight: 500;
+			color: #333333;
+
+			.label {
+				color: #666666;
+			}
+
+			.val {
+				flex: 1;
+			}
+		}
+	}
+
+	.btn {
+		width: 526rpx;
+		height: 80rpx;
+		background: #007aff;
+		border-radius: 40rpx;
+		font-size: 30rpx;
+		font-family: PingFang SC;
+		font-weight: bold;
+		color: #ffffff;
+		display: flex;
+		justify-content: center;
+		align-items: center;
+		position: fixed;
+		left: 50%;
+		margin-left: -263rpx;
+		bottom: 50rpx;
+	}
+</style>