CheckPopup.vue 5.2 KB

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