profile.wxml 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  1. <!--profile.wxml-->
  2. <wxs module="utils">
  3. module.exports = {
  4. getStatusClass: function(status) {
  5. if (status === '配送中') return 'delivering';
  6. if (status === '已完成') return 'completed';
  7. if (status === '待支付') return 'pending';
  8. if (status === 'delivering') return 'delivering';
  9. if (status === 'completed') return 'completed';
  10. if (status === 'pending') return 'pending';
  11. return '';
  12. },
  13. getStatusText: function(status) {
  14. if (status === 'delivering') return '配送中';
  15. if (status === 'completed') return '已完成';
  16. if (status === 'pending') return '待支付';
  17. return status;
  18. }
  19. }
  20. </wxs>
  21. <view class="container">
  22. <!-- 用户信息头部 -->
  23. <view class="user-header">
  24. <view class="user-avatar">
  25. <image class="avatar" src="{{userInfo.avatar}}"></image>
  26. </view>
  27. <view class="user-info">
  28. <text class="user-name">{{userInfo.name}}</text>
  29. <text class="user-phone">{{userInfo.phone}}</text>
  30. </view>
  31. <view class="user-status">
  32. <text class="status-text">已认证</text>
  33. </view>
  34. </view>
  35. <!-- 身份验证模块 -->
  36. <view class="auth-section">
  37. <view class="section-title">
  38. <text>身份验证</text>
  39. </view>
  40. <view class="auth-list">
  41. <view class="auth-item">
  42. <view class="auth-info">
  43. <image class="auth-icon" src="/images/fingerprint-icon.png"></image>
  44. <view class="auth-text">
  45. <text class="auth-title">指纹验证</text>
  46. <text class="auth-desc">用于快速身份验证</text>
  47. </view>
  48. </view>
  49. <switch class="auth-switch" checked="{{userInfo.fingerprintRegistered}}"
  50. bindchange="toggleFingerprint" color="#007AFF"></switch>
  51. </view>
  52. <view class="auth-item">
  53. <view class="auth-info">
  54. <image class="auth-icon" src="/images/face-icon.png"></image>
  55. <view class="auth-text">
  56. <text class="auth-title">人脸识别</text>
  57. <text class="auth-desc">用于高级安全验证</text>
  58. </view>
  59. </view>
  60. <switch class="auth-switch" checked="{{userInfo.faceRegistered}}"
  61. bindchange="toggleFaceRecognition" color="#007AFF"></switch>
  62. </view>
  63. </view>
  64. </view>
  65. <!-- 病历共享设置 -->
  66. <view class="medical-section">
  67. <view class="section-title">
  68. <text>病历管理</text>
  69. </view>
  70. <view class="medical-item">
  71. <view class="medical-info">
  72. <image class="medical-icon" src="/images/medical-record-icon.png"></image>
  73. <view class="medical-text">
  74. <text class="medical-title">病历共享授权</text>
  75. <text class="medical-desc">允许医院查看您的病历信息</text>
  76. </view>
  77. </view>
  78. <switch class="medical-switch" checked="{{userInfo.medicalRecordsShared}}"
  79. bindchange="toggleMedicalRecords" color="#007AFF"></switch>
  80. </view>
  81. <view class="medical-action" bindtap="viewMedicalRecords">
  82. <text class="action-text">查看病历记录</text>
  83. <text class="action-arrow">></text>
  84. </view>
  85. </view>
  86. <!-- 订单管理 -->
  87. <view class="order-section">
  88. <view class="section-title">
  89. <text>订单管理</text>
  90. </view>
  91. <view class="order-stats">
  92. <view class="stat-item" bindtap="viewOrders" data-status="全部">
  93. <text class="stat-number">{{orderStats.total}}</text>
  94. <text class="stat-label">全部订单</text>
  95. </view>
  96. <view class="stat-item" bindtap="viewOrders" data-status="配送中">
  97. <text class="stat-number">{{orderStats.delivering}}</text>
  98. <text class="stat-label">配送中</text>
  99. </view>
  100. <view class="stat-item" bindtap="viewOrders" data-status="已完成">
  101. <text class="stat-number">{{orderStats.completed}}</text>
  102. <text class="stat-label">已完成</text>
  103. </view>
  104. </view>
  105. <view class="recent-orders">
  106. <view class="recent-title">
  107. <text>最近订单</text>
  108. <text class="view-all" bindtap="viewOrders">查看全部 ></text>
  109. </view>
  110. <view class="order-list">
  111. <view class="order-item" wx:for="{{recentOrders}}" wx:key="id" bindtap="viewOrderDetail" data-order="{{item}}">
  112. <view class="order-info">
  113. <text class="order-hospital">{{item.hospital}}</text>
  114. <text class="order-date">{{item.date}}</text>
  115. <text class="order-medicines">{{item.medicines.join('、')}}</text>
  116. </view>
  117. <view class="order-status">
  118. <text class="status-badge {{utils.getStatusClass(item.status)}}">{{utils.getStatusText(item.status)}}</text>
  119. <text class="order-price">¥{{item.totalPrice}}</text>
  120. </view>
  121. </view>
  122. </view>
  123. </view>
  124. </view>
  125. <!-- 病历记录 -->
  126. <view class="diagnosis-section">
  127. <view class="section-title">
  128. <text>病历记录</text>
  129. </view>
  130. <view class="diagnosis-stats">
  131. <view class="stat-item" bindtap="viewMedicalRecords">
  132. <text class="stat-number">{{medicalStats.total}}</text>
  133. <text class="stat-label">病历记录</text>
  134. </view>
  135. <view class="stat-item" bindtap="viewMedicalRecords">
  136. <text class="stat-number">{{medicalStats.recent}}</text>
  137. <text class="stat-label">最近30天</text>
  138. </view>
  139. </view>
  140. <view class="recent-diagnosis">
  141. <view class="diagnosis-item" wx:for="{{recentMedicalRecords}}" wx:key="id" bindtap="viewMedicalRecordDetail" data-record="{{item}}">
  142. <view class="diagnosis-info">
  143. <text class="diagnosis-date">{{item.date}}</text>
  144. <text class="diagnosis-symptoms">{{item.symptoms.join('、')}}</text>
  145. <text class="diagnosis-result">{{item.diagnosis}}</text>
  146. </view>
  147. <view class="diagnosis-arrow">
  148. <text>></text>
  149. </view>
  150. </view>
  151. </view>
  152. </view>
  153. <!-- 设置与帮助 -->
  154. <view class="settings-section">
  155. <view class="section-title">
  156. <text>设置与帮助</text>
  157. </view>
  158. <view class="settings-list">
  159. <view class="setting-item" bindtap="navigateToSetting" data-type="privacy">
  160. <image class="setting-icon" src="/images/privacy-icon.png"></image>
  161. <text class="setting-text">隐私设置</text>
  162. <text class="setting-arrow">></text>
  163. </view>
  164. <view class="setting-item" bindtap="navigateToSetting" data-type="about">
  165. <image class="setting-icon" src="/images/about-icon.png"></image>
  166. <text class="setting-text">关于我们</text>
  167. <text class="setting-arrow">></text>
  168. </view>
  169. <view class="setting-item" bindtap="navigateToSetting" data-type="help">
  170. <image class="setting-icon" src="/images/help-icon.png"></image>
  171. <text class="setting-text">帮助中心</text>
  172. <text class="setting-arrow">></text>
  173. </view>
  174. <view class="setting-item" bindtap="contactSupport">
  175. <image class="setting-icon" src="/images/support-icon.png"></image>
  176. <text class="setting-text">联系客服</text>
  177. <text class="setting-arrow">></text>
  178. </view>
  179. </view>
  180. </view>
  181. <!-- 退出登录 -->
  182. <view class="logout-section">
  183. <button class="logout-btn" bindtap="logout">
  184. <text>退出登录</text>
  185. </button>
  186. </view>
  187. <!-- 指纹验证模态框 -->
  188. <view class="modal" wx:if="{{showFingerprintModal}}">
  189. <view class="modal-content">
  190. <view class="modal-header">
  191. <text class="modal-title">指纹验证</text>
  192. <text class="modal-close" bindtap="closeFingerprintModal">×</text>
  193. </view>
  194. <view class="modal-body">
  195. <image class="fingerprint-icon" src="/images/fingerprint-scan.png"></image>
  196. <text class="modal-text">请将手指放在指纹传感器上</text>
  197. <text class="modal-desc">用于快速身份验证</text>
  198. </view>
  199. <view class="modal-footer">
  200. <button class="btn cancel" bindtap="closeFingerprintModal">取消</button>
  201. <button class="btn confirm" bindtap="confirmFingerprint">验证</button>
  202. </view>
  203. </view>
  204. </view>
  205. <!-- 人脸识别模态框 -->
  206. <view class="modal" wx:if="{{showFaceModal}}">
  207. <view class="modal-content">
  208. <view class="modal-header">
  209. <text class="modal-title">人脸识别</text>
  210. <text class="modal-close" bindtap="closeFaceModal">×</text>
  211. </view>
  212. <view class="modal-body">
  213. <image class="face-icon" src="/images/face-scan.png"></image>
  214. <text class="modal-text">请将面部对准摄像头</text>
  215. <text class="modal-desc">用于高级安全验证</text>
  216. </view>
  217. <view class="modal-footer">
  218. <button class="btn cancel" bindtap="closeFaceModal">取消</button>
  219. <button class="btn confirm" bindtap="confirmFaceRecognition">开始识别</button>
  220. </view>
  221. </view>
  222. </view>
  223. </view>