| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- <template>
- <view>
- <zhuapaiConfirm ref="zhuapaiConfirmRef" @success="zpConfirmSuccess" @error="zpConfirmError"
- @cancel="zpConfirmCancel" key="1"></zhuapaiConfirm>
- </view>
- </template>
- <script setup>
- import {
- onLoad,
- onShow,
- onHide
- } from "@dcloudio/uni-app";
- import {
- ref,nextTick
- } from "vue";
- import zhuapaiConfirm from "@/components/zhuapaiConfirm/index.vue";
- const opt = ref(null);
- const zhuapaiConfirmRef = ref(null);
- onLoad((options) => {
- opt.value = options;
- setTimeout(() => {
- zhuapaiConfirmRef.value.showDialog()
- },1000)
- })
- function zpConfirmSuccess() {
- uni.redirectTo({
- url: `/pages/client/Kaoshi/exam?ksId=${opt.value.ksId}&zhuapai=${opt.value.zhuapai}&userKaozhengId=${opt.value.userKaozhengId}&from=${opt.value.from}`
- })
- }
- function zpConfirmError(e) {
- uni.showToast({
- icon: 'none',
- title: '考试环境异常请检测摄像头是否正常',
- duration: 3000,
- mask: true // 防止触摸穿透
- })
- setTimeout(() => {
- handleBack();
- }, 3000)
- }
- function zpConfirmCancel() {
- handleBack();
- }
- function handleBack() {
- const pages = getCurrentPages();
- if (pages.length > 1) {
- uni.navigateBack()
- } else {
- history.back();
- }
- }
- </script>
- <style>
- </style>
|