<template>
|
<view class="page_bg">
|
<uv-navbar title=" " :placeholder="true" leftIcon="" bgColor="rgba(0,0,0,0)" titleStyle="color:#fff"></uv-navbar>
|
|
<view class="my_info">
|
<image class="ph" :src="baseURL + user.avatar" mode="aspectFill"></image>
|
<view class="info">
|
<view class="name">
|
{{user.nickName}}
|
</view>
|
<view class="text">
|
微信号: {{user.wx||'-'}}
|
</view>
|
</view>
|
</view>
|
|
<view class="my_nav">
|
<navigator class="item" url="/pages/personal/personal" hover-class="none" :render-link="false">
|
<view class="name">
|
用户信息编辑
|
</view>
|
<uv-icon name="arrow-right" color="rgba(0, 0, 0, 0.40)" size="36rpx"></uv-icon>
|
</navigator>
|
<navigator class="item" url="/pages/invite/invite" hover-class="none" :render-link="false">
|
<view class="name">
|
邀请好友
|
</view>
|
<uv-icon name="arrow-right" color="rgba(0, 0, 0, 0.40)" size="36rpx"></uv-icon>
|
</navigator>
|
<navigator class="item" url="/pages/about/about" hover-class="none" :render-link="false">
|
<view class="name">
|
关于我们
|
</view>
|
<uv-icon name="arrow-right" color="rgba(0, 0, 0, 0.40)" size="36rpx"></uv-icon>
|
</navigator>
|
<navigator class="item" url="/pages/feedback/feedback" hover-class="none" :render-link="false">
|
<view class="name">
|
意见反馈
|
</view>
|
<uv-icon name="arrow-right" color="rgba(0, 0, 0, 0.40)" size="36rpx"></uv-icon>
|
</navigator>
|
<navigator class="item" url="/pages/set/set" hover-class="none" :render-link="false">
|
<view class="name">
|
设置
|
</view>
|
<uv-icon name="arrow-right" color="rgba(0, 0, 0, 0.40)" size="36rpx"></uv-icon>
|
</navigator>
|
</view>
|
|
<view class="logout">
|
<uv-button type="primary" :hairline="true" :plain="true" text="退出登录" shape="circle" color="#999" @click="postLogout"></uv-button>
|
</view>
|
|
</view>
|
</template>
|
|
<script>
|
import { userInfo,logout } from '@/api/api.js'
|
export default {
|
data() {
|
return {
|
baseURL: '',
|
user: {}
|
}
|
},
|
onLoad() {
|
|
},
|
onShow() {
|
this.baseURL = uni.$uv.http.config.baseURL
|
this.getUserInfo()
|
},
|
methods: {
|
postLogout(){
|
uni.showModal({
|
title: '提示',
|
content: '确定退出登录吗?',
|
success: function (res) {
|
if (res.confirm) {
|
console.log('用户点击确定');
|
logout().then(res=>{
|
console.log('退出----',res)
|
uni.showToast({
|
title: res.msg,
|
duration: 2000,
|
icon: 'none'
|
});
|
uni.removeStorageSync('token');
|
uni.removeStorageSync('userId');
|
uni.reLaunch({
|
url: '/pages/login/login'
|
});
|
})
|
} else if (res.cancel) {
|
console.log('用户点击取消');
|
}
|
}
|
});
|
|
},
|
getUserInfo(){
|
userInfo().then(res=>{
|
console.log('用户信息----',res)
|
this.user = res.user
|
uni.setStorageSync('userId', res.user.userId)
|
})
|
}
|
}
|
}
|
</script>
|
|
<style lang="scss" scoped>
|
.logout{
|
width: 380rpx;
|
margin: 60rpx auto 0;
|
}
|
.my_nav{
|
margin-top: 70rpx;
|
padding:0 30rpx;
|
.item{
|
width: 100%;
|
height: 120rpx;
|
display: flex;
|
align-items: center;
|
justify-content: space-between;
|
display: flex;
|
align-items: center;
|
justify-content: space-between;
|
box-sizing: border-box;
|
border-bottom: 1rpx solid #ddd;
|
box-sizing: border-box;
|
padding-right: 10rpx;
|
.name{
|
font-size: 30rpx;
|
color: rgba(0,0,0,0.9);
|
line-height: 46rpx;
|
}
|
}
|
}
|
.my_info{
|
display: flex;
|
align-items: center;
|
justify-content: space-between;
|
padding:20rpx 30rpx 0;
|
.info{
|
width: 100%;
|
.name{
|
font-weight: 500;
|
font-size: 35rpx;
|
color: rgba(0,0,0,0.9);
|
line-height: 48rpx;
|
}
|
.text{
|
font-weight: 400;
|
font-size: 27rpx;
|
color: rgba(0,0,0,0.7);
|
line-height: 46rpx;
|
margin-top: 10rpx;
|
}
|
}
|
.ph{
|
flex-shrink: 0;
|
width: 140rpx;
|
height: 140rpx;
|
border-radius: 50%;
|
border:4rpx solid #fff;
|
margin-right: 30rpx;
|
}
|
}
|
.page_bg{
|
width: 100%;
|
min-height: calc(100vh - var(--window-bottom));
|
background:url('/static/img/bg_2.jpg') no-repeat center top;
|
background-size: 100% auto;
|
}
|
</style>
|