wangguoyu преди 3 месеца
родител
ревизия
b41db5ceaf
променени са 2 файла, в които са добавени 73 реда и са изтрити 3 реда
  1. 66 0
      components/dialog/shexiangtoushuoming.vue
  2. 7 3
      pages/my/index.vue

+ 66 - 0
components/dialog/shexiangtoushuoming.vue

@@ -0,0 +1,66 @@
+<template>
+	<uni-popup ref="commonPopup" :animation="false" :is-mask-click="false"
+	 mask-background-color="rgba(0, 0, 0, 0.4)">
+	 <view class="phone-common-dialog">
+		<view class="common-body-box">
+			<view class="common-title">{{title}}</view>
+			<view class="common-content" :class="dialogContentClass">{{content}}</view>
+			<view class="common-btn-box">
+				<view class="confirm-btn" @click="confirmBtn">{{okBtn}}</view>
+			</view>
+		</view>
+	 </view>
+	</uni-popup>
+</template>
+
+<script setup>
+	import { ref } from 'vue';
+	const props = defineProps({
+	  title: {
+	    type: String,
+	    default: ''
+	  },
+	  content: {
+	    type: String,
+		require: true,
+	    default: ''
+	  },
+	  dialogContentClass: {
+	    type: String,
+	  	require: true,
+	    default: 'content-center-class'
+	  },
+	  notBtn: {
+	    type: String,
+	  	require: true,
+	    default: '取消'
+	  },
+	  okBtn: {
+	    type: String,
+	  	require: true,
+	    default: '确认'
+	  },
+	});
+	const commonPopup = ref(null); // 索引
+	const $emit = defineEmits(['confirm-btn'])
+	// 打开弹窗
+	function handleShow() {
+		commonPopup.value.open();
+	}
+	// 取消
+	function handleClose() {
+		commonPopup.value.close();
+	}
+	// 确认
+	function confirmBtn(){
+		$emit('confirm-btn');
+		commonPopup.value.close();
+	}
+	defineExpose({
+			handleShow,
+			handleClose
+		})
+</script>
+
+<style>
+</style>

+ 7 - 3
pages/my/index.vue

@@ -58,6 +58,9 @@
 		<view>
 			<cameraCommon ref="cameraCommonRef"></cameraCommon>
 		</view>
+		<view>
+			<shexiangtoushuoming ref="shexiangtoushuomingRef" :content="messageContent"  title="注意" okBtn="知道了"></shexiangtoushuoming>
+		</view>
 	</view>
 </template>
 
@@ -67,6 +70,7 @@
 	import {getMineInfo} from '@/api/my.js'
 	import {onLoad,onShow} from '@dcloudio/uni-app';
 	import cameraCommon from "@/components/dialog/cameraCommon.vue";
+	import shexiangtoushuoming from "@/components/dialog/shexiangtoushuoming.vue";
 	let myInfoData = reactive({
 		userImg: '',
 		realName: '',
@@ -79,6 +83,8 @@
 
 	});
 	const cameraCommonRef = ref(null)
+	const shexiangtoushuomingRef = ref(null)
+	const messageContent = ref('请在考试前使用摄像头测试功能,测试摄像头是否可以正常工作,在测试前请先确保摄像头设备可以正常使用.')
 	onLoad(() => {})
 	
 	onShow(() => {getMyInit()})
@@ -147,9 +153,7 @@
 			
 			// 摄像头说明
 			case 'sxtsm':
-			    uni.navigateTo({
-			    	url:'/pages/admin/my/myInfo?from=my'
-			    })
+			  shexiangtoushuomingRef.value.handleShow()
 			break;
 			
 			// 设置