recharge.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359
  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. 从易趣付之外地址转入的资金,需要在完成交易的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 { show_cb,do_cb } from '@/api/recharge.js';
  63. // import { upload } from '@/api/real.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. uid: '',
  74. list: '',
  75. account: '',
  76. money: '',
  77. address: '',
  78. er_code: '',
  79. remark: '',
  80. img: '/static/image/img19.png',
  81. dataMoney: {},
  82. uid: '',
  83. account: '',
  84. money: '',
  85. address: '',
  86. remark: '',
  87. img: '/static/image/img19.png',
  88. val: "", // 要生成的二维码值
  89. size: 200, // 二维码大小
  90. unit: 'upx', // 单位
  91. background: '#FFF', // 背景色
  92. foreground: '#000', // 前景色
  93. pdground: '#000', // 角标色
  94. icon: '', // 二维码图标
  95. iconsize: 40, // 二维码图标大小
  96. lv: 3, // 二维码容错级别 , 一般不用设置,默认就行
  97. onval: true, // val值变化时自动重新生成二维码
  98. loadMake: true, // 组件加载完成后自动生成二维码
  99. src: '', // 二维码生成后的图片地址或base64
  100. codeShow: false,
  101. cid: '1',
  102. codeIcon: '', // 二维码图标
  103. };
  104. },
  105. onLoad() {
  106. this.uid = uni.getStorageSync('uid');
  107. this.qianBao();
  108. },
  109. methods: {
  110. //获取数据
  111. qianBao() {
  112. const that = this;
  113. qianBao({}).then(
  114. (res) => {
  115. that.dataMoney = res.data.back.USDT.money
  116. that.val = that.dataMoney.address;
  117. console.log(that.dataMoney, 'dataMoney');
  118. }
  119. ).catch(
  120. (res) => {
  121. console.log(res,'err');
  122. }
  123. )
  124. },
  125. // 下载图片
  126. domImage() {
  127. uni.downloadFile({
  128. url: this.er_code,
  129. success(re) {
  130. console.log(re.tempFilePath, 're');
  131. uni.showToast({
  132. title: '下载成功'
  133. });
  134. }
  135. })
  136. },
  137. // 复制地址
  138. copy() {
  139. copyText(this.dataMoney.address)
  140. },
  141. // 二维码生成
  142. qrR(res) {
  143. this.er_code = res;
  144. },
  145. //确认提交
  146. submission() {
  147. let obj = this;
  148. uni.showLoading({
  149. title: '充币中...',
  150. mask: true
  151. });
  152. //确认充值调接口,成功跳转页面
  153. do_cb({
  154. uid: obj.uid,
  155. img: obj.img,
  156. address: obj.address,
  157. money: obj.money,
  158. bz: obj.remark,
  159. })
  160. .then(function(e) {
  161. uni.showToast({
  162. title: '请耐心等待系统审核通过',
  163. duration: 1500,
  164. mask: false,
  165. icon: 'none'
  166. });
  167. uni.hideLoading();
  168. })
  169. .catch(function(e) {
  170. console.log(e);
  171. });
  172. },
  173. //上传图片
  174. scImg() {
  175. upload({
  176. file: ''
  177. }).then((e) => {
  178. console.log(e, 55)
  179. this.img = e[0].url;
  180. });
  181. },
  182. }
  183. };
  184. </script>
  185. <style lang="scss">
  186. /* page {
  187. min-height: 100%;
  188. background: linear-gradient(-28deg, rgba(44, 45, 53, 1), rgba(59, 62, 74, 1));
  189. } */
  190. .body_content {
  191. width: 100%;
  192. height: 100%;
  193. }
  194. .login_text {
  195. width: 100%;
  196. color: #fff !important;
  197. font-size: 28rpx !important;
  198. background-color: #1F2A4A;
  199. margin: 25rpx 0rpx;
  200. padding: 0rpx 25rpx;
  201. padding-bottom: 15rpx;
  202. }
  203. .recharge {
  204. text-align: center;
  205. color: #85858e;
  206. font-size: 30rpx;
  207. background-color: #1F2A4A;
  208. }
  209. .example-title {
  210. text-align: left !important;
  211. padding: 25rpx 25rpx;
  212. border-bottom: 2rpx solid #2F364E;
  213. color: #0C5AFA;
  214. .titleTip {
  215. width: 5rpx;
  216. height: 30rpx;
  217. background: linear-gradient(90deg, #0C5AFA, #1356FF);
  218. border-radius: 3rpx;
  219. margin-right: 15rpx;
  220. }
  221. }
  222. .infoBox {
  223. text-align: left;
  224. padding: 28rpx 51rpx;
  225. .tplName {
  226. font-family: PingFang SC;
  227. font-weight: bold;
  228. font-size: 32rpx;
  229. color: #FFFFFF;
  230. line-height: 24rpx;
  231. }
  232. .tplNum {
  233. margin: 30rpx 0rpx;
  234. padding: 15rpx 30rpx;
  235. border-radius: 10rpx;
  236. border: 1px solid #1356FF;
  237. font-family: PingFang SC;
  238. font-size: 26rpx;
  239. color: #1356FF;
  240. display: inline-block;
  241. }
  242. .tplAddr {
  243. color: #fff;
  244. font-size: 32rpx;
  245. text {
  246. padding-left: 15rpx;
  247. font-size: 26rpx;
  248. color: #FFFFFF;
  249. }
  250. }
  251. }
  252. .login_input {
  253. border-bottom: 1px solid #464755;
  254. padding: 35rpx;
  255. }
  256. .uni-input {
  257. width: 100%;
  258. text-align: left !important;
  259. }
  260. .code {
  261. width: 277rpx;
  262. height: 277rpx;
  263. margin: 25rpx auto;
  264. margin-bottom: 35rpx;
  265. background: #0C5AFA;
  266. }
  267. .code image {
  268. width: 100%;
  269. height: 100%;
  270. }
  271. .btnBox {
  272. justify-content: center;
  273. padding-bottom: 50rpx;
  274. padding-top: 30rpx;
  275. .btn {
  276. margin-right: 50rpx;
  277. font-family: PingFang SC;
  278. font-weight: bold;
  279. font-size: 26rpx;
  280. color: #0C5AFA;
  281. border: 1rpx solid #0C5AFA;
  282. padding: 15rpx 45rpx;
  283. border-radius: 15rpx;
  284. }
  285. }
  286. .submission {
  287. padding: 30rpx 25rpx;
  288. .golden {
  289. background: #0C5AFA;
  290. color: #fff;
  291. }
  292. }
  293. .login_name {
  294. width: 480rpx;
  295. color: #ffffff;
  296. }
  297. .login_name image {
  298. width: 100rpx;
  299. height: 100rpx;
  300. }
  301. .tip {
  302. padding: 29rpx 31rpx;
  303. line-height: 55rpx;
  304. font-size: 24rpx;
  305. }
  306. .select_img {
  307. width: 28rpx;
  308. height: 32rpx;
  309. }
  310. .select_img image {
  311. width: 100%;
  312. height: 100%;
  313. }
  314. .scann {
  315. margin-bottom: 35rpx;
  316. margin-top: 15rpx;
  317. }
  318. .scanning {
  319. background-color: #6f6f78;
  320. color: #ffffff;
  321. padding: 10rpx 30rpx;
  322. border-radius: 15rpx;
  323. font-size: 28rpx;
  324. }
  325. .address_code {
  326. padding: 25rpx 0rpx;
  327. color: #ffffff;
  328. }
  329. .input-placeholder {
  330. color: #fff !important;
  331. }
  332. </style>