12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295 |
- <template>
- <div class="payment">
- <!-- 选择支付方式 -->
- <template v-if="step === 1">
- <div class="moneyInfo">
- <div class="tips">You Neet to Pay</div>
- <div class="money" v-if="salePlans">
- <FontZoom width="300" :unColor="true" v-if="salePlans && salePlans.price">
- <template v-if="salePlans && salePlans.currencyCode && salePlans.currencyCode !== 'USD'">
- <template v-if="salePlans.price.length + salePlans.currencyInfo.tokenSymbol.length >= 30">
- <div style="text-align:center">
- <div><img class="icon" :src="salePlans.currencyInfo.iconPath" /> {{ salePlans.price }}</div>
- <div>{{ salePlans.currencyInfo.tokenSymbol }} (${{salePlans.usdPrice}})</div>
- </div>
- </template>
- <template v-else>
- <img class="icon" :src="salePlans.currencyInfo.iconPath" /> {{ salePlans.price }} {{ salePlans.currencyInfo.tokenSymbol }} (${{salePlans.usdPrice}})
- </template>
- </template>
- <template v-else>
- <span class="info usd">${{salePlans.usdPrice}}</span>
- </template>
- </FontZoom>
- </div>
- </div>
- <div class="payList">
- <div class="detail" v-if="salePlans && salePlans.currencyCode && salePlans.currencyCode !== 'USD'">
- <div class="title">Crypto Wallet</div>
- <div class="item denet" @click="deNetPay">
- <div>
- <img src="../../static/payment/icon_wallet.png" />
- <span>DeNet Pay</span>
- </div>
- <div class="wallet">
- <FontZoom width="300" :unColor="true">
- Balance:{{currencyInfoData.balance}} {{currencyInfoData.tokenSymbol}}
- </FontZoom>
- </div>
- </div>
- <div class="item" @click="maskPay">
- <a class="maskLink" :href="maskUrlLink" v-if="Number(usdAmountData.rechargeAmountValue) > 0"></a>
- <img src="../../static/payment/icon_meta_mask.png" />
- <span>MetaMask</span>
- </div>
- </div>
- <div class="detail" v-if="salePlans && salePlans.currencyCode && salePlans.currencyCode === 'USD'">
- <div class="title">Credit/Debit Card</div>
- <div class="item denet" @click="deNetPay">
- <div>
- <img src="../../static/payment/icon_wallet.png" />
- <span>DeNet Pay</span>
- </div>
- <div class="wallet">
- Balance:{{currencyInfoData.balance}} {{currencyInfoData.tokenSymbol}}
- </div>
- </div>
- <div class="item" @click="achPay(true, Report.objectType.mastercardPayButton)">
- <img src="../../static/payment/icon_master_card.png" />
- <span>MasterCard</span>
- </div>
- <div class="item" @click="achPay(true, Report.objectType.visaPayButton)">
- <img src="../../static/payment/icon_visa.png" />
- <span>VISA</span>
- </div>
- </div>
- <div class="detail">
- <div class="title">Redemption Code</div>
- <div class="item" @click="showRedeem">
- <img src="../../static/payment/icon_enter_code.png" />
- <span>Enter Code</span>
- </div>
- </div>
- </div>
- </template>
- <!-- 余额足够 -->
- <template v-else-if="step === 2">
- <div class="balanceTop">
- <img class="balance" src="../../static/img/icon_balance.svg" />
- <div class="text">Balance</div>
- <div class="money">
- <FontZoom width="300" :unColor="true">
- <img class="icon" :src="currencyInfoData.iconPath" /> {{currencyInfoData.balance}} {{currencyInfoData.tokenSymbol}}
- </FontZoom>
- </div>
- <template v-if="waitRefresh">
- <div class="waitFont">It may take some time to credit the funds into your account.</div>
- <div
- @click="checkWaitInfo"
- class="waitBtn">
- <img :class="{ 'icon-refresh-rotate': refreshRotate }" src="../../static/img/icon_refresh.svg" />
- </div>
- </template>
- </div>
- <div class="balanceBot">
- <div class="l">
- <div class="neet">You Neet to Pay</div>
- <div class="money">
- <FontZoom width="190" :unColor="true">
- <span class="text">{{salePlans.price}} {{ salePlans.currencyInfo.tokenSymbol }}</span>
- </FontZoom>
- </div>
- </div>
- <div>
- <div
- class="btn"
- :class="{ disabled: (Number(usdAmountData.rechargeAmountValue) > 0) || payDisabled }"
- @click="pay">
- Pay Now
- </div>
- </div>
- </div>
- </template>
- <!-- 余额不足 -->
- <template v-else-if="step === 3">
- <template v-if="salePlans && salePlans.currencyCode && salePlans.currencyCode !== 'USD'">
- <div class="balanceInfo">
- <div class="top">
- <div class="item title">
- <img src="../../static/img/icon_deposit.png" />
- <span>Deposit to Buy</span>
- </div>
- <div class="item column">
- <div class="l">Deposit</div>
- <div class="r">
- <FontZoom width="260" :unColor="true">
- <img :src="currencyInfoData.iconPath" />
- <span>{{ usdAmountData.rechargeAmountValue || 0 }} {{currencyInfoData.tokenSymbol}}</span>
- </FontZoom>
- </div>
- </div>
- <div class="item column">
- <div class="l">Network</div>
- <div class="r">
- <FontZoom width="260" :unColor="true">
- <img :src="currencyInfoData.chainInfo.iconPath" />
- <span>{{ currencyInfoData.chainInfo.chainName }}</span>
- </FontZoom>
- </div>
- </div>
- <div class="address">
- <div class="title">Address</div>
- <QrCode :tokenChain="currencyInfoData.tokenChain" :rechargeAddress="rechargeAddress" @copy="copyErCode"></QrCode>
- </div>
- <div class="notice">
- <div class="icon"><img src="../../static/img/icon_warning.svg" /></div>
- <div class="text">Make sure you also selected <Br/><strong>{{ currencyInfoData.chainInfo.chainName }}</strong> <br/>as the Network on the platform where you are withdrawing funds for this deposiit. Otherwise, you'll lose your assets.</div>
- </div>
- </div>
- <div class="line"></div>
- <div class="balance">
- <div class="icon">
- <img src="../../static/img/icon_balance_blue.svg" />
- </div>
- <div class="text">
- <FontZoom width="260" :unColor="true">
- <span>Balance: {{ currencyInfoData.balance }} {{ currencyInfoData.tokenSymbol }}</span>
- </FontZoom>
- </div>
- <div
- class="refresh"
- @click="checkCurrencyInfo">
- <img :class="{ 'icon-refresh-rotate': refreshRotate }" src="../../static/img/icon_refresh.svg" />
- </div>
- </div>
- </div>
- <div class="balanceBot">
- <div class="l">
- <div class="neet">You Neet to Pay</div>
- <div class="money">
- <FontZoom width="190" :unColor="true">
- {{salePlans.price}} {{ salePlans.currencyInfo.tokenSymbol }}
- </FontZoom>
- </div>
- </div>
- <div>
- <div
- class="btn"
- :class="{ disabled: (Number(usdAmountData.rechargeAmountValue) > 0) || payDisabled }"
- @click="payToken">
- Pay Now
- </div>
- </div>
- </div>
- </template>
- <template v-if="salePlans && salePlans.currencyCode && salePlans.currencyCode === 'USD'">
- <div class="balanceInfo">
- <div class="top">
- <div class="item usd">
- <div class="l">Payment amount</div>
- <div class="r fontPayment">${{ usdAmountData.orderAmountValue }}</div>
- </div>
- <div class="item usd">
- <div class="l">Balance</div>
- <div class="r font">${{ usdAmountData.balance }}</div>
- </div>
- <div class="item usd" v-if="Number(usdAmountData.rechargeAmountValue) > 0">
- <div class="l">{{ usdAmountData.feeDesc }}</div>
- <div class="r font">${{ usdAmountData.feeAmountValue }}</div>
- </div>
- <div class="item usd" v-if="Number(usdAmountData.rechargeAmountValue) > 0">
- <div class="l">Deposit Amount</div>
- <div class="r fontDeposit">${{ usdAmountData.rechargeAmountValue }}</div>
- </div>
- <div class="deposit" @click="achPay(false, '')">Deposit</div>
- </div>
- <div class="line"></div>
- <div class="balance">
- <div class="icon">
- <img src="../../static/img/icon_balance_blue.svg" />
- </div>
- <div class="text">Balance: ${{currencyInfoData.balance}}</div>
- <div
- class="refresh"
- @click="checkUsdCurrencyInfo">
- <img :class="{ 'icon-refresh-rotate': refreshRotate }" src="../../static/img/icon_refresh.svg" />
- </div>
- </div>
- </div>
- <div class="balanceBot">
- <div class="l">
- <div class="neet">You Neet to Pay</div>
- <div class="money">
- <FontZoom width="190" :unColor="true">
- {{ Number(usdAmountData.rechargeAmountValue) > 0 ? usdAmountData.rechargeAmountValue : usdAmountData.orderAmountValue }} {{ salePlans.currencyInfo.tokenSymbol }}
- </FontZoom>
- </div>
- </div>
- <div>
- <div
- class="btn"
- :class="{ disabled: (Number(usdAmountData.rechargeAmountValue) > 0) || payDisabled }"
- @click="payUSD">
- Pay Now
- </div>
- </div>
- </div>
- </template>
- </template>
- <!-- 成功支付 -->
- <template v-else-if="step === 4">
- <div class="payInfo">
- <div class="picShow" v-if="buyData">
- <div class="tip">Wow, NFT in the Mystery box is</div>
- <img class="pic" :src="buyData.imagePath" />
- <div class="name">{{buyData.nftItemName}}</div>
- </div>
- </div>
- <div class="payBtn">
- <button class="btn" @click="goNext">Done</button>
- </div>
- </template>
- <!-- loading -->
- <div class="loading" v-if="loading">
- <van-loading color="#1D9BF0"></van-loading>
- </div>
- <div class="loadingBg" v-if="loading"></div>
- <!-- redeem -->
- <van-popup
- round
- v-model="redeemLayer"
- position="bottom">
- <div class="redeem">
- <div class="tips">Enter Redemption Code</div>
- <div class="footer">
- <div class="input">
- <input
- type="text"
- ref="input"
- v-model="redeemStr"
- @input="textInput"
- @blur="textBlur"
- @focus="textFocus"
- @keydown.enter="redeemPayment" />
- </div>
- <button
- class="enter"
- :class="{ disabled: !redeemNext }"
- @click="redeemPayment">
- Redeem
- </button>
- </div>
- </div>
- </van-popup>
- </div>
- </template>
- <script>
- import FontZoom from '../../components/FontZoom.vue';
- import QrCode from '../../components/qrcode.vue';
- import { postRequest } from '../../http/index';
- import { maskUrl } from '../../utils/help';
- import { Dialog, Toast } from 'vant';
- import Api from '../../http/api';
- import Report from '../../log-center/log';
- export default {
- name: 'payment',
- data() {
- return {
- step: 1, // 1: 支付方式列表 2: 余额支付 3: 充值支付 4: 支付完成
- loading: true,
- salePlans: null,
- rechargeAddress: '',
- redeemStr: '',
- redeemNext: false,
- redeemLayer: false,
- buyData: {},
- payDisabled: false,
- waitRefresh: false,
- refreshRotate: false,
- currencyInfoData: {},
- currencyTimer: 0,
- achTimer: 0,
- maskUrlLink: ``,
- usdAmountData: {},
- Report: Report,
- }
- },
- head() {
- return {
- title: 'Buy NFT Mystery Box',
- }
- },
- components: {
- QrCode,
- FontZoom,
- },
- mounted() {
- this.saleInfo()
- this.reportView(Report.pageSource.nftPaymentPage)
- },
- beforeDestroy() {
- clearTimeout(this.currencyTimer);
- },
- methods : {
- saleInfo () {
- postRequest(Api.getNftMysteryBoxSaleInfo, {
- params: {
- nftProjectId: this.$route.query.nftProjectId
- }
- }).then(res => {
- let { code, data } = res;
- if (code === 0) {
- this.salePlans = data.salePlans[0];
- this.getCurrencyInfoByCode();
- // 获取充值地址
- if (this.rechargeAddress === '') {
- this.getAddress()
- }
- }
- }).finally(() => {
- this.loading = false;
- })
- },
- getCurrencyInfoByCode() {
- postRequest(Api.getCurrencyInfoByCode, {
- params: {
- currencyCode: this.salePlans.currencyCode
- }
- }).then(res => {
- let { code, data } = res;
- if (code === 0) {
- this.currencyInfoData = data;
- }
- })
- // 计算金额
- postRequest(Api.calcRechargePayAmount, {
- params: {
- currencyCode: this.salePlans.currencyCode,
- orderAmountValue: this.salePlans.price,
- payChannel: 'ach'
- }
- }).then(res => {
- let { code, data } = res;
- if (code === 0) {
- this.usdAmountData = data;
- }
- })
- },
- getTokenRechargeRecord() {
- postRequest(Api.syncChainTokenRechargeRecord, {
- params: {
- currencyCode: this.salePlans.currencyCode
- }
- }).then(res => {
- let { code, data } = res;
- if (code === 0) {
- if (data.length > 0) {
- let currencyInfo = data[0];
- if (currencyInfo.currencyCode == this.currencyInfoData.currencyCode) {
- this.currencyInfoData.balance = currencyInfo.balance;
- }
- } else {
- this.currencyInfoData.balance = 0
- }
- }
- })
- },
- currencyInfoTimer() {
- clearTimeout(this.currencyTimer);
- this.currencyTimer = setTimeout(() => {
- this.currencyInfoTimer()
- this.getCurrencyInfoByCode()
- }, 10000);
- },
- checkUsdCurrencyInfo() {
- if (!this.refreshRotate) {
- this.refreshRotate = true;
- this.getCurrencyInfoByCode()
- setTimeout(() => {
- this.refreshRotate = false;
- }, 1000)
-
- // report
- this.reportDepositCashPageClick(Report.objectType.refreshBalanceButton)
- }
- },
- checkCurrencyInfo() {
- if (!this.refreshRotate) {
- this.refreshRotate = true;
- this.getTokenRechargeRecord()
- setTimeout(() => {
- this.refreshRotate = false;
- }, 1000)
- // report
- this.reportDepositTokenPageClick(Report.objectType.refreshBalanceButton)
- }
- },
- checkWaitInfo(isReport = true) {
- if (!this.refreshRotate) {
- this.refreshRotate = true;
- if (this.salePlans.currencyCode === 'USD') {
- this.getCurrencyInfoByCode()
- } else {
- this.getTokenRechargeRecord()
- }
- setTimeout(() => {
- this.refreshRotate = false;
- }, 1000)
- }
- if (isReport) {
- this.reportBalanceRefresh()
- }
- },
- showRedeem() {
- this.redeemStr = '';
- this.redeemNext = false;
- this.redeemLayer = true;
- this.$nextTick(() => {
- this.$refs.input.focus();
- })
- this.reportView(Report.pageSource.nftRedeemPage)
- this.reportPaymentBtnClick(Report.objectType.redeemButton)
- },
- textInput(e) {
- let len = 16
- let str = this.redeemStr.replace(/[^a-zA-Z0-9]/g, '')
- str = str.toUpperCase();
- str = str.slice(0, len);
-
- // set
- this.redeemStr = str;
- this.redeemNext = str !== '' && str.length === len;
- },
- textBlur(e) {
- let isiOS = !!window.navigator.userAgent.match(/\(i\[^;]+;( U;)? CPU.+Mac OS X/)
- if (isiOS) {
- setTimeout(() => {
- const scrollHeight = document.documentElement.scrollTop || document.body.scrollTop || 0
- window.scrollTo(0, Math.max(scrollHeight - 1, 0))
- }, 100)
- }
- },
- textFocus(e) {
- let isiOS = !!window.navigator.userAgent.match(/\(i\[^;]+;( U;)? CPU.+Mac OS X/)
- if (isiOS) {
- setTimeout(() => {
- const scrollHeight = document.documentElement.scrollTop || document.body.scrollTop || 0
- window.scrollTo(0, Math.max(scrollHeight - 1, 0))
- }, 100)
- }
- },
- redeemPayment() {
- if (!this.redeemNext) return;
- let params = {
- redeemCode: this.redeemStr,
- nftProjectId: this.$route.query.nftProjectId,
- }
- this.redeemNext = false;
- postRequest(Api.redeemNft, {
- params
- }).then(res => {
- let { code, data } = res;
- if (code === 0) {
- this.redeemLayer = false;
- if (data.length > 0) {
- this.buyData = data[0];
- }
- // 购买成功
- this.step = 4;
- } else {
- this.payError(code)
- }
- }).finally(() => {
- this.redeemNext = true;
- })
- this.reportRedeemBtnClick()
- },
- getAddress() {
- postRequest(Api.getTokenRechargeAddress, {
- params: {
- tokenChain: this.salePlans.currencyInfo?.tokenChain
- }
- }).then(res => {
- let { code, data } = res;
- if (code === 0) {
- this.rechargeAddress = data.rechargeAddress
- this.maskUrlToLink()
- }
- })
- },
- maskUrlToLink() {
- // MetaMask Link
- let url;
- let price = this.usdAmountData.rechargeAmountValue;
- if (this.salePlans.currencyInfo?.contractAddress) {
- // 代币
- url = maskUrl({
- target_address: this.salePlans.currencyInfo.contractAddress,
- parameters: {
- address: this.rechargeAddress,
- uint256: `${price}e${this.salePlans.currencyInfo?.decimalLength || 18}`
- }
- }, false)
- } else {
- // 主币
- url = maskUrl({
- target_address: this.rechargeAddress,
- parameters: {
- value: `${price}e${this.salePlans.currencyInfo?.decimalLength || 18}`
- }
- })
- }
- this.maskUrlLink = url;
- },
- goNext() {
- this.$router.push({
- path: `/nft/${this.$route.query.nftProjectId}/${this.$route.query.account}/show`,
- })
- },
- pay(isReport = true) {
- if (this.payDisabled || Number(this.usdAmountData.rechargeAmountValue) > 0) return;
- this.payDisabled = true;
- postRequest(Api.payNftMysteryBoxWithBalance, {
- params: {
- nftProjectId: this.$route.query.nftProjectId,
- salePlanId: this.salePlans.salePlanId,
- }
- }).then(res => {
- let { code, data } = res;
- if (code == 0) {
- if (data && data.buyItems.length > 0) {
- this.buyData = data.buyItems[0];
- }
- // 购买成功
- this.step = 4;
- } else {
- this.payError(code)
- }
- }).finally(() => {
- this.payDisabled = false;
- })
- // report
- if (isReport) {
- this.reportBalanceBuy()
- }
- },
- payUSD() {
- if (Number(this.usdAmountData.rechargeAmountValue) <= 0) {
- this.pay(false)
- this.reportDepositCashPageClick(Report.objectType.purchaseNftButton)
- }
- },
- payToken() {
- if (Number(this.currencyInfoData.balance) >= Number(this.salePlans.price)) {
- this.pay(false)
- this.reportDepositTokenPageClick(Report.objectType.purchaseNftButton)
- }
- },
- payError(code) {
- let msg;
- switch (code.toString()) {
- case '5001':
- msg = 'nft project not exist'
- break;
- case '5002':
- msg = 'nft project not available'
- break
- case '5101':
- msg = 'nft sale plan not exist'
- break
- case '5102':
- msg = 'nft sold out'
- break
- case '5103':
- msg = 'Purchase limit reached'
- break
- case '5104':
- case '5105':
- case '5106':
- msg = 'Invalid redemption code'
- break;
- default:
- msg = 'Invalid redemption code, please try again'
- break;
- }
- // Dialog
- Dialog({
- message: msg,
- confirmButtonText: 'OK',
- confirmButtonColor: '#1D9BF0',
- });
- },
- deNetPay() {
- if (!this.salePlans) return;
- let pageSource;
- if (this.salePlans.currencyCode === 'USD') {
- pageSource = Report.pageSource.nftDepositCashPage
- } else {
- pageSource = Report.pageSource.nftDepositTokenPage
- }
- if (Number(this.usdAmountData.rechargeAmountValue) > 0) {
- // 余额不够
- this.step = 3;
- this.currencyInfoTimer();
- // Report
- this.reportView(pageSource);
- } else {
- // 余额足够
- this.step = 2;
- this.reportView(Report.pageSource.nftBalancePage);
- }
- this.reportPaymentBtnClick(Report.objectType.denetPayButton)
- },
- maskPay() {
- if (Number(this.usdAmountData.rechargeAmountValue) > 0) {
- this.step = 2;
- this.waitRefresh = true;
- this.currencyInfoTimer();
- Dialog({
- message: `Was the pament successful?`,
- showCancelButton: true,
- confirmButtonText: 'YES',
- confirmButtonColor: '#1D9BF0',
- cancelButtonText: 'NO',
- cancelButtonColor: '#1D9BF0',
- }).then(() => {
- this.checkWaitInfo(false)
- }).catch(() => {
- this.checkWaitInfo(false)
- });
- this.reportView(Report.pageSource.nftPaymentBalancePage);
- } else {
- this.step = 2;
- this.reportView(Report.pageSource.nftBalancePage);
- }
- this.reportPaymentBtnClick(Report.objectType.metamaskPayButton)
- },
- achPay(modifyStep = true, objectType = '') {
- if (Number(this.usdAmountData.rechargeAmountValue) > 0) {
- if (modifyStep) {
- this.step = 2;
- this.reportView(Report.pageSource.nftPaymentBalancePage);
- }
- this.waitRefresh = true;
- this.currencyInfoTimer();
- Dialog({
- message: `Was the pament successful?`,
- showCancelButton: true,
- confirmButtonText: 'YES',
- confirmButtonColor: '#1D9BF0',
- cancelButtonText: 'NO',
- cancelButtonColor: '#1D9BF0',
- }).then(() => {
- this.checkWaitInfo(false)
- }).catch(() => {
- this.checkWaitInfo(false)
- });
- this.$nextTick(() => {
- let win = window.open();
- win.opener = null;
- win.location.href = `${location.protocol}//${location.host}/payment_ach/${this.usdAmountData.rechargeAmountValue}`;
- this.achTimer = setInterval(() => {
- console.log('pay')
- if (win && win.closed) {
- console.log('done')
- clearInterval(this.achTimer);
- }
- }, 500);
- })
- } else {
- if (modifyStep) {
- this.step = 2;
- this.reportView(Report.pageSource.nftBalancePage);
- }
- }
- if (objectType !== '') {
- this.reportPaymentBtnClick(objectType)
- } else {
- this.reportDepositCashPageClick(Report.objectType.depositButtion)
- }
- },
- copyErCode() {
- this.reportDepositTokenPageClick(Report.objectType.copyButtion)
- },
- reportView(pageSource) {
- Report.log({
- pageSource,
- params: {
- eventData: {
- businessType: Report.businessType.pageView,
- },
- extParams: {
- userAgent: window.navigator.userAgent,
- }
- }
- })
- },
- reportPaymentBtnClick(objectType) {
- Report.log({
- pageSource: Report.pageSource.nftPaymentPage,
- params: {
- eventData: {
- objectType,
- businessType: Report.businessType.buttonClick,
- },
- extParams: {
- userAgent: window.navigator.userAgent,
- }
- }
- })
- },
- reportRedeemBtnClick() {
- Report.log({
- pageSource: Report.pageSource.nftRedeemPage,
- params: {
- eventData: {
- objectType: Report.objectType.redeemButton,
- businessType: Report.businessType.buttonClick,
- },
- extParams: {
- userAgent: window.navigator.userAgent,
- }
- }
- })
- },
- reportDepositCashPageClick(objectType) {
- Report.log({
- pageSource: Report.pageSource.nftDepositCashPage,
- params: {
- eventData: {
- objectType,
- businessType: Report.businessType.buttonClick,
- },
- extParams: {
- userAgent: window.navigator.userAgent,
- }
- }
- })
- },
- reportDepositTokenPageClick(objectType) {
- Report.log({
- pageSource: Report.pageSource.nftDepositTokenPage,
- params: {
- eventData: {
- objectType,
- businessType: Report.businessType.buttonClick,
- },
- extParams: {
- userAgent: window.navigator.userAgent,
- }
- }
- })
- },
- reportBalanceRefresh() {
- let pageSource = this.waitRefresh ? Report.pageSource.nftPaymentBalancePage : Report.pageSource.nftBalancePage;
- Report.log({
- pageSource: pageSource,
- params: {
- eventData: {
- objectType: Report.objectType.refreshBalanceButton,
- businessType: Report.businessType.buttonClick,
- },
- extParams: {
- userAgent: window.navigator.userAgent,
- }
- }
- })
- },
- reportBalanceBuy() {
- let pageSource = this.waitRefresh ? Report.pageSource.nftPaymentBalancePage : Report.pageSource.nftBalancePage;
- Report.log({
- pageSource: pageSource,
- params: {
- eventData: {
- objectType: Report.objectType.purchaseNftButton,
- businessType: Report.businessType.buttonClick,
- },
- extParams: {
- userAgent: window.navigator.userAgent,
- }
- }
- })
- },
- }
- }
- </script>
- <style lang="scss">
- html,
- body,
- #__nuxt,
- #__layout {
- width: 100%;
- height: 100%;
- padding: 0;
- margin: 0;
- overflow: hidden;
- }
- .payment {
- width: 100%;
- height: 100%;
- }
- .moneyInfo {
- display: flex;
- align-items: center;
- justify-content: center;
- flex-direction: column;
- height: 90px;
- border-bottom: solid 8px rgba($color: #f5f5f5, $alpha: .6);
- .tips {
- font-size: 12px;
- font-weight: 500;
- }
- .money {
- display: flex;
- align-items: center;
- justify-content: center;
- margin-top: 10px;
- color: #000;
- font-size: 20px;
- font-weight: 700;
- .icon {
- overflow: hidden;
- width: 26px;
- height: 26px;
- border-radius: 50%;
- margin-right: 10px;
- vertical-align: middle;
- background-color: #f5f5f5;
- }
- .info {
- &.usd {
- margin-top: -5px;
- }
- }
- }
- }
- .payList {
- overflow-y: auto;
- height: calc(100% - 90px);
- .detail {
- padding: 18px 16px;
- .title {
- color: #ADADAD;
- height: 26px;
- font-size: 12px;
- font-weight: 500;
- }
- .item {
- position: relative;
- display: flex;
- align-items: center;
- justify-content: center;
- font-weight: 500;
- font-size: 16px;
- height: 50px;
- margin-bottom: 14px;
- border-radius: 100px;
- border: 1px solid #ECECEC;
- &:last-child {
- margin-bottom: 0;
- }
- img {
- width: 24px;
- height: 24px;
- margin-right: 4px;
- }
- &.denet {
- flex-direction: column;
- img {
- margin-top: -6px;
- }
- }
- .wallet {
- width: 100%;
- overflow: hidden;
- color: #ADADAD;
- font-size: 11px;
- text-align: center;
- margin-top: -2px;
- }
- .maskLink {
- position: absolute;
- z-index: 10;
- width: 100%;
- height: 100%;
- }
- }
- }
- }
- .loading {
- position: absolute;
- z-index: 3;
- display: flex;
- align-items: center;
- justify-content: center;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
- }
- .loadingBg {
- position: absolute;
- z-index: 2;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
- background-color: rgba($color: #000, $alpha: .1);
- }
- .redeem {
- padding: 18px 16px 38px;
- .tips {
- height: 31px;
- font-size: 15px;
- font-weight: 500;
- }
- .footer {
- display: flex;
- justify-content: space-between;
- .input {
- display: flex;
- align-items: center;
- justify-content: center;
- width: calc(100% - 93px);
- height: 45px;
- border-radius: 5px;
- border: 1px solid #E0E0E0;
- input {
- width: 94%;
- border: 0;
- outline: 0;
- }
- }
- .enter {
- width: 83px;
- height: 45px;
- border: 0;
- padding: 0;
- color: #ffffff;
- font-size: 17px;
- font-weight: 500;
- border-radius: 5px;
- background: #1D9BF0;
- &.disabled {
- background: #DEDEDE;
- }
- }
- }
- }
- .payInfo {
- width: 100%;
- height: calc(100% - 88px);
- .picShow {
- padding: 54px 48px;
- .tip {
- height: 44px;
- font-size: 18px;
- font-weight: 600;
- text-align: center;
- }
- .pic {
- display: block;
- margin: auto;
- width: 280px;
- height: 280px;
- border-radius: 3px;
- margin-bottom: 20px;
- }
- .name {
- font-size: 18px;
- font-weight: 600;
- line-height: 21px;
- text-align: center;
- }
- }
- }
- .payBtn {
- padding: 0 16px 38px;
- .btn {
- width: 100%;
- height: 50px;
- color: #FFFFFF;
- font-size: 18px;
- font-weight: 700;
- border-radius: 50px;
- background: #1D9BF0;
- }
- }
- .balanceTop {
- display: flex;
- align-items: center;
- justify-content: center;
- flex-direction: column;
- height: calc(100% - 100px);
- background-color: #f5f5f5;
- .balance {
- width: 66px;
- height: 66px;
- margin-bottom: 6px;
- }
- .text {
- font-size: 15px;
- font-weight: 500;
- line-height: 18px;
- color: #9D9D9D;
- }
- .money {
- font-size: 22px;
- font-weight: 700;
- line-height: 26px;
- margin-top: 6px;
- .icon {
- width: 22px;
- height: 22px;
- margin-right: 6px;
- }
- .font {
- color: #000;
- }
- }
- }
- .balanceInfo {
- overflow-y: auto;
- height: calc(100% - 100px);
- background-color: #f5f5f5;
- .top {
- padding: 0 16px 17px 16px;
- background-color: #ffffff;
- .item {
- display: flex;
- align-items: center;
- height: 54px;
- border-bottom: solid 1px #F2F2F2;
- &.title {
- font-size: 16px;
- font-weight: 600;
- line-height: 19px;
- img {
- width: 26px;
- height: 26px;
- margin-right: 6px;
- }
- }
- &.column {
- color: rgba($color: #5E5E5E, $alpha: .7);
- font-size: 14px;
- font-weight: 400;
- .l {
- width: 70px;
- }
- .r {
- img {
- width: 21px;
- height: 21px;
- margin-right: 4px;
- }
- span {
- color: rgba($color: #5E5E5E, $alpha: .7);
- }
- }
- }
- &.usd {
- font-size: 14px;
- font-weight: 500;
- justify-content: space-between;
- .fontPayment {
- font-size: 18px;
- font-weight: 600;
- }
- .font {
- color: #9A9A9A;
- font-size: 16px;
- font-weight: 500;
- }
- .fontDeposit {
- color: #1D9BF0;
- font-size: 18px;
- font-weight: 600;
- }
- }
- }
- .deposit {
- display: flex;
- align-items: center;
- justify-content: center;
- height: 54px;
- color: #ffffff;
- font-weight: 600;
- font-size: 18px;
- margin-top: 16px;
- border-radius: 54px;
- background: #1D9BF0;
- }
- .address {
- color: rgba($color: #5E5E5E, $alpha: .7);
- .title {
- height: 42px;
- font-size: 14px;
- font-weight: 400;
- line-height: 42px;
- }
- }
- .notice {
- display: flex;
- justify-content: space-between;
- padding: 10px;
- margin-top: 12px;
- border-radius: 8px;
- background: #F9F6EE;
- .icon {
- width: 20px;
- margin-right: 10px;
- img {
- width: 20px;
- height: 20px;
- }
- }
- .text {
- flex: 1;
- color: rgba($color: #5E5E5E, $alpha: .7);
- font-size: 14px;
- font-weight: 400;
- line-height: 19px;
- word-break: break-all;
- strong {
- color: #FF0000;
- font-weight: bold;
- }
- }
- }
- }
- .line {
- height: 8px;
- }
- .balance {
- display: flex;
- align-items: center;
- padding: 0 16px;
- height: 54px;
- background-color: #ffffff;
- .icon {
- width: 24px;
- margin-right: 6px;
- img {
- width: 24px;
- }
- }
- .text {
- flex: 1;
- font-size: 14px;
- font-weight: 500;
- line-height: 17px;
- span {
- color: #000;
- margin-right: auto;
- }
- }
- .refresh {
- width: 24px;
- height: 24px;
- img {
- width: 24px;
- transform-origin: center center;
- }
- }
- }
- }
- .balanceBot {
- display: flex;
- justify-content: space-between;
- width: 100%;
- padding: 17px 16px 38px;
- border-top: solid 1px #ECECEC;
- .l {
- display: flex;
- flex-direction: column;
- justify-content: center;
- }
- .neet {
- font-size: 12px;
- font-weight: 500;
- line-height: 14px;
- }
- .money {
- height: 22px;
- line-height: 22px;
- font-size: 18px;
- font-weight: 700;
- margin-top: 4px;
- .text {
- margin-right: auto;
- }
- }
- .btn {
- display: flex;
- align-items: center;
- justify-content: center;
- width: 110px;
- height: 46px;
- color: #ffffff;
- font-size: 18px;
- font-weight: 700;
- line-height: 21px;
- border-radius: 46px;
- background: #1D9BF0;
- &.disabled {
- background: #D2D2D2;
- }
- }
- }
- .waitFont {
- margin-top: 16px;
- padding: 0 20px;
- font-size: 14px;
- font-weight: 500;
- line-height: 17px;
- text-align: center;
- }
- .waitBtn {
- display: flex;
- align-items: center;
- justify-content: center;
- width: 50px;
- height: 50px;
- margin: 50px auto 0;
- border-radius: 50%;
- background-color: #ffffff;
- img {
- width: 24px;
- height: 24px;
- }
- }
- .icon-refresh-rotate {
- transform: rotate(360deg);
- transition-duration: 1s;
- }
- </style>
|