proxyAuthPopup.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. <template>
  2. <popup
  3. v-model:show="showValue"
  4. round
  5. teleport="body"
  6. :z-index="20000"
  7. class="proxy-auth-popup"
  8. >
  9. <!-- :close-on-click-overlay="false" -->
  10. <div class="proxy-auth-popup__body">
  11. <img class="proxy-auth-popup__icon" src="@/assets/img/agricultural/proxies.png" alt="" />
  12. <div class="proxy-auth-popup__title">开启信息更新授权</div>
  13. <div class="proxy-auth-popup__desc">
  14. 授权<span>「{{ serviceName }}」</span>帮助您更新生育期/物候期信息
  15. </div>
  16. <div class="proxy-auth-popup__tip">
  17. 每次修改都需您确认,农服提交后,会推送给您确认,您
  18. <span>同意</span>
  19. 后才可生效
  20. </div>
  21. <div class="proxy-auth-popup__actions">
  22. <div class="proxy-auth-popup__btn proxy-auth-popup__btn--ghost" @click="handleReject">
  23. 不同意
  24. </div>
  25. <div class="proxy-auth-popup__btn proxy-auth-popup__btn--primary" @click="handleAllow">
  26. 同意
  27. </div>
  28. </div>
  29. </div>
  30. </popup>
  31. </template>
  32. <script setup>
  33. import { computed } from "vue";
  34. import { Popup } from "vant";
  35. const props = defineProps({
  36. show: {
  37. type: Boolean,
  38. default: false,
  39. },
  40. /** 农服名称,后续由接口赋值 */
  41. serviceName: {
  42. type: String,
  43. default: "农服名称",
  44. },
  45. });
  46. const emit = defineEmits(["update:show", "reject", "allow"]);
  47. const showValue = computed({
  48. get: () => props.show,
  49. set: (val) => emit("update:show", val),
  50. });
  51. const handleReject = () => {
  52. emit("reject");
  53. showValue.value = false;
  54. };
  55. const handleAllow = () => {
  56. emit("allow");
  57. showValue.value = false;
  58. };
  59. </script>
  60. <style scoped lang="scss">
  61. .proxy-auth-popup {
  62. width: 300px;
  63. overflow: visible;
  64. background: linear-gradient(180deg, #d6ecff 0%, #ffffff 42%);
  65. &__body {
  66. padding: 20px;
  67. text-align: center;
  68. box-sizing: border-box;
  69. }
  70. &__icon {
  71. display: block;
  72. width: 73px;
  73. height: 73px;
  74. margin: 0 auto 10px;
  75. object-fit: contain;
  76. }
  77. &__title {
  78. color: #1a1a1a;
  79. font-size: 20px;
  80. font-weight: 500;
  81. line-height: 34px;
  82. }
  83. &__desc {
  84. margin-top: 10px;
  85. color: #000000;
  86. font-size: 16px;
  87. line-height: 24px;
  88. text-align: left;
  89. span {
  90. color: #2199F8;
  91. font-weight: 500;
  92. }
  93. }
  94. &__tip {
  95. margin-top: 10px;
  96. padding: 5px 10px;
  97. border-radius: 5px;
  98. background: rgba(174, 174, 174, 0.16);
  99. color: #5C5C5C;
  100. font-size: 12px;
  101. line-height: 20px;
  102. text-align: left;
  103. span {
  104. color: #2199f8;
  105. }
  106. }
  107. &__actions {
  108. display: flex;
  109. justify-content: space-between;
  110. gap: 12px;
  111. margin-top: 20px;
  112. }
  113. &__btn {
  114. height: 40px;
  115. line-height: 40px;
  116. border-radius: 25px;
  117. font-size: 16px;
  118. text-align: center;
  119. box-sizing: border-box;
  120. padding: 0 38px;
  121. &--ghost {
  122. background: rgba(236, 236, 236, 0.5);
  123. color: rgba(0, 0, 0, 0.6);
  124. }
  125. &--primary {
  126. background: #2199f8;
  127. color: #fff;
  128. }
  129. }
  130. }
  131. </style>