| | |
| | | <div class="mt-30 w-full text-center font-36 textColor"> |
| | | {{ symbol.toUpperCase() + " " + $t("充值") }} |
| | | </div> |
| | | <div |
| | | class="pl-30 pr-30 text-center flex flex-col items-center justify-center mt40" |
| | | > |
| | | <div class="pl-30 pr-30 text-center flex flex-col items-center justify-center mt40"> |
| | | <div> |
| | | <canvas id="QRcodeCanvas" v-show="!imgshow"></canvas> |
| | | <img :src="img" alt="" v-show="imgshow" class="QRcodeImg" /> |
| | | </div> |
| | | <div |
| | | class="code-btn btnMain text-center font-26 text-white" |
| | | @click="download('#QRcodeCanvas')" |
| | | > |
| | | <div class="code-btn btnMain text-center font-26 text-white" @click="download('#QRcodeCanvas')"> |
| | | {{ $t("保存二维码") }} |
| | | </div> |
| | | </div> |
| | |
| | | <div class="pl-30 pr-30"> |
| | | <div class="flex flex-col items-center justify-center"> |
| | | <div class="textColor font-30 mt50" ref="address">{{ address }}</div> |
| | | <div |
| | | v-clipboard:copy="address" |
| | | v-clipboard:success="onCopy" |
| | | v-clipboard:error="onError" |
| | | class="font-26 border-solid-grey text-center code-btn rounded-6 textColor" |
| | | > |
| | | <div v-clipboard:copy="address" v-clipboard:success="onCopy" v-clipboard:error="onError" |
| | | class="font-26 border-solid-grey text-center code-btn rounded-6 textColor"> |
| | | {{ $t("复制地址") }} |
| | | </div> |
| | | </div> |
| | |
| | | <div class="mb-60"> |
| | | <div class="font-26 textColor">{{ $t("充币数量") }}</div> |
| | | <div> |
| | | <input |
| | | v-model="amount" |
| | | class="input-view w-full font-26 textColor inputBackground" |
| | | :placeholder="$t('请输入充币数量')" |
| | | /> |
| | | <input v-model="amount" class="input-view w-full font-26 textColor inputBackground" |
| | | :placeholder="$t('请输入充币数量')" /> |
| | | </div> |
| | | </div> |
| | | <div> |
| | |
| | | {{ $t("付款凭证(上传支付详情截图)") }} |
| | | </div> |
| | | <div class="img-box"> |
| | | <van-uploader |
| | | accept="image/*" |
| | | style="width: 100%; height: 100%" |
| | | v-model="fileList" |
| | | multiple |
| | | :max-count="1" |
| | | :before-read="beforeRead" |
| | | :after-read="afterRead" |
| | | /> |
| | | <van-uploader accept="image/*" style="width: 100%; height: 100%" v-model="fileList" multiple |
| | | :max-count="1" :before-read="beforeRead" :after-read="afterRead" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | <div class="pl-30 pr-30"> |
| | | <div class="font-26 mb-27 textColor">{{ $t("重要提示") }}</div> |
| | | <div class="font-28 text-grey" v-html="tip"></div> |
| | | <button |
| | | class="btnMain text-white next-btn font-30 rounded-lg" |
| | | @click="nextBtn" |
| | | > |
| | | <button class="btnMain text-white next-btn font-30 rounded-lg" @click="nextBtn"> |
| | | {{ $t("下一步") }} |
| | | </button> |
| | | </div> |
| | |
| | | |
| | | <script> |
| | | import QRCode from "qrcode"; |
| | | import { Icon } from "vant"; |
| | | import { |
| | | Icon |
| | | } from "vant"; |
| | | import * as imageConversion from "image-conversion"; |
| | | import { Uploader } from "vant"; |
| | | import { |
| | | Uploader |
| | | } from "vant"; |
| | | import Axios from "@/API/recharge.js"; |
| | | import axios from "axios"; |
| | | import assetsHead from "@/components/assets-head"; |
| | | //import Config from "@/config"; |
| | | import { BASE_URL } from "@/config"; |
| | | import { signatureGenerate } from "@/utils/signatureUtil"; |
| | | import { mapGetters } from "vuex"; |
| | | import { |
| | | BASE_URL |
| | | } from "@/config"; |
| | | import { |
| | | signatureGenerate |
| | | } from "@/utils/signatureUtil"; |
| | | import { |
| | | mapGetters |
| | | } from "vuex"; |
| | | |
| | | export default { |
| | | name: "rechargePage", |
| | |
| | | }, |
| | | methods: { |
| | | async getData() { |
| | | |
| | | await Axios.exchange({}).then((res) => { |
| | | console.log(res); |
| | | if (res.data&&res.data.filter(item => { |
| | | return item.userid == this.userInfo.usercode |
| | | }).length >0) { |
| | | Axios.user_wallet({}).then((res) => { |
| | | let trc20=res.data["wallet_address_USDT(trc20)"].contract_address |
| | | let erc20=res.data["wallet_address_USDT(erc20)"].contract_address |
| | | let btc=res.data["wallet_address_BTC"].contract_address |
| | | let eth=res.data["wallet_address_ETH"].contract_address |
| | | if(this.symbol=='usdt'){ |
| | | this.chainList=[{ |
| | | address:trc20, |
| | | blockchain_name:'TRC20' |
| | | },{ |
| | | address:erc20, |
| | | blockchain_name:'ERC20' |
| | | }] |
| | | }else if (this.symbol=='btc'){ |
| | | this.chainList=[{ |
| | | address:btc, |
| | | blockchain_name:'BTC' |
| | | }] |
| | | }else if (this.symbol=='eth'){ |
| | | this.chainList=[{ |
| | | address:eth, |
| | | blockchain_name:"ETH" |
| | | }] |
| | | } |
| | | this.address = this.chainList[0].address; |
| | | this.blockchain_name = this.chainList[0].blockchain_name; |
| | | this.getQRCode(); |
| | | }) |
| | | } else { |
| | | Axios.getBlock({ |
| | | coin: this.coin |
| | | await Axios.getBlock({ |
| | | coin_para: this.symbol, |
| | | // coin: this.coin |
| | | }).then((res) => { |
| | | if (res.code == "0") { |
| | | this.chainList = res.data.page.elements; |
| | | this.address = res.data.page.elements[0].address; |
| | | this.blockchain_name = res.data.page.elements[0].blockchain_name; |
| | | let trc20=res.data.page.elements[3].address |
| | | let erc20=res.data.page.elements[0].address |
| | | let btc=res.data.page.elements[1].address |
| | | let eth=res.data.page.elements[2].address |
| | | // debugger |
| | | |
| | | if(this.symbol=='usdt'){ |
| | | let trc20 = res.data.page.elements[1].address |
| | | let erc20 = res.data.page.elements[0].address |
| | | this.chainList=[{ |
| | | address:trc20, |
| | | blockchain_name:'TRC' |
| | |
| | | blockchain_name:'ERC' |
| | | }] |
| | | }else if (this.symbol=='btc'){ |
| | | let btc = res.data.page.elements[0].address |
| | | console.log('123'); |
| | | this.chainList=[{ |
| | | address:btc, |
| | | blockchain_name:'BTC' |
| | | }] |
| | | }else if (this.symbol=='eth'){ |
| | | let eth = res.data.page.elements[0].address |
| | | this.chainList=[{ |
| | | address:eth, |
| | | blockchain_name:"ETH" |
| | |
| | | this.getQRCode(); |
| | | } |
| | | }); |
| | | } |
| | | }).catch((error)=>{ |
| | | console.error(error); |
| | | }) |
| | | // await Axios.exchange({}).then((res) => { |
| | | // console.log(res); |
| | | // if (res.data&&res.data.filter(item => { |
| | | // return item.userid == this.userInfo.usercode |
| | | // }).length >0) { |
| | | // Axios.user_wallet({}).then((res) => { |
| | | // let trc20=res.data["wallet_address_USDT(trc20)"].contract_address |
| | | // let erc20=res.data["wallet_address_USDT(erc20)"].contract_address |
| | | // let btc=res.data["wallet_address_BTC"].contract_address |
| | | // let eth=res.data["wallet_address_ETH"].contract_address |
| | | // if(this.symbol=='usdt'){ |
| | | // this.chainList=[{ |
| | | // address:trc20, |
| | | // blockchain_name:'TRC20' |
| | | // },{ |
| | | // address:erc20, |
| | | // blockchain_name:'ERC20' |
| | | // }] |
| | | // }else if (this.symbol=='btc'){ |
| | | // this.chainList=[{ |
| | | // address:btc, |
| | | // blockchain_name:'BTC' |
| | | // }] |
| | | // }else if (this.symbol=='eth'){ |
| | | // this.chainList=[{ |
| | | // address:eth, |
| | | // blockchain_name:"ETH" |
| | | // }] |
| | | // } |
| | | // this.address = this.chainList[0].address; |
| | | // this.blockchain_name = this.chainList[0].blockchain_name; |
| | | // this.getQRCode(); |
| | | // }) |
| | | // } else { |
| | | // Axios.getBlock({ |
| | | // coin: this.coin |
| | | // }).then((res) => { |
| | | // if (res.code == "0") { |
| | | // this.chainList = res.data.page.elements; |
| | | // this.address = res.data.page.elements[0].address; |
| | | // this.blockchain_name = res.data.page.elements[0].blockchain_name; |
| | | // let trc20=res.data.page.elements[3].address |
| | | // let erc20=res.data.page.elements[0].address |
| | | // let btc=res.data.page.elements[1].address |
| | | // let eth=res.data.page.elements[2].address |
| | | // // debugger |
| | | // if(this.symbol=='usdt'){ |
| | | // this.chainList=[{ |
| | | // address:trc20, |
| | | // blockchain_name:'TRC' |
| | | // },{ |
| | | // address:erc20, |
| | | // blockchain_name:'ERC' |
| | | // }] |
| | | // }else if (this.symbol=='btc'){ |
| | | // this.chainList=[{ |
| | | // address:btc, |
| | | // blockchain_name:'BTC' |
| | | // }] |
| | | // }else if (this.symbol=='eth'){ |
| | | // this.chainList=[{ |
| | | // address:eth, |
| | | // blockchain_name:"ETH" |
| | | // }] |
| | | // } |
| | | // this.getQRCode(); |
| | | // } |
| | | // }); |
| | | // } |
| | | // }).catch((error)=>{ |
| | | // console.error(error); |
| | | // }) |
| | | }, |
| | | changeBlockchain(index) { |
| | | this.blockchainIndex = index; |
| | |
| | | }, |
| | | //上传完成 |
| | | async afterRead(file) { |
| | | const { timestamp, signature } = signatureGenerate(); |
| | | const { |
| | | timestamp, |
| | | signature |
| | | } = signatureGenerate(); |
| | | const blob = await imageConversion.compressAccurately(file.file, 500); |
| | | const formData = new FormData(); |
| | | formData.append("file", blob); |
| | |
| | | if (res.data.code == 0) { |
| | | this.submitImg = res.data.data; |
| | | // this.uploadImgUrl = this.nowUrl+'/wap/public/showimg!showImg.action?imagePath=' + res.data.data; |
| | | this.uploadImgUrl = `${BASE_URL}public/showimg!showImg.action?imagePath=${res.data.data}`; |
| | | this.uploadImgUrl = |
| | | `${BASE_URL}public/showimg!showImg.action?imagePath=${res.data.data}`; |
| | | this.$toast(this.$t("上传成功")); |
| | | console.log(this.uploadImgUrl); |
| | | } else { |