wangxy 1 місяць тому
батько
коміт
9ac67ed618

+ 6 - 23
components/zhuapaiConfirm/index.vue

@@ -1,15 +1,9 @@
 <template>
-	<uni-popup ref="popupRef" type="dialog" :animation="false" :is-mask-click="false"
-		mask-background-color="rgba(0, 0, 0, 0.4);">
-		<uni-popup-dialog mode="input" class="phone-camera my-dialog-cc" :title="title" :duration="2000"
-			:before-close="true" @close="handleClose" @confirm="handleConfirm">
-			<view class="phone-camera-box" style="overflow: hidden;">
-				<view v-show="!showConfirmBtn" class="sxt-tip-box" style="text-align: center;">{{textMess}}</view>
-				<camera v-show="showConfirmBtn" class="camera" device-position="back" flash="off" @initdone="onVideoSuccess"
-					style="width:100%; height: 320rpx;"></camera>
-			</view>
-		</uni-popup-dialog>
-	</uni-popup>
+	<view class="phone-camera-box">
+		<view v-show="!showConfirmBtn" class="sxt-tip-box" style="text-align: center;">{{textMess}}</view>
+		<camera v-show="showConfirmBtn" class="camera" device-position="front" flash="off" @initdone="onVideoSuccess"
+			style="width:100%; height: 320rpx;"></camera>
+	</view>
 </template>
 
 <script setup>
@@ -23,15 +17,7 @@
 		useH5Camera
 	} from "./useCamera.js"
 
-	defineProps({
-		title: {
-			type: String,
-			default: '摄像头确认'
-		}
-	})
-
 	const emits = defineEmits(['success', 'error', 'cancel'])
-
 	const popupRef = ref(null)
 	const showConfirmBtn = ref(false);
 	const cameraContext = ref(null);
@@ -64,8 +50,6 @@
 
 	function showDialog() {
 		textMess.value = '摄像头正在初始化...'
-		popupRef.value.open();
-	
 		setTimeout(() => {
 			showConfirmBtn.value = true;
 			nextTick(() => {
@@ -76,13 +60,11 @@
 
 	function handleClose() {
 		emits('cancel')
-		popupRef.value.close();
 		stopCamera && stopCamera()
 	}
 
 	function handleConfirm() {
 		emits('success')
-		popupRef.value.close();
 		stopCamera && stopCamera()
 	}
 
@@ -98,6 +80,7 @@
 
 <style lang="scss">
 	.phone-camera-box {
+		margin-top: 60px;
 		width: 100%;
 	}
 

+ 7 - 2
pages/client/Kaoshi/examCamera.vue

@@ -1,7 +1,11 @@
 <template>
 	<view>
-		<zhuapaiConfirm ref="zhuapaiConfirmRef" @success="zpConfirmSuccess" @error="zpConfirmError"
-			@cancel="zpConfirmCancel" key="1"></zhuapaiConfirm>
+		<!-- 导航区域 -->
+		<customNavbarVue title="摄像头确认" :show-back-btn="true" @back="handleBack"></customNavbarVue>
+		
+		<zhuapaiConfirm ref="zhuapaiConfirmRef" @success="zpConfirmSuccess" key="1"></zhuapaiConfirm>
+			
+		<button @click="zpConfirmSuccess">确认</button>	
 	</view>
 </template>
 
@@ -15,6 +19,7 @@
 		ref,nextTick
 	} from "vue";
 	import zhuapaiConfirm from "@/components/zhuapaiConfirm/index.vue";
+	import customNavbarVue from "@/components/custom-navbar/custom-navbar.vue";
 
 	const opt = ref(null);
 	const zhuapaiConfirmRef = ref(null);

+ 6 - 3
pages/client/my/index.vue

@@ -72,7 +72,7 @@
 		<shexiangDialogVue ref="shexiangRef" title="摄像头说明"></shexiangDialogVue>
 		
 		<!-- 摄像头确认 -->
-		<zhuapaiConfrimVue ref="zpRef" @error="zpConfirmError" title="摄像头测试"></zhuapaiConfrimVue>
+		<!-- <zhuapaiConfrimVue ref="zpRef" @error="zpConfirmError" title="摄像头测试"></zhuapaiConfrimVue> -->
 	</view>
 </template>
 
@@ -85,7 +85,7 @@
 	import customTabbarClient from "@/components/custom-tabbar/custom-tabbar-client.vue"
 	import commonDialog from '@/components/dialog/commonDialog.vue';
 	import shexiangDialogVue from "@/components/dialog/shexiangDialog.vue";
-	import zhuapaiConfrimVue from "@/components/zhuapaiConfirm/index.vue";
+	// import zhuapaiConfrimVue from "@/components/zhuapaiConfirm/index.vue";
 	
 	let myInfoData = reactive({
 		userImg: '',
@@ -187,7 +187,10 @@
 	}
 	
 	function showZhuaPaiConfirm() {
-		zpRef.value.showDialog()
+		// zpRef.value.showDialog()
+		uni.navigateTo({
+			url: "/pages/client/my/cameraTest"
+		})
 	}
 	
 	function zpConfirmSuccess() {