index.wxml 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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" style="text-align: center;" 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 wx:if="{{artifactList.length}}" 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="{{urlImg + item.img}}" mode="aspectFill"></image>
  35. <view class="view-button">
  36. <text>查看</text>
  37. <image class="news-img" src="https://klmybwg.4dage.com/mini/wxImg/indexPage/news.png"></image>
  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. <!-- 加载状态 -->
  60. <view wx:if="{{loading}}" class="loading-container">
  61. <view class="loading-text">加载中...</view>
  62. </view>
  63. </scroll-view>
  64. </view>