<view class="page-container">
  <view class="card gb-hero">
    <view class="gb-title">🤝 超值拼团</view>
    <view class="gb-sub">集合伙伴，享受团购价</view>
  </view>

  <view class="gb-list">
    <view class="card gb-item" wx:for="{{list}}" wx:key="id" data-pid="{{item.product_id}}" bindtap="goProduct">
      <image class="gb-image" src="{{item.image}}" mode="aspectFill" />
      <view class="gb-info">
        <view class="gb-name text-ellipsis-2">{{item.name}}</view>
        <view class="gb-price-row">
          <view class="gb-price"><text class="price-symbol">¥</text>{{item.group_price || item.price}}</view>
          <view class="gb-orig" wx:if="{{item.original_price}}">原价 ¥{{item.original_price}}</view>
        </view>
        <view class="gb-group-size" wx:if="{{item.min_members}}">{{item.min_members}}人团</view>
        <view class="gb-stock" wx:if="{{item.stock<=0}}">已售罄</view>
        <button class="btn btn-danger btn-small gb-btn" wx:else data-pid="{{item.product_id}}" bindtap="goProduct">去参团</button>
      </view>
    </view>
    <empty-state wx:if="{{!loading && list.length===0}}" text="暂无拼团活动" />
  </view>
</view>
