Forráskód Böngészése

Merge branch 'yxy' into test

# Conflicts:
#	LiangZhiYUMao/pages/recommend/user-detail.vue
#	LiangZhiYUMao/pages/recommend/user-dynamics.vue
yuxy 1 hónapja
szülő
commit
0d9e43694e

+ 33 - 0
LiangZhiYUMao/pages/recommend/user-detail.vue

@@ -128,6 +128,7 @@
 							<text class="dynamic-time">{{ formatTime(item.createdAt) }}</text>
 							<view class="dynamic-stats">
 								<text class="stat-item">❤️ {{ item.likeCount || 0 }}</text>
+								<text class="stat-item comment-stat" @click.stop="viewDynamicComments(item)">💬 {{ item.commentCount || 0 }}</text>
 								<text class="stat-item">💬 {{ item.commentCount || 0 }}</text>
 							</view>
 						</view>
@@ -301,11 +302,34 @@ export default {
 		
 		// 查看动态详情
 		viewDynamicDetail(item) {
+			if (!item || !item.dynamicId) {
+				console.error('动态项无效:', item)
+				uni.showToast({
+					title: '动态信息无效',
+					icon: 'none'
+				})
+				return
+			}
 			uni.navigateTo({
 				url: `/pages/plaza/detail?dynamicId=${item.dynamicId}`
 			})
 		},
 		
+		// 查看动态评论
+		viewDynamicComments(item) {
+			if (!item || !item.dynamicId) {
+				console.error('动态项无效:', item)
+				uni.showToast({
+					title: '动态信息无效',
+					icon: 'none'
+				})
+				return
+			}
+			uni.navigateTo({
+				url: `/pages/plaza/detail?dynamicId=${item.dynamicId}&scrollToComment=true`
+			})
+		},
+
 		// 预览媒体
 		previewMedia(urls, index) {
 			if (!urls || urls.length === 0) return
@@ -637,6 +661,15 @@ export default {
 	color: #999;
 }
 
+.comment-stat {
+	cursor: pointer;
+	transition: opacity 0.2s;
+}
+
+.comment-stat:active {
+	opacity: 0.6;
+}
+
 .empty-dynamics {
 	text-align: center;
 	padding: 60rpx 20rpx;

+ 41 - 0
LiangZhiYUMao/pages/recommend/user-dynamics.vue

@@ -56,6 +56,7 @@
 						<text class="dynamic-time">{{ formatTime(item.createdAt) }}</text>
 						<view class="dynamic-stats">
 							<text class="stat-item">❤️ {{ item.likeCount || 0 }}</text>
+							<text class="stat-item comment-stat" @click.stop="viewDynamicComments(item, index)">💬 {{ item.commentCount || 0 }}</text>
 							<text class="stat-item">💬 {{ item.commentCount || 0 }}</text>
 							<text class="stat-item">⭐ {{ item.favoriteCount || 0 }}</text>
 						</view>
@@ -197,11 +198,42 @@ export default {
 		
 		// 查看动态详情
 		viewDynamicDetail(item) {
+			if (!item || !item.dynamicId) {
+				console.error('动态项无效:', item)
+				uni.showToast({
+					title: '动态信息无效',
+					icon: 'none'
+				})
+				return
+			}
 			uni.navigateTo({
 				url: `/pages/plaza/detail?dynamicId=${item.dynamicId}`
 			})
 		},
 		
+		// 查看动态评论
+		viewDynamicComments(item, index) {
+			// 如果 item 无效,尝试从 dynamicList 中根据索引获取
+			if (!item || !item.dynamicId) {
+				if (typeof index === 'number' && this.dynamicList && this.dynamicList[index]) {
+					item = this.dynamicList[index]
+				}
+			}
+
+			if (!item || !item.dynamicId) {
+				console.error('动态项无效:', item, 'index:', index, 'dynamicList:', this.dynamicList)
+				uni.showToast({
+					title: '动态信息无效',
+					icon: 'none'
+				})
+				return
+			}
+
+			uni.navigateTo({
+				url: `/pages/plaza/detail?dynamicId=${item.dynamicId}&scrollToComment=true`
+			})
+		},
+
 		// 预览媒体
 		previewMedia(urls, index) {
 			if (!urls || urls.length === 0) return
@@ -366,6 +398,15 @@ export default {
 	color: #666;
 }
 
+.comment-stat {
+	cursor: pointer;
+	transition: opacity 0.2s;
+}
+
+.comment-stat:active {
+	opacity: 0.6;
+}
+
 .empty-container {
 	display: flex;
 	flex-direction: column;

+ 4 - 0
service/Essential/src/main/resources/sql/add_introduction_to_user_profile.sql

@@ -0,0 +1,4 @@
+-- 为user_profile表添加introduction(自我简介)字段
+ALTER TABLE `user_profile` 
+ADD COLUMN `introduction` TEXT COMMENT '自我简介' AFTER `hobby`;
+