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:
@@ -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