index.scss 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639
  1. @import 'variables';
  2. .section {
  3. position: relative;
  4. padding-left: $p-spacd2;
  5. margin: $p-spac 0;
  6. &.s-fz,
  7. &.ss-fz {
  8. padding-left: calc($p-spac / 1.5);
  9. margin-top: calc($p-spac / 1.5);
  10. margin-bottom: calc($p-spac / 1.5);
  11. }
  12. // &.b-fz {
  13. // padding-left: $p-spac;
  14. // }
  15. &::before {
  16. position: absolute;
  17. top: 0;
  18. bottom: 0;
  19. left: 0;
  20. display: block;
  21. width: 4px;
  22. margin: auto;
  23. content: '';
  24. background-color: $p-color;
  25. border-radius: 2px;
  26. }
  27. }
  28. %center {
  29. display: flex;
  30. align-items: center;
  31. justify-content: center;
  32. }
  33. %chunk-base {
  34. position: relative;
  35. box-sizing: border-box;
  36. padding: $p-spac;
  37. margin-bottom: $p-spac;
  38. overflow: hidden;
  39. &.m0 {
  40. margin: 0;
  41. }
  42. }
  43. .chunk {
  44. @extend %chunk-base;
  45. @extend %box-shadow;
  46. border: 1px solid $border-color;
  47. border-radius: $p-spacd2;
  48. line-height: normal;
  49. // &:last-child {
  50. // margin-bottom: 0;
  51. // }
  52. &.checked {
  53. border-color: $p-color;
  54. }
  55. &.checked-full {
  56. color: $p-color;
  57. background-color: rgba($p-color, .2);
  58. border-color: $p-color;
  59. }
  60. }
  61. // 第一层子元素 左对齐
  62. %childs-fc-mbd2 {
  63. font-size: $s-fz;
  64. >div,
  65. >view {
  66. @apply flex;
  67. justify-content: start;
  68. >div:first-child,
  69. >view:first-child,
  70. >span:first-child,
  71. >label:first-child {
  72. // margin-right: $p-spac;
  73. // white-space: nowrap;
  74. }
  75. // >div:nth-child(2),
  76. // >view:nth-child(2),
  77. // >span:nth-child(2),
  78. // >label:nth-child(2) {
  79. // flex: 1;
  80. // }
  81. }
  82. >div,
  83. >view,
  84. >span,
  85. >label {
  86. margin-bottom: $p-spacd2;
  87. &:last-child {
  88. margin-bottom: 0;
  89. }
  90. }
  91. >span,
  92. >label {
  93. display: inline-block;
  94. }
  95. }
  96. .childs-fc-mbd2 {
  97. @extend %childs-fc-mbd2
  98. }
  99. // 第一层子元素 两端对齐
  100. .childs-fcjb-mbd2 {
  101. @extend .childs-fc-mbd2;
  102. >div,
  103. >view {
  104. @extend %center;
  105. @extend .justify-between;
  106. // align-items: start;
  107. flex-wrap: wrap;
  108. }
  109. }
  110. .chunk1 {
  111. @extend %chunk-base;
  112. @extend %childs-fc-mbd2;
  113. border-bottom: solid $border-color 1px;
  114. }
  115. .chunk2 {
  116. @extend %chunk-base;
  117. @extend .childs-fcjb-mbd2;
  118. padding-top: 0;
  119. border-bottom: solid $border-color 1px;
  120. >div,
  121. >view {
  122. >div:nth-child(2) {
  123. flex: 1;
  124. text-align: right;
  125. margin-left: $p-spac;
  126. }
  127. }
  128. }
  129. .chunk3 {
  130. @extend %chunk-base;
  131. padding-top: 0;
  132. display: flex;
  133. align-items: center;
  134. border-bottom: solid $border-color 1px;
  135. }
  136. .chunk4 {
  137. @extend %chunk-base;
  138. margin-bottom: 0;
  139. >div {
  140. margin-top: $p-spacd2;
  141. }
  142. }
  143. .chunk,
  144. .chunk1,
  145. .chunk2 {
  146. >div,
  147. >view {
  148. >span:first-child,
  149. >label:first-child {
  150. color: $gray-color;
  151. }
  152. }
  153. }
  154. // 间距对象
  155. $spac-map: (
  156. 0: (0: 't',
  157. 1: 'top',
  158. ),
  159. 1: (0: 'b',
  160. 1: 'bottom',
  161. ),
  162. 2: (0: 'l',
  163. 1: 'left',
  164. ),
  165. 3: (0: 'r',
  166. 1: 'right',
  167. ),
  168. );
  169. // 循环 $p-spac $j
  170. @for $j from 1 to 5 {
  171. // 除以 $j
  172. $suffix: if($j ==1, '', 'd' + $j);
  173. // 乘以 $j
  174. $suffixm: if($j ==1, '', 'm' + $j);
  175. // margin $p-spac除数
  176. #{$container}.m-spac#{$suffix} {
  177. margin: ($p-spac / $j);
  178. }
  179. // margin $p-spac倍数
  180. #{$container}.m-spac#{$suffixm} {
  181. margin: $p-spac * $j;
  182. }
  183. // margin $p-spac除数 负值
  184. #{$container}.nm-spac#{$suffix} {
  185. margin: ($p-spac / -$j);
  186. }
  187. // padding $p-spac除数
  188. #{$container}.p-spac#{$suffix} {
  189. padding: ($p-spac / $j);
  190. }
  191. // padding $p-spac倍数
  192. #{$container}.p-spac#{$suffixm} {
  193. padding: $p-spac * $j;
  194. }
  195. }
  196. // 循环 $p-spac $j
  197. @for $j from 1 to 5 {
  198. // 除以 $j
  199. $suffix: if($j ==1, '', 'd' + $j);
  200. // 乘以 $j
  201. $suffixm: if($j ==1, '', 'm' + $j);
  202. //循环$spac-map
  203. @for $i from 0 to 4 {
  204. $t: map-get($spac-map, $i);
  205. // 4方向 $p-spac除数
  206. #{$container}.#{map-get($t,0)}-spac#{ $suffix} {
  207. #{map-get($t,1)}: ($p-spac / $j);
  208. }
  209. // margin 4方向 $p-spac倍数
  210. #{$container}.m#{map-get($t,0)}-spac#{ $suffixm} {
  211. margin-#{map-get($t,1)}: $p-spac * $j;
  212. }
  213. // margin 4方向 $p-spac除数
  214. @if($j>1) {
  215. #{$container}.m#{map-get($t,0)}-spac#{ $suffix} {
  216. margin-#{map-get($t,1)}: ($p-spac / $j);
  217. }
  218. }
  219. // margin 4方向 $p-spac除数 负值
  220. #{$container}.nm#{map-get($t,0)}-spac#{ $suffix} {
  221. margin-#{map-get($t,1)}: ($p-spac / -$j);
  222. }
  223. // padding 4方向 $p-spac倍数
  224. #{$container}.p#{map-get($t,0)}-spac#{ $suffixm} {
  225. padding-#{map-get($t,1)}: $p-spac * $j;
  226. }
  227. // padding 4方向 $p-spac除数
  228. #{$container}.p#{map-get($t,0)}-spac#{ $suffix} {
  229. padding-#{map-get($t,1)}: ($p-spac / $j);
  230. }
  231. }
  232. }
  233. // 单行省略,优先使用 unocss: text-ellipsis
  234. .ellipsis {
  235. overflow: hidden;
  236. text-overflow: ellipsis;
  237. white-space: nowrap;
  238. }
  239. // 两行省略
  240. .ellipsis-2 {
  241. display: -webkit-box;
  242. overflow: hidden;
  243. text-overflow: ellipsis;
  244. -webkit-line-clamp: 2;
  245. -webkit-box-orient: vertical;
  246. }
  247. // 三行省略
  248. .ellipsis-3 {
  249. display: -webkit-box;
  250. overflow: hidden;
  251. text-overflow: ellipsis;
  252. -webkit-line-clamp: 3;
  253. -webkit-box-orient: vertical;
  254. }
  255. body {
  256. .order-pull-refresh .van-list__finished-text {
  257. margin-top: 5px;
  258. background-color: transparent;
  259. }
  260. .fixed-bottom {
  261. position: fixed;
  262. bottom: 0;
  263. left: 0;
  264. z-index: 10;
  265. box-sizing: border-box;
  266. width: 100%;
  267. padding: $p-spac;
  268. background-color: $bg-color;
  269. }
  270. .btns {
  271. display: flex;
  272. position: fixed;
  273. bottom: 0;
  274. left: 0;
  275. z-index: 10;
  276. box-sizing: border-box;
  277. width: 100%;
  278. padding: $p-spac;
  279. background-color: $bg-color;
  280. button {
  281. margin-right: $p-spac;
  282. // background-color: $bg-color;
  283. &:last-child {
  284. margin-right: 0;
  285. }
  286. }
  287. // 指定type的按钮
  288. button[type="submit"] {
  289. flex: 1;
  290. }
  291. }
  292. .bbb {
  293. border-bottom: solid $b-color 1px;
  294. }
  295. .bbt {
  296. border-top: solid $b-color 1px;
  297. }
  298. .pcbb {
  299. border-bottom: solid $p-color 1px;
  300. }
  301. .defb {
  302. border: solid $border-color 1px;
  303. }
  304. .defbb {
  305. border-bottom: solid $border-color 1px;
  306. }
  307. .defbt {
  308. border-top: solid $border-color 1px;
  309. }
  310. .defbrd4 {
  311. border-radius: $p-spacd4;
  312. }
  313. .relative {
  314. position: relative;
  315. }
  316. .absolute {
  317. position: absolute;
  318. }
  319. .flex {
  320. display: flex;
  321. }
  322. .flex-column {
  323. display: flex;
  324. flex-direction: column;
  325. }
  326. .flex1 {
  327. flex: 1;
  328. }
  329. .flex-start {
  330. justify-content: start;
  331. }
  332. .flex-items-start {
  333. align-items: start;
  334. }
  335. .flex-baseline {
  336. align-items: baseline;
  337. }
  338. .center {
  339. @extend %center
  340. }
  341. .justify-between {
  342. justify-content: space-between;
  343. }
  344. .vh100 {
  345. height: 100vh;
  346. }
  347. .min-vh100 {
  348. min-height: 100vh;
  349. }
  350. .w0 {
  351. width: 0;
  352. }
  353. .w100 {
  354. width: 100%;
  355. }
  356. .w30 {
  357. width: 30%;
  358. }
  359. .m-t-0 {
  360. margin-top: 0;
  361. }
  362. .m-b-0 {
  363. margin-bottom: 0;
  364. }
  365. .p-t-0 {
  366. padding-top: 0;
  367. }
  368. .p-lr-0 {
  369. padding-left: 0;
  370. padding-right: 0;
  371. }
  372. .p-b-0 {
  373. padding-bottom: 0;
  374. }
  375. .font-bold {
  376. font-weight: bold;
  377. }
  378. .text-center {
  379. text-align: center;
  380. }
  381. .text-left {
  382. text-align: left;
  383. }
  384. .text-right {
  385. text-align: right;
  386. }
  387. .inline-block {
  388. display: inline-block;
  389. }
  390. .inline {
  391. display: inline;
  392. }
  393. .gradient {
  394. opacity: 1;
  395. // transition: opacity 0.5s ease;
  396. transition-duration: 0.5s;
  397. }
  398. .hide {
  399. display: none;
  400. &.gradient {
  401. display: none;
  402. opacity: 0;
  403. // visibility: hidden;
  404. // transform: rotateX(90deg);
  405. height: 0;
  406. padding: 0;
  407. }
  408. }
  409. .s-fz {
  410. font-size: $s-fz;
  411. }
  412. .ss-fz {
  413. font-size: $ss-fz;
  414. }
  415. .p-fz {
  416. font-size: $p-fz;
  417. }
  418. .bs-fz {
  419. font-size: $bs-fz;
  420. }
  421. .b-fz {
  422. font-size: $b-fz;
  423. }
  424. .lh16 {
  425. line-height: 16px;
  426. }
  427. .p-color {
  428. color: $p-color;
  429. }
  430. .p-wcolor {
  431. color: $p-wcolor;
  432. }
  433. .p-dcolor {
  434. color: $p-dcolor;
  435. }
  436. .price-color {
  437. color: $p-price-color;
  438. }
  439. .gray-color {
  440. color: $gray-color;
  441. }
  442. .money-bg {
  443. background-color: rgba($p-price-color, 0.1);
  444. }
  445. .bg-color {
  446. background-color: $bg-color;
  447. }
  448. .border-box {
  449. box-sizing: border-box;
  450. }
  451. .green-color {
  452. color: $green-color;
  453. }
  454. .nowrap {
  455. white-space: nowrap;
  456. }
  457. .flex-nowrap {
  458. flex-wrap: nowrap;
  459. }
  460. .flex-wrap {
  461. flex-wrap: wrap;
  462. }
  463. .space-around {
  464. justify-content: space-around;
  465. }
  466. .com-btn-add {
  467. width: 40px;
  468. height: 40px;
  469. line-height: 40px;
  470. text-align: center;
  471. position: fixed;
  472. right: 10px;
  473. background: rgba(25, 137, 250, .8);
  474. border-radius: 50%;
  475. color: #fff;
  476. font-size: 30px;
  477. bottom: 20px;
  478. z-index: 1;
  479. }
  480. .checked {
  481. color: $p-color;
  482. border-color: rgba($p-color, 0.4);
  483. background-color: rgba($p-color, 0.1);
  484. }
  485. .sticky {
  486. top: 0;
  487. position: sticky;
  488. z-index: 1;
  489. background: $bg-color;
  490. }
  491. .pre-line {
  492. white-space: pre-line;
  493. }
  494. .required::before {
  495. content: '*';
  496. color: #F56C6C;
  497. margin-right: 4px;
  498. }
  499. .hide-child {
  500. * {
  501. display: none;
  502. }
  503. }
  504. .pointer {
  505. cursor: pointer;
  506. }
  507. }
  508. .container {
  509. background-color: $bg-color;
  510. padding: $p-spac;
  511. min-height: 100vh;
  512. box-sizing: border-box;
  513. text-align: left;
  514. }