diff --git a/src/layout/knowledgePage.vue b/src/layout/knowledgePage.vue index fb2c847..1f57c29 100644 --- a/src/layout/knowledgePage.vue +++ b/src/layout/knowledgePage.vue @@ -94,6 +94,7 @@ const enter = () => { const allStudied = Knowledges.value.every(item => item.isStudy); if (allStudied) { router.push('/studyPage'); + localStorage.setItem('isStudy', 'true'); } else { ElMessage.error('请先完成所有学习内容') } diff --git a/src/layout/studyPage.vue b/src/layout/studyPage.vue index be80f15..37c90a5 100644 --- a/src/layout/studyPage.vue +++ b/src/layout/studyPage.vue @@ -13,7 +13,11 @@ <div class="box" :style="{ - backgroundImage: isBox1Clicked ? `url(${btn1})` : `url(${btn2})`, + backgroundImage: isStudy + ? `url(${btn1})` + : isBox2Clicked + ? `url(${btn1})` + : `url(${btn2})`, }" @click="handleBoxClick(1)" > @@ -22,9 +26,7 @@ <div class="box" :style="{ - backgroundImage: complete - ? `url(${btn1})` - : `url(${btn2})`, + backgroundImage: complete ? `url(${btn1})` : `url(${btn2})`, }" @click="handleBoxClick(2)" > @@ -100,8 +102,9 @@ import { submitExperiment, getScore } from "@/api"; import { ElMessage, ElMessageBox } from "element-plus"; const isShowExperiment = Number(localStorage.getItem("activeStepIndex")) == 12 ? true : false; + const isStudy = Boolean(localStorage.getItem("isStudy")) || false; const router = useRouter(); -const complete = localStorage.getItem('complete') +const complete = localStorage.getItem("complete"); const user = userStore(); const loginFn = () => { // user.token ? router.push("/spacePage") : ""; diff --git a/src/utils/auth.ts b/src/utils/auth.ts index 90ca42c..fd8b2af 100644 --- a/src/utils/auth.ts +++ b/src/utils/auth.ts @@ -14,6 +14,9 @@ const clearLocalStorage = () => { localStorage.removeItem("product"); localStorage.removeItem("installationStep"); localStorage.removeItem("stepIds"); + // localStorage.removeItem("wenduCode"); + // localStorage.removeItem("shiduCode"); + localStorage.removeItem('isStudy') } export { diff --git a/src/views/largeDataScreen/home.vue b/src/views/largeDataScreen/home.vue index 984df2c..e553da9 100644 --- a/src/views/largeDataScreen/home.vue +++ b/src/views/largeDataScreen/home.vue @@ -749,6 +749,7 @@ </div> </template> </el-dialog> + <div class="setting"><el-button @click="router.back()">返回</el-button></div> </template> <script setup lang="ts"> @@ -1262,4 +1263,9 @@ const insatIdea = () => { :deep(.el-input__inner) { color: rgba(0, 0, 0, 0.6); } +.setting{ + position: absolute; + top: 20px; + right: 50px; +} </style>