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

233 lines
11 KiB

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