Smart_Canteen_Handheld_Devi.../pages/enterAndExit/mine/index.vue

74 lines
1.8 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<page-meta :page-font-size="fontValue+'px'" :root-font-size="fontValue+'px'"></page-meta>
<view class="content">
<view style="width: 100%;height:30%;display: flex;flex-direction: column;justify-content: center;align-items: center;">
<image class="logo" src="@//static/images/ic_user_photo.png" mode="aspectFit"></image>
<text class="text_show">您好{{username}}</text>
</view>
<view style="height: 70%;width: 100%;padding: 20rpx;display: flex;justify-content: center;">
<u-button shape="circle" color="#FFB679"
style="height: 72rpx;font-weight: bold;font-size: 28rpx;position: fixed;bottom:10%;width: 90%;" @click="logOut">退出登录
</u-button>
</view>
</view>
</template>
<script>
import Cookies from 'js-cookie'
import UButton from '@/uni_modules/uview-ui/components/u-button/u-button.vue'
export default {
components: { UButton },
data() {
return {
fontValue: uni.getStorageSync('fontSize') || 8,
username: Cookies.get('username')
}
},
onLoad() {
},
onShow() {
},
methods: {
logOut(){
Cookies.remove('token')
Cookies.remove('username')
Cookies.remove('password')
uni.removeStorageSync('token')
uni.removeStorageSync('username')
uni.removeStorageSync('password')
uni.reLaunch({
url: '/pages/login'
})
}
}
}
</script>
<style lang="scss" scoped>
.content {
background: #f9fbff;
height: 95vh;
display: flex;
flex-wrap: wrap;
align-content: flex-start;
.logo {
height: 200rpx;
width: 200rpx;
margin-top: 200rpx;
margin-left: auto;
margin-right: auto;
margin-bottom: 50rpx;
}
.text_show{
font-family: PingFang SC-Medium;
font-weight: bold;
color: #453C37;
font-size: 24px;
}
}
</style>