110 lines
2.7 KiB
Vue
110 lines
2.7 KiB
Vue
<template>
|
|
<view class="page supervisor-profile-page">
|
|
<view class="page-head">
|
|
<view>
|
|
<text class="page-title">我的主管工作台</text>
|
|
<text class="page-subtitle">账号与主管身份</text>
|
|
</view>
|
|
</view>
|
|
|
|
<view class="panel account-card">
|
|
<text class="panel-title">当前账号</text>
|
|
<text class="account-phone">{{ displayPhone || '未登录' }}</text>
|
|
<text class="muted account-note">主管端团队数据仅对当前项目范围可见。</text>
|
|
</view>
|
|
|
|
<view class="panel identity-card">
|
|
<text class="panel-title">主管身份</text>
|
|
<view class="identity-row">
|
|
<text class="identity-label">角色</text>
|
|
<text class="identity-value">项目主管</text>
|
|
</view>
|
|
<view class="identity-row">
|
|
<text class="identity-label">可操作范围</text>
|
|
<text class="identity-value">团队画像、复盘、专项派发</text>
|
|
</view>
|
|
</view>
|
|
|
|
<button class="secondary-button logout-button" @click="logout">退出登录</button>
|
|
<SupervisorTabBar active="profile" />
|
|
</view>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import { computed, ref } from 'vue';
|
|
import { onShow } from '@dcloudio/uni-app';
|
|
import SupervisorTabBar from '@/components/SupervisorTabBar.vue';
|
|
import { clearAuth, getAuth, isLoggedIn, maskPhone, rememberLoginRedirect } from '@/services/auth';
|
|
import { resetPageScroll } from '@/services/navigation';
|
|
|
|
const phone = ref('');
|
|
const displayPhone = computed(() => maskPhone(phone.value));
|
|
|
|
const refreshAuth = () => {
|
|
phone.value = getAuth().phone;
|
|
};
|
|
|
|
const logout = () => {
|
|
clearAuth();
|
|
rememberLoginRedirect('/pages/supervisor/profile/index');
|
|
uni.redirectTo({ url: '/pages/auth/login/index' });
|
|
};
|
|
|
|
onShow(() => {
|
|
resetPageScroll();
|
|
if (!isLoggedIn()) {
|
|
rememberLoginRedirect('/pages/supervisor/profile/index');
|
|
uni.redirectTo({ url: '/pages/auth/login/index' });
|
|
return;
|
|
}
|
|
refreshAuth();
|
|
});
|
|
</script>
|
|
|
|
<style scoped>
|
|
.supervisor-profile-page {
|
|
background: linear-gradient(180deg, var(--employee-bg-soft) 0%, var(--employee-bg) 100%);
|
|
}
|
|
|
|
.account-card,
|
|
.identity-card {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 8px;
|
|
}
|
|
|
|
.account-phone {
|
|
color: var(--employee-primary);
|
|
font-size: 24px;
|
|
font-weight: 900;
|
|
}
|
|
|
|
.account-note {
|
|
font-size: 13px;
|
|
line-height: 1.5;
|
|
}
|
|
|
|
.identity-row {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
gap: 12px;
|
|
padding-top: 10px;
|
|
border-top: 1px solid var(--employee-line);
|
|
}
|
|
|
|
.identity-label {
|
|
color: var(--employee-muted);
|
|
}
|
|
|
|
.identity-value {
|
|
color: var(--employee-text);
|
|
font-weight: 700;
|
|
text-align: right;
|
|
}
|
|
|
|
.logout-button {
|
|
width: 100%;
|
|
margin-top: 16px;
|
|
}
|
|
</style>
|