<template>
|
<view class="login">
|
<view class="login_title">欢迎回来,{{userInfo.sysuser.username}}~</view>
|
<view class="login_info">{{getWeek()}}</view>
|
<view class="login_func" @click="jump">
|
<image src="/static/images/home_i1mg_zulingxuzhi@2x.png" mode="widthFix"></image>
|
</view>
|
<view class="login_btn" @click="logout">退出登录</view>
|
</view>
|
</template>
|
|
<script>
|
import { mapState } from 'vuex'
|
export default {
|
computed: {
|
...mapState(['userInfo'])
|
},
|
data() {
|
return {
|
|
};
|
},
|
methods: {
|
jump() {
|
uni.navigateTo({
|
url: '/pages/operationList/operationList'
|
})
|
},
|
getWeek() {
|
let today = new Date();
|
let dayOfWeek = today.getDay();
|
let weekdays = ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"];
|
let weekdayName = weekdays[dayOfWeek];
|
|
const date = new Date();
|
const month = date.getMonth() + 1;
|
const day = date.getDate();
|
|
return month + '月' + day + '日' + ',' + weekdayName;
|
},
|
logout() {
|
uni.showLoading({ title: '加载中' });
|
this.$u.api.logout()
|
.then(res => {
|
if (res.code === 200) {
|
uni.hideLoading();
|
this.$store.commit('setUserInfo', res.data)
|
uni.navigateBack({ delta: 1 });
|
}
|
})
|
}
|
}
|
}
|
</script>
|
|
<style lang="scss" scoped>
|
.login {
|
width: 100vw;
|
height: 100vh;
|
padding: 40rpx 30rpx;
|
box-sizing: border-box;
|
background: #ffffff;
|
.login_title {
|
font-weight: 600;
|
font-size: 40rpx;
|
color: #333333;
|
}
|
.login_info {
|
font-weight: 400;
|
font-size: 28rpx;
|
color: #999999;
|
margin-top: 16rpx;
|
}
|
.login_func {
|
width: 100%;
|
height: 182rpx;
|
margin-top: 40rpx;
|
image {
|
width: 100%;
|
height: 100%;
|
}
|
}
|
.login_btn {
|
width: 200rpx;
|
height: 72rpx;
|
line-height: 72rpx;
|
text-align: center;
|
border-radius: 36rpx;
|
border: 1rpx solid #01B6AD;
|
font-weight: 400;
|
font-size: 28rpx;
|
color: #01B6AD;
|
position: fixed;
|
bottom: calc(env(safe-area-inset-bottom) + 30rpx);
|
left: 50%;
|
transform: translate(-50%, 0);
|
}
|
}
|
</style>
|