form.wxss 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521
  1. /* ==================
  2. 表单
  3. ==================== */
  4. .form-group {
  5. /*background-color: var(--white);影响圆角*/
  6. padding: 1rpx 30rpx;
  7. display: flex;
  8. align-items: center;
  9. min-height: 100rpx;
  10. justify-content: space-between;
  11. }
  12. .form-group+.form-group {
  13. border-top: 1rpx solid #eee;
  14. }
  15. .form-group .title {
  16. text-align: justify;
  17. padding-right: 30rpx;
  18. font-size: 30rpx;
  19. position: relative;
  20. height: 60rpx;
  21. line-height: 60rpx;
  22. }
  23. .form-group input {
  24. flex: 1;
  25. font-size: 30rpx;
  26. color: #555;
  27. padding-right: 20rpx;
  28. }
  29. .form-group>text[class*="icon-"] {
  30. font-size: 36rpx;
  31. padding: 0;
  32. box-sizing: border-box;
  33. }
  34. .form-group textarea {
  35. margin: 32rpx 0 30rpx;
  36. height: 4.6em;
  37. width: 100%;
  38. line-height: 1.2em;
  39. flex: 1;
  40. font-size: 28rpx;
  41. padding: 0;
  42. text-align: left;
  43. }
  44. .form-group.align-start .title {
  45. height: 1em;
  46. margin-top: 32rpx;
  47. line-height: 1em;
  48. }
  49. .form-group picker {
  50. flex: 1;
  51. padding-right: 40rpx;
  52. overflow: hidden;
  53. position: relative;
  54. }
  55. .form-group picker .picker {
  56. line-height: 100rpx;
  57. font-size: 28rpx;
  58. text-overflow: ellipsis;
  59. white-space: nowrap;
  60. overflow: hidden;
  61. width: 100%;
  62. text-align: right;
  63. }
  64. .form-group picker::after {
  65. font-family: "icon";
  66. display: block;
  67. content: "\e6a3";
  68. position: absolute;
  69. font-size: 34rpx;
  70. color: var(--grey);
  71. line-height: 100rpx;
  72. width: 60rpx;
  73. text-align: center;
  74. top: 0;
  75. bottom: 0;
  76. right: -20rpx;
  77. margin: auto;
  78. }
  79. .form-group textarea[disabled],
  80. .form-group textarea[disabled] .placeholder {
  81. color: transparent;
  82. }
  83. /* ==================
  84. 开关
  85. ==================== */
  86. switch,
  87. checkbox,
  88. radio {
  89. position: relative;
  90. }
  91. switch::after,
  92. switch::before {
  93. font-family: "icon";
  94. content: "\e645";
  95. position: absolute;
  96. color: var(--white) !important;
  97. top: 0%;
  98. left: 0rpx;
  99. font-size: 26rpx;
  100. line-height: 26px;
  101. width: 50%;
  102. text-align: center;
  103. pointer-events: none;
  104. transform: scale(0, 0);
  105. transition: all 0.3s ease-in-out 0s;
  106. z-index: 9;
  107. bottom: 0;
  108. height: 26px;
  109. margin: auto;
  110. }
  111. switch::before {
  112. content: "\e646";
  113. right: 0;
  114. transform: scale(1, 1);
  115. left: auto;
  116. }
  117. switch[checked]::after,
  118. switch.checked::after {
  119. transform: scale(1, 1);
  120. }
  121. switch[checked]::before,
  122. switch.checked::before {
  123. transform: scale(0, 0);
  124. }
  125. switch[checked]::before {
  126. transform: scale(0, 0);
  127. }
  128. radio::before,
  129. checkbox::before {
  130. font-family: "icon";
  131. content: "\e645";
  132. position: absolute;
  133. color: var(--white) !important;
  134. top: 50%;
  135. margin-top: -8px;
  136. right: 5px;
  137. font-size: 32rpx;
  138. line-height: 16px;
  139. pointer-events: none;
  140. transform: scale(1, 1);
  141. transition: all 0.3s ease-in-out 0s;
  142. z-index: 9;
  143. }
  144. radio .wx-radio-input,
  145. checkbox .wx-checkbox-input {
  146. margin: 0;
  147. width: 24px;
  148. height: 24px;
  149. }
  150. checkbox.round .wx-checkbox-input {
  151. border-radius: 100rpx;
  152. }
  153. switch .wx-switch-input {
  154. border: none;
  155. padding: 0 24px;
  156. width: 48px;
  157. height: 26px;
  158. margin: 0;
  159. border-radius: 100rpx;
  160. }
  161. switch .wx-switch-input:not([class*="bg-"]) {
  162. background: var(--grey) !important;
  163. }
  164. switch .wx-switch-input::after {
  165. margin: auto;
  166. width: 26px;
  167. height: 26px;
  168. border-radius: 100rpx;
  169. left: 0rpx;
  170. top: 0rpx;
  171. bottom: 0rpx;
  172. position: absolute;
  173. transform: scale(0.9, 0.9);
  174. transition: all 0.1s ease-in-out 0s;
  175. }
  176. switch .wx-switch-input.wx-switch-input-checked::after {
  177. margin: auto;
  178. left: 22px;
  179. box-shadow: none;
  180. transform: scale(0.9, 0.9);
  181. }
  182. radio-group {
  183. display: inline-block;
  184. }
  185. switch.radius .wx-switch-input::after,
  186. switch.radius .wx-switch-input,
  187. switch.radius .wx-switch-input::before {
  188. border-radius: 10rpx;
  189. }
  190. switch .wx-switch-input::before,
  191. radio.radio::before,
  192. checkbox .wx-checkbox-input::before,
  193. radio .wx-radio-input::before,
  194. radio.radio::before {
  195. display: none;
  196. }
  197. radio.radio[checked]::after {
  198. content: "";
  199. background-color: transparent;
  200. display: block;
  201. position: absolute;
  202. width: 8px;
  203. height: 8px;
  204. z-index: 999;
  205. top: 0rpx;
  206. left: 0rpx;
  207. right: 0;
  208. bottom: 0;
  209. margin: auto;
  210. border-radius: 200rpx;
  211. border: 8px solid var(--white) !important;
  212. }
  213. .switch-sex::after {
  214. content: "\e71c";
  215. }
  216. .switch-sex::before {
  217. content: "\e71a";
  218. }
  219. .switch-sex .wx-switch-input {
  220. background: var(--red) !important;
  221. border-color: var(--red) !important;
  222. }
  223. .switch-sex[checked] .wx-switch-input {
  224. background: var(--blue) !important;
  225. border-color: var(--blue) !important;
  226. }
  227. switch.red[checked] .wx-switch-input,
  228. checkbox.red[checked] .wx-checkbox-input,
  229. radio.red[checked] .wx-radio-input {
  230. border-color: var(--red) !important;
  231. }
  232. switch.orange[checked] .wx-switch-input,
  233. checkbox.orange[checked] .wx-checkbox-input,
  234. radio.orange[checked] .wx-radio-input {
  235. border-color: var(--orange) !important;
  236. }
  237. switch.yellow[checked] .wx-switch-input,
  238. checkbox.yellow[checked] .wx-checkbox-input,
  239. radio.yellow[checked] .wx-radio-input {
  240. border-color: var(--yellow) !important;
  241. }
  242. switch.olive[checked] .wx-switch-input,
  243. checkbox.olive[checked] .wx-checkbox-input,
  244. radio.olive[checked] .wx-radio-input {
  245. border-color: var(--olive) !important;
  246. }
  247. switch.green[checked] .wx-switch-input,
  248. checkbox.green[checked] .wx-checkbox-input,
  249. checkbox[checked] .wx-checkbox-input,
  250. radio.green[checked] .wx-radio-input {
  251. border-color: var(--green) !important;
  252. }
  253. switch.cyan[checked] .wx-switch-input,
  254. checkbox.cyan[checked] .wx-checkbox-input,
  255. radio.cyan[checked] .wx-radio-input {
  256. border-color: var(--cyan) !important;
  257. }
  258. switch.blue[checked] .wx-switch-input,
  259. checkbox.blue[checked] .wx-checkbox-input,
  260. radio.blue[checked] .wx-radio-input {
  261. border-color: var(--blue) !important;
  262. }
  263. switch.purple[checked] .wx-switch-input,
  264. checkbox.purple[checked] .wx-checkbox-input,
  265. radio.purple[checked] .wx-radio-input {
  266. border-color: var(--purple) !important;
  267. }
  268. switch.mauve[checked] .wx-switch-input,
  269. checkbox.mauve[checked] .wx-checkbox-input,
  270. radio.mauve[checked] .wx-radio-input {
  271. border-color: var(--mauve) !important;
  272. }
  273. switch.pink[checked] .wx-switch-input,
  274. checkbox.pink[checked] .wx-checkbox-input,
  275. radio.pink[checked] .wx-radio-input {
  276. border-color: var(--pink) !important;
  277. }
  278. switch.brown[checked] .wx-switch-input,
  279. checkbox.brown[checked] .wx-checkbox-input,
  280. radio.brown[checked] .wx-radio-input {
  281. border-color: var(--brown) !important;
  282. }
  283. switch.grey[checked] .wx-switch-input,
  284. checkbox.grey[checked] .wx-checkbox-input,
  285. radio.grey[checked] .wx-radio-input {
  286. border-color: var(--grey) !important;
  287. }
  288. switch.gray[checked] .wx-switch-input,
  289. checkbox.gray[checked] .wx-checkbox-input,
  290. radio.gray[checked] .wx-radio-input {
  291. border-color: var(--grey) !important;
  292. }
  293. switch.black[checked] .wx-switch-input,
  294. checkbox.black[checked] .wx-checkbox-input,
  295. radio.black[checked] .wx-radio-input {
  296. border-color: var(--black) !important;
  297. }
  298. switch.white[checked] .wx-switch-input,
  299. checkbox.white[checked] .wx-checkbox-input,
  300. radio.white[checked] .wx-radio-input {
  301. border-color: var(--white) !important;
  302. }
  303. switch.red[checked] .wx-switch-input.wx-switch-input-checked,
  304. checkbox.red[checked] .wx-checkbox-input,
  305. radio.red[checked] .wx-radio-input {
  306. background-color: var(--red) !important;
  307. color: var(--white) !important;
  308. }
  309. switch.orange[checked] .wx-switch-input,
  310. checkbox.orange[checked] .wx-checkbox-input,
  311. radio.orange[checked] .wx-radio-input {
  312. background-color: var(--orange) !important;
  313. color: var(--white) !important;
  314. }
  315. switch.yellow[checked] .wx-switch-input,
  316. checkbox.yellow[checked] .wx-checkbox-input,
  317. radio.yellow[checked] .wx-radio-input {
  318. background-color: var(--yellow) !important;
  319. color: var(--black) !important;
  320. }
  321. switch.olive[checked] .wx-switch-input,
  322. checkbox.olive[checked] .wx-checkbox-input,
  323. radio.olive[checked] .wx-radio-input {
  324. background-color: var(--olive) !important;
  325. color: var(--white) !important;
  326. }
  327. switch.green[checked] .wx-switch-input,
  328. switch[checked] .wx-switch-input,
  329. checkbox.green[checked] .wx-checkbox-input,
  330. checkbox[checked] .wx-checkbox-input,
  331. radio.green[checked] .wx-radio-input,
  332. radio[checked] .wx-radio-input {
  333. background-color: var(--green) !important;
  334. color: var(--white) !important;
  335. }
  336. switch.cyan[checked] .wx-switch-input,
  337. checkbox.cyan[checked] .wx-checkbox-input,
  338. radio.cyan[checked] .wx-radio-input {
  339. background-color: var(--cyan) !important;
  340. color: var(--white) !important;
  341. }
  342. switch.blue[checked] .wx-switch-input,
  343. checkbox.blue[checked] .wx-checkbox-input,
  344. radio.blue[checked] .wx-radio-input {
  345. background-color: var(--blue) !important;
  346. color: var(--white) !important;
  347. }
  348. switch.purple[checked] .wx-switch-input,
  349. checkbox.purple[checked] .wx-checkbox-input,
  350. radio.purple[checked] .wx-radio-input {
  351. background-color: var(--purple) !important;
  352. color: var(--white) !important;
  353. }
  354. switch.mauve[checked] .wx-switch-input,
  355. checkbox.mauve[checked] .wx-checkbox-input,
  356. radio.mauve[checked] .wx-radio-input {
  357. background-color: var(--mauve) !important;
  358. color: var(--white) !important;
  359. }
  360. switch.pink[checked] .wx-switch-input,
  361. checkbox.pink[checked] .wx-checkbox-input,
  362. radio.pink[checked] .wx-radio-input {
  363. background-color: var(--pink) !important;
  364. color: var(--white) !important;
  365. }
  366. switch.brown[checked] .wx-switch-input,
  367. checkbox.brown[checked] .wx-checkbox-input,
  368. radio.brown[checked] .wx-radio-input {
  369. background-color: var(--brown) !important;
  370. color: var(--white) !important;
  371. }
  372. switch.grey[checked] .wx-switch-input,
  373. checkbox.grey[checked] .wx-checkbox-input,
  374. radio.grey[checked] .wx-radio-input {
  375. background-color: var(--grey) !important;
  376. color: var(--white) !important;
  377. }
  378. switch.gray[checked] .wx-switch-input,
  379. checkbox.gray[checked] .wx-checkbox-input,
  380. radio.gray[checked] .wx-radio-input {
  381. background-color: #f0f0f0 !important;
  382. color: var(--black) !important;
  383. }
  384. switch.black[checked] .wx-switch-input,
  385. checkbox.black[checked] .wx-checkbox-input,
  386. radio.black[checked] .wx-radio-input {
  387. background-color: var(--black) !important;
  388. color: var(--white) !important;
  389. }
  390. switch.white[checked] .wx-switch-input,
  391. checkbox.white[checked] .wx-checkbox-input,
  392. radio.white[checked] .wx-radio-input {
  393. background-color: var(--white) !important;
  394. color: var(--black) !important;
  395. }
  396. .form-group .upload-img{
  397. display: flex;
  398. flex-wrap: wrap;
  399. overflow: hidden;
  400. flex: 1;
  401. }
  402. .form-group .upload-img>view{
  403. width: 25%;
  404. padding-bottom: calc((100% - 60rpx)/4);
  405. height: 0;
  406. width: calc((100% - 60rpx)/4);
  407. margin-right: 12rpx;
  408. margin-bottom: 20rpx;
  409. border-radius: 6rpx;
  410. position: relative;
  411. overflow: hidden;
  412. }
  413. .form-group .upload-img .bg-img {
  414. background-size: cover;
  415. background-position: center;
  416. background-repeat: no-repeat;
  417. }
  418. .form-group .upload-img .bg-img image {
  419. width: 100%;
  420. height: 100%;
  421. position: absolute;
  422. }
  423. .form-group .upload-img>view>text[class*="icon-"] {
  424. font-size: 52rpx;
  425. position: absolute;
  426. color: var(--grey);
  427. margin: auto;
  428. top: 0;
  429. bottom: 0;
  430. left: 0;
  431. right: 0;
  432. display: flex;
  433. justify-content: center;
  434. align-items: center;
  435. flex-direction: column;
  436. }
  437. .form-group .upload-img .tag {
  438. position: absolute;
  439. right: 0;
  440. top: 0;
  441. border-bottom-left-radius: 6rpx;
  442. padding: 6rpx 12rpx;
  443. height: auto;
  444. background-color: rgba(0, 0, 0, 0.5);
  445. }
  446. .phc{
  447. color: rgba(206, 206, 206, 100);
  448. }