cwg-error-popup.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. <template>
  2. <cwg-popup v-model:visible="visible" type="center" :mask-click="false" :show-footers="true" @close="closeDia">
  3. <view class="popup-content">
  4. <view class="icon"><cwg-icon name="gy" :size="80" color="#eb3f57" /></view>
  5. <view class="des1">{{ responseMessage }}</view>
  6. </view>
  7. <template #footer>
  8. <button @click="closeDia">{{ t('Btn.Cancel') }}</button>
  9. <button type="primary" @click="closeDia">{{ t('Btn.Confirm') }}</button>
  10. </template>
  11. </cwg-popup>
  12. </template>
  13. <script setup>
  14. import { computed } from 'vue';
  15. import { useI18n } from 'vue-i18n';
  16. const props = defineProps({
  17. visible: {
  18. type: Boolean,
  19. default: false
  20. },
  21. responseMessage: {
  22. type: String,
  23. default: ''
  24. }
  25. });
  26. const emit = defineEmits(['update:visible', 'confirm']);
  27. const { t } = useI18n();
  28. // Watch for changes in visible prop and emit update event
  29. const visible = computed({
  30. get: () => props.visible,
  31. set: (value) => emit('update:visible', value)
  32. });
  33. const closeDia = () => {
  34. visible.value = false;
  35. emit('confirm');
  36. }
  37. </script>
  38. <style lang="scss" scoped>
  39. .clause-popup {
  40. width: 90%;
  41. max-width: 800px;
  42. max-height: 80vh;
  43. overflow: hidden;
  44. .clause-content {
  45. padding: 20px;
  46. scroll-view {
  47. width: 100%;
  48. h4 {
  49. font-size: 16px;
  50. font-weight: 600;
  51. color: #303133;
  52. margin-bottom: 12px;
  53. }
  54. ul {
  55. margin-bottom: 20px;
  56. li {
  57. margin-bottom: 8px;
  58. line-height: 1.5;
  59. color: #606266;
  60. }
  61. }
  62. table {
  63. margin: 16px 0;
  64. width: 100%;
  65. border-collapse: collapse;
  66. th,
  67. td {
  68. padding: 10px;
  69. text-align: center;
  70. border: 1px solid #dcdfe6;
  71. font-size: 14px;
  72. }
  73. th {
  74. background: #f5f7fa;
  75. font-weight: 600;
  76. color: #303133;
  77. }
  78. td {
  79. color: #606266;
  80. }
  81. }
  82. // Handle v-html content
  83. div {
  84. line-height: 1.6;
  85. color: #606266;
  86. p {
  87. margin-bottom: 12px;
  88. }
  89. h1,
  90. h2,
  91. h3,
  92. h4,
  93. h5,
  94. h6 {
  95. margin: 16px 0 8px 0;
  96. color: #303133;
  97. }
  98. ul,
  99. ol {
  100. margin-left: 20px;
  101. margin-bottom: 12px;
  102. }
  103. li {
  104. margin-bottom: 4px;
  105. }
  106. }
  107. }
  108. }
  109. .clause-footer {
  110. padding: 16px 20px;
  111. border-top: 1px solid #e4e7ed;
  112. display: flex;
  113. justify-content: center;
  114. button {
  115. min-width: 120px;
  116. padding: 10px 20px;
  117. border-radius: 4px;
  118. }
  119. }
  120. }
  121. // Responsive styles
  122. @media (max-width: 768px) {
  123. .clause-popup {
  124. width: 95%;
  125. max-height: 85vh;
  126. .clause-header {
  127. padding: 12px 16px;
  128. .clause-title {
  129. font-size: 16px;
  130. }
  131. }
  132. .clause-content {
  133. padding: 16px;
  134. scroll-view {
  135. height: 50vh;
  136. h4 {
  137. font-size: 14px;
  138. }
  139. table {
  140. th,
  141. td {
  142. padding: 8px;
  143. font-size: 12px;
  144. }
  145. }
  146. }
  147. }
  148. .clause-footer {
  149. padding: 12px 16px;
  150. button {
  151. min-width: 100px;
  152. padding: 8px 16px;
  153. }
  154. }
  155. }
  156. }
  157. </style>