个人主页

This commit is contained in:
lmj
2022-11-04 19:12:28 +08:00
parent 69398ed008
commit c5e12526d6
2 changed files with 237 additions and 162 deletions

View File

@@ -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');

View File

@@ -30,21 +30,21 @@
</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: '',
}, },
} }
}, },
@@ -52,9 +52,9 @@
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 = [];
@@ -81,55 +81,63 @@
</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{
text {
font-size: 44upx; font-size: 44upx;
font-weight: 500; font-weight: 500;
color: #333333; color: #333333;
} }
.list-info{
.list-info {
display: flex; display: flex;
padding-top: 40upx ; padding-top: 40upx;
padding-bottom: 32upx; padding-bottom: 32upx;
border-bottom: 1px solid rgba(153,153,153,0.1); border-bottom: 1px solid rgba(153, 153, 153, 0.1);
.info-left{
.info-left {
flex: 1; flex: 1;
font-size: 24upx; font-size: 24upx;
color: #999999; color: #999999;
font-weight: 400; font-weight: 400;
view{
view {
font-size: 28upx; font-size: 28upx;
color: #333333; color: #333333;
font-weight: 500; font-weight: 500;
padding-bottom: 16upx; padding-bottom: 16upx;
} }
} }
.info-right{
.info-right {
width: 90upx; width: 90upx;
text-align: right; text-align: right;
padding-top: 20upx; padding-top: 20upx;
} }
} }
} }
.ubtop{
.ubtop {
width: 100%; width: 100%;
height: 392upx; height: 392upx;
padding-bottom: 20upx; padding-bottom: 20upx;
background-image: url(../../static/images/ubbgimg.png); background-image: url(../../static/images/ubbgimg.png);
background-repeat: no-repeat; background-repeat: no-repeat;
background-size: 100%; background-size: 100%;
.ub-heard{
.ub-heard {
text-align: center; text-align: center;
color: #FFFFFF; color: #FFFFFF;
font-weight: 500; font-weight: 500;
padding-top: 98upx; padding-top: 98upx;
font-size: 36upx; font-size: 36upx;
position: relative; position: relative;
image{
image {
width: 40upx; width: 40upx;
height: 40upx; height: 40upx;
right: 36upx; right: 36upx;
@@ -138,13 +146,15 @@
} }
} }
.top-content{
.top-content {
width: 100%; width: 100%;
text-align: center; text-align: center;
font-size: 24upx; font-size: 24upx;
font-weight: 400; font-weight: 400;
color: #FFFFFF; color: #FFFFFF;
view{
view {
color: #FFFFFF; color: #FFFFFF;
font-weight: 600; font-weight: 600;
font-size: 84upx; font-size: 84upx;