-
$CEC Bounty Hunt
+
Contribution Clash

@@ -58,7 +59,7 @@
-
{{ marketplaceStore.contributionPoint }}
+
{{ cecInfo.my_contribution }}
@@ -90,7 +91,7 @@
Your Credits
- {{ marketplaceStore.contributionPoint }}
+ {{ cecInfo.my_contribution }}
@@ -99,7 +100,8 @@
-
+
+
@@ -165,17 +167,21 @@ const router = useRouter();
const totalCecPool = ref(0)
const cecInfo = ref({
- my_contribution: '',
- global_contribution: '',
- total_cec_pool: '',
- my_expected_cec: ''
+ my_contribution: '-',
+ global_contribution: '-',
+ total_cec_pool: 500000,
+ my_expected_cec: '-'
})
const myWidth = computed(() => {
let str = (Number(cecInfo.value.my_contribution) / Number(cecInfo.value.global_contribution)) * 100
// let str = cecInfo.value.total_cec_pool
- if(str < 10) return 10
+ if(!localWalletStore.token) {
+ str = 0
+ } else {
+ if(str < 10) return 10
+ }
return str
})
@@ -186,11 +192,13 @@ const totalWidth = computed(() => {
//
const getCecActivity = async () => {
+ if(localWalletStore.token) {
+
const { errcode, errmsg, contributionPoint, info } = await apiCecActivity(localWalletStore.address)
if(errcode != 0) return
totalCecPool.value = contributionPoint
cecInfo.value = info
-
+}
}
// 链接钱包
@@ -228,22 +236,23 @@ const downloadGame = (platform) => {
}
};
-// const loginDiscord = () => {
- // const _address = localWalletStore.address;
- // const codeChallenge = Date.now();
- // const state = btoa(`${_address}|${codeChallenge}`);
- // // const url = 'https://discord.com/api/oauth2/authorize?client_id=1116692240224501850&redirect_uri=http%3A%2F%2Flocalhost%3A3010%2Fdiscord%2Fredirect_uri&response_type=code&scope=guilds%20identify%20guilds.members.read'
- // const url = `https://discord.com/api/oauth2/authorize?client_id=1117759635269636096&redirect_uri=https%3A%2F%2Foauth-svr.cebggame.com%2Fdiscord%2Fredirect_uri&response_type=code&scope=guilds%20identify%20guilds.members.read&state=${state}`;
- // // location.href = url
- // // // Redirect the user to the Discord OAuth2 authorization page
- // let params = `scrollbars=yes,resizable=yes,status=no,location=no,toolbar=no,menubar=no,width=600,height=800,left=100,top=100`;
- // let newwin = window.open(url, "discord login", params);
- // var timer = setInterval(function() {
- // if (newwin.closed) {
- // clearInterval(timer);
- // }
- // }, 10);
- // };
+const loginDiscord = () => {
+ const _address = localWalletStore.address;
+ const codeChallenge = Date.now();
+ const state = btoa(`${_address}|${codeChallenge}`);
+ // const url = 'https://discord.com/api/oauth2/authorize?client_id=1116692240224501850&redirect_uri=http%3A%2F%2Flocalhost%3A3010%2Fdiscord%2Fredirect_uri&response_type=code&scope=guilds%20identify%20guilds.members.read'
+ const url = `https://discord.com/api/oauth2/authorize?client_id=1117759635269636096&redirect_uri=https%3A%2F%2Foauth-svr.cebggame.com%2Fdiscord%2Fredirect_uri&response_type=code&scope=guilds%20identify%20guilds.members.read&state=${state}`;
+ // location.href = url
+ // // Redirect the user to the Discord OAuth2 authorization page
+ let params = `scrollbars=yes,resizable=yes,status=no,location=no,toolbar=no,menubar=no,width=600,height=800,left=100,top=100`;
+ let newwin = window.open(url, "discord login", params);
+ console.log(newwin)
+ var timer = setInterval(function() {
+ if (newwin.closed) {
+ clearInterval(timer);
+ }
+ }, 10);
+ };
// 发送推文
const toTwitter = () => {
@@ -714,6 +723,10 @@ onMounted(() => {
background: linear-gradient(180deg, #8929ff, #e362ff);
border-radius: 0 20px 20px 0;
}
+ .total-right {
+ background: linear-gradient(180deg, #8929ff, #e362ff);
+ border-radius: 20px;
+ }
}
.total {
position: absolute;