examCamera.vue 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <template>
  2. <view>
  3. <zhuapaiConfirm ref="zhuapaiConfirmRef" @success="zpConfirmSuccess" @error="zpConfirmError"
  4. @cancel="zpConfirmCancel" key="1"></zhuapaiConfirm>
  5. </view>
  6. </template>
  7. <script setup>
  8. import {
  9. onLoad,
  10. onShow,
  11. onHide
  12. } from "@dcloudio/uni-app";
  13. import {
  14. ref,nextTick
  15. } from "vue";
  16. import zhuapaiConfirm from "@/components/zhuapaiConfirm/index.vue";
  17. const opt = ref(null);
  18. const zhuapaiConfirmRef = ref(null);
  19. onLoad((options) => {
  20. opt.value = options;
  21. nextTick(() => {
  22. zhuapaiConfirmRef.value.showDialog()
  23. })
  24. })
  25. function zpConfirmSuccess() {
  26. uni.redirectTo({
  27. url: `/pages/client/Kaoshi/exam?ksId=${opt.value.ksId}&zhuapai=${opt.value.zhuapai}&userKaozhengId=${opt.value.userKaozhengId}&from=${opt.value.from}`
  28. })
  29. }
  30. function zpConfirmError() {
  31. handleBack();
  32. }
  33. function zpConfirmCancel() {
  34. handleBack();
  35. }
  36. function handleBack() {
  37. const pages = getCurrentPages();
  38. if (pages.length > 1) {
  39. uni.navigateBack()
  40. } else {
  41. history.back();
  42. }
  43. }
  44. </script>
  45. <style>
  46. </style>