index.scss 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610
  1. // ============================================
  2. // 陇耘鲜达小程序 - 全局样式
  3. // ============================================
  4. @import './variables.scss';
  5. // ============================================
  6. // Reset
  7. // ============================================
  8. page {
  9. font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
  10. font-size: $font-size-base;
  11. color: $text-primary;
  12. background-color: $bg-gray-100;
  13. box-sizing: border-box;
  14. }
  15. view, text {
  16. box-sizing: border-box;
  17. }
  18. image {
  19. width: 100%;
  20. height: 100%;
  21. }
  22. /* uni-app 默认 button 带有边框/伪元素描边,这里统一去除 */
  23. button {
  24. border: none;
  25. }
  26. button::after {
  27. border: none;
  28. }
  29. // ============================================
  30. // 布局工具
  31. // ============================================
  32. .flex {
  33. display: flex;
  34. }
  35. .flex-center {
  36. display: flex;
  37. align-items: center;
  38. justify-content: center;
  39. }
  40. .flex-between {
  41. display: flex;
  42. align-items: center;
  43. justify-content: space-between;
  44. }
  45. .flex-col {
  46. display: flex;
  47. flex-direction: column;
  48. }
  49. .flex-wrap {
  50. flex-wrap: wrap;
  51. }
  52. .flex-1 {
  53. flex: 1;
  54. }
  55. // ============================================
  56. // 文字工具
  57. // ============================================
  58. .text-primary {
  59. color: $text-primary;
  60. }
  61. .text-regular {
  62. color: $text-regular;
  63. }
  64. .text-secondary {
  65. color: $text-secondary;
  66. }
  67. .text-placeholder {
  68. color: $text-placeholder;
  69. }
  70. .text-success {
  71. color: $success-color;
  72. }
  73. .text-warning {
  74. color: $warning-color;
  75. }
  76. .text-danger {
  77. color: $danger-color;
  78. }
  79. .text-center {
  80. text-align: center;
  81. }
  82. .text-right {
  83. text-align: right;
  84. }
  85. .text-bold {
  86. font-weight: bold;
  87. }
  88. .text-ellipsis {
  89. overflow: hidden;
  90. text-overflow: ellipsis;
  91. white-space: nowrap;
  92. }
  93. .text-ellipsis-2 {
  94. display: -webkit-box;
  95. -webkit-box-orient: vertical;
  96. -webkit-line-clamp: 2;
  97. overflow: hidden;
  98. }
  99. // ============================================
  100. // 间距工具
  101. // ============================================
  102. .mt-xs { margin-top: $spacing-xs; }
  103. .mt-sm { margin-top: $spacing-sm; }
  104. .mt-md { margin-top: $spacing-md; }
  105. .mt-lg { margin-top: $spacing-lg; }
  106. .mt-xl { margin-top: $spacing-xl; }
  107. .mb-xs { margin-bottom: $spacing-xs; }
  108. .mb-sm { margin-bottom: $spacing-sm; }
  109. .mb-md { margin-bottom: $spacing-md; }
  110. .mb-lg { margin-bottom: $spacing-lg; }
  111. .mb-xl { margin-bottom: $spacing-xl; }
  112. .ml-xs { margin-left: $spacing-xs; }
  113. .ml-sm { margin-left: $spacing-sm; }
  114. .ml-md { margin-left: $spacing-md; }
  115. .ml-lg { margin-left: $spacing-lg; }
  116. .ml-xl { margin-left: $spacing-xl; }
  117. .mr-xs { margin-right: $spacing-xs; }
  118. .mr-sm { margin-right: $spacing-sm; }
  119. .mr-md { margin-right: $spacing-md; }
  120. .mr-lg { margin-right: $spacing-lg; }
  121. .mr-xl { margin-right: $spacing-xl; }
  122. .p-xs { padding: $spacing-xs; }
  123. .p-sm { padding: $spacing-sm; }
  124. .p-md { padding: $spacing-md; }
  125. .p-lg { padding: $spacing-lg; }
  126. .p-xl { padding: $spacing-xl; }
  127. // ============================================
  128. // 按钮样式
  129. // ============================================
  130. .btn {
  131. display: flex;
  132. align-items: center;
  133. justify-content: center;
  134. height: 80rpx;
  135. padding: 0 40rpx;
  136. font-size: $font-size-base;
  137. border-radius: $radius-round;
  138. transition: all $transition-fast;
  139. &.btn-primary {
  140. background: $client-primary;
  141. color: #ffffff;
  142. }
  143. &.btn-warning {
  144. background: $supplier-primary;
  145. color: #ffffff;
  146. }
  147. &.btn-danger {
  148. background: $deliverer-primary;
  149. color: #ffffff;
  150. }
  151. &.btn-outline {
  152. background: transparent;
  153. border: 2rpx solid currentColor;
  154. }
  155. &.btn-block {
  156. width: 100%;
  157. }
  158. &.btn-small {
  159. height: 60rpx;
  160. padding: 0 24rpx;
  161. font-size: $font-size-sm;
  162. }
  163. &.btn-large {
  164. height: 96rpx;
  165. padding: 0 48rpx;
  166. font-size: $font-size-md;
  167. }
  168. &.btn-disabled {
  169. opacity: 0.5;
  170. pointer-events: none;
  171. }
  172. }
  173. // ============================================
  174. // 卡片样式
  175. // ============================================
  176. .card {
  177. background: $bg-white;
  178. border-radius: $radius-medium;
  179. box-shadow: $shadow-light;
  180. overflow: hidden;
  181. .card-header {
  182. padding: $spacing-md;
  183. border-bottom: 1rpx solid $border-light;
  184. }
  185. .card-body {
  186. padding: $spacing-md;
  187. }
  188. .card-footer {
  189. padding: $spacing-md;
  190. border-top: 1rpx solid $border-light;
  191. }
  192. }
  193. // ============================================
  194. // 状态标签
  195. // ============================================
  196. .status-tag {
  197. display: inline-flex;
  198. align-items: center;
  199. padding: 4rpx 16rpx;
  200. font-size: $font-size-xs;
  201. border-radius: 4rpx;
  202. &.status-primary {
  203. background: $client-light;
  204. color: $client-primary;
  205. }
  206. &.status-success {
  207. background: #f0f9eb;
  208. color: $success-color;
  209. }
  210. &.status-warning {
  211. background: $supplier-light;
  212. color: $supplier-primary;
  213. }
  214. &.status-danger {
  215. background: $deliverer-light;
  216. color: $deliverer-primary;
  217. }
  218. &.status-info {
  219. background: #f4f4f5;
  220. color: $info-color;
  221. }
  222. }
  223. // ============================================
  224. // 安全区域
  225. // ============================================
  226. .safe-area-bottom {
  227. padding-bottom: constant(safe-area-inset-bottom);
  228. padding-bottom: env(safe-area-inset-bottom);
  229. }
  230. .safe-area-top {
  231. padding-top: constant(safe-area-inset-top);
  232. padding-top: env(safe-area-inset-top);
  233. }
  234. // ============================================
  235. // 空状态
  236. // ============================================
  237. .empty-state {
  238. display: flex;
  239. flex-direction: column;
  240. align-items: center;
  241. justify-content: center;
  242. padding: 100rpx 0;
  243. .empty-icon {
  244. width: 200rpx;
  245. height: 200rpx;
  246. margin-bottom: $spacing-lg;
  247. opacity: 0.5;
  248. }
  249. .empty-text {
  250. color: $text-placeholder;
  251. font-size: $font-size-base;
  252. }
  253. .empty-action {
  254. margin-top: $spacing-lg;
  255. }
  256. }
  257. // ============================================
  258. // 加载状态
  259. // ============================================
  260. .loading-mask {
  261. position: fixed;
  262. top: 0;
  263. left: 0;
  264. right: 0;
  265. bottom: 0;
  266. background: rgba(0, 0, 0, 0.5);
  267. display: flex;
  268. align-items: center;
  269. justify-content: center;
  270. z-index: $z-index-modal;
  271. }
  272. // ============================================
  273. // 分割线
  274. // ============================================
  275. .divider {
  276. height: 1rpx;
  277. background: $divider-color;
  278. }
  279. // ============================================
  280. // 按钮执行中/禁用态文字颜色修正
  281. // uni-app 默认 button 在 disabled/loading 时可能把文字置灰,
  282. // 这里仅对项目内主操作按钮类保持白字,避免“登录中”发灰。
  283. // ============================================
  284. button.btn-login[disabled],
  285. button.btn-login[loading],
  286. button.save-btn[disabled],
  287. button.save-btn[loading],
  288. button.submit-btn[disabled],
  289. button.submit-btn[loading],
  290. button.btn[disabled],
  291. button.btn[loading] {
  292. color: #ffffff !important;
  293. }
  294. // 微信 button[disabled] 会覆盖背景为浅色/白色,登录主按钮加载中需保持品牌渐变
  295. button.btn-login[disabled],
  296. button.btn-login[loading] {
  297. background: linear-gradient(135deg, var(--theme-color, #07c160) 0%, #07c160 100%) !important;
  298. opacity: 1;
  299. }
  300. button.btn-login[disabled] text,
  301. button.btn-login[loading] text,
  302. button.save-btn[disabled] text,
  303. button.save-btn[loading] text,
  304. button.submit-btn[disabled] text,
  305. button.submit-btn[loading] text,
  306. button.btn[disabled] text,
  307. button.btn[loading] text {
  308. color: inherit !important;
  309. }
  310. // ============================================
  311. // Radio Size Override
  312. // ============================================
  313. // uni-app 内置 radio 组件默认尺寸可能偏大,这里统一覆盖为 16px。
  314. .uni-radio-input {
  315. width: 16px !important;
  316. height: 16px !important;
  317. }
  318. // ============================================
  319. // Client theme (对齐 mobile-ui demo)
  320. // 仅在页面根节点加 `.client-theme` 时生效,避免影响供应商/配送员端。
  321. // ============================================
  322. .client-theme {
  323. --c-brand-green: #0a9f6d;
  324. --c-brand-green-2: #11b37a;
  325. --c-brand-green-soft: #e9f9f2;
  326. --c-barley-yellow: #d6a343;
  327. --c-bg: #f5f8f7;
  328. --c-card: #ffffff;
  329. --c-text: #1f2a26;
  330. --c-muted: #6b7b74;
  331. --c-border: #dcebe4;
  332. --c-danger: #d14343;
  333. /* 详情/购物车「加入购物车」等辅按钮(对齐 product-detail demo .btn-cart) */
  334. --c-accent-orange: #f3a43b;
  335. --c-shadow: 0 8px 20px rgba(10, 159, 109, 0.12);
  336. --c-shadow-soft: 0 8px 18px rgba(10, 159, 109, 0.12);
  337. --c-radius-card: 28rpx; // ≈ 14px
  338. --c-radius-lg: 32rpx; // ≈ 16px
  339. --c-radius-md: 24rpx; // ≈ 12px
  340. --c-radius-sm: 16rpx; // ≈ 8px
  341. }
  342. .client-theme .c-card {
  343. background: var(--c-card);
  344. border: 1rpx solid var(--c-border);
  345. border-radius: var(--c-radius-card);
  346. }
  347. .client-theme .c-pill {
  348. border-radius: 999rpx;
  349. }
  350. .client-theme .c-btn-primary {
  351. background: var(--c-brand-green);
  352. color: #ffffff;
  353. }
  354. .client-theme .c-btn-accent {
  355. background: linear-gradient(145deg, var(--c-barley-yellow), #e4b458);
  356. color: #ffffff;
  357. }
  358. .client-theme .c-tag {
  359. min-height: 48rpx;
  360. padding: 0 20rpx;
  361. border-radius: 999rpx;
  362. background: var(--c-brand-green-soft);
  363. color: var(--c-brand-green);
  364. font-size: 22rpx;
  365. display: inline-flex;
  366. align-items: center;
  367. }
  368. /* 客户端二级页:通顶栏 + 内容区边距(对齐 cart/order/profile demo) */
  369. .client-theme.client-subpage {
  370. min-height: 100vh;
  371. display: flex;
  372. flex-direction: column;
  373. background: var(--c-bg);
  374. box-sizing: border-box;
  375. }
  376. .client-theme .client-subpage-hero {
  377. flex-shrink: 0;
  378. background: linear-gradient(145deg, var(--c-brand-green), var(--c-brand-green-2));
  379. color: #ffffff;
  380. padding: calc(24rpx + constant(safe-area-inset-top)) 32rpx 28rpx;
  381. padding: calc(24rpx + env(safe-area-inset-top, 0px)) 32rpx 28rpx;
  382. border-bottom-left-radius: 36rpx;
  383. border-bottom-right-radius: 36rpx;
  384. box-shadow: var(--c-shadow);
  385. box-sizing: border-box;
  386. }
  387. .client-theme .client-subpage-hero__title {
  388. display: block;
  389. font-size: 36rpx;
  390. font-weight: 700;
  391. line-height: 1.25;
  392. }
  393. .client-theme .client-subpage-hero__sub {
  394. display: block;
  395. margin-top: 12rpx;
  396. font-size: 24rpx;
  397. opacity: 0.9;
  398. line-height: 1.35;
  399. }
  400. .client-theme .client-subpage-scroll {
  401. flex: 1;
  402. min-height: 0;
  403. height: 0;
  404. width: 100%;
  405. box-sizing: border-box;
  406. }
  407. .client-theme .client-subpage-body {
  408. padding: 24rpx 32rpx;
  409. padding-bottom: calc(32rpx + constant(safe-area-inset-bottom));
  410. padding-bottom: calc(32rpx + env(safe-area-inset-bottom, 0px));
  411. box-sizing: border-box;
  412. }
  413. // ============================================
  414. // 商品图统一规范(列表/购物车/订单等缩略图)
  415. // - 容器固定尺寸,避免不同原图比例撑坏卡片
  416. // - 图片统一裁切填充,保证列表视觉一致
  417. // ============================================
  418. .sq-product-thumb {
  419. position: relative;
  420. overflow: hidden;
  421. flex-shrink: 0;
  422. border-radius: 20rpx;
  423. background: linear-gradient(145deg, #f4fbf8, #e4f6ef);
  424. }
  425. .sq-product-thumb--md {
  426. width: 168rpx;
  427. height: 168rpx;
  428. }
  429. .sq-product-thumb--sm {
  430. width: 160rpx;
  431. height: 160rpx;
  432. }
  433. .sq-product-thumb image,
  434. .sq-product-thumb .uni-image {
  435. display: block;
  436. width: 100%;
  437. height: 100%;
  438. }
  439. // ============================================
  440. // 金额/单价全局视觉统一
  441. // 规则:涉及 price/amount/money/total/fee 的展示文本统一红色 + 小一档字号
  442. // ============================================
  443. $sq-amount-color: #d32f2f;
  444. $sq-amount-font-size: 24rpx;
  445. text[class*='price'],
  446. text[class*='amount'],
  447. text[class*='money'],
  448. text[class*='total'],
  449. text[class*='subtotal'],
  450. text[class*='fee'],
  451. view[class*='price'],
  452. view[class*='amount'],
  453. view[class*='money'],
  454. view[class*='total'],
  455. view[class*='subtotal'],
  456. view[class*='fee'],
  457. .price,
  458. .amount,
  459. .money,
  460. .total,
  461. .subtotal,
  462. .fee {
  463. color: $sq-amount-color !important;
  464. font-size: $sq-amount-font-size !important;
  465. }
  466. // ============================================
  467. // 统一大背景头部规范(适配刘海/胶囊)
  468. // - 顶部纯背景留白:safeTop + 统一额外间距
  469. // - 右侧永远预留胶囊安全区,不放业务按钮
  470. // ============================================
  471. .sq-hero-header {
  472. background: linear-gradient(145deg, var(--c-brand-green), var(--c-brand-green-2));
  473. border-bottom-left-radius: 40rpx;
  474. border-bottom-right-radius: 40rpx;
  475. box-shadow: var(--c-shadow);
  476. padding: calc(88rpx + var(--sq-safe-top, env(safe-area-inset-top, 0px)))
  477. calc(32rpx + var(--sq-capsule-right-safe, 96px))
  478. 32rpx
  479. 32rpx;
  480. box-sizing: border-box;
  481. overflow: hidden;
  482. }
  483. .sq-hero-header--supplier {
  484. background: linear-gradient(145deg, #087f57, #0a9f6d);
  485. }
  486. .sq-hero-header--deliverer {
  487. background: linear-gradient(145deg, #087f57, #0a9f6d);
  488. }
  489. .sq-hero-header--compact {
  490. padding-top: calc(72rpx + var(--sq-safe-top, env(safe-area-inset-top, 0px)));
  491. }
  492. /* 客户端 tab 页面头部:不占胶囊右侧安全位,避免右侧内容被额外挤压 */
  493. .sq-hero-header--client {
  494. padding-right: 32rpx;
  495. }
  496. .sq-hero-back-row {
  497. display: flex;
  498. align-items: center;
  499. min-height: 64rpx;
  500. margin-bottom: 14rpx;
  501. }
  502. .sq-hero-back-btn {
  503. width: 64rpx;
  504. height: 64rpx;
  505. border-radius: 32rpx;
  506. background: rgba(255, 255, 255, 0.2);
  507. border: 1rpx solid rgba(255, 255, 255, 0.3);
  508. display: inline-flex;
  509. align-items: center;
  510. justify-content: center;
  511. }
  512. .sq-hero-back-btn text {
  513. color: #ffffff;
  514. font-size: 42rpx;
  515. line-height: 1;
  516. transform: translateX(-2rpx);
  517. }
  518. .sq-hero-back-title {
  519. margin-left: 16rpx;
  520. color: #ffffff;
  521. font-size: 34rpx;
  522. font-weight: 700;
  523. }