CheckPopup.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  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/payment-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('Btn.item8'),
  68. icon: 'none',
  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: var(--bs-emphasis-color);
  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: rgba(var(--bs-body-bg-rgb), var(--bs-bg-opacity)) !important;
  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. line-height: 44px;
  125. border-radius: 6px;
  126. font-size: 16px;
  127. }
  128. }
  129. .GoPay-con {
  130. font-size: 14px;
  131. color: #606266;
  132. margin-bottom: 16px;
  133. line-height: 1.5;
  134. }
  135. .GoPay-copy {
  136. display: flex;
  137. align-items: center;
  138. gap: 12px;
  139. background-color: #ffffff;
  140. border: 1px solid #e4e7ed;
  141. border-radius: 6px;
  142. padding: 12px;
  143. .link-text {
  144. flex: 1;
  145. font-size: 14px;
  146. color: #303133;
  147. word-break: break-all;
  148. line-height: 1.4;
  149. overflow: hidden;
  150. display: -webkit-box;
  151. -webkit-line-clamp: 2;
  152. -webkit-box-orient: vertical;
  153. }
  154. .btn {
  155. min-width: 80px;
  156. text-align: right;
  157. .crm-cursor {
  158. display: inline-block;
  159. padding: 6px 12px;
  160. background-color: #f0f9eb;
  161. color: #67c23a;
  162. border-radius: 4px;
  163. font-size: 14px;
  164. transition: all 0.3s;
  165. cursor: pointer;
  166. &:hover {
  167. background-color: #e6f7ff;
  168. color: #409eff;
  169. }
  170. }
  171. }
  172. }
  173. }
  174. }
  175. @keyframes pulse {
  176. 0% {
  177. transform: scale(1);
  178. }
  179. 50% {
  180. transform: scale(1.05);
  181. }
  182. 100% {
  183. transform: scale(1);
  184. }
  185. }
  186. @media (max-width: 768px) {
  187. .popup-content {
  188. padding: 20px 16px;
  189. .des1 {
  190. font-size: 18px;
  191. }
  192. .des2 {
  193. font-size: 13px;
  194. }
  195. .GoPay {
  196. padding: 16px;
  197. .GoPay-btn button {
  198. height: 40px;
  199. font-size: 14px;
  200. }
  201. }
  202. }
  203. }
  204. </style>