Преглед изворни кода

Merge remote-tracking branch 'origin/test_dev' into test

YH_0525 пре 1 месец
родитељ
комит
af068a6ae4

+ 5 - 1
LiangZhiYUMao/pages/matchmaker-workbench/index.vue

@@ -123,7 +123,7 @@
 			</view>
 			<view class="tabbar-item message" @click="navigateToMessage">
 				<view class="tabbar-icon">
-					<view class="badge">3</view>
+					<view v-if="unreadCount > 0" class="badge">{{ unreadCount }}</view>
 				</view>
 				<text class="tabbar-text">消息</text>
 			</view>
@@ -156,6 +156,10 @@ export default {
 		computed: {
 			currentAnnouncement() {
 				return this.announcements.length > 0 ? this.announcements[this.currentAnnouncementIndex] : null
+			},
+			// 全局未读消息数(来自用户端已配置的 Vuex)
+			unreadCount() {
+				return this.$store.getters.getTotalUnread || 0
 			}
 		},
 		onLoad() {

+ 13 - 1
LiangZhiYUMao/pages/matchmaker-workbench/mine.vue

@@ -102,7 +102,7 @@
 			</view>
 			<view class="tabbar-item message" @click="navigateToMessage">
 				<view class="tabbar-icon">
-					<view class="badge">3</view>
+					<view v-if="unreadCount > 0" class="badge">{{ unreadCount }}</view>
 				</view>
 				<text class="tabbar-text">消息</text>
 			</view>
@@ -161,6 +161,13 @@
 						@click="doSignIn"
 						:disabled="isSignedToday"
 					>
+						{{ isSignedToday ? '今日已签到' : '立即签到' }}
+					</button>
+				</view>
+			</view>
+		</uni-popup>
+	</view>
+
 </template>
 
 <script>
@@ -200,6 +207,11 @@
 			// 从编辑资料页返回时,自动刷新个人资料
 			this.loadProfileData()
 		},
+		computed: {
+			unreadCount() {
+				return this.$store.getters.getTotalUnread || 0
+			}
+		},
 		methods: {
 			// 生成日历数据
 			generateCalendar() {

+ 7 - 1
LiangZhiYUMao/pages/matchmaker-workbench/my-resources.vue

@@ -167,7 +167,7 @@
 			</view>
 			<view class="tabbar-item" @click="navigateToMessage">
 				<view class="tabbar-icon message">
-					<view class="badge">3</view>
+					<view v-if="unreadCount > 0" class="badge">{{ unreadCount }}</view>
 				</view>
 				<text class="tabbar-text">消息</text>
 			</view>
@@ -193,6 +193,12 @@ export default {
 				refreshTimer: null // 定时刷新器
 			}
 		},
+		computed: {
+			// 全局未读消息数
+			unreadCount() {
+				return this.$store.getters.getTotalUnread || 0
+			}
+		},
 		onLoad() {
 			// 加载我的资源数据
 			this.loadMyResources()

+ 5 - 1
LiangZhiYUMao/pages/matchmaker-workbench/ranking.vue

@@ -93,7 +93,7 @@
 			</view>
 			<view class="tabbar-item message" @click="navigateToMessage">
 				<view class="tabbar-icon">
-					<view class="badge">3</view>
+					<view v-if="unreadCount > 0" class="badge">{{ unreadCount }}</view>
 				</view>
 				<text class="tabbar-text">消息</text>
 			</view>
@@ -125,6 +125,10 @@ export default {
 			// 第4名及以后
 			restList() {
 				return this.rankingList.slice(3)
+			},
+			// 全局未读消息数
+			unreadCount() {
+				return this.$store.getters.getTotalUnread || 0
 			}
 		},
 		onLoad() {