浏览代码

修复bug

chenxiong 3 年之前
父节点
当前提交
b47ea2d688
共有 3 个文件被更改,包括 38 次插入14 次删除
  1. 1 0
      pages2/appointment/index.vue
  2. 34 14
      pages2/class/questionBank.vue
  3. 3 0
      pages3/polyv/detail.vue

+ 1 - 0
pages2/appointment/index.vue

@@ -144,6 +144,7 @@ export default {
 						this.$api.goodsList({ makeGoodsId: this.goodsId,goodsType:3 }).then(res => {
 							if (res.data.code === 200) {
 								if(res.data.rows.length){
+									console.log(res.data.rows[0].goodsId)
 								this.goodsIdBK = res.data.rows[0].goodsId;
 								}
 							}

+ 34 - 14
pages2/class/questionBank.vue

@@ -512,12 +512,16 @@
 					<view class="sqzz"></view>
 				</view>
 				<view class="photoCenter">
-					<view style="width: 100%; height: 979rpx;position: fixed;" v-if="photoPopup">
+					<view style="width: 100%; height: 979rpx;position: fixed;" v-if="photoPopup && isTaking">
 						<camera device-position="front" flash="off" @error="error" style="width: 100%; height: 100%;" ></camera>
 					</view>
-					<view class="custom"><image src="/static/zhezhao.png" mode=""></image></view>
+					<view class="custom" v-if="!isTaking" ><image :src="avatarUrl" mode=""></image></view>
+				</view>
+				<view class="photoBoxbtns">
+					<view class="btnResult" v-if="isTaking" @click="takePhoto">拍照</view>
+					<view class="btnResult" v-if="!isTaking" @click="reTake">重拍</view>
+					<view class="btnResult" v-if="!isTaking" @click="submitPhoto">确认</view>
 				</view>
-				<view class="btnResult" @click="takePhoto">拍照</view>
 			</view>
 		</view>
 		
@@ -565,6 +569,7 @@ export default {
 			ossAvatarUrl: '',
 			goodsDetail:{},
 			isTakePhoto:false,
+			isTaking:true, //是否正在拍照
 			needPhoto:false //是否需要拍照
 		};
 	},
@@ -601,6 +606,8 @@ export default {
 			//需要拍没拍过直接弹出摄像头
 			if(this.needPhoto && !this.isTakePhoto) {
 				this.photoPopup = true;
+				this.isTaking = true;
+				this.avatarUrl = ''
 			} else { //不需要拍照
 				if(this.lastTime) {
 					this.timer = setInterval(() => {
@@ -668,6 +675,9 @@ export default {
 				});
 			})
 		},
+		reTake() {
+			this.isTaking = true;
+		},
 		postStudyRecord() {
 			let self = this
 			let data = {
@@ -806,6 +816,7 @@ export default {
 		async submitPhoto() {
 			const waitYS = await this.imageInfos();
 			this.postStudyRecord(); //提交记录
+			this.photoPopup = false;
 		},
 		//确认拍照
 		takePhoto() {
@@ -816,9 +827,10 @@ export default {
 				success: res => {
 					console.log(res.tempImagePath);
 					self.avatarUrl = res.tempImagePath;
-					self.submitPhoto();
+					// self.submitPhoto();
+					this.isTaking = false;
 		
-					self.photoPopup = false;
+					// self.photoPopup = false;
 				},
 				fail: err => {
 					console.log(err);
@@ -1386,6 +1398,7 @@ export default {
 						
 						if(self.needPhoto){
 							self.photoPopup = true; //拍照
+							this.isTaking = true;
 						} else {
 							if(this.lastTime) {
 								this.timer = setInterval(() => {
@@ -2078,16 +2091,23 @@ export default {
 				}
 			}
 		}
-		.btnResult {
-			height: 100rpx;
-			width: 100%;
-			background-color: #07c160;
-			text-align: center;
-			line-height: 100upx;
-			color: #fff;
-			font-size: 32upx;
-			font-weight: bold;
+		
+		.photoBoxbtns {
+			display: flex;
+			
+			
+			.btnResult {
+				height: 100rpx;
+				width: 100%;
+				background-color: #07c160;
+				text-align: center;
+				line-height: 100upx;
+				color: #fff;
+				font-size: 32upx;
+				font-weight: bold;
+			}
 		}
+		
 	}
 	
 .navbar {

+ 3 - 0
pages3/polyv/detail.vue

@@ -1376,6 +1376,7 @@ export default {
 			
 		},
 		restart() {
+			console.log(1)
 			var polyvPlayerContext = this.selectComponent('#playerVideo');
 			polyvPlayerContext.seek(0);
 			clearTimeout(this.toastTimer)
@@ -1386,6 +1387,7 @@ export default {
 				if (this.needSeek) {  
 					var polyvPlayerContext = this.selectComponent('#playerVideo');
 					if(this.recordObj.videoCurrentTime){
+			console.log(2)
 						polyvPlayerContext.seek(this.recordObj.videoCurrentTime);
 						this.seekTime = this.$method.secondToDate(this.recordObj.videoCurrentTime)
 						this.videoToastShow = true;
@@ -1394,6 +1396,7 @@ export default {
 						},3000)
 						
 					}else{
+			console.log(3)
 						polyvPlayerContext.seek(1);//避免相同节继续播放
 					}