index.scss 13 KB

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