修改转化文案

This commit is contained in:
yuyongdong 2024-09-14 19:32:35 +08:00
parent e970dc5c8e
commit d843280800
6 changed files with 38 additions and 42 deletions

View File

@ -11,7 +11,7 @@
<div class="icon">
<img src="@/assets/img/staking/Icon_!.png" alt="">
</div>
<div class="tips-con">Lock esCEC for vesting over a one-year period, requiring an equivalent amount of CEC to be locked</div>
<div class="tips-con">To lock esCEC to vest within one year, you need to lock an equal amount of staked CEC</div>
</div>
</div>
<div class="top-right">
@ -98,10 +98,8 @@ const dialogUnstakeText = ref({
conversionName: "CEC"
})
const conversionModal = () => {
let amount = Number(priceCalculated(stakingStore.cecInfoData.CecStaked)) - Number(priceCalculated(stakingStore.cecInfoData.CecDisarm))
console.log(amount)
cecDialogVisible.value = true
dialogUnstakeText.value = {
title: "Vest esCEC",
@ -142,22 +140,13 @@ const collectionModal = () => {
const eventBtnName = (val) => {
if(val.title == 'Vest esCEC') {
cecDeposit(val.amount)
// } else if(val.title == 'Claim esCEC') {
// claimCec()
}
}
//
const cecDeposit = async (_amount) => {
if(Number(priceCalculated(stakingStore.cecInfoData.CecStaked)) < Number(_amount)) {
cecDialogVisible.value = false
const confirmResult = await createModal(ConfirmDialog, {
title: "",
noBtnTitle: '',
message: 'Please stake a sufficient amount of CEC, which will be used to lock the corresponding amount of CEC when the esCEC is vested.'
}).show();
} else {
let amount = BigInt(_amount * 1e18)
if((Number(priceCalculated(stakingStore.cecInfoData.CecStaked)) - Number(priceCalculated(stakingStore.cecInfoData.CecDisarm))) == Number(_amount) || (Number(priceCalculated(stakingStore.cecInfoData.CecStaked)) - Number(priceCalculated(stakingStore.cecInfoData.CecDisarm))) > Number(_amount)) {
let amount = BigInt(_amount) * BigInt(1e18)
loadingDialogVisible.value = true
try {
let res = await bc.vester.deposit(amount)
@ -177,6 +166,13 @@ const cecDeposit = async (_amount) => {
}
loadingDialogVisible.value = false
}
} else {
cecDialogVisible.value = false
const confirmResult = await createModal(ConfirmDialog, {
title: "",
noBtnTitle: '',
message: 'Please stake a sufficient amount of CEC, which will be used to lock the corresponding amount of CEC when the esCEC is vested.'
}).show();
}
}

View File

@ -18,7 +18,7 @@
</div>
<div class="right">
<div>CEC</div>
<p>{{ priceCalculated(stakingStore.cecInfoData.cecBalance,18) }}</p>
<p>{{ priceCalculated(stakingStore.cecInfoData.cecBalance) }}</p>
</div>
</li>
<li>
@ -231,15 +231,13 @@ const vipHandleClose = () => {
// }
watch(localWalletStore, () => {
if(localWalletStore.token) {
// getCode()
}
// if(!localWalletStore.token) {
// stakingStore.cecInfoData = cecInfoData.value
// }
});
onMounted(() => {
if (localWalletStore.address) {
// getCecData();
}
});
</script>

View File

@ -287,7 +287,7 @@ const closeEsCecStakedText = () => {
// cec
const cecStaked = async (_amount) => {
const amount = BigInt(_amount * 1e18)
const amount = BigInt(_amount) * BigInt(1e18)
loadingDialogVisible.value = true
try{
let allow = await bc.erc20.allowance(STAKING_ADDRESSES[chainId].cec, STAKING_ADDRESSES[chainId].stakedCecTracker)
@ -317,7 +317,7 @@ const cecStaked = async (_amount) => {
//
const closeStaked = async (type, _amount) => {
let amount = BigInt(_amount * 1e18)
let amount = BigInt(_amount) * BigInt(1e18)
loadingDialogVisible.value = true
if(type == 'Unstake CEC') {
try {
@ -405,7 +405,7 @@ const getCecCollection = async (type) => {
// esCec
const esCecStaked = async (_amount) => {
const amount = BigInt(_amount * 1e18)
const amount = BigInt(_amount) * BigInt(1e18)
loadingDialogVisible.value = true
try{
let res = await bc.staking.stakeEsCec(amount)

View File

@ -6,7 +6,7 @@ const routes = [
name: "index1",
component: StakingView,
meta: {
title: "home",
title: "Staking",
canonical: "https://.counterfire.games",
},
},

View File

@ -19,7 +19,7 @@ export const walletStore = defineStore(
const showAddress = computed(() => {
if (address.value.length > 10) {
if (address.value?.length > 10) {
return `${address.value.slice(0, 6)}...${address.value.slice(-4)}`;
} else {
return address.value

View File

@ -35,7 +35,7 @@
</div>
</div>
<div class="wallet" v-else @click="isLogout = !isLogout">
<div class="wallet-address">{{ localWalletStore.showAddress }}</div>
<div class="wallet-address">{{ localWalletStore?.showAddress }}</div>
<div class="wallet-btn">
<img class="hover-show" src="@/assets/img/staking/ConnectMenu1.png" alt />
<img class="hover-none" src="@/assets/img/staking/ConnectMenu2.png" alt />
@ -175,7 +175,7 @@ const getCecData = async () => {
cecInfoData.value.totalCollection = cecInfoData.value.CecCollection + cecInfoData.value.esCecCollection;
stakingStore.cecInfoData = cecInfoData.value;
console.log(cecInfoData.value);
// getCode()
getCode()
} catch (e) {
// console.log("query claimable error", e);
}
@ -183,8 +183,10 @@ const getCecData = async () => {
}, 2000);
};
const timer = ref(null)
const count = ref()
const getCode = () => {
const TIME_COUNT = 3;
let TIME_COUNT = 3;
if (!timer.value) {
count.value = TIME_COUNT;
// this.show = false;
@ -192,7 +194,7 @@ const getCode = () => {
if (count.value > 0 && count.value <= TIME_COUNT) {
count.value--;
} else {
// getCecData()
getCecData()
TIME_COUNT = 3;
clearInterval(timer.value);
timer.value = null;