index.scss 9.4 KB

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