|
@@ -1,48 +1,65 @@
|
|
|
-<template>
|
|
|
- <view>
|
|
|
- <view class="top pr">
|
|
|
- <image src="/static/images/my/my-bg2.png" mode="widthFix" style="width: 100%;"></image>
|
|
|
- <view class="userInfo" v-if="userInfo.name">
|
|
|
- <fs-cell justify="left" bgColor="transparent">
|
|
|
- <template #title>
|
|
|
- <fs-avatar border :src="userInfo.photo" size="120rpx" link="./userInfo" v-if="userInfo.photo"></fs-avatar>
|
|
|
- <fs-wx-avatar v-else></fs-wx-avatar>
|
|
|
- </template>
|
|
|
- <template #value>
|
|
|
- <view class="cell-right">
|
|
|
- <view class="title">{{userInfo.name || userInfo.nickName}}</view>
|
|
|
- <view class="sub">{{userInfo.phone}}</view>
|
|
|
- </view>
|
|
|
- </template>
|
|
|
- </fs-cell>
|
|
|
+<template>
|
|
|
+ <view>
|
|
|
+ <fs-avatar src="/static/images/my-bg.png" shape="square" width="100%" height="288rpx"></fs-avatar>
|
|
|
+ <view class="my-box">
|
|
|
+ <view class="layout-box radius-lg top-box">
|
|
|
+ <view class="user-info" v-if="userInfo.name">
|
|
|
+ <fs-avatar size="140rpx" border :src="userInfo.photo" v-if="userInfo.photo"></fs-avatar>
|
|
|
+ <fs-wx-avatar v-else></fs-wx-avatar>
|
|
|
+
|
|
|
+ <view class="top-box-content">
|
|
|
+ <text class="vm title" style="margin-right: 10rpx;">{{userInfo.name}}</text>
|
|
|
+ <fs-icon type="icon-sex-male" color="#2285FF" v-if="userInfo.sex === '1'"></fs-icon>
|
|
|
+ <fs-icon type="icon-sex-female" colorType="error" v-if="userInfo.sex === '2'"></fs-icon>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <fs-icon
|
|
|
+ class="top-box-edit"
|
|
|
+ type="icon-edit"
|
|
|
+ size="40rpx"
|
|
|
+ link="./userInfo">
|
|
|
+ </fs-icon>
|
|
|
+ </view>
|
|
|
+ <view v-else class="user-info">
|
|
|
+ <fs-avatar size="140rpx" link="../login/login4" border>去登录</fs-avatar>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <view :style="{'margin-top': userInfo.name ? '80rpx' : '20rpx'}">
|
|
|
+ <fs-divide-list :list="shortcutList">
|
|
|
+ <template #default="{item}">
|
|
|
+ <view class="top-box-hd">{{item.num || 0}}</view>
|
|
|
+ <view class="content">{{item.title}}</view>
|
|
|
+ </template>
|
|
|
+ </fs-divide-list>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
- <navigator url="../login/login" class="login" v-else>登录</navigator>
|
|
|
-
|
|
|
- <view class="top-menu">
|
|
|
- <fs-card>
|
|
|
- <fs-grid :columnNum="4">
|
|
|
- <fs-grid-item>
|
|
|
- <fs-icon type="icon-image" size="40rpx"></fs-icon>
|
|
|
- <view class="content">菜单1</view>
|
|
|
- </fs-grid-item>
|
|
|
- <fs-grid-item>
|
|
|
- <fs-icon type="icon-image" size="40rpx"></fs-icon>
|
|
|
- <view class="content">菜单2</view>
|
|
|
- </fs-grid-item>
|
|
|
- <fs-grid-item>
|
|
|
- <fs-icon type="icon-image" size="40rpx"></fs-icon>
|
|
|
- <view class="content">菜单3</view>
|
|
|
- </fs-grid-item>
|
|
|
- <fs-grid-item>
|
|
|
- <fs-icon type="icon-image" size="40rpx"></fs-icon>
|
|
|
- <view class="content">菜单4</view>
|
|
|
- </fs-grid-item>
|
|
|
- </fs-grid>
|
|
|
- </fs-card>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
-
|
|
|
- <fs-cell-group arrow border>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <fs-card gutter :titleStyle="{padding: '0'}">
|
|
|
+ <template #title>
|
|
|
+ <view class="title-hd" >常用工具</view>
|
|
|
+ </template>
|
|
|
+ <fs-grid :columnNum="4">
|
|
|
+ <fs-grid-item>
|
|
|
+ <fs-avatar src="/static/images/invoice.png" size="80rpx"></fs-avatar>
|
|
|
+ <view class="content">我的发票</view>
|
|
|
+ </fs-grid-item>
|
|
|
+ <fs-grid-item>
|
|
|
+ <fs-avatar src="/static/images/invoice.png" size="80rpx"></fs-avatar>
|
|
|
+ <view class="content">我的发票</view>
|
|
|
+ </fs-grid-item>
|
|
|
+ <fs-grid-item>
|
|
|
+ <fs-avatar src="/static/images/invoice.png" size="80rpx"></fs-avatar>
|
|
|
+ <view class="content">我的发票</view>
|
|
|
+ </fs-grid-item>
|
|
|
+ <fs-grid-item>
|
|
|
+ <fs-avatar src="/static/images/invoice.png" size="80rpx"></fs-avatar>
|
|
|
+ <view class="content">我的发票</view>
|
|
|
+ </fs-grid-item>
|
|
|
+ </fs-grid>
|
|
|
+ </fs-card>
|
|
|
+
|
|
|
+ <fs-cell-group arrow border gutter>
|
|
|
<fs-cell link="./licensePlate/list" value="车辆管理">
|
|
|
<template #title>
|
|
|
<fs-icon type="icon-car" colorType="primary"></fs-icon>
|
|
@@ -63,6 +80,9 @@
|
|
|
<fs-icon type="icon-tongxunlu" colorType="primary"></fs-icon>
|
|
|
</template>
|
|
|
</fs-cell>
|
|
|
+ </fs-cell-group>
|
|
|
+
|
|
|
+ <fs-cell-group arrow border>
|
|
|
<fs-cell link="./notice" value="我的消息">
|
|
|
<template #title>
|
|
|
<fs-icon type="icon-notice" colorType="primary"></fs-icon>
|
|
@@ -81,11 +101,11 @@
|
|
|
</fs-cell-group>
|
|
|
|
|
|
<fs-gutter height="120rpx"></fs-gutter>
|
|
|
- <fs-button type="primary" round block @click="handleLogout">退出登录</fs-button>
|
|
|
- <fs-gutter height="60rpx"></fs-gutter>
|
|
|
- </view>
|
|
|
-</template>
|
|
|
-
|
|
|
+ <fs-button round block @click="handleLogout">退出登录</fs-button>
|
|
|
+ <fs-gutter height="60rpx"></fs-gutter>
|
|
|
+ </view>
|
|
|
+</template>
|
|
|
+
|
|
|
<script setup>
|
|
|
import { computed, ref } from 'vue'
|
|
|
import { useStore } from 'vuex'
|
|
@@ -93,49 +113,55 @@ import { useStore } from 'vuex'
|
|
|
const store = useStore()
|
|
|
const userInfo = computed(() => store.state.userInfo)
|
|
|
|
|
|
+const shortcutList = ref([
|
|
|
+ {
|
|
|
+ title: '我的访客',
|
|
|
+ num: 10
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '我的访客',
|
|
|
+ num: 10
|
|
|
+ }
|
|
|
+])
|
|
|
+
|
|
|
const handleLogout = () => {
|
|
|
store.dispatch('logout').then(res => {
|
|
|
console.log('logout')
|
|
|
})
|
|
|
}
|
|
|
-</script>
|
|
|
-
|
|
|
-<style lang="scss" scoped>
|
|
|
-.top{
|
|
|
- .userInfo {
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+.my-box{
|
|
|
+ padding: var(--gutter);
|
|
|
+ margin-top: -200rpx;
|
|
|
+ z-index: 100;
|
|
|
+ position: relative;
|
|
|
+}
|
|
|
+.top-box{
|
|
|
+ position: relative;
|
|
|
+
|
|
|
+ &-edit{
|
|
|
position: absolute;
|
|
|
- left: 20rpx;
|
|
|
- top: 40rpx;
|
|
|
+ top: 64rpx;
|
|
|
+ right: 0rpx;
|
|
|
+ }
|
|
|
|
|
|
- .title,
|
|
|
- .sub {
|
|
|
- color: #fff;
|
|
|
- }
|
|
|
+ &-hd{
|
|
|
+ font-size: 23px;
|
|
|
+ font-weight: bold;
|
|
|
}
|
|
|
|
|
|
- &-menu{
|
|
|
- margin-top: -70rpx;
|
|
|
- margin-bottom: 40rpx;
|
|
|
- position: relative;
|
|
|
- z-index: 100;
|
|
|
+ &-content{
|
|
|
+ padding: 10rpx 0;
|
|
|
}
|
|
|
-}
|
|
|
-
|
|
|
-.login {
|
|
|
- position: absolute;
|
|
|
- left: 50%;
|
|
|
- top: 50%;
|
|
|
- transform: translate(-50%, 50%);
|
|
|
- margin-top: -50px;
|
|
|
- color: #fff;
|
|
|
- border: 1px solid #fff;
|
|
|
- height: 40px;
|
|
|
- line-height: 40px;
|
|
|
- width: 100px;
|
|
|
- border-radius: 20px;
|
|
|
- text-align: center;
|
|
|
}
|
|
|
-.logout{
|
|
|
- margin: 0 var(--gutter);
|
|
|
-}
|
|
|
+.user-info{
|
|
|
+ position: absolute;
|
|
|
+ z-index: 10;
|
|
|
+ left: 50%;
|
|
|
+ top: -70rpx;
|
|
|
+ transform: translateX(-50%);
|
|
|
+ text-align: center;
|
|
|
+}
|
|
|
</style>
|