diff --git a/.env.dev b/.env.dev index 6890392..eeef735 100644 --- a/.env.dev +++ b/.env.dev @@ -1,4 +1,5 @@ VUE_APP_BASE_API='https://market.cebg.games' VUE_APP_BASE_API2='https://invitation.counterfire.games' //VUE_APP_BASE_API2='http://192.168.100.83:3000/' -VUE_APP_GPAL_API='https://m.gacha.counterfire.games' \ No newline at end of file +VUE_APP_GPAL_API='https://m.gacha.counterfire.games' +VUE_APP_GPAL_API3='https://webapi.cebggame.com' \ No newline at end of file diff --git a/.env.production b/.env.production index 7117ae2..83e6182 100644 --- a/.env.production +++ b/.env.production @@ -1,3 +1,4 @@ VUE_APP_BASE_API='https://market.cebg.games' VUE_APP_BASE_API2='https://invitation.counterfire.games' -VUE_APP_GPAL_API='https://m.gacha.counterfire.games' \ No newline at end of file +VUE_APP_GPAL_API='https://m.gacha.counterfire.games' +VUE_APP_GPAL_API3='https://webapi.cebggame.com' \ No newline at end of file diff --git a/dist.rar b/dist.rar index cbad5fc..651557d 100644 Binary files a/dist.rar and b/dist.rar differ diff --git a/src/api/User.js b/src/api/User.js index 29740ec..a3ca9af 100644 --- a/src/api/User.js +++ b/src/api/User.js @@ -1,6 +1,6 @@ import request from '@/utils/request' import request2 from '@/utils/requestduplicate' - +import request3 from '@/utils/requests' const GPAL_URL = import.meta.env.VUE_APP_GPAL_API; @@ -87,6 +87,13 @@ export const logout = () => data }) } + +export const getBasic=(params)=>{ + return request3({ + url: `/api/claim/result/${params}`, + method: 'get', + }) +} // // export const changePass = (params: any) => // request({ diff --git a/src/assets/img/task/Yoyo.png b/src/assets/img/task/Yoyo.png new file mode 100644 index 0000000..da8f372 Binary files /dev/null and b/src/assets/img/task/Yoyo.png differ diff --git a/src/assets/img/task/bg.jpg b/src/assets/img/task/bg.jpg new file mode 100644 index 0000000..c0c2a71 Binary files /dev/null and b/src/assets/img/task/bg.jpg differ diff --git a/src/assets/img/task/bg.png b/src/assets/img/task/bg.png deleted file mode 100644 index 9b5257f..0000000 Binary files a/src/assets/img/task/bg.png and /dev/null differ diff --git a/src/assets/img/task/boders.png b/src/assets/img/task/boders.png new file mode 100644 index 0000000..4c5346e Binary files /dev/null and b/src/assets/img/task/boders.png differ diff --git a/src/assets/img/task/icon_star.png b/src/assets/img/task/icon_star.png new file mode 100644 index 0000000..0a965ca Binary files /dev/null and b/src/assets/img/task/icon_star.png differ diff --git a/src/assets/img/task/triangle.png b/src/assets/img/task/triangle.png new file mode 100644 index 0000000..2ed7a67 Binary files /dev/null and b/src/assets/img/task/triangle.png differ diff --git a/src/assets/img/task/ts_main_zuanshi.png b/src/assets/img/task/ts_main_zuanshi.png new file mode 100644 index 0000000..d44e1d6 Binary files /dev/null and b/src/assets/img/task/ts_main_zuanshi.png differ diff --git a/src/assets/img/task/背景/背景/积分任务移动端(首页)-07-31.jpg b/src/assets/img/task/背景/背景/积分任务移动端(首页)-07-31.jpg new file mode 100644 index 0000000..9c92e19 Binary files /dev/null and b/src/assets/img/task/背景/背景/积分任务移动端(首页)-07-31.jpg differ diff --git a/src/assets/img/task/背景/背景/积分任务移动端(首页.jpg b/src/assets/img/task/背景/背景/积分任务移动端(首页.jpg new file mode 100644 index 0000000..2c3cce8 Binary files /dev/null and b/src/assets/img/task/背景/背景/积分任务移动端(首页.jpg differ diff --git a/src/components/task/TaskTwo.vue b/src/components/task/TaskTwo.vue index feb7e55..8c95c89 100644 --- a/src/components/task/TaskTwo.vue +++ b/src/components/task/TaskTwo.vue @@ -19,8 +19,132 @@
- -
+
You got
+ +
+
+
Points :
+
{{ userInfo.point }}
+
+
+
Ranking :
+
{{ userInfo.rank }}
+
+
+ + +
+
+
+ +
+
+ + +
Basic Rewards
+
+ +
+
CEC
+
+ {{ parseFloat((userInfo.point / 3).toFixed(2)) }} +
+
+
+
+
+
+ +
+
+ + +
Rank Rewards
+
+ +
+
CEC
+
{{ cecRankShow }}
+
+
+
+
+ +
+
+
+ +
+
Total Rewards CEC
+
+ +
+
+
+ {{ + parseFloat( + parseFloat((userInfo.point / 3).toFixed(2)) + + Number(cecRankShow) + ).toFixed(2) + }} +
+
+
Claim
+
Claim time to be announced
+
+ +
+
+
+
+ Your Yoyo {{userInfo.tickets}} +
+
Yoyo event coming soon
+
+
+ +
+
+
+
+
+ +
+
+ Gacha&Star rewards are not displayed on this page for the time + being, and will be announced after the snapshot. +
+
+
+ +
@@ -122,12 +237,7 @@
- +
- -
-
+ +
+ The event has ended
-
-
-
- +
+
+
+
+ +
+
- -
-
-
- +
+
+ +
-
-
-
Token Rewards
-
Yoyo Event
+
+
Token Rewards
+
Yoyo Event
+
+
Connect and check
-
Gacha Quest
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)
+
- +
@@ -91,9 +105,9 @@ const handTaskTwo = () => { /// router.push("/taskTwo"); const code = route.query.code; if (code) { - router.push({ path: "/taskTwo", query: { code: code } }); + router.push({ path: "/view", query: { code: code } }); } else { - router.push("/taskTwo"); + router.push("/view"); } }; @@ -120,6 +134,14 @@ onMounted(() => { .task-header { // height: 65px; } +.event-text { + color: #fff; + font-family: "Arial"; + margin-top: 10px; + font-size: 26px; + margin-left: 40px; + // margin-bottom: 10px; +} .title-content { margin-top: 90px; } @@ -130,7 +152,7 @@ onMounted(() => { align-items: center; padding-right: 6px; margin: 0 auto; - margin-bottom: 72px; + // margin-bottom: 72px; .quest-img { width: 35px; height: 35px; @@ -178,6 +200,7 @@ onMounted(() => { display: flex; justify-content: space-between; flex-direction: column; + padding-bottom: 110px; .the-title { color: #fff; text-align: center; @@ -205,6 +228,7 @@ onMounted(() => { .step-btn { display: flex; + justify-content: center; width: 90%; justify-content: space-between;