leaveConfirmPopup.vue 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <template>
  2. <popup
  3. v-model:show="showValue"
  4. round
  5. teleport="body"
  6. class="leave-confirm-popup"
  7. :close-on-click-overlay="true"
  8. >
  9. <img class="leave-confirm-popup__icon" src="@/assets/img/agricultural/notice.png" alt="" />
  10. <div class="leave-confirm-popup__title">{{ t("agriFile.confirmLeaveTitle") }}</div>
  11. <div class="leave-confirm-popup__desc">
  12. <div>{{ t("agriFile.confirmLeaveDesc1") }}</div>
  13. <div>{{ t("agriFile.confirmLeaveDesc2") }}</div>
  14. </div>
  15. <div class="leave-confirm-popup__btn" @click="handleContinue">{{ t("agriFile.continueRecord") }}</div>
  16. <div class="leave-confirm-popup__leave" @click="handleLeave">{{ t("agriFile.confirmLeave") }}</div>
  17. </popup>
  18. </template>
  19. <script setup>
  20. import { computed } from "vue";
  21. import { Popup } from "vant";
  22. import { useI18n } from "@/i18n";
  23. const { t } = useI18n();
  24. const props = defineProps({
  25. show: {
  26. type: Boolean,
  27. default: false,
  28. },
  29. });
  30. const emit = defineEmits(["update:show", "confirm", "cancel"]);
  31. const showValue = computed({
  32. get: () => props.show,
  33. set: (val) => emit("update:show", val),
  34. });
  35. const handleContinue = () => {
  36. emit("cancel");
  37. showValue.value = false;
  38. };
  39. const handleLeave = () => {
  40. emit("confirm");
  41. showValue.value = false;
  42. };
  43. </script>
  44. <style scoped lang="scss">
  45. .leave-confirm-popup {
  46. width: 78%;
  47. padding: 72px 20px 22px;
  48. text-align: center;
  49. overflow: visible;
  50. background: linear-gradient(360deg, #FFFFFF 0%, #D3EBFF 100%);
  51. &__icon {
  52. position: absolute;
  53. top: -32px;
  54. left: 50%;
  55. display: block;
  56. width: 102px;
  57. height: 102px;
  58. transform: translateX(-50%);
  59. }
  60. &__title {
  61. font-size: 26px;
  62. color: #010101;
  63. font-family: "pangmenzhengdao";
  64. }
  65. &__desc {
  66. margin-top: 8px;
  67. color: #1F1F1F;
  68. }
  69. &__btn {
  70. margin: 20px auto 10px;
  71. padding: 8px;
  72. border-radius: 25px;
  73. background: linear-gradient(180deg, #96D1FF 0%, #2199F8 100%);
  74. color: #fff;
  75. font-size: 16px;
  76. }
  77. &__leave {
  78. color: #AEAEAE;
  79. }
  80. }
  81. </style>