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