index.wxml 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <!--pages/collection/index.wxml-->
  2. <view class="collection-container">
  3. <!-- 顶部导航和搜索区域 -->
  4. <view class="top-section">
  5. <!-- 顶部导航栏 -->
  6. <view class="nav-scroll-container">
  7. <scroll-view class="category-menu" scroll-x="true">
  8. <view class="category-item {{activeCategory === 'all' ? 'active' : ''}}" bindtap="selectCategory" data-type="all">
  9. <text class="category-text">全部</text>
  10. </view>
  11. <view class="category-item {{activeCategory === item.id ? 'active' : ''}}" wx:for="{{categories}}" wx:key="id" bindtap="selectCategory" data-type="{{item.id}}">
  12. <text class="category-text">{{item.name}}</text>
  13. </view>
  14. </scroll-view>
  15. </view>
  16. <!-- 搜索框 -->
  17. <view class="search-container">
  18. <view class="search-input">
  19. <input type="text" placeholder="请输入要搜索的内容..." value="{{searchText}}" bindinput="onSearchInput" bindconfirm="onSearch" />
  20. <view class="search-icon" wx:if="{{!searchText}}" bindtap="onSearch">
  21. <icon class="icon-small" type="search" size="24"></icon>
  22. </view>
  23. <view class="clear-icon" wx:if="{{searchText}}" bindtap="onSearchClear">
  24. <text class="iconfont">✕</text>
  25. </view>
  26. </view>
  27. </view>
  28. </view>
  29. <!-- 内容区域 -->
  30. <scroll-view class="content-section" scroll-y="true" bindscrolltolower="onReachBottom">
  31. <view class="collection-list">
  32. <view class="collection-item" wx:for="{{artifactList}}" wx:key="artifactId" bindtap="goCollectDetail" data-item="{{item}}">
  33. <view class="item-image-container">
  34. <image class="item-image" src="{{item.img}}" mode="aspectFill"></image>
  35. <view class="view-button">
  36. <text>查看</text>
  37. <text class="arrow">→</text>
  38. </view>
  39. <view class="item-info">
  40. <view class="item-category">{{item.category || '三维文物'}}</view>
  41. <view class="item-title">{{item.title || '未知标题'}}</view>
  42. <view class="item-description">{{item.remark || '暂无描述'}}</view>
  43. </view>
  44. </view>
  45. </view>
  46. <!-- 加载状态 -->
  47. <view wx:if="{{loading}}" class="loading-container">
  48. <view class="loading-text">加载中...</view>
  49. </view>
  50. <!-- 没有更多数据 -->
  51. <view wx:if="{{!hasMore && artifactList.length > 0}}" class="no-more-container">
  52. <view class="no-more-text">没有更多数据了</view>
  53. </view>
  54. <!-- 暂无数据 -->
  55. <view wx:if="{{!loading && artifactList.length === 0}}" class="empty-container">
  56. <view class="empty-text">暂无数据</view>
  57. </view>
  58. </view>
  59. </scroll-view>
  60. </view>