transfer.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. <template>
  2. <view class="container">
  3. <view class="listBox">
  4. <view class="titleTetx">收款地址</view>
  5. <view class="flex listTpl">
  6. <input type="number" class="inputBox" v-model="address" placeholder="请输入收款地址" />
  7. </view>
  8. </view>
  9. <view class="listBox" style="padding-top: 0rpx;">
  10. <view class="titleTetx">转账数量</view>
  11. <view class="listTpl flex">
  12. <input type="number" class="inputBox" v-model="number" placeholder="请输入转账金额" />
  13. <view class="listAll" @click="number=dataMoney.money">全部</view>
  14. </view>
  15. <view class="flex tipBox">
  16. <view class="tip1">可用余额{{dataMoney.money||0}}USDT</view>
  17. </view>
  18. </view>
  19. <view class="submission">
  20. <button class="golden" type="golden" hover-class="none" @click="submission">确认转账</button>
  21. </view>
  22. </view>
  23. </template>
  24. <script>
  25. import {
  26. trade
  27. } from '@/api/game.js';
  28. import {
  29. qianBao
  30. } from '@/api/wallet.js';
  31. export default {
  32. data() {
  33. return {
  34. address: '',
  35. number: '',
  36. dataMoney:{},
  37. };
  38. },
  39. onLoad() {
  40. this.qianBao();
  41. },
  42. methods: {
  43. qianBao(){
  44. const taht = this;
  45. qianBao({}).then(
  46. (res) => {
  47. taht.dataMoney = res.data.back.USDT.money
  48. taht.dataMoney.money = +taht.dataMoney.money;
  49. }
  50. ).catch(
  51. (res) => {
  52. }
  53. )
  54. },
  55. submission() {
  56. const that = this;
  57. uni.showModal({
  58. title: '请输入支付密码',
  59. editable:true,
  60. success: res => {
  61. if(res.confirm){
  62. trade({
  63. type: "",
  64. num: that.number,
  65. to_user_address: that.address,
  66. trade_psw: res.content,
  67. }).then(
  68. (res) => {
  69. uni.showToast({
  70. title: e.msg,
  71. duration: 1500,
  72. });
  73. }
  74. ).catch(
  75. (res) => {
  76. }
  77. )
  78. }
  79. },
  80. fail: () => {},
  81. complete: () => {}
  82. });
  83. }
  84. }
  85. };
  86. </script>
  87. <style lang="scss">
  88. .container {
  89. padding: 25rpx 25rpx;
  90. }
  91. .listBox {
  92. padding: 46rpx 25rpx;
  93. background: #1F2A4A;
  94. border-radius: 10rpx;
  95. .titleTetx {
  96. font-weight: bold;
  97. font-size: 24rpx;
  98. color: #FFFFFF;
  99. padding-bottom: 25rpx;
  100. }
  101. .tipBox {
  102. padding-top: 15rpx;
  103. font-size: 24rpx;
  104. .tip1 {
  105. font-family: PingFang SC;
  106. font-weight: 500;
  107. font-size: 26rpx;
  108. color: #0C5AFA;
  109. line-height: 45rpx;
  110. }
  111. }
  112. }
  113. .listTpl {
  114. border-bottom: 1rpx solid #6A7288;
  115. padding-bottom: 25rpx;
  116. .inputBox {
  117. font-size: 35rpx;
  118. color: #FFFFFF;
  119. }
  120. .listTip {}
  121. .listAll {
  122. padding-left: 30rpx;
  123. font-size: 30rpx;
  124. color: #0C5AFA;
  125. }
  126. }
  127. .input-placeholder {
  128. font-family: PingFang SC;
  129. font-weight: 500;
  130. font-size: 26rpx;
  131. color: #666666;
  132. }
  133. .submission {
  134. padding: 80rpx 25rpx;
  135. padding-bottom: 25rpx;
  136. .golden {
  137. background: #0C5AFA;
  138. color: #ffffff;
  139. }
  140. }
  141. </style>