From 3e70bef212a1a7f6767189d4e66d29135fa1c0f7 Mon Sep 17 00:00:00 2001 From: huangjinming Date: Wed, 28 Jun 2023 19:27:46 +0800 Subject: [PATCH] fix --- src/components/layout/navber.vue | 16 ++++++++++------ src/components/task/TaskOne.vue | 9 +++++++-- src/components/task/TaskTwo.vue | 8 ++++++-- src/views/TaskView.vue | 9 +++++++-- 4 files changed, 30 insertions(+), 12 deletions(-) diff --git a/src/components/layout/navber.vue b/src/components/layout/navber.vue index fe56b3a..d74d4c3 100644 --- a/src/components/layout/navber.vue +++ b/src/components/layout/navber.vue @@ -38,6 +38,7 @@ import { ref, reactive, onMounted, computed, watchEffect } from "vue"; import { useChainStore } from "@/store/chain"; import { useAppStore } from "@/store/app"; import { useRouter, useRoute } from "vue-router"; +import { UserStatus } from "@/api/User"; import ChainModel from "@/components/home/ChainModel.vue"; import { hasMetamask } from "@/utils/chain.util"; import { useCopyToClipboard } from "./../../hooks/useCopyToClipboard"; @@ -80,10 +81,13 @@ async function login(event) { await chain.chainManager.login(); // console.log("logined:", chain.chainManager.isLogined); chain.logined = chain.chainManager.isLogined; - if(chain.logined){ + const resq = await UserStatus({ + account: AppModule.accountId, + invite_code: route.query.code, + }); + if (chain.logined) { emit("login-success"); } - } } } @@ -124,7 +128,7 @@ const handleCopy = () => { .logo { width: 166px; height: 80px; - img{ + img { width: 100%; height: 100%; } @@ -142,7 +146,7 @@ const handleCopy = () => { cursor: pointer; text-align: center; line-height: 61px; - font-family: 'Arial'; + font-family: "Arial"; //border: 1px solid #ffffff; background: url("@/assets/img/task/login-btn.png") no-repeat; background-size: 100% 100%; @@ -156,7 +160,7 @@ const handleCopy = () => { width: 211px; height: 61px; cursor: pointer; - font-family: 'Arial'; + font-family: "Arial"; font-size: 22px; color: #fff; text-align: center; @@ -205,7 +209,7 @@ const handleCopy = () => { // padding: 5px 15px; color: #f5f5f5; display: flex; - font-family: 'Arial'; + font-family: "Arial"; //border: 1px solid #ccc; background-color: #161515; justify-content: center; diff --git a/src/components/task/TaskOne.vue b/src/components/task/TaskOne.vue index cd95ce5..3f057c4 100644 --- a/src/components/task/TaskOne.vue +++ b/src/components/task/TaskOne.vue @@ -376,8 +376,13 @@ const updateLogin = async () => { currentTask.value = 2; }; const handTaskHome = () => { - router.push("/quest"); - console.log(router, "-=-=-"); + //router.push("/quest"); + const code = route.query.code; + if (code) { + router.push({ path: "/quest", query: { code: code } }); + } else { + router.push("/quest"); + } }; const formatAddress = (address) => { if (address.length >= 10) { diff --git a/src/components/task/TaskTwo.vue b/src/components/task/TaskTwo.vue index 7e3d5db..c493b71 100644 --- a/src/components/task/TaskTwo.vue +++ b/src/components/task/TaskTwo.vue @@ -289,8 +289,12 @@ const assign = (source, target) => { } }; const handTaskHome = () => { - router.push("/quest"); - console.log(router, "-=-=-"); + const code = route.query.code; + if (code) { + router.push({ path: "/quest", query: { code: code } }); + } else { + router.push("/quest"); + } }; const handTaskOne = () => { const code = route.query.code; diff --git a/src/views/TaskView.vue b/src/views/TaskView.vue index d03ea87..e26ed2f 100644 --- a/src/views/TaskView.vue +++ b/src/views/TaskView.vue @@ -79,8 +79,13 @@ const handTaskOne = () => { console.log(router, "-=-=-"); }; const handTaskTwo = () => { - router.push("/taskTwo"); - console.log(router, "-=-=-"); +/// router.push("/taskTwo"); + const code = route.query.code; + if (code) { + router.push({ path: "/taskTwo", query: { code: code } }); + } else { + router.push("/taskTwo"); + } }; watch(