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.
|
|
|
|
<view class="container">
|
|
|
|
|
<view class="header">
|
|
|
|
|
<text class="title">选择规格</text>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<view class="content">
|
|
|
|
|
<!-- 加载中状态 -->
|
|
|
|
|
<view wx:if="{{loading}}" class="loading">
|
|
|
|
|
<view class="loading-spinner"></view>
|
|
|
|
|
<text>加载中...</text>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<!-- 错误提示 -->
|
|
|
|
|
<view wx:if="{{error}}" class="error">
|
|
|
|
|
<view class="error-icon">⚠️</view>
|
|
|
|
|
<text>{{error}}</text>
|
|
|
|
|
<view class="button-group">
|
|
|
|
|
<button bindtap="loadSpecifications" data-product="{{productName}}" type="primary" class="retry-button">重试</button>
|
|
|
|
|
<button bindtap="goBackToProductList" type="default" class="back-button">返回上一步</button>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<!-- 商品信息 -->
|
|
|
|
|
<view wx:else class="product-info">
|
|
|
|
|
<text class="product-label">商品名称:</text>
|
|
|
|
|
<text class="product-value">{{productName}}</text>
|
|
|
|
|
<button bindtap="goBackToProductList" type="default" class="back-button">返回上一步</button>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<!-- 规格列表 -->
|
|
|
|
|
<view wx:if="{{!loading && !error && specifications.length > 0}}" class="spec-list">
|
|
|
|
|
<view class="section-header">
|
|
|
|
|
<text class="section-title">可用规格</text>
|
|
|
|
|
<text class="section-count">{{specifications.length}}个</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="spec-items">
|
|
|
|
|
<view
|
|
|
|
|
wx:for="{{specifications}}"
|
|
|
|
|
wx:key="item.name"
|
|
|
|
|
class="spec-item"
|
|
|
|
|
data-spec="{{item}}"
|
|
|
|
|
bindtap="goToSpecDetail"
|
|
|
|
|
>
|
|
|
|
|
<view class="spec-info">
|
|
|
|
|
<text class="spec-name">{{item.name}}</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="spec-price-arrow">
|
|
|
|
|
<text class="spec-price">¥{{item.finalPriceText}}</text>
|
|
|
|
|
<view class="spec-arrow">→</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<!-- 无规格提示 -->
|
|
|
|
|
<view wx:if="{{!loading && !error && specifications.length === 0}}" class="hint">
|
|
|
|
|
<view class="hint-icon">📋</view>
|
|
|
|
|
<text>该商品暂无可用规格</text>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|