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.
 
 

49 lines
1.6 KiB

<view class="container">
<!-- 头部导航栏 -->
<view class="header">
<view class="header-content" style="width: 800rpx; display: block; box-sizing: border-box">
<text class="title">商品选择</text>
</view>
</view>
<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>
<button bindtap="loadProductNames" class="btn-primary">重新加载</button>
</view>
<!-- 商品名称列表 -->
<view wx:else class="product-section">
<view class="section-header">
<text class="section-title">商品列表</text>
<text class="section-count">{{productNames.length}}个商品</text>
</view>
<view class="product-grid" style="width: 700rpx; display: grid; box-sizing: border-box">
<view
wx:for="{{productNames}}"
wx:key="*this"
class="product-card"
data-product="{{item}}"
bindtap="selectProduct"
>
<view class="product-icon">🛍️</view>
<text class="product-name">{{item}}</text>
<view class="product-arrow">→</view>
</view>
</view>
<!-- 暂无更多商品提示 -->
<view wx:if="{{productNames.length > 0}}" class="no-more">
<text class="no-more-text">暂无更多商品选择</text>
</view>
</view>
</view>
</view>