Initial commit

This commit is contained in:
sjk
2025-11-17 13:32:54 +08:00
commit e788eab6eb
1659 changed files with 171560 additions and 0 deletions

View File

@@ -0,0 +1,86 @@
<!--简单评论测试页面-->
<view class="container">
<view class="header">
<text class="title">简单评论组件测试</text>
<text class="subtitle">测试评论组件的基本显示功能</text>
</view>
<!-- 测试信息 -->
<view class="test-info">
<view class="info-item">
<text class="info-label">当前模式:</text>
<text class="info-value">{{testMode === 'with_comments' ? '有评论' : '无评论'}}</text>
</view>
<view class="info-item">
<text class="info-label">评论数量:</text>
<text class="info-value">{{commentsStatistics.commentCount}}</text>
</view>
<view class="info-item">
<text class="info-label">显示条件:</text>
<text class="info-value {{commentsStatistics.commentCount > 0 ? 'success' : 'error'}}">
commentCount > 0 = {{commentsStatistics.commentCount > 0}}
</text>
</view>
</view>
<!-- 切换按钮 -->
<button class="switch-btn" bindtap="switchTestMode">
切换到{{testMode === 'with_comments' ? '无评论' : '有评论'}}模式
</button>
<!-- 评论组件 - 完全复制商品详情页面的结构 -->
<view class="comment-section">
<text class="section-title">评论组件显示区域</text>
<!-- 关键的显示条件测试 -->
<view wx:if="{{commentsStatistics.commentCount > 0}}" class="comments-wrap">
<view class="comments-head" bindtap="navToCommentsListPage">
<view class="comments-title-wrap">
<view class="comments-title-label">商品评价</view>
<view class="comments-title-count"> ({{ commentsStatistics.commentCount }}) </view>
</view>
<view class="comments-rate-wrap">
<view class="comments-good-rate">{{commentsStatistics.goodRate}}% 好评</view>
<text class="arrow">></text>
</view>
</view>
<!-- 评论列表 -->
<view class="comment-item-wrap" wx:for="{{ commentsList }}" wx:for-item="commentItem" wx:key="id">
<view class="comment-item-head">
<image class="comment-item-avatar" src="{{commentItem.userHeadUrl}}" mode="aspectFill" />
<view class="comment-head-right">
<view class="comment-username">{{commentItem.userName}}</view>
<view class="comment-rating">
<text wx:for="{{[1,2,3,4,5]}}" wx:for-item="star" wx:key="star"
class="star {{star <= commentItem.commentScore ? 'filled' : ''}}">★</text>
</view>
</view>
</view>
<view class="comment-item-content">{{commentItem.commentContent}}</view>
</view>
</view>
<!-- 无评论时的显示 -->
<view wx:else class="no-comments-wrap">
<text class="no-comments-text">暂无评论 (commentCount = {{commentsStatistics.commentCount}})</text>
</view>
</view>
<!-- 调试信息 -->
<view class="debug-info">
<text class="section-title">调试信息</text>
<view class="debug-item">
<text class="debug-text">wx:if 条件: commentsStatistics.commentCount > 0</text>
</view>
<view class="debug-item">
<text class="debug-text">实际值: {{commentsStatistics.commentCount}} > 0</text>
</view>
<view class="debug-item">
<text class="debug-text">结果: {{commentsStatistics.commentCount > 0}}</text>
</view>
<view class="debug-item">
<text class="debug-text">应该显示: {{commentsStatistics.commentCount > 0 ? '是' : '否'}}</text>
</view>
</view>
</view>