|
@@ -1,62 +1,80 @@
|
|
<template>
|
|
<template>
|
|
- <div class="pt-70 px-20 pb-30 flex flex-col h-screen relative">
|
|
|
|
|
|
+ <div class="pt-70 pb-30 flex flex-col h-screen relative">
|
|
<div @click="visible = false" class="absolute right-20 top-50">
|
|
<div @click="visible = false" class="absolute right-20 top-50">
|
|
<span class="iconfont icon-close"></span>
|
|
<span class="iconfont icon-close"></span>
|
|
</div>
|
|
</div>
|
|
- <NuxtLink v-if="!token" to="/login" class="flex items-center space-x-15">
|
|
|
|
|
|
+ <div class="px-20">
|
|
|
|
+ <NuxtLink v-if="!token" to="/login" class="flex items-center space-x-15">
|
|
|
|
+ <div
|
|
|
|
+ class="flex items-center justify-center bg-[#d9d9d9] rounded-full h-60 w-60"
|
|
|
|
+ >
|
|
|
|
+ <span
|
|
|
|
+ class="iconfont icon-profile text-black-6"
|
|
|
|
+ style="font-size: 30px"
|
|
|
|
+ ></span>
|
|
|
|
+ </div>
|
|
|
|
+ <span class="text-black-6 text-base">登录</span>
|
|
|
|
+ </NuxtLink>
|
|
|
|
+
|
|
<div
|
|
<div
|
|
- class="flex items-center justify-center bg-[#d9d9d9] rounded-full h-60 w-60"
|
|
|
|
|
|
+ @click="handleToProfile"
|
|
|
|
+ v-else-if="token"
|
|
|
|
+ class="flex items-center space-x-15"
|
|
>
|
|
>
|
|
- <span
|
|
|
|
- class="iconfont icon-profile text-black-6"
|
|
|
|
- style="font-size: 30px"
|
|
|
|
- ></span>
|
|
|
|
- </div>
|
|
|
|
- <span class="text-black-6 text-base">登录</span>
|
|
|
|
- </NuxtLink>
|
|
|
|
-
|
|
|
|
- <div
|
|
|
|
- @click="handleToProfile"
|
|
|
|
- v-else-if="token"
|
|
|
|
- class="flex items-center space-x-15"
|
|
|
|
- >
|
|
|
|
- <van-image
|
|
|
|
- :src="userInfo.headImageUrl || defaultAvatar"
|
|
|
|
- height="60"
|
|
|
|
- width="60"
|
|
|
|
- radius="30px"
|
|
|
|
- class="shrink-0"
|
|
|
|
- ></van-image>
|
|
|
|
- <div class="flex-1 flex flex-col">
|
|
|
|
- <div class="text-black-3 text-base break-all">
|
|
|
|
- {{ userInfo.showName }}
|
|
|
|
- </div>
|
|
|
|
- <div v-if="userInfo.personalSign" class="text-black-6 text-sm">
|
|
|
|
- <span class="text-black-6">个性签名:</span>
|
|
|
|
- <span class="text-black-3 break-all">{{
|
|
|
|
- userInfo.personalSign
|
|
|
|
- }}</span>
|
|
|
|
|
|
+ <van-image
|
|
|
|
+ :src="userInfo.headImageUrl || defaultAvatar"
|
|
|
|
+ height="60"
|
|
|
|
+ width="60"
|
|
|
|
+ radius="30px"
|
|
|
|
+ class="shrink-0"
|
|
|
|
+ ></van-image>
|
|
|
|
+ <div class="flex-1 flex flex-col">
|
|
|
|
+ <div class="text-black-3 text-base break-all">
|
|
|
|
+ {{ userInfo.showName }}
|
|
|
|
+ </div>
|
|
|
|
+ <div v-if="userInfo.personalSign" class="text-black-6 text-sm">
|
|
|
|
+ <span class="text-black-6">个性签名:</span>
|
|
|
|
+ <span class="text-black-3 break-all">{{
|
|
|
|
+ userInfo.personalSign
|
|
|
|
+ }}</span>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
- <div class="flex flex-col mt-20 flex-1 overflow-scroll">
|
|
|
|
- <div
|
|
|
|
|
|
+ <div class="flex flex-col mt-20 px-20 flex-1 overflow-scroll">
|
|
|
|
+ <LeftMenuItem
|
|
v-for="item in menuData"
|
|
v-for="item in menuData"
|
|
- :key="item.title"
|
|
|
|
|
|
+ :title="item.title"
|
|
|
|
+ :icon="item.icon"
|
|
@click="handleClickMenu(item)"
|
|
@click="handleClickMenu(item)"
|
|
- class="flex items-center h-50 space-x-5 border-b hover:bg-[#fff8e7]"
|
|
|
|
- >
|
|
|
|
- <img :src="item.icon" class="w-23 h-23" alt="" srcset="" />
|
|
|
|
- <span class="text-base text-black">{{ item.title }}</span>
|
|
|
|
|
|
+ />
|
|
|
|
+ <div v-if="token">
|
|
|
|
+ <LeftMenuItem
|
|
|
|
+ title="我的"
|
|
|
|
+ :icon="menu_profile"
|
|
|
|
+ @click="isProfileMenuExpanded = !isProfileMenuExpanded"
|
|
|
|
+ >
|
|
|
|
+ <template #right>
|
|
|
|
+ <span class="iconfont icon-caret-down"></span>
|
|
|
|
+ </template>
|
|
|
|
+ </LeftMenuItem>
|
|
|
|
+ <div v-show="isProfileMenuExpanded">
|
|
|
|
+ <LeftMenuItem
|
|
|
|
+ v-for="item in profileMenu"
|
|
|
|
+ :title="item.title"
|
|
|
|
+ @click="handleClickMenu(item)"
|
|
|
|
+ />
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<van-button
|
|
<van-button
|
|
v-if="token"
|
|
v-if="token"
|
|
|
|
+ round=""
|
|
@click="handleLogout"
|
|
@click="handleLogout"
|
|
plain
|
|
plain
|
|
- style="width: 100%; margin-top: 20px"
|
|
|
|
|
|
+ style="margin: 20px 20px"
|
|
>退出登录</van-button
|
|
>退出登录</van-button
|
|
>
|
|
>
|
|
</div>
|
|
</div>
|
|
@@ -74,6 +92,7 @@ import menu_travel_project from "@/assets/img/navbar/menu_travel_project.png";
|
|
import menu_visa from "@/assets/img/navbar/menu_visa.png";
|
|
import menu_visa from "@/assets/img/navbar/menu_visa.png";
|
|
import menu_profile from "@/assets/img/navbar/menu_profile.png";
|
|
import menu_profile from "@/assets/img/navbar/menu_profile.png";
|
|
import defaultAvatar from "~/assets/img/default_avatar.png";
|
|
import defaultAvatar from "~/assets/img/default_avatar.png";
|
|
|
|
+import LeftMenuItem from "./LeftMenuItem.vue";
|
|
|
|
|
|
const visible = defineModel("visible");
|
|
const visible = defineModel("visible");
|
|
|
|
|
|
@@ -93,12 +112,6 @@ const writeNoteMenu = {
|
|
to: "/note-create",
|
|
to: "/note-create",
|
|
};
|
|
};
|
|
|
|
|
|
-const profileMenu = {
|
|
|
|
- title: "我的",
|
|
|
|
- icon: menu_profile,
|
|
|
|
- to: "/profile",
|
|
|
|
-};
|
|
|
|
-
|
|
|
|
const fixedMenuData = [
|
|
const fixedMenuData = [
|
|
{
|
|
{
|
|
title: "首页",
|
|
title: "首页",
|
|
@@ -115,33 +128,52 @@ const fixedMenuData = [
|
|
icon: menu_travel_project,
|
|
icon: menu_travel_project,
|
|
to: "/travel-projects",
|
|
to: "/travel-projects",
|
|
},
|
|
},
|
|
- // {
|
|
|
|
- // title: "签证居留",
|
|
|
|
- // icon: menu_visa,
|
|
|
|
- // to: "/visa",
|
|
|
|
- // },
|
|
|
|
- // {
|
|
|
|
- // title: "全球包车",
|
|
|
|
- // icon: menu_car,
|
|
|
|
- // to: "/car",
|
|
|
|
- // },
|
|
|
|
- // {
|
|
|
|
- // title: "买房卖房",
|
|
|
|
- // icon: menu_house,
|
|
|
|
- // to: "/house",
|
|
|
|
- // },
|
|
|
|
- // {
|
|
|
|
- // title: "出国劳务",
|
|
|
|
- // icon: menu_labour,
|
|
|
|
- // to: "/labour",
|
|
|
|
- // },
|
|
|
|
- // {
|
|
|
|
- // title: "门票代订",
|
|
|
|
- // icon: menu_tickets,
|
|
|
|
- // to: "/labour",
|
|
|
|
- // },
|
|
|
|
|
|
+ {
|
|
|
|
+ title: "签证居留",
|
|
|
|
+ icon: menu_visa,
|
|
|
|
+ to: "/visa",
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: "全球包车",
|
|
|
|
+ icon: menu_car,
|
|
|
|
+ to: "/car",
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: "买房卖房",
|
|
|
|
+ icon: menu_house,
|
|
|
|
+ to: "/house",
|
|
|
|
+ },
|
|
];
|
|
];
|
|
|
|
|
|
|
|
+const profileMenu = [
|
|
|
|
+ {
|
|
|
|
+ title: "旅游订单",
|
|
|
|
+ to: "/profile/travel-orders",
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: "包车订单",
|
|
|
|
+ to: "/profile/car-orders",
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: "签证订单",
|
|
|
|
+ to: "/profile/visa-orders",
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: "我的收藏",
|
|
|
|
+ to: "/profile/collection",
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: "我的游记",
|
|
|
|
+ to: "/profile/notes",
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: "我的评论",
|
|
|
|
+ to: "/",
|
|
|
|
+ },
|
|
|
|
+];
|
|
|
|
+
|
|
|
|
+const isProfileMenuExpanded = ref(false);
|
|
|
|
+
|
|
watch(
|
|
watch(
|
|
token,
|
|
token,
|
|
(val) => {
|
|
(val) => {
|
|
@@ -149,7 +181,7 @@ watch(
|
|
menuData.value = fixedMenuData;
|
|
menuData.value = fixedMenuData;
|
|
} else {
|
|
} else {
|
|
userInfoStore.getUserInfo();
|
|
userInfoStore.getUserInfo();
|
|
- menuData.value = [...fixedMenuData, writeNoteMenu, profileMenu];
|
|
|
|
|
|
+ menuData.value = [...fixedMenuData, writeNoteMenu];
|
|
}
|
|
}
|
|
},
|
|
},
|
|
{
|
|
{
|