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,92 @@
<!--评论显示测试页面-->
<view class="container">
<view class="header">
<text class="title">评论组件显示测试</text>
<text class="subtitle">模拟商品详情页面的评论组件</text>
</view>
<!-- 调试信息 -->
<view class="debug-section">
<text class="section-title">调试信息</text>
<view class="debug-item">
<text class="debug-label">API已调用:</text>
<text class="debug-value {{debugInfo.apiCalled ? 'success' : 'error'}}">{{debugInfo.apiCalled ? '是' : '否'}}</text>
</view>
<view class="debug-item">
<text class="debug-label">数据已接收:</text>
<text class="debug-value {{debugInfo.dataReceived ? 'success' : 'error'}}">{{debugInfo.dataReceived ? '是' : '否'}}</text>
</view>
<view class="debug-item" wx:if="{{debugInfo.errorMessage}}">
<text class="debug-label">错误信息:</text>
<text class="debug-value error">{{debugInfo.errorMessage}}</text>
</view>
<view class="debug-item">
<text class="debug-label">评论数量:</text>
<text class="debug-value">{{commentsStatistics.commentCount}}</text>
</view>
<view class="debug-item">
<text class="debug-label">显示条件:</text>
<text class="debug-value {{commentsStatistics.commentCount > 0 ? 'success' : 'error'}}">
commentCount > 0 = {{commentsStatistics.commentCount > 0}}
</text>
</view>
</view>
<!-- 操作按钮 -->
<view class="action-section">
<button class="action-btn" bindtap="reloadData" disabled="{{isLoading}}">
{{isLoading ? '加载中...' : '重新加载'}}
</button>
<button class="action-btn secondary" bindtap="clearData">清除数据</button>
</view>
<!-- 评论组件 - 复制商品详情页面的结构 -->
<view class="comment-component-section">
<text class="section-title">评论组件 ({{commentsStatistics.commentCount > 0 ? '应该显示' : '应该隐藏'}})</text>
<!-- 这里是关键的显示条件 -->
<view wx:if="{{commentsStatistics.commentCount > 0}}" class="comments-wrap">
<view class="comments-head">
<view class="comments-title-wrap">
<text class="comments-title-label">商品评价</text>
<text class="comments-title-count">({{commentsStatistics.commentCount}})</text>
</view>
<view class="comments-rate-wrap">
<text class="comments-good-rate">{{commentsStatistics.goodRate}}%好评</text>
</view>
</view>
<!-- 评论列表 -->
<view wx:for="{{commentsList}}" wx:key="id" class="comment-item-wrap">
<view class="comment-item-head">
<image class="comment-item-avatar" src="{{item.userHeadUrl}}" mode="aspectFill"></image>
<view class="comment-head-right">
<text class="comment-username">{{item.userName}}</text>
<view class="comment-rating">
<text wx:for="{{[1,2,3,4,5]}}" wx:for-item="star" wx:key="star"
class="star {{star <= item.commentScore ? 'filled' : ''}}">★</text>
</view>
</view>
</view>
<view class="comment-item-content">{{item.commentContent}}</view>
</view>
</view>
<!-- 当没有评论时显示的内容 -->
<view wx:else class="no-comments">
<text class="no-comments-text">暂无评论 (commentCount = {{commentsStatistics.commentCount}})</text>
</view>
</view>
<!-- 原始数据显示 -->
<view class="raw-data-section" wx:if="{{debugInfo.rawData}}">
<text class="section-title">原始API数据</text>
<view class="data-display">{{debugInfo.rawData}}</view>
</view>
<!-- 处理后数据显示 -->
<view class="processed-data-section" wx:if="{{debugInfo.processedData}}">
<text class="section-title">处理后数据</text>
<view class="data-display">{{debugInfo.processedData}}</view>
</view>
</view>