index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521
  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://ts1.tc.mm.bing.net/th/id/OIP-C.OSFH3hIukHqh-qrOvIfUWgAAAA?w=166&h=211&c=8&rs=1&qlt=90&o=6&dpr=1.3&pid=3.1&rm=2" 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. <!-- <button class="logout-btn" @click="logout">退出登录</button> -->
  68. </view>
  69. </view>
  70. </template>
  71. <script>
  72. export default {
  73. data() {
  74. return {
  75. userInfo: {
  76. name: '张三',
  77. id: '123456789',
  78. avatar: 'https://ts1.tc.mm.bing.net/th/id/OIP-C.OSFH3hIukHqh-qrOvIfUWgAAAA?w=166&h=211&c=8&rs=1&qlt=90&o=6&dpr=1.3&pid=3.1&rm=2'
  79. },
  80. healthStats: {
  81. heartRate: 72,
  82. bloodPressure: '120/80',
  83. weight: '65kg'
  84. },
  85. }
  86. },
  87. methods: {
  88. logout() {
  89. uni.showModal({
  90. title: '确认退出',
  91. content: '确定要退出当前账号吗?',
  92. success: (res) => {
  93. if (res.confirm) {
  94. // 清除本地存储的用户信息
  95. uni.removeStorageSync('userInfo');
  96. // 跳转到登录页面
  97. uni.navigateTo({
  98. url: '/pages/login/index'
  99. });
  100. }
  101. }
  102. });
  103. }
  104. },
  105. onLoad() {
  106. // 页面加载时获取用户信息
  107. this.getUserInfo();
  108. },
  109. onShow() {
  110. // 页面显示时更新用户信息
  111. this.getUserInfo();
  112. },
  113. methods: {
  114. getUserInfo() {
  115. // 从本地存储获取用户信息
  116. const userInfo = uni.getStorageSync('userInfo');
  117. if (userInfo) {
  118. this.userInfo = JSON.parse(userInfo);
  119. }
  120. }
  121. }
  122. }
  123. </script>
  124. <style lang="scss">
  125. @import '@/static/font/iconfont.css';
  126. /* 基础样式 */
  127. page {
  128. background-color: #f5f7fa;
  129. font-family: 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
  130. color: #333;
  131. }
  132. .container {
  133. padding-bottom: 100rpx;
  134. }
  135. /* 顶部背景和用户信息 */
  136. .header-container {
  137. position: relative;
  138. height: 350rpx;
  139. overflow: hidden;
  140. .bg-gradient {
  141. position: absolute;
  142. top: 0;
  143. left: 0;
  144. width: 100%;
  145. height: 100%;
  146. background: linear-gradient(135deg, #3498db, #2980b9);
  147. }
  148. .user-info {
  149. position: relative;
  150. z-index: 1;
  151. padding: 60rpx 40rpx;
  152. display: flex;
  153. align-items: center;
  154. .avatar {
  155. width: 140rpx;
  156. height: 140rpx;
  157. border-radius: 50%;
  158. overflow: hidden;
  159. border: 4rpx solid rgba(255, 255, 255, 0.5);
  160. image {
  161. width: 100%;
  162. height: 100%;
  163. }
  164. }
  165. .user-details {
  166. margin-left: 30rpx;
  167. .user-name {
  168. font-size: 36rpx;
  169. font-weight: bold;
  170. color: #fff;
  171. }
  172. .user-id {
  173. font-size: 24rpx;
  174. color: rgba(255, 255, 255, 0.8);
  175. margin-top: 10rpx;
  176. }
  177. }
  178. .edit-btn {
  179. margin-left: auto;
  180. color: #fff;
  181. font-size: 32rpx;
  182. }
  183. }
  184. }
  185. /* 健康数据卡片 */
  186. .health-stats {
  187. display: flex;
  188. justify-content: space-between;
  189. padding: 30rpx 40rpx;
  190. background-color: #fff;
  191. margin-top: -60rpx;
  192. margin-left: 40rpx;
  193. margin-right: 40rpx;
  194. border-radius: 20rpx;
  195. box-shadow: 0 10rpx 20rpx rgba(0, 0, 0, 0.05);
  196. .stats-card {
  197. flex: 1;
  198. text-align: center;
  199. .stats-icon {
  200. width: 60rpx;
  201. height: 60rpx;
  202. line-height: 60rpx;
  203. margin: 0 auto 15rpx;
  204. border-radius: 50%;
  205. color: #fff;
  206. font-size: 32rpx;
  207. }
  208. .stats-value {
  209. font-size: 36rpx;
  210. font-weight: bold;
  211. color: #333;
  212. }
  213. .stats-label {
  214. font-size: 24rpx;
  215. color: #666;
  216. margin-top: 10rpx;
  217. }
  218. }
  219. .stats-card:nth-child(1) .stats-icon {
  220. background-color: #ff6b6b;
  221. }
  222. .stats-card:nth-child(2) .stats-icon {
  223. background-color: #4ecdc4;
  224. }
  225. .stats-card:nth-child(3) .stats-icon {
  226. background-color: #1a535c;
  227. }
  228. }
  229. /* 功能导航 */
  230. .function-list {
  231. margin-top: 30rpx;
  232. background-color: #fff;
  233. .function-item {
  234. display: flex;
  235. align-items: center;
  236. padding: 30rpx 40rpx;
  237. border-bottom: 2rpx solid #f5f5f5;
  238. .item-icon {
  239. width: 50rpx;
  240. height: 50rpx;
  241. line-height: 50rpx;
  242. text-align: center;
  243. border-radius: 12rpx;
  244. color: #fff;
  245. font-size: 28rpx;
  246. }
  247. .item-text {
  248. margin-left: 30rpx;
  249. font-size: 28rpx;
  250. color: #333;
  251. }
  252. .item-arrow {
  253. margin-left: auto;
  254. color: #999;
  255. font-size: 24rpx;
  256. }
  257. }
  258. .function-item:nth-child(1) .item-icon {
  259. background-color: #4a90e2;
  260. }
  261. .function-item:nth-child(2) .item-icon {
  262. background-color: #50e3c2;
  263. }
  264. .function-item:nth-child(3) .item-icon {
  265. background-color: #f5a623;
  266. }
  267. .function-item:nth-child(4) .item-icon {
  268. background-color: #d0021b;
  269. }
  270. .function-item:nth-child(5) .item-icon {
  271. background-color: #7ed321;
  272. }
  273. }
  274. /* 问诊历史 */
  275. .consultation-history {
  276. margin-top: 30rpx;
  277. background-color: #fff;
  278. padding-bottom: 30rpx;
  279. .section-title {
  280. font-size: 32rpx;
  281. font-weight: bold;
  282. padding: 30rpx 40rpx;
  283. border-bottom: 2rpx solid #f5f5f5;
  284. }
  285. .history-list {
  286. padding: 0 40rpx;
  287. }
  288. .history-item {
  289. display: flex;
  290. padding: 30rpx 0;
  291. border-bottom: 2rpx solid #f5f5f5;
  292. .item-left {
  293. width: 100rpx;
  294. height: 100rpx;
  295. border-radius: 50%;
  296. overflow: hidden;
  297. image {
  298. width: 100%;
  299. height: 100%;
  300. }
  301. }
  302. .item-middle {
  303. flex: 1;
  304. margin-left: 30rpx;
  305. .doctor-name {
  306. font-size: 30rpx;
  307. font-weight: bold;
  308. color: #333;
  309. }
  310. .department {
  311. font-size: 24rpx;
  312. color: #666;
  313. margin-top: 8rpx;
  314. }
  315. .consultation-time {
  316. font-size: 22rpx;
  317. color: #999;
  318. margin-top: 8rpx;
  319. }
  320. }
  321. .item-right {
  322. .consultation-status {
  323. padding: 8rpx 20rpx;
  324. border-radius: 20rpx;
  325. font-size: 24rpx;
  326. }
  327. .completed {
  328. color: #4cd964;
  329. background-color: rgba(76, 217, 100, 0.1);
  330. }
  331. .pending {
  332. color: #ff9500;
  333. background-color: rgba(255, 149, 0, 0.1);
  334. }
  335. .cancelled {
  336. color: #ff3b30;
  337. background-color: rgba(255, 59, 48, 0.1);
  338. }
  339. }
  340. }
  341. .view-all {
  342. display: flex;
  343. align-items: center;
  344. justify-content: center;
  345. padding: 30rpx 0;
  346. font-size: 28rpx;
  347. color: #4a90e2;
  348. .icon-arrow-right {
  349. margin-left: 10rpx;
  350. }
  351. }
  352. }
  353. /* 账户设置 */
  354. .account-settings {
  355. margin-top: 30rpx;
  356. background-color: #fff;
  357. .setting-item {
  358. display: flex;
  359. align-items: center;
  360. padding: 30rpx 40rpx;
  361. border-bottom: 2rpx solid #f5f5f5;
  362. .item-icon {
  363. width: 50rpx;
  364. height: 50rpx;
  365. line-height: 50rpx;
  366. text-align: center;
  367. border-radius: 12rpx;
  368. color: #fff;
  369. font-size: 28rpx;
  370. }
  371. .item-text {
  372. margin-left: 30rpx;
  373. font-size: 28rpx;
  374. color: #333;
  375. }
  376. .item-arrow {
  377. margin-left: auto;
  378. color: #999;
  379. font-size: 24rpx;
  380. }
  381. }
  382. .setting-item:nth-child(1) .item-icon {
  383. background-color: #7986cb;
  384. }
  385. .setting-item:nth-child(2) .item-icon {
  386. background-color: #4fc3f7;
  387. }
  388. .logout-btn {
  389. margin: 40rpx;
  390. background-color: #ff3b30;
  391. color: #fff;
  392. font-size: 30rpx;
  393. height: 88rpx;
  394. line-height: 88rpx;
  395. border-radius: 44rpx;
  396. }
  397. }
  398. /* 图标样式 */
  399. @font-face {
  400. font-family: 'iconfont';
  401. src: url('https://at.alicdn.com/t/font_1797472_r754c57n48d.ttf') format('truetype');
  402. }
  403. .iconfont {
  404. font-family: "iconfont" !important;
  405. font-size: 16px;
  406. font-style: normal;
  407. -webkit-font-smoothing: antialiased;
  408. -moz-osx-font-smoothing: grayscale;
  409. }
  410. .icon-edit:before {
  411. content: "\e601";
  412. }
  413. .icon-heartbeat:before {
  414. content: "\e602";
  415. }
  416. .icon-blood-pressure:before {
  417. content: "\e603";
  418. }
  419. .icon-weight:before {
  420. content: "\e604";
  421. }
  422. .icon-medical-record:before {
  423. content: "\e605";
  424. }
  425. .icon-appointment:before {
  426. content: "\e606";
  427. }
  428. .icon-prescription:before {
  429. content: "\e607";
  430. }
  431. .icon-health-report:before {
  432. content: "\e608";
  433. }
  434. .icon-medication:before {
  435. content: "\e609";
  436. }
  437. .icon-settings:before {
  438. content: "\e60a";
  439. }
  440. .icon-help:before {
  441. content: "\e60b";
  442. }
  443. .icon-arrow-right:before {
  444. content: "\e60c";
  445. }
  446. </style>