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.
 
 

72 lines
2.9 KiB

<view class="container">
<!-- 头部导航栏 -->
<view class="header">
<view class="header-content" style="width: 4200rpx; display: block; box-sizing: border-box; height: 124rpx">
<text class="title">规格选择</text>
</view>
</view>
<view class="content" style="width: 512rpx; height: 2089rpx; display: block; box-sizing: border-box">
<!-- 加载中状态 -->
<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">
<text class="product-label">商品名称</text>
<button bindtap="goBackToProductList" class="btn-back" style="width: 172rpx; display: flex; box-sizing: border-box; left: 0rpx; top: 0rpx; height: 87rpx">
<text class="btn-back-icon">←</text>
<text class="btn-back-text">更换商品</text>
</button>
</view>
<text class="product-name">{{productName}}</text>
</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 class="spec-arrow">→</view>
</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" style="height: 600rpx; display: flex; box-sizing: border-box">
<view class="empty-icon">📋</view>
<text class="empty-text">该商品暂无可用规格</text>
<button bindtap="goBackToProductList" class="btn-secondary">返回商品列表</button>
</view>
</view>
</view>