|
|
@@ -0,0 +1,490 @@
|
|
|
+<template>
|
|
|
+ <div class="user-widget">
|
|
|
+ <el-dropdown class="nav-dropdown">
|
|
|
+ <el-button type="text" class="dashboard-title">
|
|
|
+ <i class="el-icon-tickets"></i>工作台
|
|
|
+ </el-button>
|
|
|
+ <el-dropdown-menu slot="dropdown">
|
|
|
+ <el-dropdown-item>
|
|
|
+ <a class="workstation" :href="baseUrl+'/wo/work_todo'">
|
|
|
+ <i class="el-icon-edit"></i>我的待办
|
|
|
+ </a>
|
|
|
+ </el-dropdown-item>
|
|
|
+ <el-dropdown-item>
|
|
|
+ <a class="workstation" :href="baseUrl+'/wo/work_platform'">
|
|
|
+ <i class="el-icon-date"></i>我的项目
|
|
|
+ </a>
|
|
|
+ </el-dropdown-item>
|
|
|
+ <el-dropdown-item>
|
|
|
+ <a class="workstation" :href="baseUrl+'/wo/work_hire'">
|
|
|
+ <i class="el-icon-news"></i>我的雇佣
|
|
|
+ </a>
|
|
|
+ </el-dropdown-item>
|
|
|
+ <el-dropdown-item>
|
|
|
+ <a class="workstation" :href="baseUrl+'/wo/work_cloud'">
|
|
|
+ <i class="el-icon-service"></i>我的云端
|
|
|
+ </a>
|
|
|
+ </el-dropdown-item>
|
|
|
+ </el-dropdown-menu>
|
|
|
+ </el-dropdown>
|
|
|
+ <el-dropdown class="nav-dropdown">
|
|
|
+ <el-button type="text" class="message-box-title">
|
|
|
+ <i class="el-icon-message"></i>消息
|
|
|
+ <span
|
|
|
+ v-if="messageCount.total > 0"
|
|
|
+ class="message-count message-total"
|
|
|
+ >{{messageCount.total}}</span>
|
|
|
+ </el-button>
|
|
|
+ <el-dropdown-menu slot="dropdown">
|
|
|
+ <el-dropdown-item class="message-box" @click.native="clickMessages('/message/system')">
|
|
|
+ <i class="circle blue"></i>系统消息
|
|
|
+ <span v-if="messageCount.system" class="message-count">{{messageCount.system}}</span>
|
|
|
+ </el-dropdown-item>
|
|
|
+ <el-dropdown-item class="message-box" @click.native="clickMessages('/message/project')">
|
|
|
+ <i class="circle orange"></i>工作通知
|
|
|
+ <span v-if="messageCount.work" class="message-count">{{messageCount.work}}</span>
|
|
|
+ </el-dropdown-item>
|
|
|
+ <el-dropdown-item class="message-box" @click.native="clickMessages('/message/comment')">
|
|
|
+ <i class="circle red"></i>评论回复
|
|
|
+ <span v-if="messageCount.reply" class="message-count">{{messageCount.reply}}</span>
|
|
|
+ </el-dropdown-item>
|
|
|
+ <el-dropdown-item class="message-box" @click.native="clickMessages('/message/at')">
|
|
|
+ <i class="circle green"></i>@我的
|
|
|
+ <span v-if="messageCount.at" class="message-count">{{messageCount.at}}</span>
|
|
|
+ </el-dropdown-item>
|
|
|
+ <el-dropdown-item class="message-box" @click.native="clickMessages('/message/plus')">
|
|
|
+ <i class="circle pink"></i>赞及其它
|
|
|
+ <span
|
|
|
+ v-if="messageCount.community_other"
|
|
|
+ class="message-count"
|
|
|
+ >{{messageCount.community_other}}</span>
|
|
|
+ </el-dropdown-item>
|
|
|
+ <el-dropdown-item class="message-box" @click.native="clickMessages('/message/coin')">
|
|
|
+ <i class="circle yellow"></i>收支信息
|
|
|
+ <span v-if="messageCount.balance" class="message-count">{{messageCount.balance}}</span>
|
|
|
+ </el-dropdown-item>
|
|
|
+ </el-dropdown-menu>
|
|
|
+ </el-dropdown>
|
|
|
+ <el-popover class="nav-popover" placement="bottom" width="226" trigger="hover">
|
|
|
+ <div class="ref" slot="reference">
|
|
|
+ <a class="nav-header" :href="baseUrl+'/wo/work_todo'">
|
|
|
+ <img class="header-user" :src="myInfo.icon_url" />
|
|
|
+ <img
|
|
|
+ v-if="myInfo.is_vip"
|
|
|
+ class="header-vip-icon"
|
|
|
+ :src="baseUrl+`/Public/image/h5/vip_icon${vipImage}.png`"
|
|
|
+ alt="vip-icon"
|
|
|
+ />
|
|
|
+ </a>
|
|
|
+ <span class="nickname">{{myInfo.nickname}}</span>
|
|
|
+ </div>
|
|
|
+ <div class="menu">
|
|
|
+ <div v-if="myInfo.is_vip" class="vip-info vip-info-com">
|
|
|
+ <div class="vip-info-top">
|
|
|
+ <img
|
|
|
+ class="vip-icon"
|
|
|
+ :src="baseUrl+`/Public/image/h5/vip_icon${vipImage}.png`"
|
|
|
+ alt="vip-icon"
|
|
|
+ />
|
|
|
+ <span class="vip-content">
|
|
|
+ <span class="vip-title" :class="vipTextClass">{{vipText}}</span>
|
|
|
+ <br />
|
|
|
+ <span class="vip-end-date">{{vipInfo.endDate}}到期</span>
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ <div class="vip-arcs">
|
|
|
+ <a class="vip-arc" :class="vipTextClass" :href="baseUrl+'/type/vip/'+vipType">查看权益</a>
|
|
|
+ <a
|
|
|
+ class="vip-arc"
|
|
|
+ :class="vipTextClass"
|
|
|
+ :href="baseUrl+'/vip/pay?number=3&product_id='+this.$store.state.userinfo.vip_type_id+'&next=/type/vip/'+vipType"
|
|
|
+ >立即续费</a>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="vip-items">
|
|
|
+ <a class="vip-item divider" :href="baseUrl+'/wo/work_platform'">
|
|
|
+ <i class="el-icon-date"></i>我的项目
|
|
|
+ </a>
|
|
|
+ <a class="vip-item" :href="baseUrl+'/wo/work_hire'">
|
|
|
+ <i class="el-icon-news"></i>我的雇佣
|
|
|
+ </a>
|
|
|
+ <a class="vip-item" :href="baseUrl+'/wo/work_cloud'">
|
|
|
+ <i class="el-icon-service"></i>我的云端
|
|
|
+ </a>
|
|
|
+ <a class="vip-item divider" :href="baseUrl+`/wo/manage_homepage/`">
|
|
|
+ <i class="el-icon-document"></i>我的主页
|
|
|
+ </a>
|
|
|
+ <a class="vip-item" :href="baseUrl+'/credit/pages'">
|
|
|
+ <i class="el-icon-credit"></i>技术信用
|
|
|
+ </a>
|
|
|
+ <a class="vip-item" :href="baseUrl+'/otherpage/user/collection'">
|
|
|
+ <i class="el-icon-collection"></i>收藏中心
|
|
|
+ </a>
|
|
|
+ <a class="vip-item divider" :href="baseUrl+'/index/app'">
|
|
|
+ <i class="el-icon-download-app"></i>APP下载
|
|
|
+ </a>
|
|
|
+ <a class="vip-item" @click="clickQuit">
|
|
|
+ <i class="el-icon-back" style="margin: 0 10px !important;"></i>退出
|
|
|
+ </a>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-popover>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script lang="ts">
|
|
|
+import Vue from 'vue'
|
|
|
+
|
|
|
+export default Vue.extend({
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ messageCount: {}
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ computed: {
|
|
|
+ baseUrl(): string {
|
|
|
+ return this.$store.state.domainConfig.siteUrl
|
|
|
+ },
|
|
|
+
|
|
|
+ myInfo(): any {
|
|
|
+ return this.$store.state.userinfo
|
|
|
+ },
|
|
|
+
|
|
|
+ vipInfo(): any {
|
|
|
+ let userinfo = this.$store.state.userinfo
|
|
|
+ return {
|
|
|
+ id: userinfo.vip_type_id,
|
|
|
+ endDate: userinfo.vip_end_date,
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ vipImage(): string {
|
|
|
+ switch (parseInt(this.$store.state.userinfo.vip_type_id)) {
|
|
|
+ case 1:
|
|
|
+ return '_com'
|
|
|
+ case 2:
|
|
|
+ return ''
|
|
|
+ case 3:
|
|
|
+ return '_premium'
|
|
|
+ default:
|
|
|
+ return ''
|
|
|
+ }
|
|
|
+ },
|
|
|
+ vipType(): string | undefined {
|
|
|
+ switch (parseInt(this.$store.state.userinfo.vip_type_id)) {
|
|
|
+ case 1:
|
|
|
+ case 3:
|
|
|
+ return 'enterprise'
|
|
|
+ case 2:
|
|
|
+ return 'developer'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ vipTextClass(): string {
|
|
|
+ switch (parseInt(this.$store.state.userinfo.vip_type_id)) {
|
|
|
+ case 1:
|
|
|
+ return 'is-newly'
|
|
|
+ case 2:
|
|
|
+ return 'is-dev'
|
|
|
+ case 3:
|
|
|
+ return 'is-premium'
|
|
|
+ default:
|
|
|
+ return ''
|
|
|
+ }
|
|
|
+ },
|
|
|
+ vipText(): string {
|
|
|
+ switch (parseInt(this.$store.state.userinfo.vip_type_id)) {
|
|
|
+ case 1:
|
|
|
+ return '初创版会员'
|
|
|
+ case 2:
|
|
|
+ return '开发者会员'
|
|
|
+ case 3:
|
|
|
+ return '企业版会员'
|
|
|
+ default:
|
|
|
+ return ''
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ methods: {
|
|
|
+ clickMessages(url) {
|
|
|
+ location.href = this.baseUrl + url
|
|
|
+ },
|
|
|
+
|
|
|
+ clickQuit() {
|
|
|
+ location.href = this.baseUrl + '/user/quit'
|
|
|
+ },
|
|
|
+
|
|
|
+ async getMessageCount() {
|
|
|
+ // @ts-ignore
|
|
|
+ let res = await this.$axios.$get(
|
|
|
+ '/api/message/getUnreadCount',
|
|
|
+ {},
|
|
|
+ { neverLogout: true }
|
|
|
+ )
|
|
|
+ if (res) {
|
|
|
+ this.messageCount = res.data
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ mounted() {
|
|
|
+ if (this.myInfo && this.myInfo.nickname) {
|
|
|
+ this.getMessageCount()
|
|
|
+ }
|
|
|
+ }
|
|
|
+})
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss">
|
|
|
+.kaifain-view .user-widget {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ padding-top: 1px;
|
|
|
+ font-size: 14px;
|
|
|
+ font-weight: 400;
|
|
|
+
|
|
|
+ .el-button {
|
|
|
+ font-size: inherit;
|
|
|
+ font-weight: 400;
|
|
|
+ color: #444;
|
|
|
+ }
|
|
|
+
|
|
|
+ .el-dropdown {
|
|
|
+ font-size: inherit;
|
|
|
+ }
|
|
|
+
|
|
|
+ > .nav-dropdown {
|
|
|
+ margin: 0 10px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .nav-dropdown {
|
|
|
+ > .el-button {
|
|
|
+ color: #fff;
|
|
|
+ transition: none;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .nav-popover {
|
|
|
+ font-size: inherit;
|
|
|
+ margin-left: 8px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .nav-item {
|
|
|
+ display: flex;
|
|
|
+ height: 83px;
|
|
|
+ align-items: center;
|
|
|
+ font-size: 15px;
|
|
|
+ color: #515151;
|
|
|
+ /* padding: 0 15px; */
|
|
|
+ box-sizing: border-box;
|
|
|
+ }
|
|
|
+ .nav-item:first-child {
|
|
|
+ padding: 0;
|
|
|
+ }
|
|
|
+ .nav-item:nth-child(n + 2):hover {
|
|
|
+ color: #1782d9;
|
|
|
+ border-top: 5px solid transparent;
|
|
|
+ border-bottom: 5px solid #1782d9;
|
|
|
+ }
|
|
|
+ .nav-dropdown,
|
|
|
+ .nav-popover {
|
|
|
+ --imgWidth: 28px;
|
|
|
+ height: 40px;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ }
|
|
|
+ .nav-popover > .ref {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ }
|
|
|
+ .nav-header {
|
|
|
+ position: relative;
|
|
|
+ width: var(--imgWidth);
|
|
|
+ height: var(--imgWidth);
|
|
|
+ margin-right: 5px;
|
|
|
+ }
|
|
|
+ .logo {
|
|
|
+ width: 140px;
|
|
|
+ height: auto;
|
|
|
+ }
|
|
|
+ .input {
|
|
|
+ width: 234px;
|
|
|
+ height: 40px;
|
|
|
+ border-radius: 20px;
|
|
|
+ background: #f6f6f6;
|
|
|
+ padding: 0 40px;
|
|
|
+ border: 1px solid #ebebeb;
|
|
|
+ font-size: 13px;
|
|
|
+ }
|
|
|
+ .message-count {
|
|
|
+ color: white;
|
|
|
+ margin-left: 4px;
|
|
|
+ display: block;
|
|
|
+ line-height: 18px;
|
|
|
+ padding: 0 8px;
|
|
|
+ border-radius: 9px;
|
|
|
+ background: grey;
|
|
|
+ }
|
|
|
+ .message-count.message-total {
|
|
|
+ position: absolute;
|
|
|
+ top: 0px;
|
|
|
+ right: -10px;
|
|
|
+ background: #d95c5c;
|
|
|
+ }
|
|
|
+ span.other-icon {
|
|
|
+ display: block;
|
|
|
+ margin-left: 30px;
|
|
|
+ }
|
|
|
+ .nickname {
|
|
|
+ font-size: 14px;
|
|
|
+ }
|
|
|
+ .header-user {
|
|
|
+ width: var(--imgWidth);
|
|
|
+ height: var(--imgWidth);
|
|
|
+ border-radius: 20px;
|
|
|
+ }
|
|
|
+ .header-vip-icon {
|
|
|
+ position: absolute;
|
|
|
+ top: 16px;
|
|
|
+ left: 18px;
|
|
|
+ width: 16px;
|
|
|
+ height: 16px;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+.el-icon-credit {
|
|
|
+ background: url("~@/assets/img/header/creditIconMine.png") no-repeat;
|
|
|
+ background-size: cover;
|
|
|
+ width: 16px;
|
|
|
+ height: 16px;
|
|
|
+ vertical-align: middle;
|
|
|
+ margin: 0 9px !important;
|
|
|
+}
|
|
|
+.el-icon-download-app {
|
|
|
+ background: url("~@/assets/img/header/download@2x.png") no-repeat;
|
|
|
+ background-size: cover;
|
|
|
+ width: 16px;
|
|
|
+ height: 16px;
|
|
|
+ vertical-align: middle;
|
|
|
+ margin: 0 9px !important;
|
|
|
+}
|
|
|
+i {
|
|
|
+ margin-right: 4px;
|
|
|
+}
|
|
|
+i.circle {
|
|
|
+ display: inline-block;
|
|
|
+ --width: 12px;
|
|
|
+ width: var(--width);
|
|
|
+ height: var(--width);
|
|
|
+ border-radius: calc(var(--width) / 2);
|
|
|
+}
|
|
|
+i.blue {
|
|
|
+ background: #3b83c0;
|
|
|
+}
|
|
|
+i.orange {
|
|
|
+ background: #e07b53;
|
|
|
+}
|
|
|
+i.red {
|
|
|
+ background: #d95c5c;
|
|
|
+}
|
|
|
+i.green {
|
|
|
+ background: #5bbd72;
|
|
|
+}
|
|
|
+i.pink {
|
|
|
+ background: #d9499a;
|
|
|
+}
|
|
|
+i.yellow {
|
|
|
+ background: #f2c61f;
|
|
|
+}
|
|
|
+.message-box {
|
|
|
+ position: relative;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+}
|
|
|
+.workstation {
|
|
|
+ color: #444;
|
|
|
+}
|
|
|
+.account-ctrl {
|
|
|
+ color: #444;
|
|
|
+ font-size: 15px;
|
|
|
+}
|
|
|
+
|
|
|
+.vip-info {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+ width: 206px;
|
|
|
+ height: 120px;
|
|
|
+}
|
|
|
+.vip-info-top {
|
|
|
+ display: flex;
|
|
|
+ width: 142px;
|
|
|
+}
|
|
|
+.vip-title {
|
|
|
+ color: #cb9d53;
|
|
|
+ font-size: 16px;
|
|
|
+ line-height: 36px;
|
|
|
+}
|
|
|
+.vip-icon {
|
|
|
+ width: 24px;
|
|
|
+ height: 24px;
|
|
|
+ margin: 10px 8px 0 0;
|
|
|
+}
|
|
|
+.vip-end-date {
|
|
|
+ font-size: 12px;
|
|
|
+ color: #999;
|
|
|
+}
|
|
|
+.vip-arcs {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ width: 142px;
|
|
|
+ margin-top: 11px;
|
|
|
+}
|
|
|
+.vip-arc {
|
|
|
+ flex: 1;
|
|
|
+ font-size: 13px;
|
|
|
+ color: #cb9d53;
|
|
|
+ text-align: center;
|
|
|
+}
|
|
|
+.vip-arc:first-child {
|
|
|
+ border-right: 1px solid rgba(245, 245, 245, 1);
|
|
|
+}
|
|
|
+.vip-info-com .vip-title {
|
|
|
+ color: rgb(113, 177, 253);
|
|
|
+}
|
|
|
+.vip-info-com .vip-arc {
|
|
|
+ color: rgb(113, 177, 253);
|
|
|
+}
|
|
|
+.vip-items {
|
|
|
+ font-size: 14px;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+}
|
|
|
+.vip-item {
|
|
|
+ line-height: 32px;
|
|
|
+ color: #606266;
|
|
|
+}
|
|
|
+.vip-item > i {
|
|
|
+ margin: 0 10px;
|
|
|
+}
|
|
|
+.divider {
|
|
|
+ border-top: 1px solid rgba(0, 0, 0, 0.05);
|
|
|
+ margin-top: 10px;
|
|
|
+ padding-top: 10px;
|
|
|
+ cursor: pointer;
|
|
|
+}
|
|
|
+.vip-info-com .is-dev {
|
|
|
+ color: #cb9d53;
|
|
|
+}
|
|
|
+.vip-info-com .is-newly {
|
|
|
+ color: #308eff;
|
|
|
+}
|
|
|
+
|
|
|
+.vip-info-com .is-premium {
|
|
|
+ color: #00c469;
|
|
|
+}
|
|
|
+</style>
|