digitalPayConfirmPopup.vue 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  1. <template>
  2. <cwg-popup v-model:visible="visible" type="center" :mask-click="false" :showFooters="true"
  3. :title="t('Custom.Deposit.DigitalAcc')" @close="close">
  4. <view class="popup-content">
  5. <view class="dia-content digital-pay-confirm-body">
  6. <view class="digital-pay-info">
  7. <view class="digital-pay-info__fields">
  8. <view class="digital-pay-field">
  9. <span class="digital-pay-field__label" v-t="'Custom.Deposit.DigitalName'"></span>
  10. <view class="digital-pay-field__value digital-pay-field__value--currency">
  11. {{
  12. WireTransferAccount.name + "-" + WireTransferAccount.type
  13. }}
  14. </view>
  15. </view>
  16. <view class="digital-pay-field">
  17. <span class="digital-pay-field__label" v-t="'Custom.Withdraw.Title6'"></span>
  18. <view class="digital-pay-field__value digital-pay-field__value--address">
  19. {{ WireTransferAccount.address || "--" }}
  20. </view>
  21. </view>
  22. </view>
  23. <view class="digital-pay-info__qr">
  24. <view class="digital-pay-info__qr-inner">
  25. <image :src="Host05 + WireTransferAccount.url" alt="" mode="widthFix" />
  26. </view>
  27. </view>
  28. </view>
  29. <view class="digital-pay-divider" role="presentation"></view>
  30. <view class="digital-pay-upload-wrap">
  31. <view class="digital-pay-upload__label" v-t="'Custom.Deposit.UploadRemittanceVoucher'">
  32. </view>
  33. <cwg-file-picker-wrapper v-model="imageUrl" :limit="1" :fileMediatype="'all'" :imageWidth="142"
  34. :imageHeight="142" uploadUrl="/common/upload" />
  35. </view>
  36. <view class="digital-pay-upload-wrap mt-3">
  37. <view class="digital-pay-upload__label" v-t="'Custom.Deposit.HashCode'">
  38. </view>
  39. <uni-easyinput :placeholder="t('Custom.Deposit.HashCodePlaceholder')"
  40. v-model.trim="hashCode"></uni-easyinput>
  41. </view>
  42. </view>
  43. </view>
  44. <template #footer>
  45. <button hover-class="" @click="close">{{ t('Btn.Cancel') }}</button>
  46. <button hover-class="" type="primary" @click="handleConfirm">{{ t('Btn.Confirm') }}</button>
  47. </template>
  48. </cwg-popup>
  49. </template>
  50. <script setup>
  51. import { computed, ref } from 'vue';
  52. import { useI18n } from 'vue-i18n';
  53. import Config from '@/config/index'
  54. const { Code, Host05, Host04 } = Config
  55. const props = defineProps({
  56. visible: { type: Boolean, default: false },
  57. data: { type: Object, default: () => ({ balance: 0, income: 0 }) },
  58. WireTransferAccount: { type: Object, default: () => ({ name: '', type: '', address: '', url: '' }) },
  59. });
  60. const emit = defineEmits(['update:visible', 'confirm']);
  61. const hashCode = ref('')
  62. const { t } = useI18n();
  63. const visible = computed({
  64. get: () => props.visible,
  65. set: (val) => emit('update:visible', val)
  66. });
  67. const imageUrl = ref('');
  68. const handleConfirm = () => {
  69. if (!imageUrl.value) {
  70. uni.showToast({
  71. title: t('Custom.Deposit.UploadRemittanceVoucher'),
  72. icon: 'none'
  73. })
  74. return
  75. }
  76. if (!hashCode.value) {
  77. uni.showToast({
  78. title: t("vaildate.depositHashCode.empty"),
  79. icon: 'error'
  80. })
  81. return
  82. }
  83. emit('confirm', { voucherUrl: imageUrl.value, hashCode: hashCode.value })
  84. close()
  85. }
  86. const close = () => {
  87. imageUrl.value = '';
  88. hashCode.value = ''
  89. visible.value = false;
  90. };
  91. </script>
  92. <style lang="scss" scoped>
  93. @import "@/uni.scss";
  94. .popup-content {
  95. padding: px2rpx(20);
  96. text-align: center;
  97. .des1 {
  98. font-size: px2rpx(16);
  99. line-height: 1.6;
  100. margin: px2rpx(30) 0 px2rpx(50);
  101. }
  102. .myRED {
  103. color: #f56c6c;
  104. font-weight: bold;
  105. }
  106. }
  107. .digital-pay-confirm-body {
  108. text-align: left;
  109. padding: 0 0 px2rpx(4);
  110. box-sizing: border-box;
  111. .digital-pay-info {
  112. display: flex;
  113. align-items: center;
  114. gap: 24px;
  115. padding: 8px 0 px2rpx(4);
  116. }
  117. .digital-pay-info__fields {
  118. flex: 1;
  119. min-width: 0;
  120. }
  121. .digital-pay-field {
  122. margin-bottom: px2rpx(18);
  123. &:last-child {
  124. margin-bottom: 0;
  125. }
  126. }
  127. .digital-pay-field__label {
  128. display: block;
  129. font-size: px2rpx(16);
  130. font-weight: bold;
  131. margin-bottom: px2rpx(8);
  132. line-height: 1.4;
  133. color: var(--bs-emphasis-color);
  134. }
  135. .digital-pay-field__value {
  136. font-size: px2rpx(16);
  137. line-height: 1.55;
  138. word-break: break-all;
  139. overflow-wrap: anywhere;
  140. }
  141. .digital-pay-field__value--currency {
  142. max-width: 100%;
  143. padding: px2rpx(10) px2rpx(14);
  144. border-radius: px2rpx(4);
  145. border: 1px solid var(--bs-border-color);
  146. color: var(--bs-emphasis-color);
  147. box-sizing: border-box;
  148. }
  149. .digital-pay-field__value--address {
  150. padding: 0;
  151. border: none;
  152. background: transparent;
  153. font-size: px2rpx(16);
  154. color: var(--bs-emphasis-color);
  155. line-height: 1.6;
  156. }
  157. .digital-pay-info__qr {
  158. flex-shrink: 0;
  159. align-self: center;
  160. }
  161. .digital-pay-info__qr-inner {
  162. display: flex;
  163. align-items: center;
  164. justify-content: center;
  165. padding: px2rpx(10);
  166. border: 1px solid var(--bs-border-color);
  167. border-radius: px2rpx(6);
  168. background: var(--bs-bg-color);
  169. box-sizing: border-box;
  170. image {
  171. display: block;
  172. width: px2rpx(120);
  173. height: px2rpx(120);
  174. object-fit: contain;
  175. }
  176. }
  177. .digital-pay-divider {
  178. border: none;
  179. border-top: 1px solid var(--bs-border-color);
  180. margin: px2rpx(20) 0 px2rpx(22);
  181. }
  182. .digital-pay-upload-wrap {
  183. margin-top: 0;
  184. :deep(.uni-easyinput__content) {
  185. height: px2rpx(43);
  186. }
  187. }
  188. .digital-pay-upload__label {
  189. font-size: px2rpx(16);
  190. font-weight: bold;
  191. margin-bottom: px2rpx(10);
  192. line-height: 1.4;
  193. color: var(--bs-emphasis-color);
  194. }
  195. }
  196. .dialog-digital-pay {
  197. border-radius: px2rpx(8);
  198. overflow: hidden;
  199. .el-dialog__header {
  200. padding: px2rpx(18) px2rpx(20) px2rpx(8);
  201. }
  202. .el-dialog__title {
  203. font-size: px2rpx(16);
  204. font-weight: bold;
  205. color: var(--bs-emphasis-color);
  206. }
  207. .el-dialog__body {
  208. padding: px2rpx(4) px2rpx(28) px2rpx(8);
  209. }
  210. .el-dialog__footer {
  211. padding: px2rpx(8) px2rpx(22);
  212. }
  213. }
  214. </style>