recharge.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. <template>
  2. <view class="center">
  3. <view class="top">
  4. <view class="title flex">
  5. <view class="xian"></view>
  6. <view class="title-font">充币二维码TRC20</view>
  7. </view>
  8. <view class="erweima-box">
  9. <view class="erweima-font">请转入USDT</view>
  10. <view class="erweima">
  11. <tki-qrcode
  12. :cid="cid"
  13. ref="qrcode"
  14. :val="num"
  15. :size="size"
  16. :unit="unit"
  17. :background="background"
  18. :foreground="foreground"
  19. :pdground="pdground"
  20. :iconSize="iconSize"
  21. :lv="lv"
  22. :onval="onval"
  23. :loadMake="loadMake"
  24. :usingComponents="usingComponents"
  25. @result="qrR"
  26. />
  27. </view>
  28. </view>
  29. <view class="btn" @click="domFile">保存二维码</view>
  30. </view>
  31. <view class="top">
  32. <view class="title flex">
  33. <view class="xian"></view>
  34. <view class="title-font">充币地址</view>
  35. </view>
  36. <view class="address">{{ num }}</view>
  37. <view class="btn" style="margin-top: 50rpx;" @click="setData">复制充币地址</view>
  38. </view>
  39. <view class="top info">
  40. 请勿向上述地址充值人任何非USDT资产,否则资产将不可追回。
  41. <br />
  42. USDT冲币仅支持TRC2.0波场上的资产,其他USDT将无法上帐,请您谅解。
  43. <br />
  44. 您充值至上述地址后,需要整个网络节点确认,1次网络确认后到账,2次网络确认后即可提币。
  45. <br />
  46. 最小充值金额:10USDT,小于最小金额的充值将不会上帐且无法退回。
  47. </view>
  48. </view>
  49. </template>
  50. <script>
  51. import { wallet } from '@/api/finance.js';
  52. import tkiQrcode from '@/components/tki-qrcode/tki-qrcode.vue';
  53. export default {
  54. data() {
  55. return {
  56. num: '',
  57. image: '../../static/re/re1.png',
  58. cid: 'cid',
  59. size: 150,
  60. unit: '150',
  61. background: '#FFFFFF',
  62. foreground: '#000000',
  63. pdground: '#000000',
  64. icon: '',
  65. iconSize: 40,
  66. lv: 3,
  67. onval: true,
  68. loadMake: true,
  69. usingComponents: true,
  70. };
  71. },
  72. onLoad() {
  73. this.loadData();
  74. },
  75. methods: {
  76. async loadData() {
  77. wallet().then(({ data }) => {
  78. console.log(data);
  79. const arr = Object.keys(data.back);
  80. console.log(arr);
  81. let ar = [];
  82. arr.forEach(e => {
  83. console.log(e)
  84. ar.push(data.back[e]);
  85. });
  86. console.log(ar)
  87. this.num = ar[0].money.address
  88. });
  89. },
  90. domFile() {
  91. uni.downloadFile({
  92. url: this.image,
  93. success: e => {
  94. console.log(e);
  95. uni.showToast({
  96. title: '下载成功!'
  97. });
  98. },
  99. fail(e) {
  100. uni.showToast({
  101. title: '复制失败',
  102. icon: false
  103. });
  104. console.log(e);
  105. }
  106. });
  107. },
  108. qrR(res) {
  109. this.src = res;
  110. },
  111. setData() {
  112. // #ifdef APP-PLUS
  113. uni.setClipboardData({
  114. data: this.num,
  115. success: e => {
  116. uni.showToast({
  117. title: '复制成功!'
  118. });
  119. },
  120. fail(e) {
  121. uni.showToast({
  122. title: '复制失败',
  123. icon: false
  124. });
  125. console.log(e);
  126. }
  127. });
  128. // #endif
  129. }
  130. }
  131. };
  132. </script>
  133. <style lang="scss">
  134. .center,
  135. page {
  136. height: 100%;
  137. background: #f3f3f3;
  138. }
  139. .top:first-child {
  140. margin-top: 0;
  141. }
  142. .top {
  143. margin-top: 20rpx;
  144. width: 100%;
  145. height: auto;
  146. background: #ffffff;
  147. padding: 26rpx 30rpx 50rpx;
  148. .erweima-box {
  149. margin-top: 77rpx;
  150. .erweima-font {
  151. text-align: center;
  152. font-size: 30rpx;
  153. font-family: PingFang SC;
  154. font-weight: bold;
  155. color: #333333;
  156. }
  157. .erweima {
  158. margin: 16rpx auto 0;
  159. width: 300rpx;
  160. height: 300rpx;
  161. image {
  162. width: 100%;
  163. height: 100%;
  164. }
  165. }
  166. }
  167. .address {
  168. margin-top: 86rpx;
  169. text-align: center;
  170. }
  171. }
  172. .title {
  173. justify-content: flex-start;
  174. align-items: center;
  175. .xian {
  176. width: 2rpx;
  177. height: 30rpx;
  178. background: linear-gradient(90deg, #f95b2f, #60bab0, #45969b);
  179. }
  180. .title-font {
  181. padding-left: 16rpx;
  182. font-size: 30rpx;
  183. font-family: PingFang SC;
  184. font-weight: bold;
  185. color: #333333;
  186. }
  187. }
  188. .btn {
  189. margin: 36rpx auto 0;
  190. width: 500rpx;
  191. height: 60rpx;
  192. background: linear-gradient(90deg, #60bab0, #60bab0, #45969b);
  193. border-radius: 30px;
  194. line-height: 60rpx;
  195. text-align: center;
  196. font-size: 26rpx;
  197. font-family: PingFang SC;
  198. font-weight: 500;
  199. color: #ffffff;
  200. }
  201. .info {
  202. font-size: 24rpx;
  203. font-family: PingFang SC;
  204. font-weight: 500;
  205. color: #333333;
  206. line-height: 42rpx;
  207. }
  208. </style>