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

409 lines
6.9 KiB

1 month ago
  1. /* 页面容器 */
  2. .page-container {
  3. background-color: #f8f9fa;
  4. min-height: 100vh;
  5. padding-bottom: 40rpx;
  6. }
  7. /* 顶部栏 */
  8. .top-bar {
  9. background-color: white;
  10. position: sticky;
  11. top: 0;
  12. z-index: 100;
  13. box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
  14. }
  15. /* 搜索容器 */
  16. .search-container {
  17. padding: 20rpx 30rpx;
  18. }
  19. .search-box {
  20. display: flex;
  21. align-items: center;
  22. background-color: #f8f9fa;
  23. border-radius: 50rpx;
  24. padding: 18rpx 30rpx;
  25. }
  26. .search-icon {
  27. font-size: 32rpx;
  28. color: #999;
  29. margin-right: 20rpx;
  30. }
  31. .search-input {
  32. flex: 1;
  33. font-size: 28rpx;
  34. color: #333;
  35. height: 40rpx;
  36. }
  37. .search-clear {
  38. width: 40rpx;
  39. height: 40rpx;
  40. border-radius: 50%;
  41. background-color: #e0e0e0;
  42. color: #666;
  43. font-size: 24rpx;
  44. display: flex;
  45. align-items: center;
  46. justify-content: center;
  47. }
  48. /* 分类筛选 */
  49. .category-filters {
  50. padding: 0 20rpx 20rpx;
  51. }
  52. .filters-scroll {
  53. white-space: nowrap;
  54. height: 70rpx;
  55. }
  56. .filter-tag {
  57. display: inline-flex;
  58. align-items: center;
  59. padding: 0 30rpx;
  60. height: 60rpx;
  61. line-height: 60rpx;
  62. border-radius: 30rpx;
  63. background-color: #f8f9fa;
  64. color: #666;
  65. font-size: 26rpx;
  66. margin-right: 20rpx;
  67. }
  68. .filter-tag.active {
  69. background-color: #3a7ff3;
  70. color: white;
  71. font-weight: 500;
  72. }
  73. .filter-icon {
  74. margin-right: 8rpx;
  75. }
  76. /* 药品网格布局 */
  77. .medicine-grid {
  78. display: grid;
  79. grid-template-columns: repeat(2, 1fr);
  80. gap: 20rpx;
  81. padding: 30rpx;
  82. }
  83. /* 药品卡片 */
  84. .medicine-card {
  85. background-color: white;
  86. border-radius: 20rpx;
  87. overflow: hidden;
  88. box-shadow: 0 4rpx 15rpx rgba(0, 0, 0, 0.05);
  89. transition: transform 0.3s ease, box-shadow 0.3s ease;
  90. }
  91. .medicine-card:active {
  92. transform: translateY(-4rpx);
  93. box-shadow: 0 8rpx 25rpx rgba(0, 0, 0, 0.1);
  94. }
  95. /* 卡片图片区域 */
  96. .card-image {
  97. position: relative;
  98. width: 100%;
  99. height: 320rpx;
  100. overflow: hidden;
  101. }
  102. .medicine-img {
  103. width: 100%;
  104. height: 100%;
  105. }
  106. .card-tag {
  107. position: absolute;
  108. top: 20rpx;
  109. left: 20rpx;
  110. padding: 6rpx 16rpx;
  111. border-radius: 20rpx;
  112. font-size: 22rpx;
  113. color: white;
  114. background-color: #3a7ff3;
  115. }
  116. .card-tag.prescription {
  117. background-color: #f44336;
  118. }
  119. .card-tag.otc {
  120. background-color: #4CAF50;
  121. }
  122. .card-tag.chinese {
  123. background-color: #FF9800;
  124. }
  125. .card-tag.health {
  126. background-color: #9C27B0;
  127. }
  128. .card-tag.other {
  129. background-color: #607D8B;
  130. }
  131. .hot-tag {
  132. position: absolute;
  133. top: 20rpx;
  134. right: 20rpx;
  135. padding: 6rpx 16rpx;
  136. border-radius: 20rpx;
  137. font-size: 22rpx;
  138. color: white;
  139. background-color: #ff4444;
  140. }
  141. /* 卡片内容区域 */
  142. .card-content {
  143. padding: 25rpx;
  144. }
  145. .medicine-name {
  146. font-size: 30rpx;
  147. font-weight: bold;
  148. color: #333;
  149. margin-bottom: 10rpx;
  150. line-height: 1.4;
  151. display: -webkit-box;
  152. -webkit-line-clamp: 2;
  153. -webkit-box-orient: vertical;
  154. overflow: hidden;
  155. min-height: 84rpx;
  156. }
  157. .medicine-indication {
  158. font-size: 24rpx;
  159. color: #666;
  160. margin-bottom: 15rpx;
  161. line-height: 1.4;
  162. }
  163. .manufacturer {
  164. font-size: 24rpx;
  165. color: #999;
  166. margin-bottom: 20rpx;
  167. }
  168. /* 卡片底部 */
  169. .card-footer {
  170. display: flex;
  171. justify-content: space-between;
  172. align-items: center;
  173. margin-bottom: 15rpx;
  174. }
  175. .price-section {
  176. display: flex;
  177. align-items: center;
  178. }
  179. .current-price {
  180. color: #ff4444;
  181. font-weight: bold;
  182. display: flex;
  183. align-items: baseline;
  184. }
  185. .price-symbol {
  186. font-size: 24rpx;
  187. margin-right: 2rpx;
  188. }
  189. .price-value {
  190. font-size: 36rpx;
  191. }
  192. .original-price {
  193. font-size: 24rpx;
  194. color: #999;
  195. text-decoration: line-through;
  196. margin-left: 10rpx;
  197. }
  198. .expert-brief {
  199. display: flex;
  200. align-items: center;
  201. }
  202. .expert-avatar {
  203. width: 40rpx;
  204. height: 40rpx;
  205. border-radius: 50%;
  206. margin-right: 8rpx;
  207. }
  208. .expert-name {
  209. font-size: 24rpx;
  210. color: #666;
  211. }
  212. /* 店铺信息 */
  213. .store-brief {
  214. display: flex;
  215. align-items: center;
  216. font-size: 24rpx;
  217. color: #666;
  218. padding-top: 15rpx;
  219. border-top: 1rpx solid #f0f0f0;
  220. }
  221. .store-icon {
  222. margin-right: 8rpx;
  223. }
  224. .store-name {
  225. flex: 1;
  226. overflow: hidden;
  227. text-overflow: ellipsis;
  228. white-space: nowrap;
  229. }
  230. .distance {
  231. color: #3a7ff3;
  232. font-size: 22rpx;
  233. }
  234. /* 空状态 */
  235. .empty-state {
  236. grid-column: 1 / -1;
  237. display: flex;
  238. flex-direction: column;
  239. align-items: center;
  240. justify-content: center;
  241. padding: 100rpx 0;
  242. }
  243. .empty-image {
  244. width: 200rpx;
  245. height: 200rpx;
  246. margin-bottom: 30rpx;
  247. opacity: 0.5;
  248. }
  249. .empty-text {
  250. font-size: 32rpx;
  251. color: #999;
  252. margin-bottom: 15rpx;
  253. text-align: center;
  254. }
  255. .empty-subtext {
  256. font-size: 28rpx;
  257. color: #ccc;
  258. margin-bottom: 40rpx;
  259. }
  260. .empty-btn {
  261. width: 300rpx;
  262. height: 80rpx;
  263. line-height: 80rpx;
  264. background-color: #3a7ff3;
  265. color: white;
  266. border-radius: 12rpx;
  267. font-size: 30rpx;
  268. }
  269. /* 加载更多 */
  270. .load-more,
  271. .no-more {
  272. grid-column: 1 / -1;
  273. text-align: center;
  274. padding: 40rpx 0;
  275. color: #999;
  276. font-size: 26rpx;
  277. }
  278. .load-text {
  279. position: relative;
  280. display: inline-block;
  281. padding: 0 40rpx;
  282. }
  283. .load-text::before,
  284. .load-text::after {
  285. content: '';
  286. position: absolute;
  287. top: 50%;
  288. width: 30rpx;
  289. height: 1rpx;
  290. background-color: #ddd;
  291. }
  292. .load-text::before {
  293. left: 0;
  294. }
  295. .load-text::after {
  296. right: 0;
  297. }
  298. /* 加载中 */
  299. .loading-container {
  300. grid-column: 1 / -1;
  301. display: flex;
  302. flex-direction: column;
  303. align-items: center;
  304. justify-content: center;
  305. padding: 40rpx 0;
  306. }
  307. .loading-spinner {
  308. width: 60rpx;
  309. height: 60rpx;
  310. border: 6rpx solid #f3f3f3;
  311. border-top: 6rpx solid #3a7ff3;
  312. border-radius: 50%;
  313. animation: spin 1s linear infinite;
  314. margin-bottom: 20rpx;
  315. }
  316. @keyframes spin {
  317. 0% { transform: rotate(0deg); }
  318. 100% { transform: rotate(360deg); }
  319. }
  320. /* 返回顶部按钮 */
  321. .back-to-top {
  322. position: fixed;
  323. bottom: 120rpx;
  324. right: 30rpx;
  325. width: 80rpx;
  326. height: 80rpx;
  327. border-radius: 50%;
  328. background-color: #3a7ff3;
  329. color: white;
  330. font-size: 36rpx;
  331. display: flex;
  332. align-items: center;
  333. justify-content: center;
  334. box-shadow: 0 4rpx 15rpx rgba(58, 127, 243, 0.3);
  335. opacity: 0;
  336. transform: translateY(20rpx);
  337. transition: all 0.3s ease;
  338. z-index: 99;
  339. }
  340. .back-to-top.show {
  341. opacity: 1;
  342. transform: translateY(0);
  343. }
  344. /* 响应式调整 */
  345. @media (max-width: 700rpx) {
  346. .medicine-grid {
  347. grid-template-columns: 1fr;
  348. padding: 20rpx;
  349. }
  350. .card-image {
  351. height: 400rpx;
  352. }
  353. }