CheckPopup.vue 5.2 KB

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