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

123 lines
4.4 KiB

  1. <view class="container">
  2. <!-- 头部区域 -->
  3. <view class="header">
  4. <view class="title-section">
  5. <text class="page-title">农牧业政策解读</text>
  6. <text class="page-subtitle">为您解读最新政策,助力农牧业发展</text>
  7. </view>
  8. <view class="date-info">数据更新至: {{currentDate}}</view>
  9. </view>
  10. <!-- 搜索和筛选区域 -->
  11. <view class="search-section">
  12. <view class="search-box">
  13. <image class="search-icon" src="/pagesA/images/ss.png"></image>
  14. <input
  15. class="search-input"
  16. placeholder="搜索政策关键词"
  17. placeholder-class="placeholder-style"
  18. bindinput="onSearchInput"
  19. value="{{searchKeyword}}"
  20. bindconfirm="onSearch"
  21. />
  22. <view wx:if="{{searchKeyword}}" class="clear-btn" bindtap="onClearSearch">×</view>
  23. </view>
  24. <view class="filter-section">
  25. <scroll-view class="filter-scroll" scroll-x="true">
  26. <view
  27. class="filter-tag {{activeFilter === '全部' ? 'active' : ''}}"
  28. data-filter="全部"
  29. data-value=""
  30. bindtap="onFilterTap"
  31. >全部</view>
  32. <view
  33. class="filter-tag {{ item.dictLabel === activeFilter ? 'active' : ''}}"
  34. data-filter="{{item.dictLabel}}"
  35. data-value="{{item.dictValue}}"
  36. bindtap="onFilterTap"
  37. wx:for="{{dictType}}"
  38. >{{item.dictLabel}}</view>
  39. </scroll-view>
  40. </view>
  41. </view>
  42. <!-- 政策列表区域 -->
  43. <scroll-view
  44. class="policy-list"
  45. scroll-y="true"
  46. bindscrolltolower="onReachBottom"
  47. style="height: {{scrollHeight}}px;"
  48. >
  49. <view wx:if="{{filteredPolicies.length === 0 && !isLoading}}" class="empty-state">
  50. <text class="empty-text">暂无相关政策</text>
  51. <text class="empty-tip">请尝试其他筛选条件</text>
  52. </view>
  53. <block wx:for="{{filteredPolicies}}" wx:key="id">
  54. <view class="policy-card" data-id="{{item.id}}" bindtap="onPolicyTap">
  55. <view class="policy-header">
  56. <view class="policy-tag {{item.type}}">{{item.policyCategory}}</view>
  57. <view class="policy-date">{{item.releaseDate}}</view>
  58. </view>
  59. <view class="policy-title">{{item.title}}</view>
  60. <view class="policy-footer">
  61. <view class="policy-source">{{item.issuingAgency}}</view>
  62. <image class="policy-arrow" src="/pagesB/images/you.png" mode=""/>
  63. </view>
  64. </view>
  65. </block>
  66. <!-- 加载更多提示 -->
  67. <view wx:if="{{isLoadingMore}}" class="loading-more">
  68. <text class="loading-text">正在加载更多...</text>
  69. </view>
  70. <view wx:if="{{!hasMore && filteredPolicies.length > 0}}" class="no-more">
  71. <text class="no-more-text">已经到底了</text>
  72. </view>
  73. </scroll-view>
  74. <!-- 政策详情弹窗 -->
  75. <view class="modal {{showPolicyDetail ? 'show' : ''}}" catchtap="hidePolicyDetail">
  76. <view class="modal-content" catchtap="stopPropagation">
  77. <view class="modal-header">
  78. <view class="modal-title">{{currentPolicy.title}}</view>
  79. <view class="modal-close" bindtap="hidePolicyDetail">×</view>
  80. </view>
  81. <scroll-view class="modal-body" scroll-y="true">
  82. <view class="policy-info-row">
  83. <view class="info-item">
  84. <text class="info-label">政策类型:</text>
  85. <text class="info-value">{{currentPolicy.policyCategory}}</text>
  86. </view>
  87. <view class="info-item">
  88. <text class="info-label">发布日期:</text>
  89. <text class="info-value">{{currentPolicy.releaseDate}}</text>
  90. </view>
  91. <view class="info-item">
  92. <text class="info-label">发布单位:</text>
  93. <text class="info-value">{{currentPolicy.issuingAgency}}</text>
  94. </view>
  95. </view>
  96. <view class="section">
  97. <view class="section-title">详细解读</view>
  98. <view class="section-content">
  99. <rich-text class="interpretation-text" space="emsp" nodes="{{currentPolicy.content}}"></rich-text>
  100. </view>
  101. </view>
  102. </scroll-view>
  103. <view class="modal-footer">
  104. <button class="btn btn-secondary" bindtap="hidePolicyDetail">关闭</button>
  105. </view>
  106. </view>
  107. </view>
  108. <!-- 底部导航提示 -->
  109. <view class="bottom-tip">
  110. <text class="tip-text">已加载 {{filteredPolicies.length}} 条政策解读</text>
  111. </view>
  112. </view>