2020-09-16 09:25:13 +08:00
|
|
|
|
<template>
|
2020-09-17 20:01:50 +08:00
|
|
|
|
<view class="page">
|
|
|
|
|
<view class="top">
|
|
|
|
|
<view class="header-photo">
|
2020-09-21 18:02:14 +08:00
|
|
|
|
{{userInfo.real_name.slice(0,1)}}
|
2020-09-17 20:01:50 +08:00
|
|
|
|
</view>
|
|
|
|
|
<view class="user-info">
|
2020-09-21 18:02:14 +08:00
|
|
|
|
<view class="info-left">
|
|
|
|
|
<view class="name">
|
|
|
|
|
姓名:{{userInfo.real_name}}
|
|
|
|
|
</view>
|
|
|
|
|
<view class="grade">
|
|
|
|
|
等级:<text class="l">天才</text><text class="r">{{Math.floor((userInfo.integral)/1000)+1}}</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="score">
|
|
|
|
|
积分:{{userInfo.integral}}
|
|
|
|
|
</view>
|
2020-09-17 20:01:50 +08:00
|
|
|
|
</view>
|
2020-09-21 18:02:14 +08:00
|
|
|
|
<view class="info-right">
|
|
|
|
|
<view class="score" @tap="goPage('followList')">
|
|
|
|
|
关注:{{userOtherInfo.followNumber}}
|
|
|
|
|
</view>
|
|
|
|
|
<view class="score" @tap="goPage('fansList')">
|
|
|
|
|
粉丝:{{userOtherInfo.fansNumber}}
|
|
|
|
|
</view>
|
2020-09-17 20:01:50 +08:00
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="bottom">
|
|
|
|
|
<view class="cu-list grid" :class="['col-' + gridCol,gridBorder?'':'no-border']">
|
|
|
|
|
<view class="cu-item"
|
|
|
|
|
v-for="(item,index) in cuIconList"
|
|
|
|
|
:key="index"
|
|
|
|
|
v-if="index<gridCol*2"
|
|
|
|
|
@tap="goToPage(item)">
|
|
|
|
|
<view :class="['cuIcon-' + item.cuIcon,'text-' + item.color]">
|
|
|
|
|
</view>
|
|
|
|
|
<text>{{item.name}}</text>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
2020-09-16 09:25:13 +08:00
|
|
|
|
</view>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
2020-09-21 18:02:14 +08:00
|
|
|
|
import request from '@/util/request.js';
|
2020-09-16 09:25:13 +08:00
|
|
|
|
export default {
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
2020-09-17 20:01:50 +08:00
|
|
|
|
gridCol: 3,
|
|
|
|
|
gridBorder: false,
|
|
|
|
|
cuIconList: [
|
|
|
|
|
{
|
|
|
|
|
cuIcon: 'favor',
|
|
|
|
|
color: 'orange',
|
|
|
|
|
name: '收藏',
|
|
|
|
|
code: 'collection'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
cuIcon: 'list',
|
|
|
|
|
color: 'yellow',
|
|
|
|
|
name: '我的文章',
|
|
|
|
|
code: 'myArticle'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
cuIcon: 'edit',
|
|
|
|
|
color: 'red',
|
|
|
|
|
name: '编辑信息',
|
|
|
|
|
code: 'personInfo'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
cuIcon: 'settings',
|
|
|
|
|
color: 'olive',
|
|
|
|
|
name: '设置',
|
|
|
|
|
code: 'settings'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
cuIcon: 'questionfill',
|
|
|
|
|
color: 'mauve',
|
|
|
|
|
badge: 0,
|
|
|
|
|
name: '帮助',
|
|
|
|
|
code: 'help'
|
|
|
|
|
},
|
2020-09-21 18:02:14 +08:00
|
|
|
|
],
|
|
|
|
|
userInfo: uni.getStorageSync("userInfo"),
|
|
|
|
|
userOtherInfo: {}
|
2020-09-16 09:25:13 +08:00
|
|
|
|
}
|
|
|
|
|
},
|
2020-09-21 18:06:14 +08:00
|
|
|
|
onShow() {
|
|
|
|
|
this.getUserInfo();
|
|
|
|
|
},
|
2020-09-16 09:25:13 +08:00
|
|
|
|
onLoad() {
|
2020-09-21 18:02:14 +08:00
|
|
|
|
},
|
|
|
|
|
onPullDownRefresh () {
|
|
|
|
|
this.getUserInfo();
|
|
|
|
|
},
|
|
|
|
|
mounted() {
|
2020-09-16 09:25:13 +08:00
|
|
|
|
},
|
|
|
|
|
methods: {
|
2020-09-21 18:02:14 +08:00
|
|
|
|
/**
|
|
|
|
|
* 跳转页面
|
|
|
|
|
* @param {Object} pageName 页面名称
|
|
|
|
|
*/
|
|
|
|
|
goPage(pageName) {
|
|
|
|
|
const FUNCTION_CODE = {
|
|
|
|
|
'followList': '/pages/tabbar/follow/follow-list',
|
|
|
|
|
'fansList': '/pages/tabbar/follow/fans-list',
|
|
|
|
|
}
|
|
|
|
|
uni.navigateTo({
|
|
|
|
|
url: `${FUNCTION_CODE[pageName]}`
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
/**
|
|
|
|
|
* 获取个人信息
|
|
|
|
|
*/
|
|
|
|
|
getUserInfo() {
|
|
|
|
|
request.post("/hs/getPersonalInfo",{
|
|
|
|
|
userId: uni.getStorageSync("userInfo").user_id,
|
|
|
|
|
releaseId: uni.getStorageSync("userInfo").user_id
|
|
|
|
|
}).then(res => {
|
|
|
|
|
uni.startPullDownRefresh();
|
|
|
|
|
console.log("个人信息",res);
|
|
|
|
|
this.userOtherInfo = res.data.personalInfo;
|
|
|
|
|
},err => {
|
|
|
|
|
console.log("err",err);
|
|
|
|
|
})
|
|
|
|
|
},
|
2020-09-17 20:01:50 +08:00
|
|
|
|
/**
|
|
|
|
|
* 跳转页面
|
|
|
|
|
* @param {Object} item
|
|
|
|
|
*/
|
|
|
|
|
goToPage(item) {
|
|
|
|
|
const FUNCTION_CODE = {
|
|
|
|
|
'collection': '',
|
|
|
|
|
'myArticle': '/pages/tabbar/my/my-article/my-article',
|
|
|
|
|
'personInfo': '',
|
|
|
|
|
'settings': '',
|
|
|
|
|
'help': ''
|
2020-09-21 18:02:14 +08:00
|
|
|
|
};
|
2020-09-17 20:01:50 +08:00
|
|
|
|
uni.navigateTo({
|
|
|
|
|
url: `${FUNCTION_CODE[item.code]}`
|
|
|
|
|
})
|
|
|
|
|
}
|
2020-09-16 09:25:13 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
2020-09-17 20:01:50 +08:00
|
|
|
|
<style scoped>
|
|
|
|
|
.bottom{
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-flow: column;
|
|
|
|
|
}
|
|
|
|
|
.grade .r, .grade .l{
|
|
|
|
|
font-size: 14rpx;
|
|
|
|
|
padding: 5rpx;
|
|
|
|
|
border-radius: 5rpx;
|
|
|
|
|
}
|
|
|
|
|
.grade .l{
|
|
|
|
|
background-color: #9DC75F;
|
|
|
|
|
}
|
|
|
|
|
.grade .r{
|
|
|
|
|
background-color: #2D5315;
|
|
|
|
|
}
|
|
|
|
|
.user-info view{
|
2020-09-21 18:02:14 +08:00
|
|
|
|
padding: 10rpx 10rpx;
|
2020-09-17 20:01:50 +08:00
|
|
|
|
}
|
|
|
|
|
.user-info{
|
|
|
|
|
color: #FFFFFF;
|
|
|
|
|
display: flex;
|
2020-09-21 18:02:14 +08:00
|
|
|
|
flex-flow: nowrap;
|
2020-09-17 20:01:50 +08:00
|
|
|
|
justify-content: center;
|
|
|
|
|
border: 1rpx solid #b0b0b0;
|
|
|
|
|
border-radius: 10rpx;
|
2020-09-21 18:02:14 +08:00
|
|
|
|
width: 70%;
|
|
|
|
|
font-size: 32rpx;
|
2020-09-17 20:01:50 +08:00
|
|
|
|
background-color: #ced8d8;
|
|
|
|
|
}
|
|
|
|
|
.header-photo{
|
|
|
|
|
font-size: 80rpx;
|
|
|
|
|
font-family: 'Courier New', Courier, monospace;
|
|
|
|
|
color: #1296DB;
|
|
|
|
|
border: 5rpx solid #1296DB;
|
|
|
|
|
border-radius: 50%;
|
|
|
|
|
width: 180rpx;
|
|
|
|
|
height: 180rpx;
|
2020-09-16 09:25:13 +08:00
|
|
|
|
text-align: center;
|
2020-09-17 20:01:50 +08:00
|
|
|
|
line-height: 180rpx;
|
|
|
|
|
margin: 20rpx;
|
|
|
|
|
}
|
|
|
|
|
.top{
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
padding-bottom: 40rpx;
|
|
|
|
|
border-bottom: 1rpx solid rgba(18,150,219,0.5);
|
|
|
|
|
}
|
|
|
|
|
.page{
|
|
|
|
|
padding: 20rpx;
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-flow: column;
|
|
|
|
|
background-color: #FFFFFF;
|
2020-09-16 09:25:13 +08:00
|
|
|
|
}
|
|
|
|
|
</style>
|