质押cec 绑定passport账号-ing

This commit is contained in:
yuyongdong 2024-09-12 21:31:59 +08:00
parent daa393f51c
commit 07a77d6bb3
3 changed files with 16 additions and 14 deletions

View File

@ -29,7 +29,7 @@
</li>
<li>
<div>Convert remaining time</div>
<span>$0.57</span>
<span>{{ timeStaking(Number(stakingStore.cecInfoData.lastDepositTime)) }}</span>
</li>
</div>
<div class="arrows">
@ -45,16 +45,16 @@
<div class="amount">{{ priceCalculated(stakingStore.cecInfoData.CecClaimable) }}</div>
<div class="btns">
<div class="btn">
<span v-if="stakingStore.cecInfoData.esCecBalance" @click="conversionModal">Staking</span>
<span v-else class="no">Staking</span>
<span v-if="stakingStore.cecInfoData.esCecBalance" @click="conversionModal">Convert</span>
<span v-else class="no">Convert</span>
</div>
<div class="btn">
<span v-if="stakingStore.cecInfoData.esCecConversion" @click="withdrawModal">Disarm</span>
<span v-else class="no">Disarm</span>
<span v-if="stakingStore.cecInfoData.esCecConversion" @click="withdrawModal">Cancel</span>
<span v-else class="no">Cancel</span>
</div>
<div class="btn">
<span v-if="stakingStore.cecInfoData.CecClaimable" @click="claimModal">Collection</span>
<span v-else class="no">Collection</span>
<span v-if="stakingStore.cecInfoData.CecClaimable" @click="claimModal">Claim</span>
<span v-else class="no">Claim</span>
</div>
</div>
</div>
@ -72,7 +72,7 @@ import LoadingDialog from "@/components/Dialogs/loadingDialog.vue"
import ConfirmDialog from "@/components/Dialogs/confirmDialog.vue";
import {createModal} from "@/utils/model.util";
import { STAKING_ADDRESSES } from "@/configs/configchain"
import { priceCalculated } from "@/configs/priceCalculate"
import { priceCalculated, timeStaking } from "@/configs/priceCalculate"
import {walletStore} from "@/store/wallet";
import { useStakingStore } from "@/store/staking"
import { BlockChain } from "@/components/chain/BlockChain"

View File

@ -168,6 +168,7 @@ const cecInfoData = ref({
* 查询当前用户存储的EsCEC数量(转化+未转化) queryVestedTotal
* 查询当前用户可以领取的CEC数量 queryClaimable
* 查询用户已经领取的CEC总量 queryClaimabledAll
* 查询最后转化存入的时间 queryLastDepositTime
*
*/
const getCecData = async () => {
@ -197,6 +198,7 @@ const getCecData = async () => {
cecInfoData.value.esCecClaim = BigInt(await bc.staking.queryCumulativeByEsCEC());
cecInfoData.value.CecClaimable = BigInt(await bc.vester.queryClaimable())
cecInfoData.value.cecClaimAll = BigInt(await bc.vester.queryClaimabledAll())
cecInfoData.value.lastDepositTime = BigInt(await bc.vester.queryLastDepositTime())
cecInfoData.value.totalCollection = cecInfoData.value.CecCollection + cecInfoData.value.esCecCollection;
stakingStore.cecInfoData = cecInfoData.value;
// getCode()

View File

@ -196,11 +196,11 @@ const eventBtnName = (val) => {
// cec stake
const cecStakingText = async () => {
// console.log(localWalletStore.refreshToken)
if(!stakingStore.bindPassportAddress) {
await new BlockChain().appendPassport()
let res = await apiBindPassport({passport_jwt: 'Bearer '+localWalletStore.refreshToken})
console.log(res)
} else {
// if(!stakingStore.bindPassportAddress) {
// await new BlockChain().appendPassport()
// let res = await apiBindPassport({passport_jwt: 'Bearer '+localWalletStore.refreshToken})
// console.log(res)
// } else {
// console.log(localWalletStore.refreshToken)
// return
cecDialogVisible.value = true
@ -210,7 +210,7 @@ const cecStakingText = async () => {
typeName: "CEC",
amount: stakingStore.cecInfoData.cecBalance
}
}
// }
}
const closeCecStakedText = () => {