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

238 lines
12 KiB

  1. <view class="expert-page">
  2. <!-- 顶部区域 -->
  3. <view class="header-section">
  4. <!-- 背景装饰 -->
  5. <view class="header-bg">
  6. <view class="bg-circle bg-circle-1"></view>
  7. <view class="bg-circle bg-circle-2"></view>
  8. <view class="bg-circle bg-circle-3"></view>
  9. </view>
  10. <!-- 标题内容 -->
  11. <view class="header-content">
  12. <view class="title-row">
  13. <text class="main-title">牲畜专家</text>
  14. <view class="expert-badge">
  15. <text class="badge-text">专业咨询</text>
  16. </view>
  17. </view>
  18. <text class="sub-title">连接行业专家 · 解决养殖难题</text>
  19. <!-- 统计信息 -->
  20. <view class="stats-row">
  21. <view class="stat-item">
  22. <text class="stat-number">{{allExperts.length}}</text>
  23. <text class="stat-label">总专家数</text>
  24. </view>
  25. <view class="stat-divider"></view>
  26. <view class="stat-item">
  27. <text class="stat-number">{{onlineCount}}</text>
  28. <text class="stat-label">在线专家</text>
  29. </view>
  30. <view class="stat-divider"></view>
  31. <view class="stat-item">
  32. <text class="stat-number">24h</text>
  33. <text class="stat-label">快速响应</text>
  34. </view>
  35. </view>
  36. </view>
  37. </view>
  38. <!-- 搜索和筛选区域 -->
  39. <view class="search-filter-section">
  40. <!-- 搜索框 -->
  41. <view class="search-wrapper">
  42. <view class="search-box">
  43. <image src="/pagesA/images/ss.png" class="search-icon"></image>
  44. <input type="text" placeholder="搜索专家姓名、擅长领域..." placeholder-class="placeholder" bindinput="onSearchInput" value="{{searchKeyword}}" />
  45. <view wx:if="{{searchKeyword}}" class="clear-btn" bindtap="clearSearch">
  46. <image src="/pagesA/images/ch.png" class="clear-icon"></image>
  47. </view>
  48. </view>
  49. </view>
  50. <!-- 筛选标签 -->
  51. <scroll-view class="filter-scroll" scroll-x>
  52. <view class="filter-tags">
  53. <view class="filter-tag {{currentFilter === '全部' ? 'active' : ''}}" bindtap="changeFilter" data-filter="全部">
  54. <text>全部专家</text>
  55. <view class="tag-count">{{allExperts.length}}</view>
  56. </view>
  57. <view class="filter-tag {{currentFilter === '在线' ? 'active' : ''}}" bindtap="changeFilter" data-filter="在线">
  58. <text>在线专家</text>
  59. <view class="tag-count online-count">{{onlineCount}}</view>
  60. </view>
  61. <view class="filter-tag {{currentFilter === '离线' ? 'active' : ''}}" bindtap="changeFilter" data-filter="离线">
  62. <text>离线专家</text>
  63. <view class="tag-count">{{allExperts.length - onlineCount}}</view>
  64. </view>
  65. </view>
  66. </scroll-view>
  67. </view>
  68. <!-- 专家列表 -->
  69. <view class="expert-list-section">
  70. <!-- 列表标题 -->
  71. <view class="list-header">
  72. <text class="list-title">专家列表</text>
  73. <text class="list-count">已为您找到 {{allExperts.length}} 位专家</text>
  74. </view>
  75. <!-- 专家卡片列表 -->
  76. <scroll-view class="expert-cards" scroll-y>
  77. <!-- 空状态 -->
  78. <view wx:if="{{allExperts.length === 0}}" class="empty-state">
  79. <image src="/pagesA/images/kzt.png" class="empty-image"></image>
  80. <text class="empty-title">暂无相关专家</text>
  81. <text class="empty-desc">换个关键词试试,或联系客服为您推荐</text>
  82. </view>
  83. <!-- 专家卡片 -->
  84. <view wx:else>
  85. <block wx:for="{{allExperts}}" wx:key="id">
  86. <view class="expert-card">
  87. <!-- 专家头像和在线状态 -->
  88. <view class="card-left">
  89. <view class="avatar-container">
  90. <image src="{{baseUr+item.avatar}}" class="expert-avatar" mode="aspectFill"></image>
  91. <view class="online-badge {{item.isOnline=='在线' ? 'online' : 'offline'}}">
  92. {{item.isOnline}}
  93. </view>
  94. </view>
  95. </view>
  96. <!-- 专家信息 -->
  97. <view class="card-middle">
  98. <view class="name-title-row">
  99. <text class="expert-name">{{item.realName}}</text>
  100. <text class="expert-title">{{item.expert}}</text>
  101. </view>
  102. <!-- 专门的信息展示区域 -->
  103. <view class="info-display">
  104. <view class="info-item">
  105. <text class="info-label">擅长领域:</text>
  106. <text class="info-value">{{item.expertiseArea}}</text>
  107. </view>
  108. <view class="info-item">
  109. <text class="info-label">从业经验:</text>
  110. <text class="info-value">{{item.workExperience}}</text>
  111. </view>
  112. </view>
  113. </view>
  114. <!-- 点击按钮 -->
  115. <view class="contact-btn {{item.isOnline=='在线' ? 'online-btn' : 'offline-btn'}}" bindtap="showContactInfo" data-index="{{index}}">
  116. {{item.isOnline=='在线' ? '立即咨询' : '查看联系'}}
  117. </view>
  118. </view>
  119. </block>
  120. </view>
  121. </scroll-view>
  122. </view>
  123. <!-- 联系方式弹窗 -->
  124. <view wx:if="{{showContactDialog}}" class="dialog-overlay" bindtap="hideContactDialog">
  125. <view class="contact-modal" catchtap="stopPropagation">
  126. <!-- 可滚动的内容区域 -->
  127. <scroll-view class="modal-content" scroll-y>
  128. <!-- 模态框头部 -->
  129. <view class="modal-header">
  130. <view class="header-left">
  131. <image src="/pages/images/tx.png" class="modal-avatar"></image>
  132. <view class="expert-intro">
  133. <view class="modallei">
  134. <view class="modal-name">{{currentExpert.realName}}</view>
  135. <view class="modal-title">{{currentExpert.expert}}</view>
  136. </view>
  137. <view class="title-status">
  138. <view class="modal-status {{currentExpert.isOnline='在线' ? 'online' : 'offline'}}">
  139. <view class="status-dot"></view>
  140. {{currentExpert.isOnline=='在线' ? '在线可咨询' : '暂时离线'}}
  141. </view>
  142. </view>
  143. </view>
  144. </view>
  145. </view>
  146. <!-- 专家简介 -->
  147. <view class="expert-bio">
  148. <view class="bio-header">
  149. <text class="bio-title">专家简介</text>
  150. </view>
  151. <text class="bio-content">{{currentExpert.bio || '资深牲畜养殖专家,拥有丰富的实践经验和理论知识,擅长解决各类养殖难题'}}</text>
  152. </view>
  153. <!-- 联系方式 -->
  154. <view class="contact-section">
  155. <!-- 电话 -->
  156. <view class="contact-item phone-item">
  157. <view class="contact-icon-container">
  158. <image src="/pagesA/images/phone.png" class="contact-item-icon"></image>
  159. </view>
  160. <view class="contact-info">
  161. <text class="contact-label">联系电话</text>
  162. <text class="contact-value">{{currentExpert.iphone}}</text>
  163. <text class="contact-desc">可直接拨打电话咨询</text>
  164. </view>
  165. <button class="action-btn call-btn" bindtap="makePhoneCall" data-phone="{{currentExpert.iphone}}">
  166. 拨打
  167. </button>
  168. </view>
  169. <!-- 邮箱 -->
  170. <view class="contact-item email-item">
  171. <view class="contact-icon-container">
  172. <image src="/pagesA/images/dzyx.png" class="contact-item-icon"></image>
  173. </view>
  174. <view class="contact-info">
  175. <text class="contact-label">电子邮箱</text>
  176. <text class="contact-value">{{currentExpert.email}}</text>
  177. <text class="contact-desc">发送邮件可获得详细回复</text>
  178. </view>
  179. <button class="action-btn copy-btn" bindtap="copyEmail" data-email="{{currentExpert.email}}">
  180. 复制
  181. </button>
  182. </view>
  183. <!-- 工作单位 -->
  184. <view class="contact-item institution-item">
  185. <view class="contact-icon-container">
  186. <image src="/pagesA/images/gzdw.png" class="contact-item-icon"></image>
  187. </view>
  188. <view class="contact-info">
  189. <text class="contact-label">工作单位</text>
  190. <text class="contact-value">{{currentExpert.institution}}</text>
  191. <text class="contact-desc">专业机构认证专家</text>
  192. </view>
  193. <button class="action-btn address-btn" bindtap="viewLocation" data-address="{{currentExpert.address}}">
  194. 位置
  195. </button>
  196. </view>
  197. </view>
  198. <!-- 咨询时间 -->
  199. <view class="consultation-time">
  200. <view class="time-header">
  201. <text class="time-title">咨询时间建议</text>
  202. </view>
  203. <text class="time-content">{{currentExpert.online ? '专家当前在线,可直接联系咨询' : '专家当前不在线,建议在工作时间联系或发送邮件咨询'}}</text>
  204. <view class="time-slots">
  205. <text class="time-slot">工作日 9:00-18:00</text>
  206. <text class="time-slot">周末 10:00-16:00</text>
  207. </view>
  208. </view>
  209. </scroll-view>
  210. <!-- 操作按钮(固定在底部) -->
  211. <view class="modal-actions">
  212. <button class="secondary-btn" bindtap="hideContactDialog">稍后联系</button>
  213. <button class="primary-btn" bindtap="startConsultation">
  214. {{currentExpert.online ? '立即咨询' : '预约咨询'}}
  215. </button>
  216. </view>
  217. </view>
  218. </view>
  219. </view>