质押cec 测试ing
This commit is contained in:
parent
6d073b7b62
commit
a8d8730c04
@ -88,16 +88,16 @@ function hideModal(result = null) {
|
|||||||
|
|
||||||
.cf-overlay {
|
.cf-overlay {
|
||||||
z-index: 1000;
|
z-index: 1000;
|
||||||
width: 1140px;
|
width: 700px;
|
||||||
min-height: 500px;
|
min-height: 300px;
|
||||||
background: #1a1821;
|
background: #1a1821;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 20%;
|
top: 50%;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
transform: translateX(-50%);
|
transform: translate(-50%, -50%);
|
||||||
border: 1px solid #b966ff;
|
border: 1px solid #b966ff;
|
||||||
padding: 50px;
|
padding: 30px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
box-shadow: 0px 15px 28px 3px rgba(22, 22, 22, 0.13);
|
box-shadow: 0px 15px 28px 3px rgba(22, 22, 22, 0.13);
|
||||||
border-radius: 100px;
|
border-radius: 100px;
|
||||||
@ -107,18 +107,18 @@ function hideModal(result = null) {
|
|||||||
height: 60px;
|
height: 60px;
|
||||||
font-family: 'Anton';
|
font-family: 'Anton';
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
font-size: 48px;
|
font-size: 36px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.cf-content-text {
|
.cf-content-text {
|
||||||
width: 78%;
|
width: 90%;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
text-align: left;
|
text-align: center;
|
||||||
.cf-text {
|
.cf-text {
|
||||||
font-family: 'Poppins';
|
font-family: 'Poppins';
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
font-size: 28px;
|
font-size: 22px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.cf-btn-grid {
|
.cf-btn-grid {
|
||||||
@ -130,13 +130,13 @@ function hideModal(result = null) {
|
|||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-evenly;
|
justify-content: space-evenly;
|
||||||
button {
|
button {
|
||||||
width: 289px;
|
width: 180px;
|
||||||
height: 60px;
|
height: 40px;
|
||||||
background: #fec25d;
|
background: #fec25d;
|
||||||
border: 0px;
|
border: 0px;
|
||||||
font-family: 'Poppins';
|
font-family: 'Poppins';
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
font-size: 18px;
|
font-size: 16px;
|
||||||
color: #2D2738;
|
color: #2D2738;
|
||||||
border-radius:30px;
|
border-radius:30px;
|
||||||
}
|
}
|
||||||
|
@ -22,10 +22,10 @@
|
|||||||
<div class="left">
|
<div class="left">
|
||||||
<span>{{ props.dialogText.typeLabel }}</span>
|
<span>{{ props.dialogText.typeLabel }}</span>
|
||||||
<p>
|
<p>
|
||||||
<input type="number" placeholder="0" min="0" :max="modelAmount" v-model="modelAmount">
|
<input type="number" :placeholder="placeholderAmount" v-model="modelAmount" @input="handleInput">
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="left" @click="cecAmount">
|
<div class="right" @click="cecAmount">
|
||||||
<span>MAX: {{ priceCalculated(props.dialogText.amount) }}</span>
|
<span>MAX: {{ priceCalculated(props.dialogText.amount) }}</span>
|
||||||
<p>{{ props.dialogText.typeName }}</p>
|
<p>{{ props.dialogText.typeName }}</p>
|
||||||
</div>
|
</div>
|
||||||
@ -35,7 +35,7 @@
|
|||||||
<span>{{ props.dialogText.conversion }}</span>
|
<span>{{ props.dialogText.conversion }}</span>
|
||||||
<p class="padding-left-20">{{ modelAmount }}</p>
|
<p class="padding-left-20">{{ modelAmount }}</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="left">
|
<div class="right">
|
||||||
<span> </span>
|
<span> </span>
|
||||||
<p>{{ props.dialogText.conversionName }}</p>
|
<p>{{ props.dialogText.conversionName }}</p>
|
||||||
</div>
|
</div>
|
||||||
@ -69,14 +69,16 @@ const props = defineProps({
|
|||||||
// },
|
// },
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const placeholderAmount = ref(0)
|
||||||
const emit = defineEmits(["handleClose", "eventBtn"]);
|
const emit = defineEmits(["handleClose", "eventBtn"]);
|
||||||
const handleCancel = (e) => {
|
const handleCancel = (e) => {
|
||||||
|
modelAmount.value = 0
|
||||||
emit("handleClose");
|
emit("handleClose");
|
||||||
};
|
};
|
||||||
|
|
||||||
const eventBtn = () => {
|
const eventBtn = () => {
|
||||||
if(modelAmount.value == 0) {
|
if(modelAmount.value == 0) {
|
||||||
message.error('Please enter the corresponding number')
|
message.error('Please enter the amount')
|
||||||
} else {
|
} else {
|
||||||
emit("eventBtn",{title:props.dialogText.title, amount: modelAmount.value});
|
emit("eventBtn",{title:props.dialogText.title, amount: modelAmount.value});
|
||||||
}
|
}
|
||||||
@ -87,19 +89,27 @@ const cecAmount = () => {
|
|||||||
modelAmount.value = priceCalculated(props.dialogText.amount)
|
modelAmount.value = priceCalculated(props.dialogText.amount)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const handleInput = (e) => {
|
||||||
|
if(Number(modelAmount.value) > Number(priceCalculated(props.dialogText.amount))) {
|
||||||
|
modelAmount.value = priceCalculated(props.dialogText.amount)
|
||||||
|
} else if(Number(modelAmount.value) == 0 || Number(modelAmount.value) < 0) {
|
||||||
|
modelAmount.value= 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
:deep(.cecDialog) {
|
:deep(.cecDialog) {
|
||||||
width: 800px !important;
|
width: 600px !important;
|
||||||
// height: 468px;
|
min-height: 330px;
|
||||||
.ant-modal-content {
|
.ant-modal-content {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
padding: 0px;
|
padding: 0px;
|
||||||
background: #1a1821;
|
background: #1a1821;
|
||||||
border: 1px solid #b966ff;
|
border: 1px solid #b966ff;
|
||||||
box-shadow: 0px 15px 28px 3px rgba(22, 22, 22, 0.13);
|
box-shadow: 0px 15px 28px 3px rgba(22, 22, 22, 0.13);
|
||||||
border-radius: 100px;
|
border-radius: 50px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.cec-dialog {
|
.cec-dialog {
|
||||||
@ -107,8 +117,8 @@ const cecAmount = () => {
|
|||||||
position: absolute;
|
position: absolute;
|
||||||
top: -23px;
|
top: -23px;
|
||||||
right: -23px;
|
right: -23px;
|
||||||
width: 106px;
|
width: 80px;
|
||||||
height: 106px;
|
height: 80px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
img {
|
img {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@ -117,26 +127,26 @@ const cecAmount = () => {
|
|||||||
}
|
}
|
||||||
.cec-dialog-content {
|
.cec-dialog-content {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
margin-top: 40px;
|
margin-top: 20px;
|
||||||
.content-title {
|
.content-title {
|
||||||
width: 700px;
|
width: 500px;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
padding: 0 40px;
|
padding: 0 20px;
|
||||||
border-bottom: 1px solid #3d4057;
|
border-bottom: 1px solid #3d4057;
|
||||||
h1 {
|
h1 {
|
||||||
font-family: "Anton";
|
font-family: "Anton";
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
font-size: 48px;
|
font-size: 28px;
|
||||||
}
|
}
|
||||||
p {
|
p {
|
||||||
|
color: #FF7C7C;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.content-amount {
|
.content-amount {
|
||||||
width: 700px;
|
width: 500px;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
margin-top: 20px;
|
margin-top: 10px;
|
||||||
padding: 0 40px;
|
padding: 0 20px;
|
||||||
li {
|
li {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@ -144,15 +154,16 @@ const cecAmount = () => {
|
|||||||
>div {
|
>div {
|
||||||
span {
|
span {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
margin-bottom: 20px;
|
margin-bottom: 10px;
|
||||||
color: #b966ff;
|
color: #b966ff;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
p {
|
p {
|
||||||
font-size: 28px;
|
font-size: 28px;
|
||||||
font-family: 'Poppins';
|
font-family: 'Poppins';
|
||||||
input {
|
input {
|
||||||
width: 397px;
|
width: 200px;
|
||||||
border: 0;
|
border: 0;
|
||||||
background: #2d2738;
|
background: #2d2738;
|
||||||
padding-left: 20px;
|
padding-left: 20px;
|
||||||
@ -191,12 +202,18 @@ const cecAmount = () => {
|
|||||||
padding-left: 20px;
|
padding-left: 20px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.right {
|
||||||
|
p {
|
||||||
|
text-align: right;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.content-btn {
|
.content-btn {
|
||||||
width: 300px;
|
width: 180px;
|
||||||
height: 60px;
|
height: 40px;
|
||||||
line-height: 60px;
|
line-height: 40px;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
color: #000;
|
color: #000;
|
||||||
@ -204,8 +221,8 @@ const cecAmount = () => {
|
|||||||
background: #fec25d;
|
background: #fec25d;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
border-radius: 20px;
|
border-radius: 20px;
|
||||||
margin-top: 120px;
|
margin-top: 30px;
|
||||||
margin-bottom: 40px;
|
margin-bottom: 20px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -102,11 +102,11 @@ const dialogUnstakeText = ref({
|
|||||||
const conversionModal = () => {
|
const conversionModal = () => {
|
||||||
cecDialogVisible.value = true
|
cecDialogVisible.value = true
|
||||||
dialogUnstakeText.value = {
|
dialogUnstakeText.value = {
|
||||||
title: "Reverse conversion esCEC",
|
title: "Vest esCEC",
|
||||||
typeLabel: "Unstake",
|
typeLabel: "Vest",
|
||||||
tips: "withdrawing the transformed ESCEC unlocks a certain number of cecs",
|
tips: "Vest esCEC needs to lock amount of CEC",
|
||||||
typeName: "es CEC",
|
typeName: "es CEC",
|
||||||
conversion: "Reveres conversion esCEC",
|
conversion: "CEC Locked",
|
||||||
conversionName: "CEC",
|
conversionName: "CEC",
|
||||||
amount: stakingStore.cecInfoData.esCecBalance
|
amount: stakingStore.cecInfoData.esCecBalance
|
||||||
}
|
}
|
||||||
@ -137,7 +137,7 @@ const collectionModal = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const eventBtnName = (val) => {
|
const eventBtnName = (val) => {
|
||||||
if(val.title == 'Reverse conversion esCEC') {
|
if(val.title == 'Vest esCEC') {
|
||||||
cecDeposit(val.amount)
|
cecDeposit(val.amount)
|
||||||
// } else if(val.title == 'Claim esCEC') {
|
// } else if(val.title == 'Claim esCEC') {
|
||||||
// claimCec()
|
// claimCec()
|
||||||
@ -268,7 +268,7 @@ onMounted(() => {
|
|||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.content {
|
.content {
|
||||||
width: 1120px;
|
width: 1348px;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
@ -85,7 +85,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="right">
|
<div class="right">
|
||||||
<div>esCEC Conversion</div>
|
<div>Vesting esCEC</div>
|
||||||
<p>{{ priceCalculated(stakingStore.cecInfoData.esCecConversion) }}</p>
|
<p>{{ priceCalculated(stakingStore.cecInfoData.esCecConversion) }}</p>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
@ -254,7 +254,7 @@ onMounted(() => {
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
padding-left: 54px;
|
padding-left: 54px;
|
||||||
line-height: 22px;
|
line-height: 22px;
|
||||||
margin-bottom: 16px;
|
margin-bottom: 5px;
|
||||||
h1 {
|
h1 {
|
||||||
font-family: "Poppins";
|
font-family: "Poppins";
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
|
@ -202,8 +202,8 @@ const eventBtnName = (val) => {
|
|||||||
const cecStakingText = async () => {
|
const cecStakingText = async () => {
|
||||||
if(!stakingStore.bindPassportAddress) {
|
if(!stakingStore.bindPassportAddress) {
|
||||||
const confirmResult = await createModal(ConfirmDialog, {
|
const confirmResult = await createModal(ConfirmDialog, {
|
||||||
title: 'Need login to Passport',
|
title: 'Link your Passport.',
|
||||||
message: 'Are you sure you want to login with Passport?'
|
message: 'Please note, once linked, it cannot be unlinked. Ensure you’re connecting the correct Passport.'
|
||||||
}).show()
|
}).show()
|
||||||
if(confirmResult.errcode == 0) {
|
if(confirmResult.errcode == 0) {
|
||||||
await new BlockChain().appendPassport()
|
await new BlockChain().appendPassport()
|
||||||
@ -212,9 +212,15 @@ const cecStakingText = async () => {
|
|||||||
message.success('Bind Successful')
|
message.success('Bind Successful')
|
||||||
refreshCecInfo()
|
refreshCecInfo()
|
||||||
} else if(res.errcode == 1) {
|
} else if(res.errcode == 1) {
|
||||||
message.error('account or passport bound')
|
const confirmResult1 = await createModal(ConfirmDialog, {
|
||||||
|
title: '',
|
||||||
|
noBtnTitle: '',
|
||||||
|
message: 'This Immutable Passport is already connected to another wallet. Please use a different Immutable Passport.'
|
||||||
|
}).show()
|
||||||
|
if(confirmResult1.errcode == 0) {
|
||||||
new PassportWallet().logout();
|
new PassportWallet().logout();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
message.error('User denied transaction signature')
|
message.error('User denied transaction signature')
|
||||||
}
|
}
|
||||||
@ -453,7 +459,7 @@ onMounted(() => {
|
|||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
background: #2D2738;
|
background: #2D2738;
|
||||||
border-radius: 20px;
|
border-radius: 20px;
|
||||||
padding: 0 20px;
|
// padding: 0 20px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
.top {
|
.top {
|
||||||
display: flex;
|
display: flex;
|
||||||
@ -463,7 +469,7 @@ onMounted(() => {
|
|||||||
border-bottom: 2px solid #4C425F;
|
border-bottom: 2px solid #4C425F;
|
||||||
padding: 20px 0px 10px 0px;
|
padding: 20px 0px 10px 0px;
|
||||||
// margin: 0 41px 0 54px;
|
// margin: 0 41px 0 54px;
|
||||||
margin-left: 34px;
|
margin-left: 54px;
|
||||||
margin-right: 21px;
|
margin-right: 21px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
.top-left {
|
.top-left {
|
||||||
@ -532,7 +538,7 @@ onMounted(() => {
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: space-evenly;
|
justify-content: space-evenly;
|
||||||
// padding: 10px 0;
|
// padding: 10px 0;
|
||||||
margin: 0 21px 0 34px;
|
margin: 0 21px 0 54px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
border-bottom: 2px solid #4C425F;
|
border-bottom: 2px solid #4C425F;
|
||||||
li {
|
li {
|
||||||
|
@ -4,15 +4,20 @@ import { ethers } from "ethers"
|
|||||||
// 计算价格精度
|
// 计算价格精度
|
||||||
export const priceCalculated = (price, decimals=18) => {
|
export const priceCalculated = (price, decimals=18) => {
|
||||||
if (!price) {
|
if (!price) {
|
||||||
return '0.000000'
|
return '0.00000'
|
||||||
}
|
}
|
||||||
let str = Number(ethers.utils.formatUnits(price, decimals)).toFixed(6)
|
let str = Number(ethers.utils.formatUnits(price, decimals))
|
||||||
if(str == '0.000000') {
|
str = (Math.floor(str * 100000)/100000).toFixed(5)
|
||||||
str = '<0.000010'
|
// let numStr = String(str)
|
||||||
|
// const regex = new RegExp(`(\\.\\d{${6}})[1-9]+`, 'g')
|
||||||
|
// str = numStr.replace(regex, (match) => match.slice(0, 6 + 5))
|
||||||
|
// console.log(str)
|
||||||
|
if(str == '0.00000') {
|
||||||
|
str = '<0.00001'
|
||||||
} else {
|
} else {
|
||||||
return str.slice(0, -1)
|
return str
|
||||||
}
|
}
|
||||||
return str.slice(0, -1)
|
return str
|
||||||
}
|
}
|
||||||
|
|
||||||
// 计算购买总价格
|
// 计算购买总价格
|
||||||
|
@ -15,6 +15,7 @@ export const useStakingStore = defineStore('staking', () => {
|
|||||||
esCecCollection: BigInt('0'),
|
esCecCollection: BigInt('0'),
|
||||||
totalCollection: BigInt('0'),
|
totalCollection: BigInt('0'),
|
||||||
CecClaimable: BigInt("0"),
|
CecClaimable: BigInt("0"),
|
||||||
|
lastDepositTime: BigInt("0"),
|
||||||
})
|
})
|
||||||
const bindPassportAddress = ref([])
|
const bindPassportAddress = ref([])
|
||||||
const bindPassportEmail = ref([])
|
const bindPassportEmail = ref([])
|
||||||
|
@ -43,40 +43,69 @@
|
|||||||
<div class="con">
|
<div class="con">
|
||||||
<Header />
|
<Header />
|
||||||
<div class="staking-label">
|
<div class="staking-label">
|
||||||
<li :class="labelListIndex == index ? 'active' : ''" v-for="(item, index) in labelList" :key="index" @click="labelListIndex = index">{{ item.text }}</li>
|
<li
|
||||||
|
:class="labelListIndex == index ? 'active' : ''"
|
||||||
|
v-for="(item, index) in labelList"
|
||||||
|
:key="index"
|
||||||
|
@click="labelListIndex = index"
|
||||||
|
>{{ item.text }}</li>
|
||||||
</div>
|
</div>
|
||||||
<Staking v-if="labelListIndex == 0" @refreshCecInfo="userCecInfo" />
|
<Staking v-if="labelListIndex == 0" @refreshCecInfo="userCecInfo" />
|
||||||
<Conversion v-else-if="labelListIndex == 1" @refreshCecInfo="userCecInfo" />
|
<Conversion v-else-if="labelListIndex == 1" @refreshCecInfo="userCecInfo" />
|
||||||
</div>
|
</div>
|
||||||
|
<div class="footer">
|
||||||
|
<div class="footer-left">
|
||||||
|
<div>
|
||||||
|
<img src="@/assets/img/cec_activity/game_logo02.png" alt />
|
||||||
|
</div>
|
||||||
|
<p>© Candy Bubble Global Limited.ALL RIGHTS RESERVED.</p>
|
||||||
|
</div>
|
||||||
|
<div class="footer-right">
|
||||||
|
<!-- <li>
|
||||||
|
<a href="https://discord.com/invite/counterfire" target="_blank">
|
||||||
|
<img src="./../assets/home/com_Discord_icon.png" alt="">
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href="https://twitter.com/@playCounterFire" target="_blank">
|
||||||
|
<img src="./../assets/home/com_X_icon.png" alt="">
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href="https://www.youtube.com/@playCounterFire" target="_blank">
|
||||||
|
<img src="./../assets/home/com_Youtube_icon.png" alt="">
|
||||||
|
</a>
|
||||||
|
</li>-->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, toRaw, onMounted } from "vue";
|
import {ref, toRaw, onMounted} from "vue";
|
||||||
import Header from "@/components/staking/header.vue";
|
import Header from "@/components/staking/header.vue";
|
||||||
import Staking from "@/components/staking/index.vue";
|
import Staking from "@/components/staking/index.vue";
|
||||||
import Conversion from "@/components/staking/conversion.vue";
|
import Conversion from "@/components/staking/conversion.vue";
|
||||||
import { BlockChain } from "@/components/chain/BlockChain"
|
import {BlockChain} from "@/components/chain/BlockChain";
|
||||||
// import { switchEthereumChain } from "@/components/chain/utils"
|
// import { switchEthereumChain } from "@/components/chain/utils"
|
||||||
import { apiVipInfo } from "@/utils/marketplace"
|
import {apiVipInfo} from "@/utils/marketplace";
|
||||||
import {walletStore} from "@/store/wallet";
|
import {walletStore} from "@/store/wallet";
|
||||||
import { useStakingStore } from "@/store/staking"
|
import {useStakingStore} from "@/store/staking";
|
||||||
import { PassportWallet } from "@/components/chain/wallet/PassportWallet";
|
import {PassportWallet} from "@/components/chain/wallet/PassportWallet";
|
||||||
|
|
||||||
const localWalletStore = walletStore();
|
const localWalletStore = walletStore();
|
||||||
const stakingStore = useStakingStore()
|
const stakingStore = useStakingStore();
|
||||||
const labelListIndex = ref(0)
|
const labelListIndex = ref(0);
|
||||||
const labelList = ref([
|
const labelList = ref([
|
||||||
{
|
{
|
||||||
text: 'Staking',
|
text: "Staking",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: 'Vest',
|
text: "Vest",
|
||||||
}
|
},
|
||||||
])
|
]);
|
||||||
const isLogout = ref(false);
|
const isLogout = ref(false);
|
||||||
|
|
||||||
|
|
||||||
const cecInfoData = ref({
|
const cecInfoData = ref({
|
||||||
cecBalance: BigInt("0"),
|
cecBalance: BigInt("0"),
|
||||||
CecStaked: BigInt("0"),
|
CecStaked: BigInt("0"),
|
||||||
@ -135,11 +164,12 @@ const getCecData = async () => {
|
|||||||
cecInfoData.value.esCecCollection = BigInt(await bc.staking.queryClaimableByEsCEC());
|
cecInfoData.value.esCecCollection = BigInt(await bc.staking.queryClaimableByEsCEC());
|
||||||
cecInfoData.value.CecClaim = BigInt(await bc.staking.queryCumulativeByCEC());
|
cecInfoData.value.CecClaim = BigInt(await bc.staking.queryCumulativeByCEC());
|
||||||
cecInfoData.value.esCecClaim = BigInt(await bc.staking.queryCumulativeByEsCEC());
|
cecInfoData.value.esCecClaim = BigInt(await bc.staking.queryCumulativeByEsCEC());
|
||||||
cecInfoData.value.CecClaimable = BigInt(await bc.vester.queryClaimable())
|
cecInfoData.value.CecClaimable = BigInt(await bc.vester.queryClaimable());
|
||||||
cecInfoData.value.cecClaimAll = BigInt(await bc.vester.queryClaimabledAll())
|
cecInfoData.value.cecClaimAll = BigInt(await bc.vester.queryClaimabledAll());
|
||||||
cecInfoData.value.lastDepositTime = BigInt(await bc.vester.queryLastDepositTime())
|
cecInfoData.value.lastDepositTime = BigInt(await bc.vester.queryLastDepositTime());
|
||||||
cecInfoData.value.totalCollection = cecInfoData.value.CecCollection + cecInfoData.value.esCecCollection;
|
cecInfoData.value.totalCollection = cecInfoData.value.CecCollection + cecInfoData.value.esCecCollection;
|
||||||
stakingStore.cecInfoData = cecInfoData.value;
|
stakingStore.cecInfoData = cecInfoData.value;
|
||||||
|
console.log(cecInfoData.value);
|
||||||
// getCode()
|
// getCode()
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// console.log("query claimable error", e);
|
// console.log("query claimable error", e);
|
||||||
@ -148,7 +178,7 @@ const getCecData = async () => {
|
|||||||
}, 2000);
|
}, 2000);
|
||||||
};
|
};
|
||||||
|
|
||||||
const getCode = () =>{
|
const getCode = () => {
|
||||||
const TIME_COUNT = 3;
|
const TIME_COUNT = 3;
|
||||||
if (!timer.value) {
|
if (!timer.value) {
|
||||||
count.value = TIME_COUNT;
|
count.value = TIME_COUNT;
|
||||||
@ -162,62 +192,61 @@ const getCode = () =>{
|
|||||||
clearInterval(timer.value);
|
clearInterval(timer.value);
|
||||||
timer.value = null;
|
timer.value = null;
|
||||||
}
|
}
|
||||||
}, 2000)
|
}, 2000);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const getLinkWallet = async () => {
|
const getLinkWallet = async () => {
|
||||||
let disabled = [5,3]
|
let disabled = [5, 3];
|
||||||
await new BlockChain().cecLogin({disabled})
|
await new BlockChain().cecLogin({disabled});
|
||||||
location.reload()
|
location.reload();
|
||||||
};
|
};
|
||||||
|
|
||||||
const logOut = async () => {
|
const logOut = async () => {
|
||||||
stakingStore.cecInfoData = {}
|
stakingStore.bindPassportAddress = ''
|
||||||
|
stakingStore.bindPassportEmail = ''
|
||||||
|
stakingStore.cecInfoData = {};
|
||||||
new PassportWallet().logout();
|
new PassportWallet().logout();
|
||||||
await new BlockChain().logout()
|
await new BlockChain().logout();
|
||||||
// location.reload()
|
// location.reload()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// 加载页面切换链ID
|
// 加载页面切换链ID
|
||||||
const getNetId = async () => {
|
const getNetId = async () => {
|
||||||
await new BlockChain().checkNetId(localWalletStore.walletType)
|
await new BlockChain().checkNetId(localWalletStore.walletType);
|
||||||
}
|
};
|
||||||
|
|
||||||
// 判断是否绑定passport账号
|
// 判断是否绑定passport账号
|
||||||
const getVipInfo = async () => {
|
const getVipInfo = async () => {
|
||||||
const { errcode, info } = await apiVipInfo()
|
const {errcode, info} = await apiVipInfo();
|
||||||
console.log('bind_passport_address',info.bind_passport_address)
|
console.log("bind_passport_address", info.bind_passport_address);
|
||||||
if(errcode == 0) {
|
if (errcode == 0) {
|
||||||
stakingStore.bindPassportAddress = info.bind_passport_address
|
stakingStore.bindPassportAddress = info.bind_passport_address;
|
||||||
stakingStore.bindPassportEmail = info.bind_email
|
stakingStore.bindPassportEmail = info.bind_email;
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
// 发送推文
|
// 发送推文
|
||||||
const toTwitter = () => {
|
const toTwitter = () => {
|
||||||
const url = "https://twitter.com/intent/tweet?text=";
|
const url = "https://twitter.com/intent/tweet?text=";
|
||||||
const hashtags = encodeURIComponent("500,000 $CEC Awaits - Earn Your Share!");
|
const hashtags = encodeURIComponent("500,000 $CEC Awaits - Earn Your Share!");
|
||||||
const imageUrl = encodeURIComponent(`https://counterfire.games/cecActivity`);
|
const imageUrl = encodeURIComponent(`https://market.kingsome.cn`);
|
||||||
const params = `${hashtags}&url=${imageUrl}`;
|
const params = `${hashtags}&url=${imageUrl}`;
|
||||||
// const params = `${hashtags}`;
|
// const params = `${hashtags}`;
|
||||||
window.open(`${url}${params}`, "_blank");
|
window.open(`${url}${params}`, "_blank");
|
||||||
};
|
};
|
||||||
|
|
||||||
const userCecInfo = () => {
|
const userCecInfo = () => {
|
||||||
getNetId()
|
getNetId();
|
||||||
getVipInfo()
|
getVipInfo();
|
||||||
getCecData();
|
getCecData();
|
||||||
}
|
};
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
if(localWalletStore.address) {
|
if (localWalletStore.address) {
|
||||||
userCecInfo()
|
userCecInfo();
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
@ -234,8 +263,8 @@ onMounted(() => {
|
|||||||
background-size: 100% 100%;
|
background-size: 100% 100%;
|
||||||
.header-left {
|
.header-left {
|
||||||
div {
|
div {
|
||||||
width: 263px;
|
width: 283px;
|
||||||
height: 163px;
|
height: 133px;
|
||||||
img {
|
img {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
@ -246,7 +275,7 @@ onMounted(() => {
|
|||||||
display: flex;
|
display: flex;
|
||||||
// align-items: center;
|
// align-items: center;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
margin-top: 58px;
|
margin-top: 43px;
|
||||||
.left {
|
.left {
|
||||||
width: 106px;
|
width: 106px;
|
||||||
height: 47px;
|
height: 47px;
|
||||||
@ -377,32 +406,67 @@ onMounted(() => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
.con {
|
.con {
|
||||||
margin-top: -133px;
|
margin-top: -240px;
|
||||||
|
padding-bottom: 80px;
|
||||||
.staking-label {
|
.staking-label {
|
||||||
display: flex;
|
display: flex;
|
||||||
width: 1348px;
|
width: 1348px;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
margin-top: 33px;
|
margin-top: 33px;
|
||||||
margin-bottom: 11px;
|
margin-bottom: 5px;
|
||||||
li {
|
li {
|
||||||
width: 281px;
|
width: 281px;
|
||||||
height: 57px;
|
height: 57px;
|
||||||
line-height: 57px;
|
line-height: 57px;
|
||||||
background: #363142;
|
background: #363142;
|
||||||
border-radius: 40px 40px 0px 0px;
|
border-radius: 40px 40px 0px 0px;
|
||||||
font-family: 'Poppins';
|
font-family: "Poppins";
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
font-size: 30px;
|
font-size: 30px;
|
||||||
color: #C7BCE8;
|
color: #c7bce8;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin-right: 16px;
|
margin-right: 16px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
.active {
|
.active {
|
||||||
background: #FFC35B;
|
background: #ffc35b;
|
||||||
color: #000;
|
color: #000;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.footer {
|
||||||
|
width: 100%;
|
||||||
|
height: 98px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
padding: 0 45px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
border-top: 2px solid #2c2635;
|
||||||
|
background: #1a1821;
|
||||||
|
.footer-left {
|
||||||
|
width: 1348px;
|
||||||
|
margin: 0 auto;
|
||||||
|
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
div {
|
||||||
|
width: 235px;
|
||||||
|
height: 51px;
|
||||||
|
margin-right: 40px;
|
||||||
|
img {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
p {
|
||||||
|
font-family: 'Poppins-Regular';
|
||||||
|
font-weight: 400;
|
||||||
|
color: #877e98;
|
||||||
|
font-size: 18px;
|
||||||
|
margin-top: 8px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
Loading…
x
Reference in New Issue
Block a user