|
|
@@ -1,38 +1,49 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
- <div class="head">
|
|
|
- <div class="bg"></div>
|
|
|
- </div>
|
|
|
<div class="user">
|
|
|
<img
|
|
|
class="avatar"
|
|
|
:src="(userInfo || {}).avatar || 'https://jxjmrh.oss-cn-hangzhou.aliyuncs.com/image/avatar.jpg'"
|
|
|
/>
|
|
|
- <div class="name" v-if="userInfo && userInfo.id">{{ userInfo.nickname }}</div>
|
|
|
- <router-link tag="div" to="/login" class="btn-login" v-else>登录</router-link>
|
|
|
+ <div class="info" v-if="userInfo && userInfo.id">
|
|
|
+ <div class="name">{{ userInfo.nickname }}</div>
|
|
|
+ <div class="desc" v-if="userInfo.orgName">
|
|
|
+ {{ userInfo.orgName }}
|
|
|
+ </div>
|
|
|
+ <div class="desc" v-else @click="$router.push({ name: 'profile' })">
|
|
|
+ 企业信息未补全
|
|
|
+ <img class="edit" src="../../assets/my_icon_edit_profile.png" />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="info" v-else @click="$router.push({ name: 'login' })">
|
|
|
+ <div class="name">暂未登录</div>
|
|
|
+ <div class="desc">
|
|
|
+ 立即登录获取精彩服务
|
|
|
+ <img class="into" src="../../assets/icon_into.png" />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="notification" @click="$router.push({ name: 'conversations' })">
|
|
|
+ <img src="../../assets/home_notification.png" />
|
|
|
+ <div class="badge" v-if="showBadge"></div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
<div class="menus">
|
|
|
- <router-link class="item" to="/collections">
|
|
|
+ <div class="item" @click="to('/collections')">
|
|
|
<img src="../../assets/my_menu_icon_1.png" class="icon" />
|
|
|
<div class="text">我的收藏</div>
|
|
|
<img src="../../assets/icon_into.png" class="into" />
|
|
|
- </router-link>
|
|
|
- <router-link to="/myInteract" class="item">
|
|
|
+ </div>
|
|
|
+ <div class="item" @click="to('/myInteract')">
|
|
|
<img src="../../assets/my_menu_icon_2.png" class="icon" />
|
|
|
<div class="text">我的互动</div>
|
|
|
<img src="../../assets/icon_into.png" class="into" />
|
|
|
- </router-link>
|
|
|
- <router-link to="/profile" class="item">
|
|
|
+ </div>
|
|
|
+ <div class="item" @click="to('/about')">
|
|
|
<img src="../../assets/my_menu_icon_3.png" class="icon" />
|
|
|
- <div class="text">资料编辑</div>
|
|
|
- <img src="../../assets/icon_into.png" class="into" />
|
|
|
- </router-link>
|
|
|
- <div class="item">
|
|
|
- <img src="../../assets/my_menu_icon_4.png" class="icon" />
|
|
|
<div class="text">关于我们</div>
|
|
|
<img src="../../assets/icon_into.png" class="into" />
|
|
|
</div>
|
|
|
- <div class="item">
|
|
|
+ <div class="item" @click="to('/settings')">
|
|
|
<img src="../../assets/my_menu_icon_5.png" class="icon" />
|
|
|
<div class="text">系统设置</div>
|
|
|
<img src="../../assets/icon_into.png" class="into" />
|
|
|
@@ -44,69 +55,109 @@
|
|
|
import { mapState } from 'vuex';
|
|
|
export default {
|
|
|
data() {
|
|
|
- return {};
|
|
|
+ return {
|
|
|
+ showBadge: false
|
|
|
+ };
|
|
|
},
|
|
|
computed: {
|
|
|
...mapState(['userInfo'])
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.$http.get('/message/unreadNum').then(res => {
|
|
|
+ if (res > 0) {
|
|
|
+ this.showBadge = true;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ to(to, login = true) {
|
|
|
+ if (login) {
|
|
|
+ if (this.checkLogin()) {
|
|
|
+ this.$router.push(to);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.$router.push(to);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
};
|
|
|
</script>
|
|
|
<style lang="less" scoped>
|
|
|
-.head {
|
|
|
- height: 103px;
|
|
|
- box-sizing: content-box;
|
|
|
- padding-top: var(--safe-top);
|
|
|
- position: relative;
|
|
|
- .bg {
|
|
|
- position: absolute;
|
|
|
- bottom: 0;
|
|
|
- left: -1000px;
|
|
|
- right: -1000px;
|
|
|
- margin: auto;
|
|
|
- background: @prim;
|
|
|
- width: 1200px;
|
|
|
- height: 1200px;
|
|
|
- border-radius: 50%;
|
|
|
- }
|
|
|
-}
|
|
|
.user {
|
|
|
- .flex-col();
|
|
|
+ .flex();
|
|
|
+ height: 240px;
|
|
|
+ background: @prim;
|
|
|
align-items: center;
|
|
|
- margin-top: -45px;
|
|
|
- z-index: 1;
|
|
|
position: relative;
|
|
|
.avatar {
|
|
|
width: 90px;
|
|
|
height: 90px;
|
|
|
+ min-width: 90px;
|
|
|
+ margin-left: 34px;
|
|
|
object-fit: cover;
|
|
|
border-radius: 50%;
|
|
|
- border: 6px solid #ffffff;
|
|
|
background: white;
|
|
|
}
|
|
|
- .name {
|
|
|
- font-size: 22px;
|
|
|
- font-weight: bold;
|
|
|
- color: black;
|
|
|
- margin-top: 1px;
|
|
|
+ .info {
|
|
|
+ margin: 0 16px;
|
|
|
+ .flex-col();
|
|
|
+ flex-grow: 1;
|
|
|
+ .name {
|
|
|
+ color: white;
|
|
|
+ font-size: 22px;
|
|
|
+ font-weight: bold;
|
|
|
+ line-height: 30px;
|
|
|
+ .ellipsisLn(1);
|
|
|
+ }
|
|
|
+ .desc {
|
|
|
+ .flex();
|
|
|
+ color: rgba(255, 255, 255, 0.7);
|
|
|
+ font-size: 13px;
|
|
|
+ line-height: 24px;
|
|
|
+ position: relative;
|
|
|
+ .into {
|
|
|
+ width: 24px;
|
|
|
+ min-width: 24px;
|
|
|
+ height: 24px;
|
|
|
+ }
|
|
|
+ .edit {
|
|
|
+ width: 32px;
|
|
|
+ min-width: 32px;
|
|
|
+ height: 32px;
|
|
|
+ position: absolute;
|
|
|
+ right: 0;
|
|
|
+ top: 0;
|
|
|
+ bottom: 0;
|
|
|
+ margin: auto;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
- .btn-login {
|
|
|
- .flex();
|
|
|
- color: white;
|
|
|
- font-size: 13px;
|
|
|
- padding: 0 12px;
|
|
|
- height: 30px;
|
|
|
- background: @prim;
|
|
|
- border-radius: 4px;
|
|
|
- margin-top: 10px;
|
|
|
- &:active {
|
|
|
- background: shade(@prim, 10%);
|
|
|
+ .notification {
|
|
|
+ position: absolute;
|
|
|
+ top: 56px;
|
|
|
+ right: 16px;
|
|
|
+ img {
|
|
|
+ width: 32px;
|
|
|
+ height: 32px;
|
|
|
+ }
|
|
|
+ .badge {
|
|
|
+ position: absolute;
|
|
|
+ top: 3px;
|
|
|
+ right: 3px;
|
|
|
+ background: #ff5b5b;
|
|
|
+ width: 8px;
|
|
|
+ height: 8px;
|
|
|
+ border-radius: 50%;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
.menus {
|
|
|
- margin-top: 30px;
|
|
|
+ margin-top: -20px;
|
|
|
.flex-col();
|
|
|
position: relative;
|
|
|
+ border-radius: 22px 22px 0 0;
|
|
|
+ background: white;
|
|
|
+ padding-top: 16px;
|
|
|
.item {
|
|
|
position: relative;
|
|
|
.flex();
|