| | |
| | | el |
| | | <template> |
| | | <div class="header"> |
| | | <img width="227px" height="74px" src="@/assets/home/logo.png" alt="" /> |
| | | <img width="427px" height="74px" src="@/assets/home/Header.png" alt="" /> |
| | | <div class="other"> |
| | | <div class="item"> |
| | | <img width="21px" height="21px" src="@/assets/home/share.png" alt="" /> |
| | | <span>分享网站</span> |
| | | </div> |
| | | <div class="item"> |
| | | <img |
| | | width="21px" |
| | | height="21px" |
| | | src="@/assets/home/BellFilled.png" |
| | | alt="" |
| | | /> |
| | | <span>我的消息</span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <my-header /> |
| | | <div class="banner"> |
| | | <!-- <img width="100%" height="306px" src="@/assets/home/banner.png" alt="" /> --> |
| | | </div> |
| | |
| | | v-else |
| | | :underline="false" |
| | | class="hover:cursor-pointer" |
| | | @click="toApply" |
| | | >申请</el-link |
| | | ><span class="m-2">|</span> |
| | | @click="toApply(item)" |
| | | ><span v-if="item.name !== '评审专家'">申请</span></el-link |
| | | ><span v-if="item.name !== '评审专家'" class="m-2">|</span> |
| | | <el-link |
| | | v-if="state.rolesCode.indexOf(item.code) !== -1" |
| | | :underline="false" |
| | |
| | | |
| | | <script lang="ts" setup> |
| | | import { onMounted, ref, computed, reactive } from "vue"; |
| | | import myFooter from "./component/myFooter.vue"; |
| | | import MyFooter from "./component/myFooter.vue"; |
| | | import MyHeader from "./component/myHeader.vue"; |
| | | import { useUserStoreHook } from "@/store/modules/user"; |
| | | import { exRole } from "@/api/register/index.ts"; |
| | | import { exRole } from "@/api/register/index"; |
| | | import { storageLocal, isString, isIncludeAllChildren } from "@pureadmin/utils"; |
| | | |
| | | import { getToken } from "@/utils/auth"; |
| | | import { useRoute, useRouter } from "vue-router"; |
| | | const router = useRouter(); |
| | | import { useUserStore } from "@/store/modules/user"; |
| | | |
| | | const userStore = useUserStore(); |
| | | |
| | | // 访问 state 属性 |
| | | // console.log(userStore.roles,'-'); // 直接获取值 |
| | | defineOptions({ |
| | | name: "Main" |
| | | name: "MainPage" |
| | | }); |
| | | let activeName = ref("first"); |
| | | /** 角色(如果昵称为空则显示用户名) */ |
| | |
| | | accessToken: "" |
| | | }); |
| | | onMounted(() => { |
| | | exRole().then(res => { |
| | | state.roleList = res.result; |
| | | }); |
| | | // exRole().then(res => { |
| | | // state.roleList = res.result; |
| | | // }); |
| | | state.roleList = useUserStoreHook().rolesList; |
| | | getUseRoles(); |
| | | state.accessToken = getToken()?.accessToken; |
| | | }); |
| | |
| | | useUserStoreHook().logOut(); |
| | | }; |
| | | // 申请 |
| | | const toApply = () => {}; |
| | | const toApply = item => { |
| | | router.push({ name: "RegisterNav", query: { code: item.code } }); |
| | | }; |
| | | // 去首页 |
| | | const toWelcome = item => { |
| | | let role = state.userInfo?.exRoles.find(ele => { |
| | | return item.code == ele.code; |
| | | }); |
| | | console.log(role); |
| | | if (role.hasFlsh) { |
| | | return router.push({ name: "Welcome" }); |
| | | const toWelcome = async item => { |
| | | if (useUserStoreHook().nowRole.code !== item.code) { |
| | | await useUserStoreHook().changeLogoInExRule({ |
| | | ruleCode: item.code |
| | | }); |
| | | } |
| | | router.push({ name: "RegisterNav" }); |
| | | router.push({ name: "Mine" }); |
| | | }; |
| | | // 去登录 |
| | | const toLogin = item => { |
| | |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .header { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: space-evenly; |
| | | height: 80px; |
| | | width: 100%; |
| | | .middle { |
| | | width: 50%; |
| | | display: flex; |
| | | justify-content: space-around; |
| | | color: rgb(51, 51, 51); |
| | | font-family: 思源黑体; |
| | | } |
| | | .other { |
| | | display: flex; |
| | | .item { |
| | | display: flex; |
| | | justify-content: center; |
| | | width: 63px; |
| | | height: 48px; |
| | | color: rgb(51, 51, 51); |
| | | font-family: 思源黑体; |
| | | font-size: 12px; |
| | | font-weight: 400; |
| | | line-height: 20px; |
| | | letter-spacing: 0%; |
| | | text-align: left; |
| | | text-transform: capitalize; |
| | | flex-wrap: wrap; |
| | | margin-right: 10px; |
| | | } |
| | | } |
| | | } |
| | | .banner { |
| | | // left: -3.76px; |
| | | // top: 80px; |
| | |
| | | a:active { |
| | | color: #fff; |
| | | } |
| | | .el-link.is-disabled { |
| | | color: #a8abb2; |
| | | cursor: not-allowed; |
| | | } |
| | | </style> |