fix: main data
This commit is contained in:
@@ -40,8 +40,8 @@
|
||||
</view>
|
||||
<view class="stat-divider"></view>
|
||||
<view class="stat-item">
|
||||
<text class="stat-num">{{ isLoggedIn ? userStats.comment : '-' }}</text>
|
||||
<text class="stat-label">评论数</text>
|
||||
<text class="stat-num">{{ isLoggedIn ? userStats.pkCount : '-' }}</text>
|
||||
<text class="stat-label">参与PK</text>
|
||||
</view>
|
||||
<view class="stat-divider"></view>
|
||||
<view class="stat-item">
|
||||
@@ -71,13 +71,13 @@
|
||||
<view class="menu-item" @tap="navTo('/pages/mine/pk')">
|
||||
<view class="icon-left"><text class="icon-bookmark"></text></view>
|
||||
<text class="menu-text">我参与的PK</text>
|
||||
<text class="menu-value" v-if="isLoggedIn">{{ userStats.participant }}</text>
|
||||
<text class="menu-value" v-if="isLoggedIn">{{ userStats.pkCount }}</text>
|
||||
</view>
|
||||
<view class="menu-item" @tap="navTo('comments')">
|
||||
<!-- <view class="menu-item" @tap="navTo('comments')">
|
||||
<view class="icon-left"><text class="icon-document"></text></view>
|
||||
<text class="menu-text">我的评论</text>
|
||||
<text class="menu-value" v-if="isLoggedIn">{{ userStats.comment }}</text>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
|
||||
<!-- Menu Group 2 -->
|
||||
@@ -130,6 +130,7 @@ const userStats = ref({
|
||||
participant: 0,
|
||||
comment: 0,
|
||||
liked: 0,
|
||||
pkCount: 0,
|
||||
label: []
|
||||
});
|
||||
|
||||
@@ -139,6 +140,7 @@ const loadUserStats = async () => {
|
||||
participant: 0,
|
||||
comment: 0,
|
||||
liked: 0,
|
||||
pkCount: 0,
|
||||
label: []
|
||||
};
|
||||
return;
|
||||
@@ -150,6 +152,7 @@ const loadUserStats = async () => {
|
||||
participant: data.participant || 0,
|
||||
comment: data.comment || 0,
|
||||
liked: data.liked || 0,
|
||||
pkCount: data.pkCount || 0,
|
||||
label: data.label || []
|
||||
};
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user