tab1.page.scss 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366
  1. ion-toolbar {
  2. --background: #1a73e8; /* 主题颜色 */
  3. --color: white; /* 文字颜色 */
  4. display: flex;
  5. align-items: center;
  6. justify-content: space-between;
  7. padding: 0 16px; /* 调整左右内边距 */
  8. }
  9. ion-avatar {
  10. margin-right: 8px;
  11. display: flex;
  12. align-items: center;
  13. justify-content: center;
  14. margin-top: 4px; /* 调整头像的垂直位置 */
  15. }
  16. ion-avatar img {
  17. width: 35px;
  18. height: 35px;
  19. border-radius: 25%;
  20. }
  21. ion-title {
  22. font-size: 18px;
  23. font-weight: bold;
  24. flex: 1; /* 使标题居中 */
  25. text-align: center;
  26. }
  27. ion-button {
  28. display: flex;
  29. align-items: center;
  30. justify-content: center;
  31. gap: 4px;
  32. ion-label {
  33. font-size: 16px;
  34. }
  35. ion-icon {
  36. font-size: 20px;
  37. }
  38. }
  39. .health-banner {
  40. position: relative;
  41. width: 100%; /* 占满整个宽度 */
  42. /* 使用min-height代替padding-top */
  43. min-height: 300px; /* 根据需要调整 */
  44. background: url('../../assets/images/user.png') no-repeat center center / cover;
  45. overflow: hidden;
  46. margin: 0 0; /* 只保留上下外边距 */
  47. border-radius: 0; /* 移除圆角 */
  48. /* 添加过渡效果 */
  49. transition: background-image 1s ease-in-out;
  50. .banner-content {
  51. position: absolute;
  52. top: 0;
  53. left: 0;
  54. right: 0;
  55. bottom: 0;
  56. display: flex;
  57. flex-direction: column;
  58. justify-content: space-between;
  59. padding: 16px;
  60. box-sizing: border-box;
  61. }
  62. .banner-header {
  63. font-size: 20px;
  64. font-weight: bold;
  65. color: white;
  66. }
  67. .banner-footer {
  68. position: absolute;
  69. bottom: 60px; /* 调整按钮的位置 */
  70. left: 0;
  71. right: 0;
  72. padding: 0 16px; /* 调整左右内边距 */
  73. }
  74. .banner-body {
  75. display: flex;
  76. justify-content: space-between;
  77. align-items: center;
  78. margin-top: 16px;
  79. }
  80. .avatar-stack {
  81. position: relative;
  82. display: inline-block;
  83. margin-left: 8px; /* 向左移动 8px */
  84. .avatar {
  85. width: 40px;
  86. height: 40px;
  87. border-radius: 50%;
  88. position: absolute;
  89. box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
  90. &:nth-child(2) {
  91. left: 16px;
  92. }
  93. &:nth-child(3) {
  94. left: 32px;
  95. }
  96. }
  97. }
  98. .expert-info {
  99. font-size: 16px;
  100. color: white;
  101. margin-left: 8px; /* 向左移动 8px */
  102. margin-bottom: 16px; /* 增加底部间距 */
  103. }
  104. .banner-footer {
  105. position: relative; /* 使用相对定位 */
  106. padding: 0 16px; /* 调整左右内边距 */
  107. }
  108. .full-width-button {
  109. width: 100%; /* 占满整个宽度 */
  110. }
  111. .banner-bottom {
  112. position: absolute;
  113. bottom: 0;
  114. left: 0;
  115. right: 0;
  116. background: rgba(0, 0, 0, 0.7); /* 深蓝色半透明 */
  117. padding: 16px;
  118. border-radius: 0 0 10px 10px; /* 圆角 */
  119. .bottom-content {
  120. display: flex;
  121. justify-content: space-between;
  122. align-items: center;
  123. }
  124. .left-content {
  125. font-size: 14px;
  126. color: white;
  127. }
  128. .right-content {
  129. font-size: 14px;
  130. color: white;
  131. }
  132. }
  133. }
  134. // 推荐医生
  135. .recommended-doctors {
  136. margin: 16px 0;
  137. padding: 0 16px;
  138. background: white;
  139. border-radius: 10px;
  140. box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  141. width: 100%;
  142. max-width: 960px; /* 最大宽度 */
  143. }
  144. .header {
  145. display: flex;
  146. justify-content: space-between;
  147. align-items: center;
  148. padding: 16px 0;
  149. }
  150. .header .title {
  151. font-size: 16px;
  152. font-family: Roboto, "Helvetica Neue", sans-serif;
  153. color: #000000;
  154. line-height: 21px; /* 确保高度一致 */
  155. }
  156. .header .subtitle {
  157. font-size: 14px;
  158. color: #999;
  159. }
  160. .scroll-container {
  161. display: flex;
  162. overflow-x: auto;
  163. scroll-snap-type: x mandatory;
  164. position: relative;
  165. width: 100%; /* 宽度为100%,确保容器不会过大 */
  166. min-height: 200px; /* 设置最小高度 */
  167. white-space: nowrap; /* 防止换行 */
  168. }
  169. .card {
  170. display: inline-flex; /* 使用inline-flex以允许水平排列 */
  171. flex-direction: column;
  172. align-items: center;
  173. background: #f8f8f8;
  174. border-radius: 10px;
  175. padding: 16px;
  176. text-align: center;
  177. scroll-snap-align: start;
  178. min-width: 200px; /* 确保卡片有一定的宽度 */
  179. transition: transform 0.5s ease-in-out;
  180. margin-right: 16px; /* 卡片间距 */
  181. position: relative;
  182. }
  183. .card .tag {
  184. font-size: 12px;
  185. background: #ff4d4d;
  186. color: white;
  187. padding: 4px 8px;
  188. border-radius: 4px;
  189. position: absolute;
  190. top: 16px;
  191. left: 16px;
  192. }
  193. .card .avatar {
  194. width: 80px;
  195. height: 80px;
  196. border-radius: 50%;
  197. margin-bottom: 8px;
  198. }
  199. .card .name {
  200. font-size: 16px;
  201. font-weight: bold;
  202. margin-bottom: 4px;
  203. }
  204. .card .specialty {
  205. font-size: 14px;
  206. color: #666;
  207. margin-bottom: 8px;
  208. }
  209. .card ion-button {
  210. width: 100%; /* 占满卡片的宽度 */
  211. margin-top: 8px;
  212. }
  213. .controls {
  214. display: flex;
  215. justify-content: space-between;
  216. margin-top: 16px;
  217. button {
  218. margin: 0 8px;
  219. padding: 8px 16px;
  220. border: none;
  221. border-radius: 4px;
  222. cursor: pointer;
  223. background-color: #007bff;
  224. color: white;
  225. font-size: 14px;
  226. transition: background-color 0.3s;
  227. &:hover {
  228. background-color: #0056b3;
  229. }
  230. }
  231. }
  232. /* 边界提示 */
  233. .scroll-container::before,
  234. .scroll-container::after {
  235. content: '';
  236. position: absolute;
  237. top: 0;
  238. bottom: 0;
  239. width: 50px; /* 边界提示区域的宽度 */
  240. z-index: 1;
  241. pointer-events: none; /* 使提示区域不影响触摸事件 */
  242. }
  243. /* 媒体查询 - 适应小屏幕 */
  244. @media (max-width: 600px) {
  245. .card {
  246. min-width: 150px; /* 减小卡片宽度以适应小屏幕 */
  247. }
  248. .scroll-container::before,
  249. .scroll-container::after {
  250. width: 30px; /* 减小边界提示区域的宽度 */
  251. }
  252. }
  253. // 功能区
  254. .function-area {
  255. margin: 16px 0;
  256. padding: 0 16px;
  257. background: white;
  258. border-radius: 10px;
  259. box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  260. width: 100%;
  261. max-width: 960px; /* 最大宽度 */
  262. }
  263. .function-row {
  264. display: flex; // 使用 Flexbox 布局
  265. justify-content: space-between; // 按空间均匀分布
  266. align-items: center; // 垂直居中
  267. overflow-x: auto; // 允许水平滚动
  268. scroll-snap-type: x mandatory; // 启用滚动捕捉
  269. -webkit-overflow-scrolling: touch; // 平滑滚动
  270. padding: 16px 0;
  271. .function-item {
  272. flex: 1 0 20%; // 每个项目占 20% 宽度
  273. min-width: 0; // 确保项目可以缩小
  274. display: flex;
  275. flex-direction: column;
  276. align-items: center;
  277. text-align: center;
  278. scroll-snap-align: start; // 滚动时对齐
  279. .icon {
  280. font-size: 24px;
  281. margin-bottom: 8px;
  282. }
  283. .label {
  284. font-size: 14px;
  285. color: #333;
  286. }
  287. }
  288. }
  289. // 响应式设计
  290. @media (max-width: 768px) {
  291. .function-row {
  292. .function-item {
  293. .icon {
  294. font-size: 20px; // 减小图标大小
  295. }
  296. .label {
  297. font-size: 12px; // 减小标签文字大小
  298. }
  299. }
  300. }
  301. .promotion-carousel .poster {
  302. min-height: 150px; // 减小海报高度
  303. }
  304. .floating-action-button {
  305. width: 50px;
  306. height: 50px;
  307. ion-icon {
  308. font-size: 20px; // 减小图标大小
  309. }
  310. .label {
  311. font-size: 10px; // 减小标签文字大小
  312. }
  313. }
  314. }