Leaderboard
@@ -240,9 +352,16 @@ import { useRouter, useRoute } from "vue-router";
import Vue3autocounter from "vue3-autocounter";
import NavBar from "../layout/navber.vue";
import { useCopyToClipboard } from "../../hooks/useCopyToClipboard";
-import { getLeaderboard, UserInfo, UserStatus, getJoin } from "@/api/User";
+import {
+ getLeaderboard,
+ UserInfo,
+ UserStatus,
+ getJoin,
+ getBasic,
+} from "@/api/User";
import { useChainStore } from "@/store/chain";
import { useAppStore } from "@/store/app";
+import { hasMetamask } from "@/utils/chain.util";
import { ref, reactive, watchEffect, onMounted, watch, computed } from "vue";
import { message } from "ant-design-vue";
const chain = useChainStore();
@@ -254,10 +373,32 @@ const rank = ref(0);
const top = ref(0);
const points = ref(0);
const ticket = ref(0);
+const cecRankShow = ref(0);
const counter = ref(null);
const data = reactive([]);
-const isStatus= ref(false)
+const isStatus = ref(false);
const userInfo = reactive({});
+const totalScore = ref(1518320);
+const rankScore = ref(82673);
+
+const remainingReward = ref(500000);
+
+const userPercentage = computed(
+ () => (userInfo.point / totalScore.value) * 100
+);
+const cuount = computed(() => (userInfo.rank / rankScore.value) * 100);
+const reward = computed(() => {
+ if (cuount.value > 0.5) {
+ return 0;
+ } else if (cuount.value <= 0.1) {
+ return remainingReward.value * 0.4 * (userPercentage.value * 0.1);
+ } else if (cuount.value > 0.1 && cuount.value <= 0.3) {
+ return remainingReward.value * 0.4 * (userPercentage.value * 0.2);
+ } else if (cuount.value > 0.3 && cuount.value <= 0.5) {
+ return remainingReward.value * 0.2 * (userPercentage.value * 0.2);
+ }
+});
+
const formattedData = computed(() => {
return data
.map((item) => ({
@@ -274,11 +415,36 @@ const formattedData = computed(() => {
}, []);
});
const typesInRegular = computed(() =>
- userInfo.regular.map((item) => item.type).join("
")
+ userInfo.regular.map((item) => item.type).join("
")
);
const totalRegularPoints = computed(() =>
userInfo.regular.reduce((total, item) => total + item.point, 0)
);
+const isMobile = () => {
+ const userAgent = navigator.userAgent;
+ return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(
+ userAgent
+ );
+};
+async function login(event) {
+ var next = window.location.href;
+
+ if (isMobile() && !hasMetamask()) {
+ ///debugger
+ var url = `https://metamask.app.link/dapp/${next}`;
+ location.href = url;
+ } else {
+ if (!chain.logined) {
+ // 没有登录情况下执行登录
+ await chain.chainManager.login();
+ // console.log("logined:", chain.chainManager.isLogined);
+ chain.logined = chain.chainManager.isLogined;
+ // if (chain.logined) {
+ // currentTask.value = 2;
+ // }
+ }
+ }
+}
const assign = (source, target) => {
if (target === undefined || target === null) {
throw new TypeError("Cannot convert undefined or null to object");
@@ -299,9 +465,9 @@ const handTaskHome = () => {
const handTaskOne = () => {
const code = route.query.code;
if (code) {
- router.push({ path: "/undertest", query: { code: code } });
+ router.push({ path: "/taskTwo", query: { code: code } });
} else {
- router.push("/undertest");
+ router.push("/taskTwo");
}
console.log(router, "-=-=-");
};
@@ -339,8 +505,15 @@ watch(
// console.log(data.value, "ff");
}
const userStatus = await UserStatus({ account: AppModule.accountId });
- if (userStatus && userStatus.claim && Number(userStatus.claim) !== 0 && userStatus.status.every((status) => status == 1)) {
- isStatus.value = true
+ const basic = await getBasic(AppModule.accountId.toLowerCase());
+ cecRankShow.value = basic.data.cecRankShow;
+ if (
+ userStatus &&
+ userStatus.claim &&
+ Number(userStatus.claim) !== 0 &&
+ userStatus.status.every((status) => status == 1)
+ ) {
+ isStatus.value = true;
const resjoin = await getJoin({
account: AppModule.accountId,
invite_code: route.query.code,
@@ -373,10 +546,16 @@ onMounted(async () => {
// console.log(data.value, "ff");
}
const userStatus = await UserStatus({ account: AppModule.accountId });
- if (userStatus && userStatus.claim && Number(userStatus.claim) !== 0 && userStatus.status.every((status) => status == 1)) {
- isStatus.value = true
-
- }
+ const basic = await getBasic(AppModule.accountId.toLowerCase());
+ cecRankShow.value = basic.data.cecRankShow;
+ if (
+ userStatus &&
+ userStatus.claim &&
+ Number(userStatus.claim) !== 0 &&
+ userStatus.status.every((status) => status == 1)
+ ) {
+ isStatus.value = true;
+ }
const resq = await UserInfo({ account: AppModule.accountId });
if (resq) {
@@ -395,6 +574,16 @@ onMounted(async () => {
.task-two-header {
// height: 65px;
}
+.the-event {
+ // padding-left: 100px;
+ // padding-right: 100px;
+ text-align: center;
+ font-family: "Arial";
+ padding-bottom: 120px;
+ padding-top: 120px;
+ color: #fff;
+ font-size: 38px;
+}
.task-two {
position: relative;
width: 100%;
@@ -495,6 +684,225 @@ onMounted(async () => {
justify-content: space-between;
margin: 0 auto;
position: relative;
+ .gacha-star {
+ // position: absolute;
+ // bottom: -50px;
+ // // right: 0px;
+ // left: 50%;
+ margin-bottom: 10px;
+ font-size: 22px;
+ width: 100%;
+ display: flex;
+ margin-top: 20px;
+ justify-content: center;
+ align-items: center;
+ font-family: "Poppins";
+ font-weight: 300;
+ color: #fefefe;
+ .gacha-star-item {
+ display: flex;
+ align-items: center;
+ width: 100%;
+ .icon-star {
+ width: 193px;
+ margin-right: 15px;
+
+ // height: 3px;
+ img {
+ width: 193px;
+ // height: 103px;
+ }
+ }
+ }
+ }
+ .boders {
+ margin-top: 10px;
+ }
+ .rewards-card {
+ padding-top: 29px;
+ padding-right: 4px;
+ width: 100%;
+ margin-bottom: 33px;
+ justify-content: space-between;
+ display: flex;
+ .base-rewards {
+ display: flex;
+ width: 270px;
+ justify-content: space-between;
+ }
+ }
+ .total-boders {
+ margin-top: 58px;
+ }
+ .cec-top {
+ display: flex;
+ flex-direction: column;
+ justify-content: space-between;
+ height: 100%;
+ }
+ .cec-title {
+ font-size: 19px;
+ font-family: "Poppins";
+ font-weight: 300;
+ position: relative;
+ color: #ffffff;
+ }
+ .cec-title::before {
+ content: "";
+ position: absolute;
+ top: 5px;
+ right: -9px;
+ width: 6px;
+ height: 6px;
+ background-color: red;
+ border-radius: 50%;
+ }
+ .cec-content {
+ display: flex;
+ width: 100%;
+ justify-content: space-between;
+ .cec-lable {
+ font-size: 19px;
+ font-family: "Poppins";
+ font-weight: 300;
+ color: #d79b30;
+ }
+ .cec-number {
+ font-size: 19px;
+ font-family: "Poppins";
+ font-weight: 400;
+ color: #fff000;
+ }
+ }
+ .connect-centent {
+ display: flex;
+ width: 783px;
+ justify-content: flex-end;
+ }
+
+ .points-btn {
+ width: 265px;
+ height: 52px;
+ padding-left: 32px;
+ display: flex;
+ padding-right: 32px;
+ align-items: center;
+ background: rgba(44, 34, 16, 0.5);
+ border: 1px solid #5c4e35;
+ }
+ .got {
+ font-size: 40px;
+ font-family: "GemunuExtraBold";
+ font-weight: 400;
+ // position: absolute;
+
+ color: #ffffff;
+ // margin-top: 72px;
+ margin-bottom: 15px;
+ }
+ .points-item-number {
+ font-size: 22px;
+ font-family: "Poppins-Regular";
+ font-weight: 400;
+ color: #52ff00;
+ }
+ .got-btn {
+ display: flex;
+ width: 100%;
+ justify-content: space-between;
+ }
+ .total-rewards {
+ width: 100%;
+ height: 66px;
+ background: rgba(44, 34, 16, 0.5);
+ border: 1px solid #5c4e35;
+ margin-top: 10px;
+ display: flex;
+ padding-left: 17px;
+ padding-right: 42px;
+ align-items: center;
+ justify-content: space-between;
+ .total-lable {
+ display: flex;
+ align-items: center;
+ .total-cec {
+ padding-left: 15px;
+ padding-right: 15px;
+ font-size: 19px;
+ font-family: "Poppins";
+ font-weight: 300;
+ color: #fefefe;
+ }
+ .triangle-icon-right {
+ transform: rotate(180deg);
+ }
+ }
+
+ .total-number {
+ font-size: 19px;
+ font-family: "Poppins";
+ font-weight: 400;
+ color: #fff000;
+ }
+ }
+ .claim-btn {
+ width: 253px;
+ height: 69px;
+ margin: 0 auto;
+ margin-top: 30px;
+ text-align: center;
+ line-height: 69px;
+ // cursor: pointer;
+ background: #757575;
+ }
+ .yoyo-content {
+ width: 100%;
+ justify-content: space-between;
+ display: flex;
+ padding-top: 20px;
+ align-items: center;
+ padding-right: 93px;
+ .your-yoyo-lable {
+ display: flex;
+ justify-content: space-between;
+ flex-direction: column;
+ .your-yoyo-text {
+ font-size: 28px;
+ font-family: "GemunuExtraBold";
+ font-weight: 400;
+ color: #ffffff;
+ }
+ .your-yoyo-number {
+ font-size: 28px;
+ font-family: "GemunuExtraBold";
+ font-weight: 400;
+ color: #62fe00;
+ }
+ }
+ .yoyo-coming-soon {
+ font-size: 22px;
+ font-family: "Poppins-Regular";
+ font-weight: 300;
+ color: #ffffff;
+ }
+ }
+ .yoyo-img {
+ width: 107px;
+ height: 80px;
+ img {
+ width: 107px;
+ height: 80px;
+ }
+ }
+ .claim-text {
+ // width: 70%;
+ font-size: 22px;
+ font-family: "Poppins-Regular";
+ font-weight: 300;
+ color: #fefefe;
+ margin: 0 auto;
+ margin-top: 18px;
+ }
.boder-left {
position: absolute;
top: 50px;
@@ -536,7 +944,7 @@ onMounted(async () => {
.link-btn-title {
color: #a68548;
}
- .link-url{
+ .link-url {
white-space: nowrap;
}
}
@@ -573,18 +981,18 @@ onMounted(async () => {
color: #5ce501;
}
.item-number-right::after {
- content: "";
+ content: "";
position: absolute;
- top: 0px;
+ top: 0px;
right: -6px;
width: 6px;
height: 6px;
- background-color: #f50123;
- border-radius: 50%;
+ background-color: #f50123;
+ border-radius: 50%;
}
.points-item {
width: 281px;
- font-size: 32px;
+ font-size: 24px;
font-family: "SAIRABLACK";
font-weight: 400;
color: #ffffff;
@@ -734,7 +1142,7 @@ onMounted(async () => {
font-weight: 400;
color: #ffffff;
justify-content: space-between;
- .assress-item-id{
+ .assress-item-id {
width: 60px;
}
}
@@ -834,7 +1242,7 @@ onMounted(async () => {
.my-tooltip {
&.ant-tooltip {
//sass写法
- max-width: 800px;
+ max-width: 400px;
}
}
diff --git a/src/router/index.js b/src/router/index.js
index f5ba677..bde3ea3 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -45,7 +45,7 @@ const routes = [
import(/* webpackChunkName "TaskOne" */ "@/components/task/TaskOne.vue"),
},
{
- path: "/taskTwo",
+ path: "/view",
name: "TaskTwo",
meta: {
title: "Gacha TaskTwo",
diff --git a/src/utils/requests.ts b/src/utils/requests.ts
new file mode 100644
index 0000000..2b8ff03
--- /dev/null
+++ b/src/utils/requests.ts
@@ -0,0 +1,65 @@
+import axios from 'axios'
+import { message } from 'ant-design-vue'
+
+import glodata from '@/store/user_global';
+
+// console.log(import.meta.env);
+
+const service = axios.create({
+ baseURL: import.meta.env.VUE_APP_GPAL_API3,
+ timeout: 10000
+})
+
+// Request interceptors
+service.interceptors.request.use(
+ (config) => {
+ // Add X-Access-Token header to every request, you can add other custom headers here
+ if (glodata.token) {
+ if (config.url) {
+ if (config.url.indexOf('?') > 0) {
+ config.url += `&token=${glodata.token}`
+ } else {
+ config.url += `?token=${glodata.token}`
+ }
+ if (config.url.indexOf('account=') < 0 && glodata.accountId) {
+ config.url += `&account=${glodata.accountId}`
+ }
+ if (config.url.indexOf('net_id=') < 0 && glodata.chainId) {
+ config.url += `&net_id=${glodata.chainId}`
+ }
+ }
+ }
+ config.headers['Content-Type'] = 'application/json'
+ return config
+ },
+ (error) => {
+ Promise.reject(error)
+ }
+)
+
+// Response interceptors
+service.interceptors.response.use(
+ (response) => {
+ // Some example codes here:
+ // code == 0: success
+ // code == 10: username or password is incorrect
+ // You can change this part for your own usage.
+ const res = response.data
+ if (res.errcode) {
+ // Message({
+ // message: res.errmsg || 'Error',
+ // type: 'error',
+ // duration: 5 * 1000
+ // })
+ // return Promise.reject(new Error(res.errmsg || 'Error'))
+ } else {
+ return response.data
+ }
+ },
+ (error) => {
+ message.error(error.message, 5);
+ return Promise.reject(error)
+ }
+)
+
+export default service
\ No newline at end of file
diff --git a/src/views/TaskView.vue b/src/views/TaskView.vue
index 51f1c84..a94ebf2 100644
--- a/src/views/TaskView.vue
+++ b/src/views/TaskView.vue
@@ -7,8 +7,8 @@
-
-
+
@@ -49,21 +49,35 @@
-
+
+
+
+
+ view your quest
+
+
+
+
+

+
+
+
EVENT DURATION:
+
JUNE 26- JULY 31 AT 22:00(SGT)
+