app-diy-form.vue 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780
  1. <template>
  2. <view class="app-diy-form" :style="{
  3. paddingTop: `${marginTop}rpx`,
  4. paddingBottom: `${marginBottom}rpx`,
  5. }">
  6. <view class="title" v-if="title !== '' && title !== null">{{title}}</view>
  7. <!--<view style="border: 1rpx solid #ff3455">
  8. <view v-for="(item, index) in myList" :key="index">{{item.name}}:{{item.value}}</view>
  9. </view>-->
  10. <view :style="{
  11. backgroundColor: backgroundColor,
  12. backgroundImage: backgroundImage ? `url(${backgroundImage})` : `none`,
  13. backgroundPosition: backgroundPosition,
  14. backgroundSize: `${backgroundWidth}% ${backgroundHeight}%`,
  15. backgroundRepeat: backgroundRepeat,
  16. paddingTop: `${paddingTop}rpx`,
  17. paddingBottom: `${paddingBottom}rpx`,
  18. }">
  19. <view class="list"
  20. :class="[showItemBorder?'item-border':'', showAllItems?'show-all':'show-first',]">
  21. <template v-for="(item, index) in myList">
  22. <view :key="index" v-if="item.key=='text'"
  23. class="item"
  24. :class="[itemClass, index===0 ? `is-first-item` : ``,]"
  25. :style="{
  26. 'padding': `0 ${itemPaddingX}rpx`,
  27. 'margin-bottom': `${itemMarginY}rpx`,
  28. }">
  29. <view v-if="labelPosition !== 'inset'" class="box-grow-0 cross-top label">
  30. <image v-if="showRequiredIcon && (item.is_required == 1 || item.is_required == '1')"
  31. class="required-icon"
  32. src="/static/image/icon/required.png"></image>
  33. <view class="name-key"
  34. :class="[`text-align-${labelTextAlign}`]"
  35. :style="{
  36. 'color': labelColor
  37. }">{{item.name}}
  38. </view>
  39. </view>
  40. <view class="box-grow-1">
  41. <app-input v-model="item.value"
  42. :background-color="inputBackground"
  43. @input="textInput"
  44. :color="inputTextColor"
  45. :placeholder="labelPosition === 'inset' ? item.name:item.hint"
  46. :height="`${itemHeight}`"
  47. :border="showInputBorder"
  48. :radius="inputRadius"
  49. :padding-left="getInputPaddingLeft"
  50. :border-color="inputBorderColor"></app-input>
  51. </view>
  52. </view>
  53. <view :key="index" v-if="item.key=='textarea'"
  54. class="item"
  55. :class="[itemClass, index===0 ? `is-first-item` : ``,]"
  56. :style="{
  57. 'padding': `0 ${itemPaddingX}rpx`,
  58. 'margin-bottom': `${itemMarginY}rpx`,
  59. }">
  60. <view v-if="labelPosition !== 'inset'" class="box-grow-0 cross-top label">
  61. <image v-if="showRequiredIcon && (item.is_required == 1 || item.is_required == '1')"
  62. class="required-icon"
  63. src="/static/image/icon/required.png"></image>
  64. <view class="name-key"
  65. :class="[`text-align-${labelTextAlign}`]"
  66. :style="{
  67. 'color': labelColor
  68. }">{{item.name}}
  69. </view>
  70. </view>
  71. <view class="box-grow-1">
  72. <app-textarea v-model="item.value"
  73. :background-color="inputBackground"
  74. @input="textInput"
  75. :color="inputTextColor"
  76. :placeholder="labelPosition === 'inset' ? item.name:item.hint"
  77. :show-border="showInputBorder"
  78. :border-radius="inputRadius"
  79. :padding-x="getInputPaddingLeft"
  80. :border-color="inputBorderColor"></app-textarea>
  81. </view>
  82. </view>
  83. <view :key="index" v-if="item.key=='date'"
  84. class="item"
  85. :class="[itemClass, index===0 ? `is-first-item` : ``,]"
  86. :style="{
  87. 'padding': `0 ${itemPaddingX}rpx`,
  88. 'margin-bottom': `${itemMarginY}rpx`,
  89. }">
  90. <view class="box-grow-0 cross-top label">
  91. <image v-if="showRequiredIcon && (item.is_required == 1 || item.is_required == '1')"
  92. class="required-icon"
  93. src="/static/image/icon/required.png"></image>
  94. <view class="name-key"
  95. :class="[`text-align-${labelTextAlign}`]"
  96. :style="{
  97. 'color': labelColor
  98. }">{{item.name}}
  99. </view>
  100. </view>
  101. <view class="box-grow-1">
  102. <app-datetime-picker v-model="item.value"
  103. @change="datetimeChange"
  104. :text="item.value||''"
  105. :sign="index"
  106. :show-border="showInputBorder"
  107. :background="inputBackground"
  108. :height="itemHeight"
  109. :radius="inputRadius"
  110. :text-color="inputTextColor"
  111. :text-position="getDateTimeTextPosition"
  112. :border-color="inputBorderColor"
  113. :start="item.min ? item.min : ''"
  114. :end="item.max ? item.max : ''">
  115. <!-- #ifdef MP-TOUTIAO -->
  116. {{item.value||''}}
  117. <!-- #endif -->
  118. </app-datetime-picker>
  119. </view>
  120. </view>
  121. <view :key="index" v-if="item.key=='time'"
  122. class="item"
  123. :class="[itemClass, index===0 ? `is-first-item` : ``,]"
  124. :style="{
  125. 'padding': `0 ${itemPaddingX}rpx`,
  126. 'margin-bottom': `${itemMarginY}rpx`,
  127. }">
  128. <view class="box-grow-0 cross-top label">
  129. <image v-if="showRequiredIcon && (item.is_required == 1 || item.is_required == '1')"
  130. class="required-icon"
  131. src="/static/image/icon/required.png"></image>
  132. <view class="name-key"
  133. :class="[`text-align-${labelTextAlign}`]"
  134. :style="{
  135. 'color': labelColor
  136. }">{{item.name}}
  137. </view>
  138. </view>
  139. <view class="box-grow-1">
  140. <app-datetime-picker v-model="item.value"
  141. @change="datetimeChange"
  142. mode="time"
  143. :text="item.value||''"
  144. :sign="index"
  145. :show-border="showInputBorder"
  146. :background="inputBackground"
  147. :height="itemHeight"
  148. :radius="inputRadius"
  149. :text-color="inputTextColor"
  150. :text-position="getDateTimeTextPosition"
  151. :border-color="inputBorderColor"
  152. :start="item.min ? item.min : ''"
  153. :end="item.max ? item.max : ''">
  154. <!-- #ifdef MP-TOUTIAO -->
  155. {{item.value||''}}
  156. <!-- #endif -->
  157. </app-datetime-picker>
  158. </view>
  159. </view>
  160. <view :key="index" v-if="item.key=='radio'"
  161. class="item"
  162. :class="[itemClass, index===0 ? `is-first-item` : ``,]"
  163. :style="{
  164. 'padding': `0 ${itemPaddingX}rpx`,
  165. 'margin-bottom': `${itemMarginY}rpx`,
  166. }">
  167. <view class="box-grow-0 cross-top label">
  168. <image v-if="showRequiredIcon && (item.is_required == 1 || item.is_required == '1')"
  169. class="required-icon"
  170. src="/static/image/icon/required.png"></image>
  171. <view class="name-key"
  172. :class="[`text-align-${labelTextAlign}`]"
  173. :style="{
  174. 'color': labelColor
  175. }">{{item.name}}
  176. </view>
  177. </view>
  178. <view class="box-grow-1" :style="{
  179. padding: labelPosition === 'top' ? `0 0` : `0 12rpx`,
  180. }">
  181. <app-radio-group :list="item.list" v-model="item.value" type="round"
  182. @change="checkChange"></app-radio-group>
  183. </view>
  184. </view>
  185. <view :key="index" v-if="item.key=='checkbox'"
  186. class="item"
  187. :class="[itemClass, index===0 ? `is-first-item` : ``,]"
  188. :style="{
  189. 'padding': `0 ${itemPaddingX}rpx`,
  190. 'margin-bottom': `${itemMarginY}rpx`,
  191. }">
  192. <view class="box-grow-0 cross-top label">
  193. <image v-if="showRequiredIcon && (item.is_required == 1 || item.is_required == '1')"
  194. class="required-icon"
  195. src="/static/image/icon/required.png"></image>
  196. <view class="name-key"
  197. :class="[`text-align-${labelTextAlign}`]"
  198. :style="{
  199. 'color': labelColor
  200. }">{{item.name}}
  201. </view>
  202. </view>
  203. <view class="box-grow-1 dir-left-wrap" :style="{
  204. padding: labelPosition === 'top' ? `0 0` : `0 12rpx`,
  205. }">
  206. <app-diy-form-checkbox-group :list="item.list"
  207. v-model="item.value"
  208. @change="checkChange"></app-diy-form-checkbox-group>
  209. </view>
  210. </view>
  211. <view :key="index" v-if="item.key=='img_upload'"
  212. class="item"
  213. :class="[itemClass, index===0 ? `is-first-item` : ``,]"
  214. :style="{
  215. 'padding': `0 ${itemPaddingX}rpx`,
  216. 'margin-bottom': `${itemMarginY}rpx`,
  217. }">
  218. <view class="box-grow-0 cross-top label">
  219. <image v-if="showRequiredIcon && (item.is_required == 1 || item.is_required == '1')"
  220. class="required-icon"
  221. src="/static/image/icon/required.png"></image>
  222. <view class="name-key"
  223. :class="[`text-align-${labelTextAlign}`]"
  224. :style="{
  225. 'color': labelColor
  226. }">{{item.name}}
  227. </view>
  228. </view>
  229. <view class="box-grow-1 dir-left-wrap" :style="{
  230. padding: labelPosition === 'top' ? `12rpx 0` : `12rpx 12rpx`,
  231. }">
  232. <!-- 普通图片 -->
  233. <template v-if="item.img_type == 1">
  234. <app-upload-image
  235. :value="item.value?[item.value]:null"
  236. :max-num="1"
  237. @image-event="handleImageUpload"
  238. :sign="`${index}`"
  239. :show-number="false"></app-upload-image>
  240. </template>
  241. <!-- 身份证,正反面 -->
  242. <template v-if="item.img_type == 2">
  243. <app-upload-image
  244. :value="(item.value && item.value[0])?[item.value[0]]:null"
  245. style="margin-right: 12rpx"
  246. :max-num="1"
  247. @image-event="handleUserIdFrontUpload"
  248. :sign="`${index}`"
  249. text="身份证正面"
  250. :show-number="false"
  251. default-img="/static/image/user-id-card-front.png"></app-upload-image>
  252. <app-upload-image
  253. :value="(item.value && item.value[1])?[item.value[1]]:null"
  254. :max-num="1"
  255. @image-event="handleUserIdBackUpload"
  256. :sign="`${index}`"
  257. text="身份证反面"
  258. :show-number="false"
  259. default-img="/static/image/user-id-card-back.png"></app-upload-image>
  260. </template>
  261. <!-- 营业执照 -->
  262. <template v-if="item.img_type == 3">
  263. <app-upload-image
  264. :value="item.value?[item.value]:null"
  265. :max-num="1"
  266. @image-event="handleImageUpload"
  267. :sign="`${index}`"
  268. text="营业执照"
  269. :show-number="false"
  270. default-img="/static/image/company-license.png"></app-upload-image>
  271. </template>
  272. </view>
  273. </view>
  274. </template>
  275. </view>
  276. <view class="main-center cross-center scroll-bar" v-if="showScrollBtn"
  277. @click="showAllItems = !showAllItems">
  278. <view class="cross-center">点击{{showAllItems?'收起':'展开'}}</view>
  279. <view class="cross-center">
  280. <image v-if="showAllItems" src="/static/image/icon/icon-up.png"
  281. style="width: 18rpx;height: 10rpx;"></image>
  282. <image v-else src="/static/image/icon/icon-down.png"
  283. style="width: 18rpx;height: 10rpx;"></image>
  284. </view>
  285. </view>
  286. <view v-if="showSubmit" class="submit" :style="{
  287. 'padding': `${submitBtnMargin}rpx ${submitBtnPadding}rpx 24rpx`,
  288. }">
  289. <app-form-id @click="submit">
  290. <view class="submit-button" :style="{
  291. 'background-color': submitBtnBackground,
  292. 'border-color': submitBtnBorderColor,
  293. 'color': submitBtnTextColor,
  294. 'border-radius': `${submitBtnRadius}rpx`,
  295. 'height': `${submitBtnHeight}rpx`,
  296. 'line-height': `${submitBtnHeight-2}rpx`,
  297. }">{{submitBtnText}}
  298. </view>
  299. </app-form-id>
  300. </view>
  301. </view>
  302. </view>
  303. </template>
  304. <script>
  305. import AppDatetimePicker from '../../basic-component/app-datetime-picker/app-datetime-picker.vue';
  306. import AppRadio from "../../basic-component/app-radio/app-radio";
  307. import AppRadioGroup from "../../basic-component/app-radio/app-radio-group";
  308. import AppDiyFormCheckboxGroup from "./app-diy-form-checkbox-group";
  309. import AppUploadImage from "../../basic-component/app-upload-image/app-upload-image";
  310. import AppTextarea from "../../basic-component/app-textarea/app-textarea";
  311. export default {
  312. name: 'app-diy-form',
  313. components: {AppTextarea, AppUploadImage, AppDiyFormCheckboxGroup, AppRadioGroup, AppRadio, AppDatetimePicker},
  314. props: {
  315. sign: {
  316. default: null,
  317. },
  318. title: {
  319. type: String,
  320. default: null,
  321. },
  322. backgroundColor: {
  323. default: '#ffffff',
  324. },
  325. backgroundImage: {
  326. default: null,
  327. },
  328. backgroundPosition: {
  329. default: 'center',
  330. },
  331. backgroundWidth: {
  332. default: 100,
  333. },
  334. backgroundHeight: {
  335. default: 100,
  336. },
  337. backgroundRepeat: {
  338. default: 'no-repeat',
  339. },
  340. marginTop: {
  341. default: 0,
  342. },
  343. marginBottom: {
  344. default: 0,
  345. },
  346. paddingTop: {
  347. default: 0,
  348. },
  349. paddingBottom: {
  350. default: 0,
  351. },
  352. list: {
  353. type: Array,
  354. default: [],
  355. },
  356. showRequiredIcon: {
  357. type: Boolean,
  358. default: false,
  359. },
  360. itemPaddingX: {
  361. default: 24,
  362. },
  363. itemMarginY: {
  364. default: 0,
  365. },
  366. itemHeight: {
  367. type: Number,
  368. default: 88,
  369. },
  370. showItemBorder: {
  371. default: true,
  372. },
  373. labelPosition: {
  374. default: 'left',
  375. },
  376. labelColor: {
  377. default: '#666666',
  378. },
  379. labelTextAlign: {
  380. default: 'right',
  381. },
  382. showInputBorder: {
  383. type: Boolean,
  384. default: false,
  385. },
  386. inputBackground: {
  387. default: '#ffffff',
  388. },
  389. inputBorderColor: {
  390. default: '#c0c4cc',
  391. },
  392. inputTextColor: {
  393. default: '#666666',
  394. },
  395. inputPlaceholderColor: {
  396. default: '#bbbbbb',
  397. },
  398. inputRadius: {
  399. default: 0,
  400. },
  401. showSubmit: {
  402. type: Boolean,
  403. default: false,
  404. },
  405. submitUrl: {
  406. type: String,
  407. default: null,
  408. },
  409. submitBtnText: {
  410. default: '提交',
  411. },
  412. submitBtnHeight: {
  413. default: 80,
  414. },
  415. submitBtnPadding: {
  416. default: 24,
  417. },
  418. submitBtnMargin: {
  419. default: 40,
  420. },
  421. submitBtnRadius: {
  422. default: 40,
  423. },
  424. submitBtnBackground: {
  425. default: '#ff4544',
  426. },
  427. submitBtnBorderColor: {
  428. default: '#ff4544',
  429. },
  430. submitBtnTextColor: {
  431. default: '#ffffff',
  432. },
  433. showScrollBtn: {
  434. default: false,
  435. },
  436. },
  437. data() {
  438. const newList = [];
  439. for (let i in this.list) {
  440. const item = this.list[i];
  441. if (typeof item.default === 'undefined') {
  442. item.default = null;
  443. }
  444. if (typeof item.value === 'undefined' || item.value === null || item.value === '') {
  445. item.value = item.default;
  446. }
  447. item.hint = item.hint || '';
  448. if (item.key === 'radio' || item.key === 'checkbox') {
  449. if (!item.list) item.list = [];
  450. for (let j in item.list) {
  451. if (!item.list[j].value || item.list[j].value === false || item.list[j].value === 'false') {
  452. item.list[j].value = false;
  453. } else {
  454. item.list[j].value = true;
  455. }
  456. }
  457. }
  458. if (item.key === 'img_upload' && (item.img_type === 2 || item.img_type === '2') && !item.value) {
  459. item.value = ['', ''];
  460. }
  461. newList[i] = item;
  462. }
  463. return {
  464. myList: newList,
  465. randomString: '',
  466. validateResult: {
  467. hasError: false,
  468. errors: [],
  469. },
  470. showAllItems: this.showScrollBtn ? false : true,
  471. };
  472. },
  473. computed: {
  474. itemClass() {
  475. if (this.labelPosition === 'left') {
  476. return 'label-left dir-left-nowrap cross-top';
  477. }
  478. if (this.labelPosition === 'inset') {
  479. return 'label-inset dir-left-nowrap cross-top';
  480. }
  481. if (this.labelPosition === 'top') {
  482. return 'label-top';
  483. }
  484. },
  485. getDateTimeTextPosition() {
  486. if (this.labelPosition === 'top') {
  487. return 'left';
  488. }
  489. return 'right';
  490. },
  491. getInputPaddingLeft() {
  492. if (this.labelPosition === 'top') {
  493. if (this.showInputBorder) {
  494. return 24;
  495. } else {
  496. return 0;
  497. }
  498. }
  499. return 24;
  500. },
  501. },
  502. created() {
  503. this.validate();
  504. this.outputData();
  505. },
  506. methods: {
  507. textInput() {
  508. this.outputData();
  509. },
  510. datetimeChange() {
  511. this.outputData();
  512. },
  513. checkChange() {
  514. setTimeout(() => {
  515. this.outputData();
  516. }, 10);
  517. },
  518. handleImageUpload(e) {
  519. const index = parseInt(e.sign);
  520. if (e.imageList.length > 0) {
  521. this.myList[index].value = e.imageList[0];
  522. } else {
  523. this.myList[index].value = '';
  524. }
  525. this.outputData();
  526. },
  527. handleUserIdFrontUpload(e) {
  528. const index = parseInt(e.sign);
  529. if (e.imageList.length > 0) {
  530. this.myList[index].value[0] = e.imageList[0];
  531. } else {
  532. this.myList[index].value[0] = '';
  533. }
  534. this.outputData();
  535. },
  536. handleUserIdBackUpload(e) {
  537. const index = parseInt(e.sign);
  538. if (e.imageList.length > 0) {
  539. this.myList[index].value[1] = e.imageList[0];
  540. } else {
  541. this.myList[index].value[1] = '';
  542. }
  543. this.outputData();
  544. },
  545. validate() {
  546. this.validateResult = {
  547. hasError: false,
  548. errors: [],
  549. };
  550. for (let i in this.myList) {
  551. const item = this.myList[i];
  552. if (item.is_required === 1 || item.is_required === '1') {
  553. if (typeof item.value === 'undefined' || item.value === null || item.value === '') {
  554. this.validateResult.hasError = true;
  555. this.validateResult.errors.push({
  556. index: i,
  557. msg: `"${item.name}"不能为空。`,
  558. });
  559. continue;
  560. }
  561. if (item.img_type && parseInt(item.img_type) === 2) {
  562. if (!item.value || !item.value.length) {
  563. this.validateResult.hasError = true;
  564. this.validateResult.errors.push({
  565. index: i,
  566. msg: `"${item.name}"不能为空。`,
  567. });
  568. continue;
  569. }
  570. let imgErr = false;
  571. for (let j in item.value) {
  572. if (item.value[j] === null || item.value[j] === '') {
  573. imgErr = true;
  574. break;
  575. }
  576. }
  577. if (imgErr) {
  578. this.validateResult.hasError = true;
  579. this.validateResult.errors.push({
  580. index: i,
  581. msg: `"${item.name}"不能为空。`,
  582. });
  583. continue;
  584. }
  585. }
  586. }
  587. }
  588. this.$emit('validate', this.validateResult, this.sign);
  589. },
  590. outputData() {
  591. this.validate();
  592. for (let i in this.myList) {
  593. this.myList[i].label = this.myList[i].name;
  594. this.myList[i].required = this.myList[i].is_required;
  595. }
  596. this.$emit('input', this.myList, this.sign);
  597. // #ifdef MP-TOUTIAO
  598. setTimeout(() => {
  599. this.randomString = this.$utils.randomString(32);
  600. }, 1);
  601. // #endif
  602. },
  603. submit() {
  604. this.outputData();
  605. if (this.validateResult.hasError && this.validateResult.errors) {
  606. uni.showModal({
  607. title: '提示',
  608. content: this.validateResult.errors[0].msg,
  609. showCancel: false,
  610. });
  611. return;
  612. }
  613. uni.showLoading({
  614. mask: true,
  615. title: '正在提交...',
  616. });
  617. this.$request({
  618. url: this.submitUrl ? this.submitUrl : this.$api.diy.page_store,
  619. method: 'post',
  620. data: {
  621. form_data: JSON.stringify(this.myList),
  622. },
  623. }).then(response => {
  624. uni.hideLoading();
  625. if (response.code === 0) {
  626. uni.showModal({
  627. title: '提示',
  628. content: response.msg || '提交成功',
  629. showCancel: false,
  630. });
  631. } else {
  632. uni.showModal({
  633. title: '提示',
  634. content: response.msg || '提交失败',
  635. showCancel: false,
  636. });
  637. }
  638. }).catch(() => {
  639. uni.hideLoading();
  640. });
  641. },
  642. },
  643. }
  644. </script>
  645. <style scoped lang="scss">
  646. .name-key {
  647. width: 100%;
  648. text-align: right;
  649. font-size: #{32rpx};
  650. color: #353535
  651. }
  652. .name-key.text-align-left {
  653. text-align: left;
  654. }
  655. .name-key.text-align-right {
  656. text-align: right;
  657. }
  658. .title {
  659. padding: #{24rpx};
  660. color: #999;
  661. font-size: #{26rpx};
  662. }
  663. .arrow {
  664. width: #{12rpx};
  665. height: #{22rpx};
  666. }
  667. .scroll-bar {
  668. border-top: #{1rpx} solid $uni-weak-color-one;
  669. height: #{72rpx};
  670. color: $uni-general-color-two;
  671. image {
  672. margin-left: #{16rpx};
  673. }
  674. }
  675. .list {
  676. .item {
  677. height: 0 !important;
  678. overflow: hidden;
  679. .label {
  680. min-width: #{125rpx};
  681. padding: #{24rpx} #{12rpx} #{24rpx} 0;
  682. height: 100%;
  683. position: relative;
  684. }
  685. .required-icon {
  686. width: #{20rpx};
  687. height: #{20rpx};
  688. display: inline-block;
  689. position: absolute;
  690. left: #{15rpx};
  691. top: #{34rpx};
  692. }
  693. }
  694. .item.is-first-item {
  695. height: auto !important;
  696. overflow: auto;
  697. }
  698. .item.label-left {
  699. .name-key {
  700. max-width: #{200rpx};
  701. }
  702. }
  703. .item.label-top {
  704. .name-key {
  705. text-align: left;
  706. }
  707. .label {
  708. padding: #{20rpx} #{12rpx} #{8rpx} 0;
  709. }
  710. }
  711. .item:last-child {
  712. margin-bottom: 0 !important;
  713. }
  714. }
  715. .show-all {
  716. .item {
  717. height: auto !important;
  718. overflow: auto;
  719. }
  720. }
  721. .show-first {
  722. .item {
  723. margin-bottom: 0 !important;
  724. border: none !important;
  725. }
  726. }
  727. .item-border {
  728. .item {
  729. border-bottom: #{1rpx} solid $uni-weak-color-one;
  730. }
  731. .item:last-child {
  732. border-bottom: none;
  733. }
  734. }
  735. .submit-button {
  736. text-align: center;
  737. border: #{1rpx} solid;
  738. }
  739. .submit-button:active {
  740. box-shadow: inset 0 0 #{1000rpx} rgba(0, 0, 0, .15);
  741. }
  742. </style>