gongjiao.wxml 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <view class="search-container">
  2. <view class="search-bar">
  3. <input
  4. class="search-input"
  5. placeholder="输入关键词搜索..."
  6. placeholder-class="placeholder-style"
  7. value="{{searchText}}"
  8. bindinput="handleSearchInput"
  9. />
  10. <icon class="search-icon" type="search" size="16"></icon>
  11. </view>
  12. <button class="search-btn" bindtap="handleSearch" hover-class="btn-hover">搜索</button>
  13. </view>
  14. <!-- 分类筛选 -->
  15. <view class="categories">
  16. <block wx:for="{{categories}}" wx:key="value">
  17. <view
  18. class="category {{activeCategory === item.value ? 'active' : ''}}"
  19. bindtap="handleCategoryChange"
  20. data-category="{{item.value}}"
  21. >
  22. {{item.name}}
  23. </view>
  24. </block>
  25. </view>
  26. <!-- 数据列表 -->
  27. <view class="spot-list">
  28. <block wx:for="{{spots}}" wx:key="id">
  29. <view
  30. class="spot-item"
  31. bindtap="navigateToDetail"
  32. data-id="{{item.id}}"
  33. >
  34. <image src="{{item.image_url}}" />
  35. <view class="info">
  36. <text class="name">{{item.name}}</text>
  37. <text class="location">{{item.location}}</text>
  38. </view>
  39. </view>
  40. </block>
  41. </view>
  42. <!-- 加载状态 -->
  43. <view wx:if="{{loading}}" class="loading">加载中...</view>
  44. <view wx:if="{{!loading && spots.length === 0}}">暂无数据</view>