digitalPayConfirmPopup.vue 6.9 KB

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