You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

247 lines
5.1 KiB

<template>
<view class="mine-container" :style="{height: `${windowHeight}px`}">
<view class="header-section">
<view class="header-people">
<view class="left">
<image class="img" mode="aspectFit" :src="userInfo.avatar"></image>
<view class="people-info">
<view class="name">{{userInfo.nickname || '默认name'}}</view>
<view class="iphone">{{userInfo.mobile || '默认122'}}</view>
</view>
</view>
<view class="right">
</view>
</view>
<view class="future">
<image class="img" mode="aspectFit" src="http://118.195.155.9:8112/hl/mine-future.png"></image>
</view>
<view class="logout">
<view class="title" v-if="!isLogin" @click="handleLogin">登录</view>
<view class="title" v-else @click="handleLogout">退</view>
</view>
</view>
</view>
</template>
<script>
import { getToken } from '@/utils/auth'
import storage from "@/utils/storage";
export default {
components: {
},
data() {
return {
current: 1,
// name: this.$store.state.user.userInfo.name || 'name',
// mobile: this.$store.state.user.userInfo.mobile || '111',
version: getApp().globalData.config.appInfo.version
};
},
computed: {
userInfo() {
return this.$store.state.user.userInfo || {};
},
avatar() {
return this.$store.state.user.avatar;
},
windowHeight() {
return uni.getSystemInfoSync().windowHeight - 50;
},
isLogin() {
return !!getToken()
}
},
methods: {
handleToInfo() {
this.$modal.showToast("模块建设中~");
// this.$tab.navigateTo("/pages/mine/info/index");
},
handleToEditInfo() {
this.$modal.showToast("模块建设中~");
// this.$tab.navigateTo("/pages/mine/info/edit");
},
handleToSetting() {
this.$tab.navigateTo("/pages/mine/setting/index");
},
handleToLogin() {
this.$tab.reLaunch("/pages/login");
},
handleToAvatar() {
this.$tab.navigateTo("/pages/mine/avatar/index");
},
handleLogin() {
this.$tab.reLaunch("/pages/login");
},
handleLogout() {
this.$modal.confirm("确定注销并退出系统吗?").then(() => {
this.$store.dispatch("LogOut").then(() => {
this.$tab.reLaunch("/pages/index");
});
});
},
handleHelp() {
// this.$modal.showToast("模块建设中~");
this.$tab.navigateTo("/pages/login");
},
handleAbout() {
this.$modal.showToast("模块建设中~");
// this.$tab.navigateTo("/pages/mine/about/index");
},
handleBuilding() {
this.$modal.showToast("模块建设中~");
}
}
};
</script>
<style lang="scss" scoped>
.mine-container {
width: 100%;
height: 100%;
position: relative;
.header-section {
padding: 16px 16px 0;
.header-people {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 50px;
.left {
display: flex;
flex: 1;
justify-content: flex-start;
align-items: center;
.img {
width: 80rpx;
height: 80rpx;
background-color: #fff;
border-radius: 50%;
margin-right: 10px;
}
.people-info {
.name {
color: #0D0D26;
font-weight: 500;
font-size: 32rpx;
}
.iphone {
margin-top: 6px;
font-size: 14px;
color: #95969D;
}
}
}
.right {
padding: 4px 10px;
border-radius: 10px;
text-align: center;
display: flex;
align-items: center;
.img {
width: 20px;
height: 20px;
border-radius: 50%;
background-color: red;
margin-right: 10px;
}
.vip {
color: #0D0D26;
}
}
}
.header-info {
background-color: #fff;
padding: 16px 10px;
border-top-left-radius: 10px;
border-top-right-radius: 10px;
display: flex;
justify-content: space-between;
align-items: center;
.item {
text-align: center;
.num {
margin-bottom: 4px;
color: #0D0D26;
font-size: 18px;
font-weight: 500;
font-family: Source Han Sans;
}
.txt {
color: #95969D;
font-size: 12px;
font-family: Source Han Sans;
}
&.warn {
.num {
margin-bottom: 4px;
color: #E30000;
font-size: 18px;
}
.txt {
color: #E30000;
font-size: 12px;
}
}
}
}
}
.future {
min-height: 400rpx;
.img {
width: 100vw;
height: 538rpx;
}
}
.logout {
width: 412rpx;
margin: 60rpx auto;
background: #356899;
padding: 10px 20rpx;
border-radius: 10rpx;
text-align: center;
.title {
color: #fff;
font-size: 28rpx;
font-weight: 500;
}
}
.content-section {
position: relative;
top: -50px;
.mine-actions {
margin: 15px 15px;
padding: 20px 0px;
border-radius: 8px;
background-color: white;
.action-item {
.icon {
font-size: 28px;
}
.text {
display: block;
font-size: 13px;
margin: 8px 0px;
}
}
}
}
}
</style>