index.scss 13 KB

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