index.scss 9.4 KB

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