index.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620
  1. <template>
  2. <view class="container">
  3. <!-- 顶部背景和用户信息 -->
  4. <view class="header-container">
  5. <view class="bg-gradient"></view>
  6. <view class="user-info">
  7. <view class="avatar">
  8. <image src="https://picsum.photos/id/64/200/200" mode="aspectFill"></image>
  9. </view>
  10. <view class="user-details">
  11. <view class="user-name">张三</view>
  12. <view class="user-id">ID: 123456789</view>
  13. </view>
  14. <navigator url="/pages/mine/profile/profile" class="edit-btn">
  15. <text class="iconfont icon-bianji"></text>
  16. </navigator>
  17. </view>
  18. </view>
  19. <!-- 功能导航 -->
  20. <view class="function-list">
  21. <navigator url="/pages/mine/medical-record/medical-record" class="function-item">
  22. <view class="item-icon">
  23. <text class="iconfont icon-a-1-24"></text>
  24. </view>
  25. <view class="item-text">我的病历</view>
  26. <view class="item-arrow">
  27. <text class="iconfont icon-arrow-right"></text>
  28. </view>
  29. </navigator>
  30. <navigator url="/pages/mine/appointment/appointment" class="function-item">
  31. <view class="item-icon">
  32. <text class="iconfont icon-wodeyuyue"></text>
  33. </view>
  34. <view class="item-text">我的预约</view>
  35. <view class="item-arrow">
  36. <text class="iconfont icon-arrow-right"></text>
  37. </view>
  38. </navigator>
  39. <navigator url="/pages/mine/prescription/prescription" class="function-item">
  40. <view class="item-icon">
  41. <text class="iconfont icon-dianzichufang"></text>
  42. </view>
  43. <view class="item-text">电子处方</view>
  44. <view class="item-arrow">
  45. <text class="iconfont icon-arrow-right"></text>
  46. </view>
  47. </navigator>
  48. <navigator url="/pages/mine/health-report/health-report" class="function-item">
  49. <view class="item-icon">
  50. <text class="iconfont icon-Heath-Report"></text>
  51. </view>
  52. <view class="item-text">健康报告</view>
  53. <view class="item-arrow">
  54. <text class="iconfont icon-arrow-right"></text>
  55. </view>
  56. </navigator>
  57. <navigator url="/pages/mine/medication/medication" class="function-item">
  58. <view class="item-icon">
  59. <text class="iconfont icon-yongyaotixing"></text>
  60. </view>
  61. <view class="item-text">用药提醒</view>
  62. <view class="item-arrow">
  63. <text class="iconfont icon-arrow-right"></text>
  64. </view>
  65. </navigator>
  66. </view>
  67. <!-- 问诊历史 -->
  68. <view class="consultation-history">
  69. <view class="section-title">问诊历史</view>
  70. <view class="history-list">
  71. <navigator url="/pages/mine/consultation-detail/consultation-detail?id=1" class="history-item">
  72. <view class="item-left">
  73. <image src="https://picsum.photos/id/91/200/200" mode="aspectFill"></image>
  74. </view>
  75. <view class="item-middle">
  76. <view class="doctor-name">李医生</view>
  77. <view class="department">内科 | 主任医师</view>
  78. <view class="consultation-time">2023-05-15 10:30</view>
  79. </view>
  80. <view class="item-right">
  81. <view class="consultation-status completed">已完成</view>
  82. </view>
  83. </navigator>
  84. <navigator url="/pages/mine/consultation-detail/consultation-detail?id=2" class="history-item">
  85. <view class="item-left">
  86. <image src="https://picsum.photos/id/65/200/200" mode="aspectFill"></image>
  87. </view>
  88. <view class="item-middle">
  89. <view class="doctor-name">王医生</view>
  90. <view class="department">儿科 | 副主任医师</view>
  91. <view class="consultation-time">2023-05-10 14:45</view>
  92. </view>
  93. <view class="item-right">
  94. <view class="consultation-status completed">已完成</view>
  95. </view>
  96. </navigator>
  97. <navigator url="/pages/mine/consultation-detail/consultation-detail?id=3" class="history-item">
  98. <view class="item-left">
  99. <image src="https://picsum.photos/id/62/200/200" mode="aspectFill"></image>
  100. </view>
  101. <view class="item-middle">
  102. <view class="doctor-name">张医生</view>
  103. <view class="department">骨科 | 主治医师</view>
  104. <view class="consultation-time">2023-05-05 09:15</view>
  105. </view>
  106. <view class="item-right">
  107. <view class="consultation-status completed">已完成</view>
  108. </view>
  109. </navigator>
  110. </view>
  111. <navigator url="/pages/mine/all-history/all-history" class="view-all">
  112. 查看全部
  113. <text class="iconfont icon-arrow-right"></text>
  114. </navigator>
  115. </view>
  116. <!-- 账户设置 -->
  117. <view class="account-settings">
  118. <navigator url="/pages/mine/settings/settings" class="setting-item">
  119. <view class="item-icon">
  120. <text class="iconfont icon-settings"></text>
  121. </view>
  122. <view class="item-text">账户设置</view>
  123. <view class="item-arrow">
  124. <text class="iconfont icon-arrow-right"></text>
  125. </view>
  126. </navigator>
  127. <navigator url="/pages/mine/help/help" class="setting-item">
  128. <view class="item-icon">
  129. <text class="iconfont icon-help"></text>
  130. </view>
  131. <view class="item-text">帮助与反馈</view>
  132. <view class="item-arrow">
  133. <text class="iconfont icon-arrow-right"></text>
  134. </view>
  135. </navigator>
  136. <button class="logout-btn" @click="logout">退出登录</button>
  137. </view>
  138. </view>
  139. </template>
  140. <script>
  141. export default {
  142. data() {
  143. return {
  144. userInfo: {
  145. name: '张三',
  146. id: '123456789',
  147. avatar: 'https://picsum.photos/id/64/200/200'
  148. },
  149. healthStats: {
  150. heartRate: 72,
  151. bloodPressure: '120/80',
  152. weight: '65kg'
  153. },
  154. consultationHistory: [
  155. {
  156. id: 1,
  157. doctorName: '李医生',
  158. department: '内科 | 主任医师',
  159. time: '2023-05-15 10:30',
  160. status: 'completed',
  161. avatar: 'https://picsum.photos/id/91/200/200'
  162. },
  163. {
  164. id: 2,
  165. doctorName: '王医生',
  166. department: '儿科 | 副主任医师',
  167. time: '2023-05-10 14:45',
  168. status: 'completed',
  169. avatar: 'https://picsum.photos/id/65/200/200'
  170. },
  171. {
  172. id: 3,
  173. doctorName: '张医生',
  174. department: '骨科 | 主治医师',
  175. time: '2023-05-05 09:15',
  176. status: 'completed',
  177. avatar: 'https://picsum.photos/id/62/200/200'
  178. }
  179. ]
  180. }
  181. },
  182. methods: {
  183. logout() {
  184. uni.showModal({
  185. title: '确认退出',
  186. content: '确定要退出当前账号吗?',
  187. success: (res) => {
  188. if (res.confirm) {
  189. // 清除本地存储的用户信息
  190. uni.removeStorageSync('userInfo');
  191. // 跳转到登录页面
  192. uni.reLaunch({
  193. url: '/pages/login/login'
  194. });
  195. }
  196. }
  197. });
  198. }
  199. },
  200. onLoad() {
  201. // 页面加载时获取用户信息
  202. this.getUserInfo();
  203. },
  204. onShow() {
  205. // 页面显示时更新用户信息
  206. this.getUserInfo();
  207. },
  208. methods: {
  209. getUserInfo() {
  210. // 从本地存储获取用户信息
  211. const userInfo = uni.getStorageSync('userInfo');
  212. if (userInfo) {
  213. this.userInfo = JSON.parse(userInfo);
  214. }
  215. }
  216. }
  217. }
  218. </script>
  219. <style lang="scss">
  220. @import '@/static/font/iconfont.css';
  221. /* 基础样式 */
  222. page {
  223. background-color: #f5f7fa;
  224. font-family: 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
  225. color: #333;
  226. }
  227. .container {
  228. padding-bottom: 100rpx;
  229. }
  230. /* 顶部背景和用户信息 */
  231. .header-container {
  232. position: relative;
  233. height: 350rpx;
  234. overflow: hidden;
  235. .bg-gradient {
  236. position: absolute;
  237. top: 0;
  238. left: 0;
  239. width: 100%;
  240. height: 100%;
  241. background: linear-gradient(135deg, #3498db, #2980b9);
  242. }
  243. .user-info {
  244. position: relative;
  245. z-index: 1;
  246. padding: 60rpx 40rpx;
  247. display: flex;
  248. align-items: center;
  249. .avatar {
  250. width: 140rpx;
  251. height: 140rpx;
  252. border-radius: 50%;
  253. overflow: hidden;
  254. border: 4rpx solid rgba(255, 255, 255, 0.5);
  255. image {
  256. width: 100%;
  257. height: 100%;
  258. }
  259. }
  260. .user-details {
  261. margin-left: 30rpx;
  262. .user-name {
  263. font-size: 36rpx;
  264. font-weight: bold;
  265. color: #fff;
  266. }
  267. .user-id {
  268. font-size: 24rpx;
  269. color: rgba(255, 255, 255, 0.8);
  270. margin-top: 10rpx;
  271. }
  272. }
  273. .edit-btn {
  274. margin-left: auto;
  275. color: #fff;
  276. font-size: 32rpx;
  277. }
  278. }
  279. }
  280. /* 健康数据卡片 */
  281. .health-stats {
  282. display: flex;
  283. justify-content: space-between;
  284. padding: 30rpx 40rpx;
  285. background-color: #fff;
  286. margin-top: -60rpx;
  287. margin-left: 40rpx;
  288. margin-right: 40rpx;
  289. border-radius: 20rpx;
  290. box-shadow: 0 10rpx 20rpx rgba(0, 0, 0, 0.05);
  291. .stats-card {
  292. flex: 1;
  293. text-align: center;
  294. .stats-icon {
  295. width: 60rpx;
  296. height: 60rpx;
  297. line-height: 60rpx;
  298. margin: 0 auto 15rpx;
  299. border-radius: 50%;
  300. color: #fff;
  301. font-size: 32rpx;
  302. }
  303. .stats-value {
  304. font-size: 36rpx;
  305. font-weight: bold;
  306. color: #333;
  307. }
  308. .stats-label {
  309. font-size: 24rpx;
  310. color: #666;
  311. margin-top: 10rpx;
  312. }
  313. }
  314. .stats-card:nth-child(1) .stats-icon {
  315. background-color: #ff6b6b;
  316. }
  317. .stats-card:nth-child(2) .stats-icon {
  318. background-color: #4ecdc4;
  319. }
  320. .stats-card:nth-child(3) .stats-icon {
  321. background-color: #1a535c;
  322. }
  323. }
  324. /* 功能导航 */
  325. .function-list {
  326. margin-top: 30rpx;
  327. background-color: #fff;
  328. .function-item {
  329. display: flex;
  330. align-items: center;
  331. padding: 30rpx 40rpx;
  332. border-bottom: 2rpx solid #f5f5f5;
  333. .item-icon {
  334. width: 50rpx;
  335. height: 50rpx;
  336. line-height: 50rpx;
  337. text-align: center;
  338. border-radius: 12rpx;
  339. color: #fff;
  340. font-size: 28rpx;
  341. }
  342. .item-text {
  343. margin-left: 30rpx;
  344. font-size: 28rpx;
  345. color: #333;
  346. }
  347. .item-arrow {
  348. margin-left: auto;
  349. color: #999;
  350. font-size: 24rpx;
  351. }
  352. }
  353. .function-item:nth-child(1) .item-icon {
  354. background-color: #4a90e2;
  355. }
  356. .function-item:nth-child(2) .item-icon {
  357. background-color: #50e3c2;
  358. }
  359. .function-item:nth-child(3) .item-icon {
  360. background-color: #f5a623;
  361. }
  362. .function-item:nth-child(4) .item-icon {
  363. background-color: #d0021b;
  364. }
  365. .function-item:nth-child(5) .item-icon {
  366. background-color: #7ed321;
  367. }
  368. }
  369. /* 问诊历史 */
  370. .consultation-history {
  371. margin-top: 30rpx;
  372. background-color: #fff;
  373. padding-bottom: 30rpx;
  374. .section-title {
  375. font-size: 32rpx;
  376. font-weight: bold;
  377. padding: 30rpx 40rpx;
  378. border-bottom: 2rpx solid #f5f5f5;
  379. }
  380. .history-list {
  381. padding: 0 40rpx;
  382. }
  383. .history-item {
  384. display: flex;
  385. padding: 30rpx 0;
  386. border-bottom: 2rpx solid #f5f5f5;
  387. .item-left {
  388. width: 100rpx;
  389. height: 100rpx;
  390. border-radius: 50%;
  391. overflow: hidden;
  392. image {
  393. width: 100%;
  394. height: 100%;
  395. }
  396. }
  397. .item-middle {
  398. flex: 1;
  399. margin-left: 30rpx;
  400. .doctor-name {
  401. font-size: 30rpx;
  402. font-weight: bold;
  403. color: #333;
  404. }
  405. .department {
  406. font-size: 24rpx;
  407. color: #666;
  408. margin-top: 8rpx;
  409. }
  410. .consultation-time {
  411. font-size: 22rpx;
  412. color: #999;
  413. margin-top: 8rpx;
  414. }
  415. }
  416. .item-right {
  417. .consultation-status {
  418. padding: 8rpx 20rpx;
  419. border-radius: 20rpx;
  420. font-size: 24rpx;
  421. }
  422. .completed {
  423. color: #4cd964;
  424. background-color: rgba(76, 217, 100, 0.1);
  425. }
  426. .pending {
  427. color: #ff9500;
  428. background-color: rgba(255, 149, 0, 0.1);
  429. }
  430. .cancelled {
  431. color: #ff3b30;
  432. background-color: rgba(255, 59, 48, 0.1);
  433. }
  434. }
  435. }
  436. .view-all {
  437. display: flex;
  438. align-items: center;
  439. justify-content: center;
  440. padding: 30rpx 0;
  441. font-size: 28rpx;
  442. color: #4a90e2;
  443. .icon-arrow-right {
  444. margin-left: 10rpx;
  445. }
  446. }
  447. }
  448. /* 账户设置 */
  449. .account-settings {
  450. margin-top: 30rpx;
  451. background-color: #fff;
  452. .setting-item {
  453. display: flex;
  454. align-items: center;
  455. padding: 30rpx 40rpx;
  456. border-bottom: 2rpx solid #f5f5f5;
  457. .item-icon {
  458. width: 50rpx;
  459. height: 50rpx;
  460. line-height: 50rpx;
  461. text-align: center;
  462. border-radius: 12rpx;
  463. color: #fff;
  464. font-size: 28rpx;
  465. }
  466. .item-text {
  467. margin-left: 30rpx;
  468. font-size: 28rpx;
  469. color: #333;
  470. }
  471. .item-arrow {
  472. margin-left: auto;
  473. color: #999;
  474. font-size: 24rpx;
  475. }
  476. }
  477. .setting-item:nth-child(1) .item-icon {
  478. background-color: #7986cb;
  479. }
  480. .setting-item:nth-child(2) .item-icon {
  481. background-color: #4fc3f7;
  482. }
  483. .logout-btn {
  484. margin: 40rpx;
  485. background-color: #ff3b30;
  486. color: #fff;
  487. font-size: 30rpx;
  488. height: 88rpx;
  489. line-height: 88rpx;
  490. border-radius: 44rpx;
  491. }
  492. }
  493. /* 图标样式 */
  494. @font-face {
  495. font-family: 'iconfont';
  496. src: url('https://at.alicdn.com/t/font_1797472_r754c57n48d.ttf') format('truetype');
  497. }
  498. .iconfont {
  499. font-family: "iconfont" !important;
  500. font-size: 16px;
  501. font-style: normal;
  502. -webkit-font-smoothing: antialiased;
  503. -moz-osx-font-smoothing: grayscale;
  504. }
  505. .icon-edit:before {
  506. content: "\e601";
  507. }
  508. .icon-heartbeat:before {
  509. content: "\e602";
  510. }
  511. .icon-blood-pressure:before {
  512. content: "\e603";
  513. }
  514. .icon-weight:before {
  515. content: "\e604";
  516. }
  517. .icon-medical-record:before {
  518. content: "\e605";
  519. }
  520. .icon-appointment:before {
  521. content: "\e606";
  522. }
  523. .icon-prescription:before {
  524. content: "\e607";
  525. }
  526. .icon-health-report:before {
  527. content: "\e608";
  528. }
  529. .icon-medication:before {
  530. content: "\e609";
  531. }
  532. .icon-settings:before {
  533. content: "\e60a";
  534. }
  535. .icon-help:before {
  536. content: "\e60b";
  537. }
  538. .icon-arrow-right:before {
  539. content: "\e60c";
  540. }
  541. </style>