CheckPopup.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. <template>
  2. <cwg-popup v-model:visible="visible" type="center" :mask-click="false" :showFooters="true" :showClose="false">
  3. <view class="popup-content">
  4. <view class="icon">
  5. <cwg-icon name="loading" :size="64" color="#1e2a3a" />
  6. </view>
  7. <view class="des1">{{ t('news_add_field.ApplicationDialog.Des31') }}</view>
  8. <view class="des2">
  9. <text>{{ t('news_add_field.ApplicationDialog.Des32') }}</text>
  10. <text>{{ t('news_add_field.ApplicationDialog.Des33') }}</text>
  11. <text class="crm-cursor" @click="toHistory">{{ t('news_add_field.ApplicationDialog.Des34') }}</text>
  12. <text>{{ t('news_add_field.ApplicationDialog.Des35') }}</text>
  13. </view>
  14. <view class="GoPay" v-if="goPayLink">
  15. <view class="GoPay-btn">
  16. <button type="primary" @click="GoPayBtn">{{ t('Label.item3') }}</button>
  17. </view>
  18. <view class="GoPay-con">{{ t('Label.item4') }}</view>
  19. <view class="GoPay-copy">
  20. <text class="link-text">{{ goPayLink }}</text>
  21. <view class="btn">
  22. <text class="crm-cursor" @click="CopyShareLink('custom_link')">{{ t('Ib.Index.Copy') }}</text>
  23. </view>
  24. </view>
  25. </view>
  26. </view>
  27. <template #footer>
  28. <button @click="close">{{ t('Btn.Cancel') }}</button>
  29. <button type="primary" @click="close">{{ t('Btn.Confirm') }}</button>
  30. </template>
  31. </cwg-popup>
  32. </template>
  33. <script setup>
  34. import { computed, ref } from 'vue';
  35. import { useI18n } from 'vue-i18n';
  36. const props = defineProps({
  37. visible: { type: Boolean, default: false },
  38. success: { type: Boolean, default: true },
  39. errorMsg: { type: String, default: '' },
  40. goPayLink: { type: String, default: '' },
  41. isWaiting: { type: Boolean, default: false }
  42. });
  43. const emit = defineEmits(['update:visible', 'close', 'toHistory', 'goPay', 'copy']);
  44. const { t } = useI18n();
  45. const visible = computed({
  46. get: () => props.visible,
  47. set: (val) => emit('update:visible', val)
  48. });
  49. const close = () => {
  50. visible.value = false;
  51. emit('close');
  52. };
  53. //支付历史
  54. const toHistory = () => {
  55. uni.navigateTo({ url: "/pages/customer/history" })
  56. }
  57. // 去支付
  58. const GoPayBtn = () => {
  59. window.open(props.goPayLink)
  60. }
  61. // 复制分享链接
  62. const CopyShareLink = (link) => {
  63. uni.setClipboardData({
  64. data: props.goPayLink,
  65. success: function () {
  66. uni.showToast({
  67. title: t('Ib.Index.CopySuccess'),
  68. icon: 'success',
  69. duration: 2000
  70. });
  71. }
  72. });
  73. emit('copy');
  74. }
  75. </script>
  76. <style lang="scss" scoped>
  77. @import "@/uni.scss";
  78. .popup-content {
  79. text-align: center;
  80. max-width: 500px;
  81. margin: 0 auto;
  82. .icon {
  83. margin-bottom: 24px;
  84. animation: pulse 1.5s ease-in-out infinite;
  85. }
  86. .des1 {
  87. font-size: 20px;
  88. font-weight: bold;
  89. color: #1e2a3a;
  90. margin: 0 0 20px 0;
  91. line-height: 1.4;
  92. }
  93. .des2 {
  94. font-size: 14px;
  95. color: #606266;
  96. margin-bottom: 24px;
  97. line-height: 1.6;
  98. text-align: left;
  99. text {
  100. display: inline-block;
  101. margin-right: 4px;
  102. }
  103. .crm-cursor {
  104. color: #409eff;
  105. text-decoration: underline;
  106. transition: color 0.3s;
  107. cursor: pointer;
  108. &:hover {
  109. color: #66b1ff;
  110. }
  111. }
  112. }
  113. .GoPay {
  114. margin-top: 24px;
  115. background-color: #f5f7fa;
  116. border-radius: 8px;
  117. padding: 20px;
  118. text-align: left;
  119. .GoPay-btn {
  120. margin-bottom: 16px;
  121. button {
  122. width: 100%;
  123. height: 44px;
  124. border-radius: 6px;
  125. font-size: 16px;
  126. }
  127. }
  128. .GoPay-con {
  129. font-size: 14px;
  130. color: #606266;
  131. margin-bottom: 16px;
  132. line-height: 1.5;
  133. }
  134. .GoPay-copy {
  135. display: flex;
  136. align-items: center;
  137. gap: 12px;
  138. background-color: #ffffff;
  139. border: 1px solid #e4e7ed;
  140. border-radius: 6px;
  141. padding: 12px;
  142. .link-text {
  143. flex: 1;
  144. font-size: 14px;
  145. color: #303133;
  146. word-break: break-all;
  147. line-height: 1.4;
  148. }
  149. .btn {
  150. min-width: 80px;
  151. text-align: right;
  152. .crm-cursor {
  153. display: inline-block;
  154. padding: 6px 12px;
  155. background-color: #f0f9eb;
  156. color: #67c23a;
  157. border-radius: 4px;
  158. font-size: 14px;
  159. transition: all 0.3s;
  160. cursor: pointer;
  161. &:hover {
  162. background-color: #e6f7ff;
  163. color: #409eff;
  164. }
  165. }
  166. }
  167. }
  168. }
  169. }
  170. @keyframes pulse {
  171. 0% {
  172. transform: scale(1);
  173. }
  174. 50% {
  175. transform: scale(1.05);
  176. }
  177. 100% {
  178. transform: scale(1);
  179. }
  180. }
  181. @media (max-width: 768px) {
  182. .popup-content {
  183. padding: 20px 16px;
  184. .des1 {
  185. font-size: 18px;
  186. }
  187. .des2 {
  188. font-size: 13px;
  189. }
  190. .GoPay {
  191. padding: 16px;
  192. .GoPay-btn button {
  193. height: 40px;
  194. font-size: 14px;
  195. }
  196. }
  197. }
  198. }
  199. </style>