CheckPopup.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  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. openExternalUrl(props.goPayLink)
  61. }
  62. // 复制分享链接
  63. const CopyShareLink = (link) => {
  64. uni.setClipboardData({
  65. data: props.goPayLink,
  66. success: function () {
  67. uni.showToast({
  68. title: t('Btn.item8'),
  69. icon: 'none',
  70. duration: 2000
  71. });
  72. }
  73. });
  74. emit('copy');
  75. }
  76. </script>
  77. <style lang="scss" scoped>
  78. @import "@/uni.scss";
  79. .popup-content {
  80. text-align: center;
  81. max-width: 500px;
  82. margin: 0 auto;
  83. .icon {
  84. margin-bottom: 24px;
  85. animation: pulse 1.5s ease-in-out infinite;
  86. }
  87. .des1 {
  88. font-size: 20px;
  89. font-weight: bold;
  90. color: var(--bs-emphasis-color);
  91. margin: 0 0 20px 0;
  92. line-height: 1.4;
  93. }
  94. .des2 {
  95. font-size: 14px;
  96. color: #606266;
  97. margin-bottom: 24px;
  98. line-height: 1.6;
  99. text-align: left;
  100. text {
  101. display: inline-block;
  102. margin-right: 4px;
  103. }
  104. .crm-cursor {
  105. color: #409eff;
  106. text-decoration: underline;
  107. transition: color 0.3s;
  108. cursor: pointer;
  109. &:hover {
  110. color: #66b1ff;
  111. }
  112. }
  113. }
  114. .GoPay {
  115. margin-top: 24px;
  116. background-color: rgba(var(--bs-body-bg-rgb), var(--bs-bg-opacity)) !important;
  117. border-radius: 8px;
  118. padding: 20px;
  119. text-align: left;
  120. .GoPay-btn {
  121. margin-bottom: 16px;
  122. button {
  123. width: 100%;
  124. height: 44px;
  125. line-height: 44px;
  126. border-radius: 6px;
  127. font-size: 16px;
  128. }
  129. }
  130. .GoPay-con {
  131. font-size: 14px;
  132. color: #606266;
  133. margin-bottom: 16px;
  134. line-height: 1.5;
  135. }
  136. .GoPay-copy {
  137. display: flex;
  138. align-items: center;
  139. gap: 12px;
  140. background-color: #ffffff;
  141. border: 1px solid #e4e7ed;
  142. border-radius: 6px;
  143. padding: 12px;
  144. .link-text {
  145. flex: 1;
  146. font-size: 14px;
  147. color: #303133;
  148. word-break: break-all;
  149. line-height: 1.4;
  150. overflow: hidden;
  151. display: -webkit-box;
  152. -webkit-line-clamp: 2;
  153. -webkit-box-orient: vertical;
  154. }
  155. .btn {
  156. min-width: 80px;
  157. text-align: right;
  158. .crm-cursor {
  159. display: inline-block;
  160. padding: 6px 12px;
  161. background-color: #f0f9eb;
  162. color: #67c23a;
  163. border-radius: 4px;
  164. font-size: 14px;
  165. transition: all 0.3s;
  166. cursor: pointer;
  167. &:hover {
  168. background-color: #e6f7ff;
  169. color: #409eff;
  170. }
  171. }
  172. }
  173. }
  174. }
  175. }
  176. @keyframes pulse {
  177. 0% {
  178. transform: scale(1);
  179. }
  180. 50% {
  181. transform: scale(1.05);
  182. }
  183. 100% {
  184. transform: scale(1);
  185. }
  186. }
  187. @media (max-width: 768px) {
  188. .popup-content {
  189. padding: 20px 16px;
  190. .des1 {
  191. font-size: 18px;
  192. }
  193. .des2 {
  194. font-size: 13px;
  195. }
  196. .GoPay {
  197. padding: 16px;
  198. .GoPay-btn button {
  199. height: 40px;
  200. font-size: 14px;
  201. }
  202. }
  203. }
  204. }
  205. </style>