You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

66 lines
2.4 KiB

<view class="container">
<!-- 头部导航栏 -->
<view class="content">
<!-- 加载中状态 -->
<view wx:if="{{loading}}" class="loading">
<view class="loading-spinner"></view>
<text class="loading-text">正在加载规格数据...</text>
</view>
<!-- 错误提示 -->
<view wx:if="{{error}}" class="error-card">
<view class="error-icon">⚠️</view>
<text class="error-text">{{error}}</text>
<view class="button-group">
<button bindtap="loadSpecifications" data-product="{{productName}}" class="btn-primary">重新加载</button>
<button bindtap="goBackToProductList" class="btn-secondary">返回商品列表</button>
</view>
</view>
<!-- 商品信息 -->
<view wx:else class="product-card">
<view class="product-info-container">
<view class="product-info-row">
<view class="product-name-container">
<text class="product-name">{{productName}}</text>
</view>
<button bindtap="goBackToProductList" class="btn-change-product">
<text class="btn-change-product-text">更换商品</text>
</button>
</view>
</view>
</view>
<!-- 规格列表 -->
<view wx:if="{{!loading && !error && specifications.length > 0}}" class="spec-section">
<view class="section-header">
<text class="section-title">可用规格</text>
<text class="section-count">({{specifications.length}})</text>
</view>
<view class="spec-list">
<view
wx:for="{{specifications}}"
wx:key="item.name"
class="spec-item"
data-spec="{{item}}"
bindtap="goToSpecDetail"
>
<text class="spec-name">{{item.name}}</text>
</view>
</view>
<!-- 暂无更多规格提示 -->
<view wx:if="{{specifications.length > 0}}" class="no-more">
<text class="no-more-text">已经到底啦</text>
</view>
</view>
<!-- 无规格提示 -->
<view wx:if="{{!loading && !error && specifications.length === 0}}" class="empty-state">
<view class="empty-icon">📋</view>
<text class="empty-text">该商品暂无可用规格</text>
<text class="empty-subtext">试试其他商品吧</text>
<button bindtap="goBackToProductList" class="btn-secondary">返回商品列表</button>
</view>
</view>
</view>