digitalPayConfirmPopup.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. <template>
  2. <cwg-popup v-model:visible="visible" type="center" :mask-click="false" :showFooters="true"
  3. :title="t('Custom.Deposit.DigitalAcc')">
  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" :editable="true" :fileMediatype="'all'"
  34. :imageWidth="142" :imageHeight="142" uploadUrl="/common/upload" :baseUrl="Host80" />
  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 :customStyle="customStyle" :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 = () => { visible.value = false; imageUrl.value = "";hashCode.value = '' };
  86. </script>
  87. <style lang="scss" scoped>
  88. @import "@/uni.scss";
  89. .popup-content {
  90. padding: px2rpx(20);
  91. text-align: center;
  92. .des1 {
  93. font-size: px2rpx(16);
  94. line-height: 1.6;
  95. margin: px2rpx(30) 0 px2rpx(50);
  96. }
  97. .myRED {
  98. color: #f56c6c;
  99. font-weight: bold;
  100. }
  101. }
  102. .digital-pay-confirm-body {
  103. text-align: left;
  104. padding: 0 0 px2rpx(4);
  105. box-sizing: border-box;
  106. .digital-pay-info {
  107. display: flex;
  108. align-items: center;
  109. gap: 24px;
  110. padding: 8px 0 px2rpx(4);
  111. }
  112. .digital-pay-info__fields {
  113. flex: 1;
  114. min-width: 0;
  115. }
  116. .digital-pay-field {
  117. margin-bottom: px2rpx(18);
  118. &:last-child {
  119. margin-bottom: 0;
  120. }
  121. }
  122. .digital-pay-field__label {
  123. display: block;
  124. font-size: px2rpx(16);
  125. font-weight: bold;
  126. margin-bottom: px2rpx(8);
  127. line-height: 1.4;
  128. color: var(--bs-emphasis-color);
  129. }
  130. .digital-pay-field__value {
  131. font-size: px2rpx(16);
  132. line-height: 1.55;
  133. word-break: break-all;
  134. overflow-wrap: anywhere;
  135. }
  136. .digital-pay-field__value--currency {
  137. max-width: 100%;
  138. padding: px2rpx(10) px2rpx(14);
  139. border-radius: px2rpx(4);
  140. border: 1px solid var(--bs-border-color);
  141. color: var(--bs-emphasis-color);
  142. box-sizing: border-box;
  143. }
  144. .digital-pay-field__value--address {
  145. padding: 0;
  146. border: none;
  147. background: transparent;
  148. font-size: px2rpx(16);
  149. color: var(--bs-emphasis-color);
  150. line-height: 1.6;
  151. }
  152. .digital-pay-info__qr {
  153. flex-shrink: 0;
  154. align-self: center;
  155. }
  156. .digital-pay-info__qr-inner {
  157. display: flex;
  158. align-items: center;
  159. justify-content: center;
  160. padding: px2rpx(10);
  161. border: 1px solid var(--bs-border-color);
  162. border-radius: px2rpx(6);
  163. background: var(--bs-bg-color);
  164. box-sizing: border-box;
  165. image {
  166. display: block;
  167. width: px2rpx(120);
  168. height: px2rpx(120);
  169. object-fit: contain;
  170. }
  171. }
  172. .digital-pay-divider {
  173. border: none;
  174. border-top: 1px solid var(--bs-border-color);
  175. margin: px2rpx(20) 0 px2rpx(22);
  176. }
  177. .digital-pay-upload-wrap {
  178. margin-top: 0;
  179. :deep(.uni-easyinput__content){
  180. height: px2rpx(43);
  181. }
  182. }
  183. .digital-pay-upload__label {
  184. font-size: px2rpx(16);
  185. font-weight: bold;
  186. margin-bottom: px2rpx(10);
  187. line-height: 1.4;
  188. color: var(--bs-emphasis-color);
  189. }
  190. }
  191. .dialog-digital-pay {
  192. border-radius: px2rpx(8);
  193. overflow: hidden;
  194. .el-dialog__header {
  195. padding: px2rpx(18) px2rpx(20) px2rpx(8);
  196. }
  197. .el-dialog__title {
  198. font-size: px2rpx(16);
  199. font-weight: bold;
  200. color: var(--bs-emphasis-color);
  201. }
  202. .el-dialog__body {
  203. padding: px2rpx(4) px2rpx(28) px2rpx(8);
  204. }
  205. .el-dialog__footer {
  206. padding: px2rpx(8) px2rpx(22);
  207. }
  208. }
  209. </style>