与牧同行-小程序用户端
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.

79 lines
3.2 KiB

  1. <view class="page-container">
  2. <!-- 搜索栏 -->
  3. <view class="search-container">
  4. <view class="search-box">
  5. <image src="/pagesB/images/sou.png" class="search-icon"></image>
  6. <input placeholder="搜索经验分享..." placeholder-class="placeholder" bindinput="onSearchInput" bindconfirm="onSearchConfirm" value="{{searchText}}" class="search-input" />
  7. <view wx:if="{{searchText}}" bindtap="clearSearch" class="clear-btn">
  8. <image src="/pagesA/images/ch.png" class="clear-icon"></image>
  9. </view>
  10. </view>
  11. </view>
  12. <!-- 分类标签 -->
  13. <scroll-view class="category-container" scroll-x="true">
  14. <view class="category-list">
  15. <view class="category-item {{activeCategory === '' ? 'active' : ''}}" bindtap="onCategoryTap" data-id="">
  16. <text class="category-text">全部</text>
  17. </view>
  18. <view wx:for="{{categories}}" wx:key="id" class="category-item {{activeCategory === item.label ? 'active' : ''}}" bindtap="onCategoryTap" data-id="{{item.label}}">
  19. <text class="category-text">{{item.label}}</text>
  20. </view>
  21. </view>
  22. </scroll-view>
  23. <!-- 经验分享列表 -->
  24. <scroll-view class="experience-scroll" scroll-y="true" bindscrolltolower="onScrollToLower" style="height: 100vh;">
  25. <view class="experience-list">
  26. <view wx:for="{{experienceList}}" wx:key="id" class="experience-item" bindtap="onExperienceTap" data-id="{{item.id}}">
  27. <!-- 分类标签 -->
  28. <view class="tag">
  29. <view class="item-category-tag">
  30. <text class="tag-text">{{item.categoryName}}</text>
  31. </view>
  32. <!-- 发布时间 -->
  33. <text class="publish-time">{{item.publishTime}}</text>
  34. </view>
  35. <!-- 标题 -->
  36. <view class="item-title">{{item.title}}</view>
  37. <!-- 摘要 -->
  38. <view class="item-summary">{{item.summary}}</view>
  39. <!-- 底部信息 -->
  40. <view class="item-footer">
  41. <!-- 作者信息 -->
  42. <view class="author-info">
  43. <image src="{{baseUrl+item.vetAvatar}}" class="author-avatar"></image>
  44. <text class="author-name">{{item.vetName}}</text>
  45. </view>
  46. <!-- 浏览量 -->
  47. <view class="view-info">
  48. <image src="/pagesB/images/lll.png" class="view-icon"></image>
  49. <text class="view-count">{{item.viewCount}}</text>
  50. </view>
  51. </view>
  52. </view>
  53. <!-- 加载更多 -->
  54. <view wx:if="{{!loading && hasMore}}" class="load-more" bindtap="loadMoreData">
  55. <text class="load-more-text">点击加载更多</text>
  56. </view>
  57. <view wx:if="{{loading}}" class="loading">
  58. <text class="loading-text">加载中...</text>
  59. </view>
  60. <view wx:if="{{!hasMore && experienceList.length > 0}}" class="no-more">
  61. <text class="no-more-text">没有更多了</text>
  62. </view>
  63. <!-- 空状态 -->
  64. <view wx:if="{{experienceList.length === 0 && !loading}}" class="empty-state">
  65. <text class="empty-text">暂无相关经验分享</text>
  66. <text class="empty-hint">{{searchText || activeCategory ? '换个关键词试试吧' : '快去分享你的经验吧'}}</text>
  67. </view>
  68. </view>
  69. </scroll-view>
  70. </view>