cwg-check-popup.vue 4.3 KB

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