index.scss 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716
  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. display: 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. .chunk10 {
  116. @extend .chunk1;
  117. >div,
  118. >view {
  119. display: initial;
  120. }
  121. }
  122. .chunk11 {
  123. @extend .chunk1;
  124. >div,
  125. >view {
  126. @extend .mb-spac;
  127. >div,
  128. >view {
  129. flex: 1;
  130. }
  131. }
  132. }
  133. .chunk2 {
  134. @extend %chunk-base;
  135. @extend .childs-fcjb-mbd2;
  136. padding-top: 0;
  137. border-bottom: solid $border-color 1px;
  138. >div,
  139. >view {
  140. >div:nth-child(2) {
  141. flex: 1;
  142. text-align: right;
  143. margin-left: $p-spac;
  144. }
  145. }
  146. }
  147. .chunk3 {
  148. @extend %chunk-base;
  149. padding-top: 0;
  150. display: flex;
  151. align-items: center;
  152. border-bottom: solid $border-color 1px;
  153. }
  154. .chunk4 {
  155. @extend %chunk-base;
  156. margin-bottom: 0;
  157. >div {
  158. margin-top: $p-spacd2;
  159. }
  160. }
  161. .chunk5 {
  162. >* {
  163. @extend .p-spac;
  164. @extend .defbb;
  165. span,
  166. label {
  167. color: $label-color;
  168. }
  169. }
  170. }
  171. .chunk,
  172. .chunk1,
  173. .chunk2 {
  174. >div,
  175. >view {
  176. >span:first-child,
  177. >label:first-child {
  178. color: $label-color;
  179. }
  180. }
  181. }
  182. // 间距对象
  183. $spac-map: (
  184. 0: (0: 't',
  185. 1: 'top',
  186. ),
  187. 1: (0: 'b',
  188. 1: 'bottom',
  189. ),
  190. 2: (0: 'l',
  191. 1: 'left',
  192. ),
  193. 3: (0: 'r',
  194. 1: 'right',
  195. ),
  196. );
  197. // 循环 $p-spac $j
  198. @for $j from 1 to 5 {
  199. // 除以 $j
  200. $suffix: if($j ==1, '', 'd' + $j);
  201. // 乘以 $j
  202. $suffixm: if($j ==1, '', 'm' + $j);
  203. // margin $p-spac除数
  204. #{$container}.m-spac#{$suffix} {
  205. margin: ($p-spac / $j);
  206. }
  207. // margin $p-spac倍数
  208. #{$container}.m-spac#{$suffixm} {
  209. margin: $p-spac * $j;
  210. }
  211. // margin $p-spac除数 负值
  212. #{$container}.nm-spac#{$suffix} {
  213. margin: ($p-spac / -$j);
  214. }
  215. // padding $p-spac除数
  216. #{$container}.p-spac#{$suffix} {
  217. padding: ($p-spac / $j);
  218. }
  219. // padding $p-spac倍数
  220. #{$container}.p-spac#{$suffixm} {
  221. padding: $p-spac * $j;
  222. }
  223. }
  224. // 循环 $p-spac $j
  225. @for $j from 1 to 5 {
  226. // 除以 $j
  227. $suffix: if($j ==1, '', 'd' + $j);
  228. // 乘以 $j
  229. $suffixm: if($j ==1, '', 'm' + $j);
  230. //循环$spac-map
  231. @for $i from 0 to 4 {
  232. $t: map-get($spac-map, $i);
  233. // 4方向 $p-spac除数
  234. #{$container}.#{map-get($t,0)}-spac#{ $suffix} {
  235. #{map-get($t,1)}: ($p-spac / $j);
  236. }
  237. // margin 4方向 $p-spac倍数
  238. #{$container}.m#{map-get($t,0)}-spac#{ $suffixm} {
  239. margin-#{map-get($t,1)}: $p-spac * $j;
  240. }
  241. // margin 4方向 $p-spac除数
  242. @if($j>1) {
  243. #{$container}.m#{map-get($t,0)}-spac#{ $suffix} {
  244. margin-#{map-get($t,1)}: ($p-spac / $j);
  245. }
  246. }
  247. // margin 4方向 $p-spac除数 负值
  248. #{$container}.nm#{map-get($t,0)}-spac#{ $suffix} {
  249. margin-#{map-get($t,1)}: ($p-spac / -$j);
  250. }
  251. // padding 4方向 $p-spac倍数
  252. #{$container}.p#{map-get($t,0)}-spac#{ $suffixm} {
  253. padding-#{map-get($t,1)}: $p-spac * $j;
  254. }
  255. // padding 4方向 $p-spac除数
  256. #{$container}.p#{map-get($t,0)}-spac#{ $suffix} {
  257. padding-#{map-get($t,1)}: ($p-spac / $j);
  258. }
  259. }
  260. }
  261. // 单行省略
  262. .ellipsis {
  263. overflow: hidden;
  264. text-overflow: ellipsis;
  265. white-space: nowrap;
  266. }
  267. // 两行省略
  268. .ellipsis-2 {
  269. display: -webkit-box;
  270. overflow: hidden;
  271. text-overflow: ellipsis;
  272. -webkit-line-clamp: 2;
  273. -webkit-box-orient: vertical;
  274. }
  275. // 三行省略
  276. .ellipsis-3 {
  277. display: -webkit-box;
  278. overflow: hidden;
  279. text-overflow: ellipsis;
  280. -webkit-line-clamp: 3;
  281. -webkit-box-orient: vertical;
  282. }
  283. body {
  284. .order-pull-refresh .van-list__finished-text {
  285. margin-top: 5px;
  286. background-color: transparent;
  287. }
  288. .fixed-bottom {
  289. position: fixed;
  290. bottom: 0;
  291. left: 0;
  292. z-index: 10;
  293. box-sizing: border-box;
  294. width: 100%;
  295. padding: $p-spac;
  296. background-color: $bg-color;
  297. }
  298. .btns {
  299. display: flex;
  300. position: fixed;
  301. bottom: 0;
  302. left: 0;
  303. z-index: 10;
  304. box-sizing: border-box;
  305. width: 100%;
  306. padding: $p-spac;
  307. background-color: $bg-color;
  308. button {
  309. margin-right: $p-spac;
  310. // background-color: $bg-color;
  311. &:last-child {
  312. margin-right: 0;
  313. }
  314. }
  315. // 指定type的按钮
  316. button[type="submit"] {
  317. flex: 1;
  318. }
  319. }
  320. .bbb {
  321. border-bottom: solid $b-color 1px;
  322. }
  323. .bbt {
  324. border-top: solid $b-color 1px;
  325. }
  326. .pcbb {
  327. border-bottom: solid $p-color 1px;
  328. }
  329. .defb {
  330. border: solid $border-color 1px;
  331. }
  332. .defbb {
  333. border-bottom: solid $border-color 1px;
  334. }
  335. .defbt {
  336. border-top: solid $border-color 1px;
  337. }
  338. .defbrd4 {
  339. border-radius: $p-spacd4;
  340. }
  341. .relative {
  342. position: relative;
  343. }
  344. .absolute {
  345. position: absolute;
  346. }
  347. .flex {
  348. display: flex;
  349. }
  350. .flex-column {
  351. display: flex;
  352. flex-direction: column;
  353. }
  354. .flex1 {
  355. flex: 1;
  356. }
  357. .flex-start {
  358. justify-content: start;
  359. }
  360. .flex-items-start {
  361. align-items: start;
  362. }
  363. .flex-baseline {
  364. align-items: baseline;
  365. }
  366. .center {
  367. @extend %center
  368. }
  369. .justify-between {
  370. justify-content: space-between;
  371. }
  372. .vh100 {
  373. height: 100vh;
  374. }
  375. .min-vh100 {
  376. min-height: 100vh;
  377. }
  378. .w0 {
  379. width: 0;
  380. }
  381. .w100 {
  382. width: 100%;
  383. }
  384. .w50 {
  385. width: 50%;
  386. }
  387. .w30 {
  388. width: 30%;
  389. }
  390. .m-t-0 {
  391. margin-top: 0;
  392. }
  393. .m-b-0 {
  394. margin-bottom: 0;
  395. }
  396. .p-t-0 {
  397. padding-top: 0;
  398. }
  399. .p-lr-0 {
  400. padding-left: 0;
  401. padding-right: 0;
  402. }
  403. .p-b-0 {
  404. padding-bottom: 0;
  405. }
  406. .font-bold {
  407. font-weight: bold;
  408. }
  409. .text-center {
  410. text-align: center;
  411. }
  412. .text-left {
  413. text-align: left;
  414. }
  415. .text-right {
  416. text-align: right;
  417. }
  418. .inline-block {
  419. display: inline-block;
  420. }
  421. .inline {
  422. display: inline;
  423. }
  424. .gradient {
  425. opacity: 1;
  426. // transition: opacity 0.5s ease;
  427. transition-duration: 0.5s;
  428. }
  429. .hide {
  430. display: none;
  431. &.gradient {
  432. display: none;
  433. opacity: 0;
  434. // visibility: hidden;
  435. // transform: rotateX(90deg);
  436. height: 0;
  437. padding: 0;
  438. }
  439. }
  440. .s-fz {
  441. font-size: $s-fz;
  442. }
  443. .ss-fz {
  444. font-size: $ss-fz;
  445. }
  446. .p-fz {
  447. font-size: $p-fz;
  448. }
  449. .bs-fz {
  450. font-size: $bs-fz;
  451. }
  452. .b-fz {
  453. font-size: $b-fz;
  454. }
  455. .lh16 {
  456. line-height: 16px;
  457. }
  458. .initial-color {
  459. color: initial;
  460. }
  461. .p-color {
  462. color: $p-color;
  463. }
  464. .gray-color {
  465. color: $gray-color;
  466. }
  467. .label-color {
  468. color: $label-color;
  469. }
  470. .p-wcolor {
  471. color: $p-wcolor;
  472. }
  473. .p-dcolor {
  474. color: $p-dcolor;
  475. }
  476. .price-color {
  477. color: $p-price-color;
  478. }
  479. .money-bg {
  480. background-color: rgba($p-price-color, 0.1);
  481. }
  482. .bg-color {
  483. background-color: $bg-color;
  484. }
  485. .grayscale {
  486. filter: grayscale(1);
  487. }
  488. .border-box {
  489. box-sizing: border-box;
  490. }
  491. .green-color {
  492. color: $green-color;
  493. }
  494. .nowrap {
  495. white-space: nowrap;
  496. }
  497. .flex-nowrap {
  498. flex-wrap: nowrap;
  499. }
  500. .flex-wrap {
  501. flex-wrap: wrap;
  502. }
  503. .space-around {
  504. justify-content: space-around;
  505. }
  506. .com-btn-add {
  507. width: 40px;
  508. height: 40px;
  509. line-height: 40px;
  510. text-align: center;
  511. position: fixed;
  512. right: 10px;
  513. background: rgba(25, 137, 250, .8);
  514. border-radius: 50%;
  515. color: #fff;
  516. font-size: 30px;
  517. bottom: 20px;
  518. z-index: 1;
  519. }
  520. .checked {
  521. color: $p-color;
  522. border-color: rgba($p-color, 0.4);
  523. background-color: rgba($p-color, 0.1);
  524. }
  525. .sticky {
  526. top: 0;
  527. position: sticky;
  528. z-index: 1;
  529. background: $bg-color;
  530. }
  531. .pre-line {
  532. white-space: pre-line;
  533. }
  534. .required::before {
  535. content: '*';
  536. color: #F56C6C;
  537. margin-right: 4px;
  538. }
  539. .hide-child {
  540. * {
  541. display: none;
  542. }
  543. }
  544. .pointer {
  545. cursor: pointer;
  546. }
  547. .link {
  548. cursor: pointer;
  549. color: $p-color;
  550. text-decoration: underline;
  551. }
  552. .disabled {
  553. pointer-events: none;
  554. color: $gray-color;
  555. }
  556. .events-none {
  557. pointer-events: none;
  558. }
  559. }
  560. .container {
  561. background-color: $bg-color;
  562. padding: $p-spac;
  563. min-height: 100vh;
  564. box-sizing: border-box;
  565. text-align: left;
  566. }
  567. // 改写element-ui样式
  568. .el-dialog__body {
  569. color: initial;
  570. }