mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-mobile.git
synced 2025-12-11 20:06:48 +08:00
个人主页
This commit is contained in:
@@ -50,11 +50,11 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="hear-info">
|
<view class="hear-info">
|
||||||
<view class="info-name">
|
<view class="info-name index-one-line-ellipsis">
|
||||||
{{userInfoObj.name}} <text>现代优秀独立女性</text>
|
{{userInfoObj.name}} <text>{{ userData.sign }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="information">
|
<view class="information">
|
||||||
<text class="grade">LV.6</text>
|
<text class="grade">{{ statData.level }}</text>
|
||||||
<view class="Progress">
|
<view class="Progress">
|
||||||
<text>200/300</text>
|
<text>200/300</text>
|
||||||
<u-line-progress :showText="false" :percentage="50" activeColor="#007DFF" height="4"></u-line-progress>
|
<u-line-progress :showText="false" :percentage="50" activeColor="#007DFF" height="4"></u-line-progress>
|
||||||
@@ -73,18 +73,18 @@
|
|||||||
</view>
|
</view>
|
||||||
<text class="asset-border"></text>
|
<text class="asset-border"></text>
|
||||||
<view>
|
<view>
|
||||||
<text>5643.5<i style="color: #999999;font-size: 24upx;font-style:normal;padding-left:5upx">h</i></text>
|
<text>{{ statData.totalStudyHour }}<i style="color: #999999;font-size: 24upx;font-style:normal;padding-left:5upx">h</i></text>
|
||||||
学习时长
|
学习时长
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
<text class="asset-border"></text>
|
<text class="asset-border"></text>
|
||||||
<view>
|
<view>
|
||||||
<text>113</text>
|
<text>{{ concernme }}</text>
|
||||||
关注我的
|
关注我的
|
||||||
</view>
|
</view>
|
||||||
<text class="asset-border"></text>
|
<text class="asset-border"></text>
|
||||||
<view>
|
<view>
|
||||||
<text>412</text>
|
<text>{{ myconcern }}</text>
|
||||||
我的关注
|
我的关注
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -302,8 +302,10 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { mapGetters } from 'vuex'
|
import { mapGetters } from 'vuex'
|
||||||
import userApi from "@/api/system/user";
|
import apiUser from "@/api/system/user";
|
||||||
import {userAvatarText} from '@/utils/tools.js';
|
import {userAvatarText} from '@/utils/tools.js';
|
||||||
|
import apiStart from '@/api/phase2/stat.js';
|
||||||
|
import apiFollow from "@/api/phase2/userfollow.js";
|
||||||
export default {
|
export default {
|
||||||
computed: {
|
computed: {
|
||||||
...mapGetters(['userInfo']),
|
...mapGetters(['userInfo']),
|
||||||
@@ -313,6 +315,8 @@
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
concernme:'',
|
||||||
|
myconcern:'',
|
||||||
userInfoObj:{
|
userInfoObj:{
|
||||||
// sex:null,
|
// sex:null,
|
||||||
account:{
|
account:{
|
||||||
@@ -324,23 +328,74 @@
|
|||||||
zoom: true,
|
zoom: true,
|
||||||
//徽标
|
//徽标
|
||||||
type: "error",
|
type: "error",
|
||||||
value: 11
|
value: 11,
|
||||||
|
userData:{
|
||||||
|
aid: "",
|
||||||
|
avatar: "",
|
||||||
|
code: "",
|
||||||
|
name: "",
|
||||||
|
orgInfo: "",
|
||||||
|
sex: '',
|
||||||
|
sign: "",
|
||||||
|
},
|
||||||
|
statData:{
|
||||||
|
evalue: 0,//经验值
|
||||||
|
level: "LV1",//级别
|
||||||
|
monthStudyHour:0,//当月学习时长
|
||||||
|
totalStudyHour: 0, //累计学习时长
|
||||||
|
monthStudyDays:0, //当月学习天数
|
||||||
|
totalStudyDays:0, //累计学习天数
|
||||||
|
uvalue:0 //U币数量
|
||||||
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
this.userInfoObj=this.userInfo;
|
this.userInfoObj=this.userInfo;
|
||||||
//console.log(this.userInfoObj,"我拿到的数据")
|
// console.log(this.userInfoObj,"我拿到的数据")
|
||||||
},
|
},
|
||||||
onload(){
|
onload(){
|
||||||
//this.load()
|
//this.load()
|
||||||
|
|
||||||
},
|
},
|
||||||
|
mounted() {
|
||||||
|
this.loadUserStat();
|
||||||
|
this.Followto();
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
|
Followto(){
|
||||||
|
apiFollow.counts(this.userInfoObj.aid).then(res => {
|
||||||
|
console.log(res);
|
||||||
|
this.concernme = res.result.passive;
|
||||||
|
this.myconcern = res.result.initiative;
|
||||||
|
})
|
||||||
|
},
|
||||||
navigateTo(u) {
|
navigateTo(u) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: u
|
url: u
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
loadUserStat(){//获取经验值和等级
|
||||||
|
apiUser.getByIds([this.userInfoObj.aid]).then(res => {
|
||||||
|
if (res.status == 200) {
|
||||||
|
this.userData = res.result[0];
|
||||||
|
} else {
|
||||||
|
this.$message.error(res.message);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
apiStart.getUserStatTotalInfo(this.userInfoObj.aid).then(res=>{
|
||||||
|
if(res.status == 200) {
|
||||||
|
this.statData.evalue = res.result.evalue;
|
||||||
|
this.statData.level = res.result.level;
|
||||||
|
this.statData.monthStudyHour = res.result.monthStudyHour;
|
||||||
|
this.statData.totalStudyHour = res.result.totalStudyHour;
|
||||||
|
this.statData.monthStudyDays = res.result.monthStudyDays;
|
||||||
|
this.statData.totalStudyDays = res.result.totalStudyDays;
|
||||||
|
this.statData.uvalue = res.result.uvalue;
|
||||||
|
this.medalList=res.result.medalList;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
|
|
||||||
@@ -349,6 +404,16 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
.index-one-line-ellipsis{
|
||||||
|
display: -webkit-box;
|
||||||
|
// white-space:pre-wrap;
|
||||||
|
word-wrap: break-word;
|
||||||
|
word-break:break-all;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow:ellipsis;
|
||||||
|
-webkit-box-orient: vertical;
|
||||||
|
-webkit-line-clamp:1;
|
||||||
|
}
|
||||||
.myhead{
|
.myhead{
|
||||||
height: 510upx;
|
height: 510upx;
|
||||||
background: url('../../static/images/centerbg.png');
|
background: url('../../static/images/centerbg.png');
|
||||||
|
|||||||
@@ -1,154 +1,164 @@
|
|||||||
<template>
|
<template>
|
||||||
<view style="background: #F9F9F9;">
|
<view style="background: #F9F9F9;">
|
||||||
<view class="ubtop" style="background-color: #fff;">
|
<view class="ubtop" style="background-color: #fff;">
|
||||||
<view class="ub-heard">
|
<view class="ub-heard">
|
||||||
我的u币
|
我的u币
|
||||||
<image src="../../static/images/wenhao.png" mode=""></image>
|
<image src="../../static/images/wenhao.png" mode=""></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="top-content">
|
<view class="top-content">
|
||||||
<view>{{uinfo.uCurrency}}</view>
|
<view>{{uinfo.uCurrency}}</view>
|
||||||
统计时间:2022.11.4
|
统计时间:2022.11.4
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="ub-list" v-for="(day, index) in uCoinRecord" :key="index">
|
<view class="ub-list" v-for="(day, index) in uCoinRecord" :key="index">
|
||||||
<text>{{day.dayNmae}}</text>
|
<text>{{day.dayNmae}}</text>
|
||||||
<view class="list-info" v-for="info in day.list">
|
<view class="list-info" v-for="info in day.list">
|
||||||
<view class="info-left">
|
<view class="info-left">
|
||||||
<view>{{info.content}}</view>
|
<view>{{info.content}}</view>
|
||||||
{{ info.recordTime }}
|
{{ info.recordTime }}
|
||||||
</view>
|
</view>
|
||||||
<view class="info-right">
|
<view class="info-right">
|
||||||
{{info.uvalue > 0? '+':''}}
|
{{info.uvalue > 0? '+':''}}
|
||||||
{{info.uvalue}}
|
{{info.uvalue}}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { mapGetters } from 'vuex'
|
import { mapGetters } from 'vuex';
|
||||||
import apiStat from '@/api/phase2/stat.js';
|
import apiStat from '@/api/phase2/stat.js';
|
||||||
export default {
|
export default {
|
||||||
computed: {
|
computed: {
|
||||||
...mapGetters(['userInfo']),
|
...mapGetters(['userInfo']),
|
||||||
avatarText(){
|
avatarText() {
|
||||||
return userAvatarText(this.userInfo.name);
|
return userAvatarText(this.userInfo.name);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
uCoinRecord:[],
|
uCoinRecord: [],
|
||||||
uinfo: {
|
uinfo: {
|
||||||
uCurrency: 0 ,// 用户累计U币
|
uCurrency: 0, // 用户累计U币
|
||||||
timestamp:'',
|
timestamp: '',
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.getlist();
|
this.getlist();
|
||||||
this.getLevel()
|
this.getLevel()
|
||||||
},
|
},
|
||||||
methods:{
|
methods: {
|
||||||
getlist(){
|
getlist() {
|
||||||
apiStat.userCoinList(this.userInfo.aid, 7).then(res =>{
|
apiStat.userCoinList(this.userInfo.aid, 7).then(res => {
|
||||||
console.log(res);
|
console.log(res);
|
||||||
if (res.status == 200) {
|
if (res.status == 200) {
|
||||||
this.uCoinRecord = [];
|
this.uCoinRecord = [];
|
||||||
for (let key in res.result.uCoinRecord) {
|
for (let key in res.result.uCoinRecord) {
|
||||||
this.uCoinRecord.push({
|
this.uCoinRecord.push({
|
||||||
dayNmae: key,
|
dayNmae: key,
|
||||||
list: res.result.uCoinRecord[key]
|
list: res.result.uCoinRecord[key]
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getLevel() { //获取用户累计U币
|
getLevel() { //获取用户累计U币
|
||||||
apiStat.getUserStatTotalInfo(this.userInfo.aid).then(res => {
|
apiStat.getUserStatTotalInfo(this.userInfo.aid).then(res => {
|
||||||
if (res.status == 200) {
|
if (res.status == 200) {
|
||||||
this.uinfo.uCurrency = res.result.uvalue;
|
this.uinfo.uCurrency = res.result.uvalue;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.ub-list{
|
.ub-list {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
padding: 32upx 36upx;
|
padding: 32upx 36upx;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
text{
|
|
||||||
font-size: 44upx;
|
text {
|
||||||
font-weight: 500;
|
font-size: 44upx;
|
||||||
color: #333333;
|
font-weight: 500;
|
||||||
|
color: #333333;
|
||||||
}
|
|
||||||
.list-info{
|
}
|
||||||
display: flex;
|
|
||||||
padding-top: 40upx ;
|
.list-info {
|
||||||
padding-bottom: 32upx;
|
display: flex;
|
||||||
border-bottom: 1px solid rgba(153,153,153,0.1);
|
padding-top: 40upx;
|
||||||
.info-left{
|
padding-bottom: 32upx;
|
||||||
flex: 1;
|
border-bottom: 1px solid rgba(153, 153, 153, 0.1);
|
||||||
font-size: 24upx;
|
|
||||||
color: #999999;
|
.info-left {
|
||||||
font-weight: 400;
|
flex: 1;
|
||||||
view{
|
font-size: 24upx;
|
||||||
font-size: 28upx;
|
color: #999999;
|
||||||
color: #333333;
|
font-weight: 400;
|
||||||
font-weight: 500;
|
|
||||||
padding-bottom: 16upx;
|
view {
|
||||||
}
|
font-size: 28upx;
|
||||||
}
|
color: #333333;
|
||||||
.info-right{
|
font-weight: 500;
|
||||||
width: 90upx;
|
padding-bottom: 16upx;
|
||||||
text-align: right;
|
}
|
||||||
padding-top: 20upx;
|
}
|
||||||
}
|
|
||||||
}
|
.info-right {
|
||||||
}
|
width: 90upx;
|
||||||
.ubtop{
|
text-align: right;
|
||||||
width: 100%;
|
padding-top: 20upx;
|
||||||
height: 392upx;
|
}
|
||||||
padding-bottom: 20upx;
|
}
|
||||||
background-image: url(../../static/images/ubbgimg.png);
|
}
|
||||||
background-repeat: no-repeat;
|
|
||||||
background-size: 100%;
|
.ubtop {
|
||||||
.ub-heard{
|
width: 100%;
|
||||||
text-align: center;
|
height: 392upx;
|
||||||
color: #FFFFFF;
|
padding-bottom: 20upx;
|
||||||
font-weight: 500;
|
background-image: url(../../static/images/ubbgimg.png);
|
||||||
padding-top: 98upx;
|
background-repeat: no-repeat;
|
||||||
font-size: 36upx;
|
background-size: 100%;
|
||||||
position: relative;
|
|
||||||
image{
|
.ub-heard {
|
||||||
width: 40upx;
|
text-align: center;
|
||||||
height: 40upx;
|
color: #FFFFFF;
|
||||||
right: 36upx;
|
font-weight: 500;
|
||||||
position: absolute;
|
padding-top: 98upx;
|
||||||
// vertical-align: middle;
|
font-size: 36upx;
|
||||||
|
position: relative;
|
||||||
}
|
|
||||||
}
|
image {
|
||||||
.top-content{
|
width: 40upx;
|
||||||
width: 100%;
|
height: 40upx;
|
||||||
text-align: center;
|
right: 36upx;
|
||||||
font-size: 24upx;
|
position: absolute;
|
||||||
font-weight: 400;
|
// vertical-align: middle;
|
||||||
color: #FFFFFF;
|
|
||||||
view{
|
}
|
||||||
color: #FFFFFF;
|
}
|
||||||
font-weight: 600;
|
|
||||||
font-size: 84upx;
|
.top-content {
|
||||||
}
|
width: 100%;
|
||||||
}
|
text-align: center;
|
||||||
}
|
font-size: 24upx;
|
||||||
|
font-weight: 400;
|
||||||
|
color: #FFFFFF;
|
||||||
|
|
||||||
|
view {
|
||||||
|
color: #FFFFFF;
|
||||||
|
font-weight: 600;
|
||||||
|
font-size: 84upx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user