首页增加金币的显示
This commit is contained in:
parent
6ddd02ad6d
commit
d44c39db63
@ -5,8 +5,11 @@
|
|||||||
<view class="container">
|
<view class="container">
|
||||||
<view class="top-view">
|
<view class="top-view">
|
||||||
<view class="userinfo">
|
<view class="userinfo">
|
||||||
|
<view class="userinfo-user">
|
||||||
<image class="userinfo-avatar" src="{{avatar}}"/>
|
<image class="userinfo-avatar" src="{{avatar}}"/>
|
||||||
<view class="userinfo-nickname">{{ nickname }}</view>
|
<view class="userinfo-nickname">{{ nickname }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="userinfo-score">金币: {{score}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<recentGame :gameList.sync="recent_game_list" @gameCellTap.user="gameTap"></recentGame>
|
<recentGame :gameList.sync="recent_game_list" @gameCellTap.user="gameTap"></recentGame>
|
||||||
@ -167,10 +170,13 @@
|
|||||||
let res = await http.post('/api/emulated/user_info', {type: 'all'});
|
let res = await http.post('/api/emulated/user_info', {type: 'all'});
|
||||||
console.log(res);
|
console.log(res);
|
||||||
this.gameSet.clear();
|
this.gameSet.clear();
|
||||||
for(let game of res.games) {
|
if (res.userInfo) {
|
||||||
this.gameSet.add(game.gid);
|
for(let game of res.userInfo.games) {
|
||||||
|
this.gameSet.add(game.gid);
|
||||||
|
}
|
||||||
|
this.score = res.userInfo.score;
|
||||||
}
|
}
|
||||||
this.score = res.score;
|
|
||||||
this.$apply();
|
this.$apply();
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log('error get user info');
|
console.log('error get user info');
|
||||||
|
@ -5,6 +5,7 @@ page {
|
|||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
margin: 10px;
|
margin: 10px;
|
||||||
|
justify-content: space-between;
|
||||||
}
|
}
|
||||||
|
|
||||||
.userinfo-avatar {
|
.userinfo-avatar {
|
||||||
@ -57,3 +58,15 @@ page {
|
|||||||
font-weight:bold;
|
font-weight:bold;
|
||||||
padding:13rpx 10rpx;
|
padding:13rpx 10rpx;
|
||||||
}
|
}
|
||||||
|
.userinfo-user {
|
||||||
|
display: flex;
|
||||||
|
flex-flow: row;
|
||||||
|
width: 70%;
|
||||||
|
justify-items:center;
|
||||||
|
align-items:center;
|
||||||
|
}
|
||||||
|
.userinfo-score {
|
||||||
|
margin-right: 10rpx;
|
||||||
|
font-size:18px;
|
||||||
|
color: #aaa;
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user