recharge.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352
  1. <template>
  2. <view class="container">
  3. <view class="recharge">
  4. <view class="example-title flex_item">
  5. <view class="titleTip"></view>
  6. <view class="">充值地址</view>
  7. </view>
  8. <view class="infoBox">
  9. <view class="tplName">链名称</view>
  10. <view class="tplNum">USDT-TRC20</view>
  11. <view class="tplAddr">收款地址<text>{{dataMoney.address}}</text></view>
  12. </view>
  13. <view class="code">
  14. <image :src="er_code" mode=""></image>
  15. <!-- #ifdef H5 || APP-PLUS -->
  16. <zb-code ref="qrcode" :show="codeShow" :cid="cid" :val="val" :size="size" :unit="unit"
  17. :background="background" :foreground="foreground" :pdground="pdground" :icon="codeIcon"
  18. :iconSize="iconsize" :onval="onval" :loadMake="loadMake" @result="qrR" />
  19. <!-- #endif -->
  20. </view>
  21. <view class="flex btnBox">
  22. <!-- #ifdef APP -->
  23. <view class="btn margin-r-30" @click="domImage">保存相册</view>
  24. <!-- #endif -->
  25. <view class="btn" @click="copy">复制地址</view>
  26. </view>
  27. </view>
  28. <!-- <view class="login_text">
  29. <view class="login_input flex" style="padding-top: 45rpx;">
  30. <view class="login_img">金额</view>
  31. <view class="login_name"><input class="uni-input" type="text" v-model="money" placeholder="请输入充值金额" />
  32. </view>
  33. </view>
  34. <view class="login_input flex">
  35. <view class="login_img"><text>打款凭证</text></view>
  36. <view class="login_name" @click="scImg">
  37. <image :src="img"></image>
  38. </view>
  39. </view>
  40. <view class="login_input flex" style="padding-top: 45rpx;border-bottom: none;">
  41. <view class="login_img">备注</view>
  42. <view class="login_name"><input class="uni-input" type="text" v-model="remark"
  43. placeholder="例如:备注用户账号" /></view>
  44. </view>
  45. <view class="submission"><button class="golden" type="golden" hover-class="none"
  46. @click="submission">确认提交</button></view>
  47. </view> -->
  48. <view class="login_text">
  49. <view class="tip">
  50. <view>
  51. <text>
  52. 该地址仅支持 USDT-TRC20 收款请勿用于其他币种,否则资产将不可找回</br>
  53. 从STAR(星空)之外地址转入的资金,需要在完成交易的120分钟后,才能将资产转账给易币付其他用户或提到钱包以外的地址 最小收款金额:
  54. 0.0001USDT小于最小金额的收款将不会上账且无法退回1次网络确认后可到账,1次网络确认后可转账。您的充值地址不会经常改变,可截图保存并重复充值。
  55. </text>
  56. </view>
  57. </view>
  58. </view>
  59. </view>
  60. </template>
  61. <script type="text/javascript">
  62. import { rechargeUSDT } from '@/api/game.js';
  63. import { upload } from '@/api/order.js';
  64. import {
  65. qianBao
  66. } from '@/api/wallet.js';
  67. import {
  68. copyText
  69. } from '@/utils/rocessor.js';
  70. export default {
  71. data() {
  72. return {
  73. er_code: '',
  74. dataMoney: {},
  75. money: '',
  76. address: '',
  77. remark: '',
  78. img: '/static/image/img19.png',
  79. val: "", // 要生成的二维码值
  80. size: 200, // 二维码大小
  81. unit: 'upx', // 单位
  82. background: '#FFF', // 背景色
  83. foreground: '#000', // 前景色
  84. pdground: '#000', // 角标色
  85. icon: '', // 二维码图标
  86. iconsize: 40, // 二维码图标大小
  87. lv: 3, // 二维码容错级别 , 一般不用设置,默认就行
  88. onval: true, // val值变化时自动重新生成二维码
  89. loadMake: true, // 组件加载完成后自动生成二维码
  90. src: '', // 二维码生成后的图片地址或base64
  91. codeShow: false,
  92. cid: '1',
  93. codeIcon: '', // 二维码图标
  94. };
  95. },
  96. onLoad() {
  97. this.qianBao();
  98. },
  99. methods: {
  100. //获取数据
  101. qianBao() {
  102. const that = this;
  103. qianBao({}).then(
  104. (res) => {
  105. that.dataMoney = res.data.back.USDT.money
  106. that.val = that.dataMoney.address;
  107. console.log(that.dataMoney, 'dataMoney');
  108. }
  109. ).catch(
  110. (res) => {
  111. console.log(res,'err');
  112. }
  113. )
  114. },
  115. // 下载图片
  116. domImage() {
  117. uni.downloadFile({
  118. url: this.er_code,
  119. success(re) {
  120. console.log(re.tempFilePath, 're');
  121. uni.showToast({
  122. title: '下载成功'
  123. });
  124. }
  125. })
  126. },
  127. // 复制地址
  128. copy() {
  129. copyText(this.dataMoney.address)
  130. },
  131. // 二维码生成
  132. qrR(res) {
  133. this.er_code = res;
  134. },
  135. //确认提交
  136. submission() {
  137. let obj = this;
  138. uni.showLoading({
  139. title: '充币中...',
  140. mask: true
  141. });
  142. //确认充值调接口,成功跳转页面
  143. rechargeUSDT({
  144. num: obj.money,
  145. picture : obj.img,
  146. money_type: "USDT",
  147. mark: obj.remark,
  148. })
  149. .then(function(e) {
  150. uni.showToast({
  151. title: '请耐心等待系统审核通过',
  152. duration: 1200,
  153. mask: false,
  154. icon: 'none'
  155. });
  156. obj.money='';
  157. obj.img='/static/image/img19.png';
  158. obj.remark='';
  159. obj.qianBao();
  160. uni.navigateBack()
  161. })
  162. .catch(function(e) {
  163. console.log(e);
  164. });
  165. },
  166. //上传图片
  167. scImg() {
  168. upload({
  169. file: ''
  170. }).then((e) => {
  171. console.log(e, 55)
  172. this.img = e[0].url;
  173. });
  174. },
  175. }
  176. };
  177. </script>
  178. <style lang="scss">
  179. /* page {
  180. min-height: 100%;
  181. background: linear-gradient(-28deg, rgba(44, 45, 53, 1), rgba(59, 62, 74, 1));
  182. } */
  183. .body_content {
  184. width: 100%;
  185. height: 100%;
  186. }
  187. .login_text {
  188. width: 100%;
  189. color: #fff !important;
  190. font-size: 28rpx !important;
  191. background-color: #1F2A4A;
  192. margin: 25rpx 0rpx;
  193. padding: 0rpx 25rpx;
  194. padding-bottom: 15rpx;
  195. }
  196. .recharge {
  197. text-align: center;
  198. color: #85858e;
  199. font-size: 30rpx;
  200. background-color: #1F2A4A;
  201. }
  202. .example-title {
  203. text-align: left !important;
  204. padding: 25rpx 25rpx;
  205. border-bottom: 2rpx solid #2F364E;
  206. color: #0C5AFA;
  207. .titleTip {
  208. width: 5rpx;
  209. height: 30rpx;
  210. background: linear-gradient(90deg, #0C5AFA, #1356FF);
  211. border-radius: 3rpx;
  212. margin-right: 15rpx;
  213. }
  214. }
  215. .infoBox {
  216. text-align: left;
  217. padding: 28rpx 51rpx;
  218. .tplName {
  219. font-family: PingFang SC;
  220. font-weight: bold;
  221. font-size: 32rpx;
  222. color: #FFFFFF;
  223. line-height: 24rpx;
  224. }
  225. .tplNum {
  226. margin: 30rpx 0rpx;
  227. padding: 15rpx 30rpx;
  228. border-radius: 10rpx;
  229. border: 1px solid #1356FF;
  230. font-family: PingFang SC;
  231. font-size: 26rpx;
  232. color: #1356FF;
  233. display: inline-block;
  234. }
  235. .tplAddr {
  236. color: #fff;
  237. font-size: 32rpx;
  238. text {
  239. padding-left: 15rpx;
  240. font-size: 26rpx;
  241. color: #FFFFFF;
  242. }
  243. }
  244. }
  245. .login_input {
  246. border-bottom: 1px solid #464755;
  247. padding: 35rpx;
  248. }
  249. .uni-input {
  250. width: 100%;
  251. text-align: left !important;
  252. }
  253. .code {
  254. width: 277rpx;
  255. height: 277rpx;
  256. margin: 25rpx auto;
  257. margin-bottom: 35rpx;
  258. background: #0C5AFA;
  259. }
  260. .code image {
  261. width: 100%;
  262. height: 100%;
  263. }
  264. .btnBox {
  265. justify-content: center;
  266. padding-bottom: 50rpx;
  267. padding-top: 30rpx;
  268. .btn {
  269. margin-right: 50rpx;
  270. font-family: PingFang SC;
  271. font-weight: bold;
  272. font-size: 26rpx;
  273. color: #0C5AFA;
  274. border: 1rpx solid #0C5AFA;
  275. padding: 15rpx 45rpx;
  276. border-radius: 15rpx;
  277. }
  278. }
  279. .submission {
  280. padding: 30rpx 25rpx;
  281. .golden {
  282. background: #0C5AFA;
  283. color: #fff;
  284. }
  285. }
  286. .login_name {
  287. width: 480rpx;
  288. color: #ffffff;
  289. }
  290. .login_name image {
  291. width: 100rpx;
  292. height: 100rpx;
  293. }
  294. .tip {
  295. padding: 29rpx 31rpx;
  296. line-height: 55rpx;
  297. font-size: 24rpx;
  298. }
  299. .select_img {
  300. width: 28rpx;
  301. height: 32rpx;
  302. }
  303. .select_img image {
  304. width: 100%;
  305. height: 100%;
  306. }
  307. .scann {
  308. margin-bottom: 35rpx;
  309. margin-top: 15rpx;
  310. }
  311. .scanning {
  312. background-color: #6f6f78;
  313. color: #ffffff;
  314. padding: 10rpx 30rpx;
  315. border-radius: 15rpx;
  316. font-size: 28rpx;
  317. }
  318. .address_code {
  319. padding: 25rpx 0rpx;
  320. color: #ffffff;
  321. }
  322. .input-placeholder {
  323. color: #fff !important;
  324. }
  325. </style>