123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111 |
- <view class="container">
- <!-- 搜索框 -->
- <view class="search-header">
- <view class="search-box" bindtap="navigateToSearch">
- <icon type="search" size="16" color="#8C8C8C"/>
- <text class="search-text">{{keyword}}</text>
- </view>
- </view>
- <!-- 排序栏 -->
- <view class="sort-bar">
- <view
- class="sort-item {{sortType === 'default' ? 'active' : ''}}"
- data-type="default"
- bindtap="onSortChange"
- >
- 综合
- </view>
- <view
- class="sort-item {{sortType === 'price' ? 'active' : ''}}"
- data-type="price"
- bindtap="onSortChange"
- >
- 价格
- <view class="sort-icon">
- <text class="iconfont icon-up {{sortOrder === 'asc' && sortType === 'price' ? 'active' : ''}}"/>
- <text class="iconfont icon-down {{sortOrder === 'desc' && sortType === 'price' ? 'active' : ''}}"/>
- </view>
- </view>
- <view
- class="sort-item {{sortType === 'sales' ? 'active' : ''}}"
- data-type="sales"
- bindtap="onSortChange"
- >
- 销量
- <view class="sort-icon">
- <text class="iconfont icon-up {{sortOrder === 'asc' && sortType === 'sales' ? 'active' : ''}}"/>
- <text class="iconfont icon-down {{sortOrder === 'desc' && sortType === 'sales' ? 'active' : ''}}"/>
- </view>
- </view>
- <view
- class="sort-item {{sortType === 'commission' ? 'active' : ''}}"
- data-type="commission"
- bindtap="onSortChange"
- >
- 佣金
- <view class="sort-icon">
- <text class="iconfont icon-up {{sortOrder === 'asc' && sortType === 'commission' ? 'active' : ''}}"/>
- <text class="iconfont icon-down {{sortOrder === 'desc' && sortType === 'commission' ? 'active' : ''}}"/>
- </view>
- </view>
- </view>
- <!-- 商品列表 -->
- <scroll-view
- class="goods-list"
- scroll-y="{{true}}"
- bindscrolltolower="loadMore"
- enable-back-to-top="{{true}}"
- refresher-enabled="{{true}}"
- refresher-triggered="{{isRefreshing}}"
- bindrefresherrefresh="onRefresh"
- >
- <view class="goods-grid">
- <view
- class="goods-item"
- wx:for="{{goodsList}}"
- wx:key="id"
- bindtap="goToDetail"
- data-id="{{item.id}}"
- >
- <view class="goods-img">
- <image src="{{item.image}}" mode="aspectFill" lazy-load></image>
- </view>
- <view class="goods-info">
- <text class="goods-name">{{item.title}}</text>
- <view class="price-box">
- <view class="price-group">
- <text class="price-symbol">¥</text>
- <text class="price">{{item.price}}</text>
- </view>
- <view class="commission-group">
- <text class="iconfont icon-share"></text>
- <text class="commission">{{item.commission}}</text>
- </view>
- </view>
- </view>
- </view>
- </view>
- <!-- 加载状态 -->
- <view class="loading-status">
- <block wx:if="{{isLoading}}">
- <view class="loading">
- <text>加载中...</text>
- </view>
- </block>
- <block wx:elif="{{!hasMore}}">
- <view class="no-more">
- <text>没有更多了</text>
- </view>
- </block>
- </view>
- </scroll-view>
- <!-- 空状态 -->
- <view class="empty-state" wx:if="{{goodsList.length === 0 && !isLoading}}">
- <icon type="info" size="64" color="#CCCCCC"/>
- <text>暂无相关商品</text>
- </view>
- </view>
|