瀏覽代碼

feat: 新增人脸框

xuqiaoying 3 年之前
父節點
當前提交
3c2ed289e7
共有 5 個文件被更改,包括 190 次插入77 次删除
  1. 9 9
      pages/learn/index.vue
  2. 60 15
      pages2/class/questionBank.vue
  3. 1 1
      pages2/verify/input.vue
  4. 53 7
      pages3/live/detail.vue
  5. 67 45
      pages3/polyv/detail.vue

+ 9 - 9
pages/learn/index.vue

@@ -718,16 +718,16 @@ export default {
 				title: '拼命加载中...',
 				mask:true,
 			})
-			var confirmDetail = true;
-			if (item.educationName == '继续教育') { 
-				if(item.officialName && item.businessName == '二级' && item.projectName == '建造师') { 
-					confirmDetail = await this.userConfirmInfoDetail()
-				}
-			}
+			// var confirmDetail = true;
+			// if (item.educationName == '继续教育') { 
+			// 	if(item.officialName && item.businessName == '二级' && item.projectName == '建造师') { 
+			// 		confirmDetail = await this.userConfirmInfoDetail()
+			// 	}
+			// }
 			
-			if(!confirmDetail) {
-				return;
-			}
+			// if(!confirmDetail) {
+			// 	return;
+			// }
 
 			this.itemIndex = index
 			if (item.gradeStatus == 1 && item.status == 1 && (item.serviceEndTime > this.sysTime) && (item

+ 60 - 15
pages2/class/questionBank.vue

@@ -783,7 +783,7 @@
           </view>
           <view class="photoCenter">
             <view
-              style="width: 100%; height: 979rpx; position: fixed"
+              class="center_camera"
               v-if="photoPopup && isTaking"
             >
               <camera
@@ -791,7 +791,18 @@
                 flash="off"
                 @error="error"
                 style="width: 100%; height: 100%"
-              ></camera>
+              >
+                <!-- 加人脸框 -->
+                <cover-view class="head_take">
+                  <cover-view class="headTake_up color"></cover-view>
+                  <cover-view class="headTake_minddle">
+                    <cover-view class="min_left color"></cover-view>
+                    <cover-view class="min_img"></cover-view>
+                    <cover-view class="min_right color"></cover-view>
+                  </cover-view>
+                  <cover-view class="headTake_down color"></cover-view>
+                </cover-view>
+              </camera>
             </view>
             <view class="custom" v-if="!isTaking"
               ><image :src="avatarUrl" mode=""></image
@@ -2601,33 +2612,67 @@ export default {
 <style lang="scss" scoped>
 .photoBox {
   background-color: #ffffff;
-  border-radius: 32px 32px 0px 0px;
+  border-radius: 24px 24px 0px 0px;
   .photoTop {
-    height: 74upx;
+    height: 74rpx;
     display: flex;
     align-items: center;
-    justify-content: space-between;
-    padding: 0upx 38upx;
+    justify-content: center;
+    padding: 0rpx 38rpx;
     .sqzz {
-      width: 28upx;
-      height: 28upx;
+      width: 28rpx;
+      height: 28rpx;
       display: flex;
       align-items: center;
       justify-content: center;
     }
     .centersq {
       color: #333;
-      font-size: 30upx;
+      font-size: 30rpx;
       font-weight: 500;
     }
   }
   .photoCenter {
-    width: 750upx;
-    height: 979upx;
+    width: 750rpx;
+    height: 75vh;
     position: relative;
+    .center_camera {
+      width: 100%;
+      height: 75vh;
+      // position: fixed;
+      .head_take {
+        width: 100%;
+        height: 75vh;
+        display: flex;
+        flex-direction: column;
+      }
+      .headTake_up {
+        width: 100%;
+        height: 100rpx;
+      }
+      .headTake_minddle {
+        display: flex;
+        .min_img {
+          width: 500rpx;
+          height: 550rpx;
+        }
+        .min_left, .min_right {
+          flex: 1;
+          height: 550rpx;
+        }
+      }
+      .headTake_down {
+        width: 100%;
+        flex: 1;
+      }
+      .color {
+        background-color: #333;
+        opacity: 0.5;
+      }
+    }
     .custom {
-      width: 750upx;
-      height: 979upx;
+      width: 750rpx;
+      height: 75vh;
       position: absolute;
       z-index: 1000;
       top: 0;
@@ -2647,9 +2692,9 @@ export default {
       width: 100%;
       background-color: #07c160;
       text-align: center;
-      line-height: 100upx;
+      line-height: 100rpx;
       color: #fff;
-      font-size: 32upx;
+      font-size: 32rpx;
       font-weight: bold;
     }
   }

+ 1 - 1
pages2/verify/input.vue

@@ -1944,7 +1944,7 @@ page {
   border: 2rpx solid #eeeeee;
   border-radius: 24rpx;
   width: 100%;
-  height: 300rpx;
+  height: 400rpx;
   overflow: hidden;
 }
 .headerSDels {

+ 53 - 7
pages3/live/detail.vue

@@ -513,7 +513,7 @@
           </view>
           <view class="photoCenter">
             <view
-              style="width: 100%; height: 979rpx; position: fixed"
+              class="center_camera"
               v-if="photoPopup && isTaking"
             >
               <camera
@@ -521,7 +521,18 @@
                 flash="off"
                 @error="error"
                 style="width: 100%; height: 100%"
-              ></camera>
+              >
+                <!-- 加人脸框 -->
+                <cover-view class="head_take">
+                  <cover-view class="headTake_up color"></cover-view>
+                  <cover-view class="headTake_minddle">
+                    <cover-view class="min_left color"></cover-view>
+                    <cover-view class="min_img"></cover-view>
+                    <cover-view class="min_right color"></cover-view>
+                  </cover-view>
+                  <cover-view class="headTake_down color"></cover-view>
+                </cover-view>
+              </camera>
             </view>
             <view class="custom" v-if="!isTaking"
               ><image :src="avatarUrl" mode=""></image
@@ -836,7 +847,8 @@ export default {
     // 查询用户最后一次看的录播的信息
     getUserWatchLast() {
       this.$http({
-        url: '/study/record/getUserWatchLast',
+        // url: '/study/record/getUserWatchLast',
+        url: '/study/record/queryLiveLast',
         method: 'get',
         data: {
           goodsId: this.goodsId
@@ -2414,12 +2426,12 @@ export default {
 }
 .photoBox {
   background-color: #ffffff;
-  border-radius: 32px 32px 0px 0px;
+  border-radius: 24px 24px 0px 0px;
   .photoTop {
     height: 74rpx;
     display: flex;
     align-items: center;
-    justify-content: space-between;
+    justify-content: center;
     padding: 0rpx 38rpx;
     .sqzz {
       width: 28rpx;
@@ -2436,11 +2448,45 @@ export default {
   }
   .photoCenter {
     width: 750rpx;
-    height: 979rpx;
+    height: 75vh;
     position: relative;
+    .center_camera {
+      width: 100%;
+      height: 75vh;
+      // position: fixed;
+      .head_take {
+        width: 100%;
+        height: 75vh;
+        display: flex;
+        flex-direction: column;
+      }
+      .headTake_up {
+        width: 100%;
+        height: 100rpx;
+      }
+      .headTake_minddle {
+        display: flex;
+        .min_img {
+          width: 500rpx;
+          height: 550rpx;
+        }
+        .min_left, .min_right {
+          flex: 1;
+          height: 550rpx;
+        }
+      }
+      .headTake_down {
+        width: 100%;
+        flex: 1;
+      }
+      .color {
+        background-color: #333;
+        opacity: 0.5;
+      }
+    }
     .custom {
       width: 750rpx;
-      height: 979rpx;
+      height: 75vh;
       position: absolute;
       z-index: 1000;
       top: 0;

+ 67 - 45
pages3/polyv/detail.vue

@@ -492,7 +492,7 @@
           </view>
           <view class="photoCenter">
             <view
-              style="width: 100%; height: 979rpx; position: fixed"
+              class="center_camera"
               v-if="photoPopup && isTaking"
             >
               <camera
@@ -501,8 +501,15 @@
                 @error="error"
                 style="width: 100%; height: 100%"
               >
+                <!-- 加人脸框 -->
                 <cover-view class="head_take">
-                  <cover-view class="head_img"></cover-view>
+                  <cover-view class="headTake_up color"></cover-view>
+                  <cover-view class="headTake_minddle">
+                    <cover-view class="min_left color"></cover-view>
+                    <cover-view class="min_img"></cover-view>
+                    <cover-view class="min_right color"></cover-view>
+                  </cover-view>
+                  <cover-view class="headTake_down color"></cover-view>
                 </cover-view>
               </camera>
             </view>
@@ -859,6 +866,7 @@ export default {
         }
       }).then((res) => {
         if (res.data.code == 200) {
+          this.sectionItem = res.data.data
           if (res.data.data && Object.keys(res.data.data).length) { //有最后一次看的录播的信息
             this.courseId = res.data.data.courseId
             console.log('查询用户最后一次看的录播的信息', res.data, this.courseId)
@@ -1007,7 +1015,7 @@ export default {
         this.postStudyRecord(0, oldSectionId);
       });
       uni.$on("getSection", (item) => {
-        console.log('清除直播===',item, item.recordingUrl)
+        console.log('清除====',item, item.recordingUrl)
         //清除直播
           this.hasStart = false;
         this.isPlayRebuild = item.rebuild;
@@ -1053,7 +1061,6 @@ export default {
     originUnload() {
       if (this.playSectionId > 0 && this.hasStart) {
         //退出提交记录
-        console.log('退出提交记录sfhasdoufsou敖德萨所多', this.courseId)
         this.postStudyRecord();
       }
       //清除正在播放的节ID
@@ -1086,30 +1093,7 @@ export default {
     closePop() {
       this.toggleCourseShow = false
     },
-    //切换老师
-    // switchTeacher(data, tindex){
-    //     console.log(data,'data');
-    //     this.teaIndex = tindex
-    //     this.goodsTeacher.forEach((item,index) => {
-    //         if(item.teaList && item.teaList.length > 0){
-    //            let list = item.teaList.filter(x => x.courseId == data.courseId)
-    //            if(list && list.length > 0){
-    //               item.courseList.forEach((course,courseIndex) => {
-    //                   if(course.courseId == data.courseId){
-    //                     console.log(index,'index');
-    //                      console.log(courseIndex,'courseIndex');
-    //                     this.$set(this.goodsTeacher[index].courseList[courseIndex],"show",1)
-    //                   }else{
-    //                     this.$set(this.goodsTeacher[index].courseList[courseIndex],"show",0)
-    //                   }
-    //               })
-    //            }
-    //         }
-    //     })
-    //     console.log('切换后的this.goodsTeacher, ', this.goodsTeacher)
-    // },
     async activeFunc(item, index) {
-      console.log('item', item, this.goodsTeacher)
       this.teacherIndex = index
       let findResult = ''
       this.goodsTeacher.forEach((citem,index) => {
@@ -1378,8 +1362,22 @@ export default {
 						this.playVideo(res.data.data)
 					}
 					
+          // 查询用户最后一次看的录播的信息
+          // this.$http({
+          //   url: '/study/record/getUserWatchLast',
+          //   method: 'get',
+          //   data: {
+          //     orderGoodsId: this.orderGoodsId,
+          //   }
+          // }).then((res) => {
+          //   if (res.data.code == 200) {
+          //     this.sectionItem = res.data.data  
+          //   }
+          // })
+
 				}
 			})
+
 		},
     /**
      * 模块大节播放完毕,刷新列表
@@ -1877,7 +1875,9 @@ export default {
     configPhoto() {
       var polyvPlayerContext = this.selectComponent("#playerVideo");
       let totalVideoTime = polyvPlayerContext.getDuration();
+      // console.log('totalVideoTime总时长:', totalVideoTime, 'this.photoList:', this.photoList)
       let duration = polyvPlayerContext.getCurrentTime();
+      // console.log('取当前播放的时间点:', duration)
       let photoNum = this.photoNum;
       if (!this.photoConfig) {
         this.photoConfig = true;
@@ -2548,11 +2548,11 @@ export default {
       });
     },
     timeEvent() {
-      let self = this;
       var polyvPlayerContext = this.selectComponent("#playerVideo");
       if (polyvPlayerContext != null) {
         this.playTime = polyvPlayerContext.getCurrentTime(); //播放时刻
-        //	console.log(this.playTime,789,this.photoHistoryList)
+        // console.log(this.playTime, 789, this.photoHistoryList)
+        // console.log('photoNum:', this.photoNum, 'this.photoList:', this.photoList, 'this.sectionItem.learning:', this.sectionItem.learning)
         //判断是否需要拍照
         if (this.photoNum > 0) {
           this.configPhoto();
@@ -3164,12 +3164,12 @@ export default {
 }
 .photoBox {
   background-color: #ffffff;
-  border-radius: 32px 32px 0px 0px;
+  border-radius: 24px 24px 0px 0px;
   .photoTop {
     height: 74rpx;
     display: flex;
     align-items: center;
-    justify-content: space-between;
+    justify-content: center;
     padding: 0rpx 38rpx;
     .sqzz {
       width: 28rpx;
@@ -3186,11 +3186,45 @@ export default {
   }
   .photoCenter {
     width: 750rpx;
-    height: 979rpx;
+    height: 75vh;
     position: relative;
+    .center_camera {
+      width: 100%;
+      height: 75vh;
+      // position: fixed;
+      .head_take {
+        width: 100%;
+        height: 75vh;
+        display: flex;
+        flex-direction: column;
+      }
+      .headTake_up {
+        width: 100%;
+        height: 100rpx;
+      }
+      .headTake_minddle {
+        display: flex;
+        .min_img {
+          width: 500rpx;
+          height: 550rpx;
+        }
+        .min_left, .min_right {
+          flex: 1;
+          height: 550rpx;
+        }
+      }
+      .headTake_down {
+        width: 100%;
+        flex: 1;
+      }
+      .color {
+        background-color: #333;
+        opacity: 0.5;
+      }
+    }
     .custom {
       width: 750rpx;
-      height: 979rpx;
+      height: 75vh;
       position: absolute;
       z-index: 1000;
       top: 0;
@@ -3200,18 +3234,6 @@ export default {
         height: 100%;
       }
     }
-    .head_take {
-      width: 100%;
-      display: flex;
-      justify-content: center;
-      margin-top: 100rpx;
-      .head_img {
-        width: 500rpx;
-        height: 500rpx;
-        // background-color: #A4A4A6;
-        border: 2rpx solid #666;
-      }
-    }
   }
 
   .btns {