Parcourir la source

红娘排行榜 点击可查看详情

YH_0525 il y a 4 semaines
Parent
commit
a01607ae76

+ 12 - 2
LiangZhiYUMao/pages/matchmaker-workbench/index.vue

@@ -91,7 +91,7 @@
 					<text class="section-more" @click="navigateToRanking">排行榜 ></text>
 				</view>
 				<view class="best-matchmaker-list">
-					<view class="best-matchmaker-item" v-for="(item, index) in bestMatchmakers" :key="item.matchmaker_id || index">
+					<view class="best-matchmaker-item" v-for="(item, index) in bestMatchmakers" :key="item.matchmaker_id || index" @click="goToMatchmakerDetail(item)">
 						<text class="rank-number" :class="'rank-' + (index + 1)">{{ index + 1 }}</text>
 						<image class="avatar-small" :src="item.avatar_url || '/static/default-avatar.svg'" mode="aspectFill"></image>
 						<view class="matchmaker-info">
@@ -286,7 +286,7 @@ export default {
 			// 导航到活动中心
 			navigateToActivityCenter() {
 				uni.navigateTo({
-					url: '/pages/activities/list'
+					url: '/pages/matchmaker-workbench/activities'
 				})
 			},
 			// 导航到排行榜
@@ -295,6 +295,16 @@ export default {
 					url: '/pages/matchmaker-workbench/ranking'
 				})
 			},
+			// 跳转到红娘详情
+			goToMatchmakerDetail(item) {
+				if (!item) return
+				const id = item.matchmaker_id || item.matchmakerId
+				if (id) {
+					uni.navigateTo({
+						url: `/pages/matchmakers/detail?id=${id}`
+					})
+				}
+			},
 			// 导航到工作台
 			navigateToWorkbench() {
 				// 已在工作台,无需跳转

+ 17 - 8
LiangZhiYUMao/pages/matchmaker-workbench/ranking.vue

@@ -28,32 +28,32 @@
 
 		<!-- 前三名展示 -->
 		<view class="top-three-container" v-if="topThree.length >= 3">
-			<view class="top-three-item second">
+			<view class="top-three-item second" @click="goToDetail(topThree[1])">
 				<text class="rank-number">2</text>
 				<image class="avatar-large" :src="topThree[1].avatar_url || defaultAvatar" mode="aspectFill"></image>
 				<text class="matchmaker-name">{{ topThree[1].real_name }}</text>
 				<text class="success-count">成功人数: {{ topThree[1].success_couples || 0 }}</text>
-				<view class="like-btn" :class="{ liked: topThree[1].hasLiked }" @click="handleLike(topThree[1])">
+				<view class="like-btn" :class="{ liked: topThree[1].hasLiked }" @click.stop="handleLike(topThree[1])">
 					{{ topThree[1].hasLiked ? '已点赞' : '点赞' }}
 				</view>
 			</view>
 
-			<view class="top-three-item first">
+			<view class="top-three-item first" @click="goToDetail(topThree[0])">
 				<text class="rank-number">1</text>
 				<image class="avatar-large" :src="topThree[0].avatar_url || defaultAvatar" mode="aspectFill"></image>
 				<text class="matchmaker-name">{{ topThree[0].real_name }}</text>
 				<text class="success-count">成功人数: {{ topThree[0].success_couples || 0 }}</text>
-				<view class="like-btn" :class="{ liked: topThree[0].hasLiked }" @click="handleLike(topThree[0])">
+				<view class="like-btn" :class="{ liked: topThree[0].hasLiked }" @click.stop="handleLike(topThree[0])">
 					{{ topThree[0].hasLiked ? '已点赞' : '点赞' }}
 				</view>
 			</view>
 
-			<view class="top-three-item third">
+			<view class="top-three-item third" @click="goToDetail(topThree[2])">
 				<text class="rank-number">3</text>
 				<image class="avatar-large" :src="topThree[2].avatar_url || defaultAvatar" mode="aspectFill"></image>
 				<text class="matchmaker-name">{{ topThree[2].real_name }}</text>
 				<text class="success-count">成功人数: {{ topThree[2].success_couples || 0 }}</text>
-				<view class="like-btn" :class="{ liked: topThree[2].hasLiked }" @click="handleLike(topThree[2])">
+				<view class="like-btn" :class="{ liked: topThree[2].hasLiked }" @click.stop="handleLike(topThree[2])">
 					{{ topThree[2].hasLiked ? '已点赞' : '点赞' }}
 				</view>
 			</view>
@@ -61,7 +61,7 @@
 
 		<!-- 排行榜列表 -->
 		<scroll-view scroll-y class="ranking-list">
-			<view class="ranking-item" v-for="(item, index) in restList" :key="item.matchmaker_id">
+			<view class="ranking-item" v-for="(item, index) in restList" :key="item.matchmaker_id" @click="goToDetail(item)">
 				<text class="rank-number-normal">{{ index + 4 }}</text>
 				<image class="avatar-small" :src="item.avatar_url || defaultAvatar" mode="aspectFill"></image>
 				<view class="matchmaker-info">
@@ -69,7 +69,7 @@
 					<text class="success-count-normal">成功: {{ item.success_couples || 0 }} | 点赞: {{ item.weeklyLikes || 0 }}</text>
 					<text class="user-rating">等级: {{ item.level_name || '青铜红娘' }}</text>
 				</view>
-				<view class="like-btn-small" :class="{ liked: item.hasLiked }" @click="handleLike(item)">
+				<view class="like-btn-small" :class="{ liked: item.hasLiked }" @click.stop="handleLike(item)">
 					{{ item.hasLiked ? '已赞' : '点赞' }}
 				</view>
 			</view>
@@ -266,6 +266,15 @@ export default {
 				uni.redirectTo({
 					url: '/pages/matchmaker-workbench/mine'
 				})
+			},
+			// 跳转到红娘详情
+			goToDetail(matchmaker) {
+				const id = matchmaker.matchmaker_id || matchmaker.matchmakerId
+				if (id) {
+					uni.navigateTo({
+						url: `/pages/matchmakers/detail?id=${id}`
+					})
+				}
 			}
 		}
 	}