index.scss 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661
  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: $label-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. .w50 {
  357. width: 50%;
  358. }
  359. .w30 {
  360. width: 30%;
  361. }
  362. .m-t-0 {
  363. margin-top: 0;
  364. }
  365. .m-b-0 {
  366. margin-bottom: 0;
  367. }
  368. .p-t-0 {
  369. padding-top: 0;
  370. }
  371. .p-lr-0 {
  372. padding-left: 0;
  373. padding-right: 0;
  374. }
  375. .p-b-0 {
  376. padding-bottom: 0;
  377. }
  378. .font-bold {
  379. font-weight: bold;
  380. }
  381. .text-center {
  382. text-align: center;
  383. }
  384. .text-left {
  385. text-align: left;
  386. }
  387. .text-right {
  388. text-align: right;
  389. }
  390. .inline-block {
  391. display: inline-block;
  392. }
  393. .inline {
  394. display: inline;
  395. }
  396. .gradient {
  397. opacity: 1;
  398. // transition: opacity 0.5s ease;
  399. transition-duration: 0.5s;
  400. }
  401. .hide {
  402. display: none;
  403. &.gradient {
  404. display: none;
  405. opacity: 0;
  406. // visibility: hidden;
  407. // transform: rotateX(90deg);
  408. height: 0;
  409. padding: 0;
  410. }
  411. }
  412. .s-fz {
  413. font-size: $s-fz;
  414. }
  415. .ss-fz {
  416. font-size: $ss-fz;
  417. }
  418. .p-fz {
  419. font-size: $p-fz;
  420. }
  421. .bs-fz {
  422. font-size: $bs-fz;
  423. }
  424. .b-fz {
  425. font-size: $b-fz;
  426. }
  427. .lh16 {
  428. line-height: 16px;
  429. }
  430. .p-color {
  431. color: $p-color;
  432. }
  433. .gray-color {
  434. color: $gray-color;
  435. }
  436. .label-color {
  437. color: $label-color;
  438. }
  439. .p-wcolor {
  440. color: $p-wcolor;
  441. }
  442. .p-dcolor {
  443. color: $p-dcolor;
  444. }
  445. .price-color {
  446. color: $p-price-color;
  447. }
  448. .money-bg {
  449. background-color: rgba($p-price-color, 0.1);
  450. }
  451. .bg-color {
  452. background-color: $bg-color;
  453. }
  454. .border-box {
  455. box-sizing: border-box;
  456. }
  457. .green-color {
  458. color: $green-color;
  459. }
  460. .nowrap {
  461. white-space: nowrap;
  462. }
  463. .flex-nowrap {
  464. flex-wrap: nowrap;
  465. }
  466. .flex-wrap {
  467. flex-wrap: wrap;
  468. }
  469. .space-around {
  470. justify-content: space-around;
  471. }
  472. .com-btn-add {
  473. width: 40px;
  474. height: 40px;
  475. line-height: 40px;
  476. text-align: center;
  477. position: fixed;
  478. right: 10px;
  479. background: rgba(25, 137, 250, .8);
  480. border-radius: 50%;
  481. color: #fff;
  482. font-size: 30px;
  483. bottom: 20px;
  484. z-index: 1;
  485. }
  486. .checked {
  487. color: $p-color;
  488. border-color: rgba($p-color, 0.4);
  489. background-color: rgba($p-color, 0.1);
  490. }
  491. .sticky {
  492. top: 0;
  493. position: sticky;
  494. z-index: 1;
  495. background: $bg-color;
  496. }
  497. .pre-line {
  498. white-space: pre-line;
  499. }
  500. .required::before {
  501. content: '*';
  502. color: #F56C6C;
  503. margin-right: 4px;
  504. }
  505. .hide-child {
  506. * {
  507. display: none;
  508. }
  509. }
  510. .pointer {
  511. cursor: pointer;
  512. }
  513. .link {
  514. cursor: pointer;
  515. color: $p-color;
  516. text-decoration: underline;
  517. }
  518. }
  519. .container {
  520. background-color: $bg-color;
  521. padding: $p-spac;
  522. min-height: 100vh;
  523. box-sizing: border-box;
  524. text-align: left;
  525. }
  526. // 改写element-ui样式
  527. .el-dialog__body {
  528. color: initial;
  529. }