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

141 lines
4.6 KiB

1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
  1. <!-- 药品推荐主页面 -->
  2. <view class="page-container">
  3. <!-- 顶部搜索和筛选栏 -->
  4. <view class="top-bar">
  5. <!-- 搜索框 -->
  6. <view class="search-container">
  7. <view class="search-box">
  8. <view class="search-icon">
  9. <image src="/pagesB/images/sou.png" mode=""/>
  10. </view>
  11. <input
  12. class="search-input"
  13. placeholder="搜索药品名称、专家或症状"
  14. bindinput="onSearchInput"
  15. value="{{searchKeyword}}"
  16. />
  17. <view class="search-clear" wx:if="{{searchKeyword}}" bindtap="clearSearch">
  18. </view>
  19. </view>
  20. </view>
  21. <!-- 快捷分类筛选 -->
  22. <view class="category-filters">
  23. <scroll-view class="filters-scroll" scroll-x="true">
  24. <view class="filter-tag {{currentCategory === '全部' ? 'active' : ''}}"
  25. data-category="全部" bindtap="onCategoryChange">
  26. 全部推荐
  27. </view>
  28. <view class="filter-tag {{currentCategory === '处方药' ? 'active' : ''}}"
  29. data-category="处方药" bindtap="onCategoryChange">
  30. 处方药
  31. </view>
  32. <view class="filter-tag {{currentCategory === '非处方药' ? 'active' : ''}}"
  33. data-category="非处方药" bindtap="onCategoryChange">
  34. 非处方药
  35. </view>
  36. <view class="filter-tag {{currentCategory === '中成药' ? 'active' : ''}}"
  37. data-category="中成药" bindtap="onCategoryChange">
  38. 中成药
  39. </view>
  40. <view class="filter-tag {{currentCategory === '保健品' ? 'active' : ''}}"
  41. data-category="保健品" bindtap="onCategoryChange">
  42. 保健品
  43. </view>
  44. </scroll-view>
  45. </view>
  46. </view>
  47. <!-- 药品列表 - 网格布局 -->
  48. <view class="medicine-grid">
  49. <!-- 空状态 -->
  50. <view class="empty-state" wx:if="{{filteredList.length === 0 && !loading}}">
  51. <view class="empty-text" wx:if="{{searchKeyword}}">
  52. 未找到"{{searchKeyword}}"相关的药品
  53. </view>
  54. <view class="empty-text" wx:else>
  55. 暂无药品推荐
  56. </view>
  57. </view>
  58. <!-- 药品卡片 -->
  59. <block wx:for="{{filteredList}}" wx:key="id">
  60. <view class="medicine-card" bindtap="showMedicineDetail" data-id="{{item.id}}">
  61. <!-- 药品图片 -->
  62. <view class="card-image">
  63. <image
  64. src="{{baseUr+item.images}}"
  65. mode="aspectFill"
  66. class="medicine-img"
  67. />
  68. <!-- 药品标签 -->
  69. <view class="card-tag">
  70. {{item.medicineType}}
  71. </view>
  72. <!-- 热销标签 -->
  73. <view class="hot-tag" wx:if="{{item.salesType}}">
  74. {{item.salesType}}
  75. </view>
  76. </view>
  77. <!-- 药品基本信息 -->
  78. <view class="card-content">
  79. <!-- 药品名称 -->
  80. <view class="medicine-name">{{item.medicineName}}</view>
  81. <!-- 价格和推荐信息 -->
  82. <view class="card-footer">
  83. <!-- 价格 -->
  84. <view class="price-section">
  85. <view class="current-price">
  86. <text class="price-symbol">¥</text>
  87. <text class="price-value">{{item.price}}</text>
  88. </view>
  89. <view class="original-price" wx:if="{{item.originalPrice}}">
  90. ¥{{item.originalPrice}}
  91. </view>
  92. </view>
  93. <!-- 推荐专家 -->
  94. <view class="expert-brief">
  95. <image
  96. src="{{baseUr+item.expertAvatar}}"
  97. class="expert-avatar"
  98. mode="aspectFill"
  99. />
  100. <text class="expert-name">{{item.expertName}}</text>
  101. </view>
  102. </view>
  103. <!-- 店铺信息 -->
  104. <view class="store-brief">
  105. <view class="store-icon">🏪</view>
  106. <text class="store-name">{{item.storeName}}</text>
  107. </view>
  108. </view>
  109. </view>
  110. </block>
  111. </view>
  112. <!-- 加载更多 -->
  113. <view class="load-more" wx:if="{{hasMore && !loading}}">
  114. <view class="load-text">上拉加载更多</view>
  115. </view>
  116. <!-- 加载中 -->
  117. <view class="loading-container" wx:if="{{loading}}">
  118. <view class="loading-spinner"></view>
  119. <text>加载中...</text>
  120. </view>
  121. <!-- 没有更多 -->
  122. <view class="no-more" wx:if="{{!hasMore && filteredList.length > 0}}">
  123. <text>没有更多药品了</text>
  124. </view>
  125. <!-- 返回顶部按钮 -->
  126. <view class="back-to-top {{showBackToTop ? 'show' : ''}}" bindtap="scrollToTop">
  127. </view>
  128. </view>