recharge.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  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. 最小充值金额:100USDT,小于最小金额的充值将不会上帐且无法退回。
  47. <br />
  48. 请通过IMTOKEN充值,充值时在备注栏填写 个人的用户ID,如果用户ID错误,将导致您无法入账,请注意确认。
  49. </view>
  50. </view>
  51. </template>
  52. <script>
  53. import { wallet } from '@/api/finance.js';
  54. import tkiQrcode from '@/components/tki-qrcode/tki-qrcode.vue';
  55. export default {
  56. data() {
  57. return {
  58. num: '',
  59. image: '../../static/re/re1.png',
  60. cid: 'cid',
  61. size: 150,
  62. unit: '150',
  63. background: '#FFFFFF',
  64. foreground: '#000000',
  65. pdground: '#000000',
  66. icon: '',
  67. iconSize: 40,
  68. lv: 3,
  69. onval: true,
  70. loadMake: true,
  71. usingComponents: true,
  72. };
  73. },
  74. onLoad() {
  75. this.loadData();
  76. },
  77. methods: {
  78. async loadData() {
  79. wallet().then(({ data }) => {
  80. console.log(data);
  81. const arr = Object.keys(data.back);
  82. console.log(arr);
  83. let ar = [];
  84. arr.forEach(e => {
  85. console.log(e)
  86. ar.push(data.back[e]);
  87. });
  88. console.log(ar)
  89. this.num = ar[0].money.address
  90. });
  91. },
  92. domFile() {
  93. uni.downloadFile({
  94. url: this.image,
  95. success: e => {
  96. console.log(e);
  97. uni.showToast({
  98. title: '下载成功!'
  99. });
  100. },
  101. fail(e) {
  102. uni.showToast({
  103. title: '复制失败',
  104. icon: false
  105. });
  106. console.log(e);
  107. }
  108. });
  109. },
  110. qrR(res) {
  111. this.src = res;
  112. },
  113. setData() {
  114. // #ifdef APP-PLUS
  115. uni.setClipboardData({
  116. data: this.num,
  117. success: e => {
  118. uni.showToast({
  119. title: '复制成功!'
  120. });
  121. },
  122. fail(e) {
  123. uni.showToast({
  124. title: '复制失败',
  125. icon: false
  126. });
  127. console.log(e);
  128. }
  129. });
  130. // #endif
  131. }
  132. }
  133. };
  134. </script>
  135. <style lang="scss">
  136. .center,
  137. page {
  138. height: 100%;
  139. background: #f3f3f3;
  140. }
  141. .top:first-child {
  142. margin-top: 0;
  143. }
  144. .top {
  145. margin-top: 20rpx;
  146. width: 100%;
  147. height: auto;
  148. background: #ffffff;
  149. padding: 26rpx 30rpx 50rpx;
  150. .erweima-box {
  151. margin-top: 77rpx;
  152. .erweima-font {
  153. text-align: center;
  154. font-size: 30rpx;
  155. font-family: PingFang SC;
  156. font-weight: bold;
  157. color: #333333;
  158. }
  159. .erweima {
  160. margin: 16rpx auto 0;
  161. width: 300rpx;
  162. height: 300rpx;
  163. image {
  164. width: 100%;
  165. height: 100%;
  166. }
  167. }
  168. }
  169. .address {
  170. margin-top: 86rpx;
  171. text-align: center;
  172. }
  173. }
  174. .title {
  175. justify-content: flex-start;
  176. align-items: center;
  177. .xian {
  178. width: 2rpx;
  179. height: 30rpx;
  180. background: linear-gradient(90deg, #f95b2f, #60bab0, #45969b);
  181. }
  182. .title-font {
  183. padding-left: 16rpx;
  184. font-size: 30rpx;
  185. font-family: PingFang SC;
  186. font-weight: bold;
  187. color: #333333;
  188. }
  189. }
  190. .btn {
  191. margin: 36rpx auto 0;
  192. width: 500rpx;
  193. height: 60rpx;
  194. background: linear-gradient(90deg, #60bab0, #60bab0, #45969b);
  195. border-radius: 30px;
  196. line-height: 60rpx;
  197. text-align: center;
  198. font-size: 26rpx;
  199. font-family: PingFang SC;
  200. font-weight: 500;
  201. color: #ffffff;
  202. }
  203. .info {
  204. font-size: 24rpx;
  205. font-family: PingFang SC;
  206. font-weight: 500;
  207. color: #333333;
  208. line-height: 42rpx;
  209. }
  210. </style>