cec-bitget
This commit is contained in:
parent
e68464adec
commit
4038b92b63
@ -342,7 +342,7 @@ export class BlockChain {
|
||||
}
|
||||
|
||||
async claimAddress({title, subTitle, targetChainId}) {
|
||||
console.log(targetChainId)
|
||||
// console.log(targetChainId)
|
||||
// return
|
||||
const initData = {}
|
||||
initData[this.store.walletType] = this.store.address
|
||||
|
1679
src/views/ClaimView copy.vue
Normal file
1679
src/views/ClaimView copy.vue
Normal file
File diff suppressed because it is too large
Load Diff
@ -83,7 +83,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content" v-else-if="address && cecInfo.available == '0'">
|
||||
<div class="content" v-else-if="address && cecUserStatus == -2">
|
||||
<div class="content-tips">
|
||||
You have no CEC available to claim.
|
||||
</div>
|
||||
@ -128,7 +128,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content" v-else>
|
||||
<div class="content" v-else-if="cecUserStatus == -1">
|
||||
<div class="content-tips content-tips-login">
|
||||
<span>Address:</span> {{address}}
|
||||
</div>
|
||||
@ -142,7 +142,6 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="content-times">
|
||||
<!-- @click="isBindAccount" -->
|
||||
<div class="content-time-top" @click="cecUserStatus = 0">
|
||||
<li>
|
||||
<div class="left">
|
||||
@ -178,15 +177,15 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content" v-if="false">
|
||||
<div class="content" v-else>
|
||||
<div class="content-title">
|
||||
<div class="content-title-left">
|
||||
<!-- <div class="content-title-left">
|
||||
<div class="content-title-logo">
|
||||
<img src="@/assets/img/cec_claim/Bitgetlogo.png" alt="">
|
||||
</div>
|
||||
<p>Deposit to Bitget</p>
|
||||
<div class="free">0 gas</div>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="content-title-right">
|
||||
<div class="content-tips-link">
|
||||
<div>
|
||||
@ -199,30 +198,35 @@
|
||||
<div class="content-body">
|
||||
<div class="content-body-header">
|
||||
<div class="content-body-header-left">
|
||||
<span v-if="cecUserStatus == 0">Grab a share of 1,000,000 $CEC</span>
|
||||
<!-- <span v-if="cecUserStatus == 0">Grab a share of 1,000,000 $CEC</span> -->
|
||||
</div>
|
||||
<div class="content-body-header-right">
|
||||
Aug 30, 06:00 - Sep 5, 06:00 UTC
|
||||
Sep 9, 00:00 UTC
|
||||
</div>
|
||||
</div>
|
||||
<div class="content-body-box">
|
||||
<!-- 3 -->
|
||||
<!-- 3 claim 等待 -->
|
||||
<div v-if="cecUserStatus == 3">
|
||||
<div class="body-box-title padding-top">
|
||||
<h3><span>{{Number(cecInfo.available) == 0 ? 0 : priceCalculated(cecInfo.available,18).toString().match(/^\d+(?:\.\d{0,2})?/)[0]}}</span> $CEC deposit to Bitget in progress</h3>
|
||||
<h3><span>{{Number(cecInfo.available) == 0 ? 0 : priceCalculated(cecInfo.available,18).toString().match(/^\d+(?:\.\d{0,2})?/)[0]}}</span> $CEC claimed to your address in progress</h3>
|
||||
</div>
|
||||
<div class="body-box-con margin-top-20">
|
||||
<p>Well done! You're all set!</p>
|
||||
</div>
|
||||
<div class="body-box-con margin-20">
|
||||
<p>You'll receive your $CEC airdrop in Bitget spot account before the listing time.</p>
|
||||
<p>check the progress here Bscscan</p>
|
||||
</div>
|
||||
|
||||
<!-- <div class="body-box-btn margin-top-20">
|
||||
<p class="center"></p>
|
||||
</div> -->
|
||||
<div class="body-box-btn margin-top">
|
||||
<p class="center">Jump to<a href="https://www.bitget.com/support/articles/12560603814979?utmSource=Twitter_CEC" target="_blank"> Bitget Launchpool</a> and grab your share of 11M $CEC now!</p>
|
||||
<p class="center">
|
||||
Jump to
|
||||
<a href="https://www.bitget.com/support/articles/12560603814979?utmSource=Twitter_CEC" target="_blank"> Bing X Earn</a>
|
||||
and
|
||||
<a href="https://www.bitget.com/support/articles/12560603814979?utmSource=Twitter_CEC" target="_blank"> Bitget Pool X</a>
|
||||
to earn more $CEC
|
||||
</p>
|
||||
</div>
|
||||
<div class="body-box-btn">
|
||||
<!-- <p><a @click="cecUserStatus = 4">Cancel the Pre-Deposit to Bitget</a></p> -->
|
||||
@ -242,47 +246,55 @@
|
||||
<div class="no" @click="cecUserStatus = 3">No</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 5 取消绑定成功 -->
|
||||
<!-- 5 claim 成功 -->
|
||||
<div v-if="cecUserStatus == 5">
|
||||
<div class="body-box-title">
|
||||
<!-- <h3><span>{{ Number(cecInfo.available) == 0 ? 0 : priceCalculated(cecInfo.available,18).toString().match(/^\d+(?:\.\d{0,2})?/)[0] }}</span> $CEC deposit to Bitget in progress</h3> -->
|
||||
<!-- <span>Cancellation successful</span> -->
|
||||
<div class="body-box-title padding-top">
|
||||
<h3><span>{{Number(cecInfo.available) == 0 ? 0 : priceCalculated(cecInfo.available,18).toString().match(/^\d+(?:\.\d{0,2})?/)[0]}}</span> $CEC successfully claimed</h3>
|
||||
</div>
|
||||
<div class="body-box-con">
|
||||
<h5>Cancellation successful</h5>
|
||||
<div class="body-box-con margin-top-20">
|
||||
<p>Well done! You're all set!</p>
|
||||
</div>
|
||||
<div class="body-box-con margin-20">
|
||||
<p>check the progress here Bscscan</p>
|
||||
</div>
|
||||
<!-- <div class="body-box-btn margin-top-20">
|
||||
<p class="center"></p>
|
||||
</div> -->
|
||||
<div class="body-box-btn margin-top">
|
||||
<p class="center">
|
||||
Jump to
|
||||
<a href="https://www.bitget.com/support/articles/12560603814979?utmSource=Twitter_CEC" target="_blank"> Bing X Earn</a>
|
||||
and
|
||||
<a href="https://www.bitget.com/support/articles/12560603814979?utmSource=Twitter_CEC" target="_blank"> Bitget Pool X</a>
|
||||
to earn more $CEC
|
||||
</p>
|
||||
</div>
|
||||
<div class="body-box-btn">
|
||||
<div @click="reqGetInfo">OK</div>
|
||||
<!-- <p><a @click="cecUserStatus = 4">Cancel the Pre-Deposit to Bitget</a></p> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 2 回显交易所绑定信息 -->
|
||||
<div v-if="cecUserStatus == 2">
|
||||
<div class="body-box-title">
|
||||
<h4>Confirm withdrawal of <span>{{Number(cecInfo.available) == 0 ? 0 : priceCalculated(cecInfo.available,18).toString().match(/^\d+(?:\.\d{0,2})?/)[0]}}</span> $CEC</h4>
|
||||
<h4>Confirm claim of <span>{{Number(cecInfo.available) == 0 ? 0 : priceCalculated(cecInfo.available,18).toString().match(/^\d+(?:\.\d{0,2})?/)[0]}}</span> $CEC</h4>
|
||||
</div>
|
||||
<div class="body-box-con">
|
||||
<li>
|
||||
<!-- <li>
|
||||
<h5>Bitget UID :</h5>
|
||||
<span>{{ cecInfo.bindUid }}</span>
|
||||
</li> -->
|
||||
<li>
|
||||
<h5>Receiving Address :</h5>
|
||||
<span>{{ claimMyAddress }}</span>
|
||||
</li>
|
||||
<li>
|
||||
<h5>Deposit Address :</h5>
|
||||
<span>{{ cecInfo.bindAddress }}</span>
|
||||
</li>
|
||||
<li>
|
||||
<div class="font-size-14">You may not receive your airdrop in Bitget if your UID, deposit address is not correct or doesn't exist</div>
|
||||
</li>
|
||||
<li>
|
||||
<h6>KYC passed only</h6>
|
||||
</li>
|
||||
<li>
|
||||
<div>It's required to comlete the identity verification to become eligible to deposit to Bitget</div>
|
||||
<div class="font-size-14">You will use this address to receive $CEC and to pay for gas</div>
|
||||
</li>
|
||||
</div>
|
||||
<div class="body-box-btn">
|
||||
<div @click="cecUserStatus = 3">Confirm</div>
|
||||
<span @click="cecUserStatus = 1">Back</span>
|
||||
<div @click="cecUserStatus = 3">Claim</div>
|
||||
<span @click="cecUserStatus = 1">Disconnect</span>
|
||||
</div>
|
||||
</div>
|
||||
<!-- </div>
|
||||
@ -290,13 +302,13 @@
|
||||
<!-- 0 是否绑定交易所 -->
|
||||
<div v-if="cecUserStatus == 0">
|
||||
<div class="body-box-title">
|
||||
<h3>Do you have a Bitget exchange account?</h3>
|
||||
<h3>Connect the receiving wallet and use it to pay for gas</h3>
|
||||
</div>
|
||||
<div class="body-box-con">
|
||||
<p class="toBitget"><a href="https://bitget.onelink.me/XqvW?af_xp=custom&pid=Counterfire" target="_blank">No, click to create</a></p>
|
||||
<!-- <p class="toBitget"><a href="https://bitget.onelink.me/XqvW?af_xp=custom&pid=Counterfire" target="_blank">No, click to create</a></p> -->
|
||||
</div>
|
||||
<div class="body-box-btn">
|
||||
<div @click="cecUserStatus = 1">Yes, i have it</div>
|
||||
<div @click="connectWallet">Connect</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 1 绑定交易所 -->
|
||||
@ -327,7 +339,6 @@
|
||||
</div>
|
||||
<!-- ------------------------------------------------------------------------ -->
|
||||
</div>
|
||||
<LoadingDialog :loadingDialogVisible="loadingDialogVisible" />
|
||||
<div ref="claimLogModal">
|
||||
<a-modal :class="'claimLogModal'" :getContainer="() => $refs.claimLogModal" v-model:open="claimLogDialogVisible" :closable="false" :footer="null" :maskClosable="false">
|
||||
<div class="log-title">Cec claim</div>
|
||||
@ -354,7 +365,6 @@ import { apiCecInfoAll, apiBindAccount, apiCecClaim } from "@/utils/marketplace"
|
||||
import ConfirmDialog from "@/components/Dialogs/confirmDialog.vue";
|
||||
import {createModal} from "@/utils/model.util";
|
||||
|
||||
const loadingDialogVisible = ref(false)
|
||||
const localWalletStore = walletStore()
|
||||
const marketplaceStore = useMarketplaceStore()
|
||||
const instructionLink = ref('https://medium.com/@CounterFire/pre-deposit-instruction-a30d6ce62f80')
|
||||
@ -362,7 +372,7 @@ const claimLogDialogVisible = ref(false)
|
||||
const address = ref()
|
||||
const tradeId = ref()
|
||||
const tradeAddress = ref()
|
||||
const cecUserStatus = ref(-1) // -2 没有cec -1 登陆后 0 是否绑定交易所 1 绑定账号 2 账号回显 3 绑定成功提示 4 是否取消绑定 5 取消绑定成功
|
||||
const cecUserStatus = ref(0) // -2 没有cec -1 登陆后 0 获取claim地址 2 账号回显 3 绑定成功提示 4 是否取消绑定 5 取消绑定成功
|
||||
const cecInfo = ref({
|
||||
available: 0,
|
||||
bindAddress: '',
|
||||
@ -380,7 +390,7 @@ const getCecTotal = async () => {
|
||||
let data = await apiCecInfoAll(address.value, token)
|
||||
cecInfo.value = data.data
|
||||
if(data.data.bindUid) {
|
||||
// cecUserStatus.value = -2
|
||||
// cecUserStatus.value = 0
|
||||
// } else {
|
||||
cecUserStatus.value = -1
|
||||
} else {
|
||||
@ -394,14 +404,6 @@ const getCecTotal = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
const isBindAccount = () => {
|
||||
if(cecInfo.value.bindUid) {
|
||||
cecUserStatus.value = 3
|
||||
} else {
|
||||
cecUserStatus.value = 0
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
const connectLogin = async () => {
|
||||
await new BlockChain().cecLogin()
|
||||
@ -478,15 +480,26 @@ const reqGetInfo = async () => {
|
||||
getCecTotal()
|
||||
}
|
||||
|
||||
const claimMyAddress = ref()
|
||||
// 获取钱包地址
|
||||
const connectWallet = async () => {
|
||||
const chainId = parseInt(import.meta.env.VUE_APP_NET_ID_CLAIM);
|
||||
const subTitle = 'Select the payment address.'
|
||||
const { provider, address } = await new BlockChain().claimAddress({subTitle: subTitle,targetChainId: chainId})
|
||||
console.log(address)
|
||||
if(address) {
|
||||
claimMyAddress.value = address
|
||||
cecUserStatus.value = 2
|
||||
}
|
||||
}
|
||||
|
||||
// 领取
|
||||
const cecClaim = async () => {
|
||||
let walletToken = await new BlockChain().token()
|
||||
let token = marketplaceStore.fireToken || walletToken
|
||||
try {
|
||||
loadingDialogVisible.value = true
|
||||
let res = await new BlockChain().claim.cecClaim(token)
|
||||
if(res) {
|
||||
loadingDialogVisible.value = false
|
||||
getCecTotal()
|
||||
const confirmResult = await createModal(ConfirmDialog, {
|
||||
title: '',
|
||||
@ -504,7 +517,6 @@ const cecClaim = async () => {
|
||||
} else {
|
||||
message.error("Claim fail.");
|
||||
}
|
||||
loadingDialogVisible.value = false
|
||||
}
|
||||
|
||||
// let walletToken = await new BlockChain().token()
|
||||
@ -1307,9 +1319,11 @@ onMounted(() => {
|
||||
}
|
||||
span {
|
||||
display: inline-block;
|
||||
width: 118px;
|
||||
// width: 118px;
|
||||
height: 42px;
|
||||
line-height: 42px;
|
||||
padding: 0px 10px;
|
||||
box-sizing: border-box;
|
||||
text-align: center;
|
||||
background: rgba(30,27,38,0);
|
||||
border-radius: 21px;
|
||||
|
Loading…
x
Reference in New Issue
Block a user