This commit is contained in:
mzltMpfqGS
2026-04-15 19:45:16 +08:00
commit e4a087e67e
301 changed files with 35048 additions and 0 deletions

View File

@@ -0,0 +1,49 @@
// components/comment-item/comment-item.js
// 评论项组件
Component({
properties: {
comment: {
type: Object,
value: {}
},
showArticle: {
type: Boolean,
value: false
}
},
methods: {
onAvatarTap() {
const comment = this.data.comment
if (comment && comment.userId) {
wx.navigateTo({
url: `/pages/user-profile/user-profile?userId=${comment.userId}`
})
}
},
onReply() {
this.triggerEvent('reply', { comment: this.data.comment })
},
onLike() {
this.triggerEvent('like', { comment: this.data.comment })
},
onArticleTap() {
const comment = this.data.comment
if (comment && comment.articleId) {
wx.navigateTo({
url: `/pages/article-detail/article-detail?id=${comment.articleId}`
})
}
}
}
})
/**
* @联系作者16768118056
* @描述:(此项目非免费分享)源码百分百可用,搞定毕设不发愁,支持远程调试安装、二次开发、定制、讲解、文档类。
* @访问https://www.notmaker.com/detail/8326a897119d4542896c863a69d7bbe7/gtt20260415查看完整运行演示。
*/

View File

@@ -0,0 +1,10 @@
{
"component": true,
"usingComponents": {}
}
/**
* @16768118056
* @
* @访https://www.notmaker.com/detail/8326a897119d4542896c863a69d7bbe7/gtt20260415查看完整运行演示。
*/

View File

@@ -0,0 +1,33 @@
<!-- components/comment-item/comment-item.wxml -->
<!-- 评论项组件 -->
<view class="comment-item">
<image class="avatar" src="{{comment.avatar || '/static/images/default-avatar.png'}}" bindtap="onAvatarTap" />
<view class="content">
<view class="header">
<text class="nickname">{{comment.nickname}}</text>
<text class="time">{{comment.createTime}}</text>
</view>
<text class="text">{{comment.content}}</text>
<view class="article-info" wx:if="{{showArticle && comment.articleTitle}}" bindtap="onArticleTap">
<text class="iconfont icon-article"></text>
<text class="article-title">{{comment.articleTitle}}</text>
</view>
<view class="actions">
<view class="action-btn" bindtap="onLike">
<text class="iconfont {{comment.isLiked ? 'icon-like-fill' : 'icon-like'}}"></text>
<text>{{comment.likeCount || 0}}</text>
</view>
<view class="action-btn" bindtap="onReply">
<text class="iconfont icon-comment"></text>
<text>回复</text>
</view>
</view>
</view>
</view>
/**
* @联系作者16768118056
* @描述:(此项目非免费分享)源码百分百可用,搞定毕设不发愁,支持远程调试安装、二次开发、定制、讲解、文档类。
* @访问https://www.notmaker.com/detail/8326a897119d4542896c863a69d7bbe7/gtt20260415查看完整运行演示。
*/

View File

@@ -0,0 +1,95 @@
/* components/comment-item/comment-item.wxss */
/* 评论项样式 */
.comment-item {
display: flex;
padding: 24rpx 0;
}
.avatar {
width: 64rpx;
height: 64rpx;
border-radius: 32rpx;
margin-right: 20rpx;
flex-shrink: 0;
}
.content {
flex: 1;
min-width: 0;
}
.header {
display: flex;
align-items: center;
margin-bottom: 12rpx;
}
.nickname {
font-size: 28rpx;
font-weight: bold;
color: #333;
margin-right: 16rpx;
}
.time {
font-size: 22rpx;
color: #999;
}
.text {
font-size: 28rpx;
color: #333;
line-height: 1.6;
margin-bottom: 12rpx;
}
.article-info {
display: flex;
align-items: center;
padding: 16rpx;
background-color: #f5f5f5;
border-radius: 8rpx;
margin-bottom: 12rpx;
}
.article-info .iconfont {
font-size: 24rpx;
color: #667eea;
margin-right: 12rpx;
}
.article-title {
font-size: 24rpx;
color: #667eea;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.actions {
display: flex;
gap: 40rpx;
}
.action-btn {
display: flex;
align-items: center;
gap: 8rpx;
}
.action-btn .iconfont {
font-size: 28rpx;
color: #999;
}
.action-btn text {
font-size: 24rpx;
color: #999;
}
/**
* @联系作者16768118056
* @描述:(此项目非免费分享)源码百分百可用,搞定毕设不发愁,支持远程调试安装、二次开发、定制、讲解、文档类。
* @访问https://www.notmaker.com/detail/8326a897119d4542896c863a69d7bbe7/gtt20260415查看完整运行演示。
*/