my_form.vue 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785
  1. <template>
  2. <view>
  3. <view class="requiredFieldOnly-head" v-if="requiredFieldOnly">
  4. <view class="label">
  5. 基本信息
  6. </view>
  7. <view class="content">
  8. 仅显示必填信息<text style="padding: 0 2.5px;" /> <u-switch activeColor="#C40C24" v-model="unShowAll" />
  9. </view>
  10. </view>
  11. <slot name="head" />
  12. <block v-for="(item, index) in list " :key="item.key">
  13. <block v-if="item.isMust || !unShowAll">
  14. <!-- 文本输入 -->
  15. <view class="input-box" v-if="item.type == 'text'"
  16. :style="{ marginTop: tovw(item.marginTop || 0), opacity: item.disabled ? 0.7 : 1 }"
  17. @click="focusLabel = item.label">
  18. <view class="box" :class="item.unBorBot ? '' : 'borBot'">
  19. <view class="label">
  20. <text class="must" v-if="item.isMust">*</text>
  21. {{ item.label }}:
  22. </view>
  23. <view class="content-box">
  24. <view class="content">
  25. <input v-if="item.inputmode == 'number'" type="number" :disabled="item.disabled"
  26. placeholder-style="color: #BBBBBB;font-family: Source Han Sans SC, Source Han Sans SC;"
  27. :focus="focusLabel == item.label" :placeholder="item.placeholder || '请填写' + item.label"
  28. :value="item.value" :style="{ width: item.value ? '220px' : '240px' }"
  29. @input="onInput($event, index)" :maxlength="item.maxlength || '499'"
  30. confirm-type="done" />
  31. <input v-else-if="item.inputmode == 'digit'" type="digit" :disabled="item.disabled"
  32. placeholder-style="color: #BBBBBB;font-family: Source Han Sans SC, Source Han Sans SC;"
  33. :focus="focusLabel == item.label" :placeholder="item.placeholder || '请填写' + item.label"
  34. :value="item.value" :style="{ width: item.value ? '220px' : '240px' }"
  35. @input="onInput($event, index)" :maxlength="item.maxlength || '499'"
  36. confirm-type="done" />
  37. <textarea v-else :disabled="item.disabled"
  38. placeholder-style="color: #BBBBBB;font-family: Source Han Sans SC, Source Han Sans SC;"
  39. auto-height type="text" :focus="focusLabel == item.label"
  40. :placeholder="item.placeholder || '请填写' + item.label" :value="item.value"
  41. :style="{ width: item.value ? '220px' : '240px' }" @input="onInput($event, index)"
  42. :maxlength="item.maxlength || '499'" confirm-type="done" />
  43. <icon v-if="item.value && !item.disabled" class="icon" type="clear" size="3.733vw"
  44. @click="onClearInput(index)" />
  45. </view>
  46. <view v-if="item.errText" class="err-text">
  47. <icon class="icon" color="#E3041F" type="clear" size="2.733vw" />
  48. {{ item.errText }}
  49. </view>
  50. </view>
  51. </view>
  52. </view>
  53. <!-- 文本域 -->
  54. <view class="textarea-box" v-else-if="item.type == 'textarea'">
  55. <textarea class="textarea" :class="item.unBorBot ? '' : 'borBot'" :disabled="item.disabled"
  56. placeholder-style="color: #BBBBBB;font-family: Source Han Sans SC, Source Han Sans SC;" type="text"
  57. :placeholder="item.placeholder || '请填写' + item.label" :value="item.value"
  58. @input="onInput($event, index)" :maxlength="item.maxlength || '499'" confirm-type="done" />
  59. </view>
  60. <!-- 自定义选项分类 -->
  61. <view class="custom-class-box" v-else-if="item.type == 'customClass'"
  62. :style="{ marginTop: tovw(item.marginTop || 0) }">
  63. <view class="head">
  64. <view class="label">
  65. <text class="must" style="color: #E3041F;" v-if="item.isMust">*</text>
  66. {{ item.label }}
  67. </view>
  68. <view class="state">
  69. {{ item.isMultipleChoice ? '可多选' : '仅单选' }}
  70. </view>
  71. </view>
  72. <view class="options">
  73. <view class="option"
  74. :class="item.isMultipleChoice ? (item.value.includes(option.value) ? 'active' : '') : (item.value == option.value ? 'active' : '')"
  75. v-for=" option in item.list " :key="option.value" hover-class="navigator-hover"
  76. @click="changOptions(option.value, index)">
  77. {{ option.remarks }}
  78. </view>
  79. </view>
  80. </view>
  81. <!-- 选择所在地区 -->
  82. <picker class="region" @change="selectRegion($event, index)" mode='region' :disabled="item.disabled"
  83. :value="item.value" v-else-if="item.type == 'region'"
  84. :style="{ marginTop: tovw(item.marginTop || 0), opacity: item.disabled ? 0.7 : 1 }">
  85. <view class="box" :class="item.unBorBot ? '' : 'borBot'">
  86. <view class="label">
  87. <text class="must" v-if="item.isMust">*</text>
  88. {{ item.label }}:
  89. </view>
  90. <view class="content-box">
  91. <view class="value" v-if="item.value.length">
  92. {{ item.value.join(",") }}
  93. </view>
  94. <view v-else class="placeholder" hover-class="none">
  95. {{ item.placeholder || '请选择' + item.label }}
  96. </view>
  97. <view v-if="!item.disabled" class="iconfont icon-a-wodetiaozhuan" />
  98. </view>
  99. </view>
  100. </picker>
  101. <!-- 日期 -->
  102. <picker class="region" @change="selectRegion($event, index)" mode='date' :disabled="item.disabled"
  103. :value="item.value" v-else-if="item.type == 'date'"
  104. :style="{ marginTop: tovw(item.marginTop || 0), opacity: item.disabled ? 0.7 : 1 }">
  105. <view class="box" :class="item.unBorBot ? '' : 'borBot'">
  106. <view class="label">
  107. <text class="must" v-if="item.isMust">*</text>
  108. {{ item.label }}:
  109. </view>
  110. <view class="content-box">
  111. <view class="value" v-if="item.value">
  112. {{ item.value }}
  113. </view>
  114. <view v-else class="placeholder" hover-class="none">
  115. {{ item.placeholder || '请选择' + item.label }}
  116. </view>
  117. <view v-if="!item.disabled" class="iconfont icon-a-wodetiaozhuan" />
  118. </view>
  119. </view>
  120. </picker>
  121. <!-- 上传附件 -->
  122. <view class="custom-class-box" v-else-if="item.type == 'upload'"
  123. :style="{ marginTop: tovw(item.marginTop || 0) }">
  124. <view class="head">
  125. <view class="label">
  126. <text class="must" v-if="item.isMust">*</text>
  127. {{ item.label }}
  128. </view>
  129. <view class="state">
  130. {{ item.placeholder }}
  131. </view>
  132. </view>
  133. <view class="content">
  134. <view class="file-box" v-for="file in item.value" :key="file.attachmentid">
  135. <image class="image" v-if="file.fileType == 'image'" :src="file.url" mode="aspectFill"
  136. lazy-load="true" @click="previewImg(file)" />
  137. <video v-else-if="file.fileType == 'video'" class="video" :poster="file.subfiles[0].url"
  138. :src="file.url" />
  139. <image class="delete" @click.stop="deleteFile(file, index)"
  140. src="https://yossys06593.obs.cn-east-3.myhuaweicloud.com:443/202404241713944430197B47af9b2f.png"
  141. mode="widthFix" />
  142. </view>
  143. <My_upload v-if="item.allowUpload" :showLoading="false" :accept="item.accept"
  144. @uploadCallback="uploadCallback($event, index)" @onLoading="onUploadLoading($event, index)">
  145. <view class="upload-box" hover-class="navigator-hover">
  146. <u-loading-icon v-if="item.loading" />
  147. <text v-else class="iconfont icon-xiazai" />
  148. <text style="margin-left: 5px;">上传</text>
  149. </view>
  150. </My_upload>
  151. </view>
  152. </view>
  153. <!-- 开关 -->
  154. <view class="region" v-else-if="item.type == 'switch'">
  155. <view class="box" :class="item.unBorBot ? '' : 'borBot'">
  156. <view class="label">
  157. <text class="must" v-if="item.isMust">*</text>
  158. {{ item.label }}:
  159. </view>
  160. <view class="content-box">
  161. <view />
  162. <u-switch activeColor="#70D95D" v-model="item.value" :disabled="item.disabled"
  163. @change="switchChange($event, index)" />
  164. </view>
  165. </view>
  166. </view>
  167. <!-- 性别 -->
  168. <view class="region" v-else-if="item.type == 'sex'">
  169. <view class="box" :class="item.unBorBot ? '' : 'borBot'">
  170. <view class="label">
  171. <text class="must" v-if="item.isMust">*</text>
  172. {{ item.label }}:
  173. </view>
  174. <u-radio-group v-model="item.value" placement="row" @change="groupChange($event, index)">
  175. <u-radio :customStyle="{ marginRight: tovw(60) }" label="男" name="男" />
  176. <u-radio label="女" name="女" />
  177. </u-radio-group>
  178. </view>
  179. </view>
  180. <!-- 单选 -->
  181. <view class="region" v-else-if="item.type == 'radio'">
  182. <view class="box" :class="item.unBorBot ? '' : 'borBot'">
  183. <view class="label">
  184. <text class="must" v-if="item.isMust">*</text>
  185. {{ item.label }}:
  186. </view>
  187. <u-radio-group v-model="item.value" :placement="item.placement || 'row'"
  188. @change="groupChange($event, index)">
  189. <u-radio v-for="option in item.options"
  190. :customStyle="{ marginRight: tovw(option.marginRight || item.marginRight || 0), marginTop: tovw(option.marginTop || item.marginTop || 0) }"
  191. :key="option.label" :label="option.label" :name="option.name" />
  192. </u-radio-group>
  193. </view>
  194. </view>
  195. <!-- 日期 -->
  196. <view class="region" @change="selectRegion($event, index)" v-else-if="item.type == 'route'"
  197. :style="{ marginTop: tovw(item.marginTop || 0), opacity: item.disabled ? 0.7 : 1 }"
  198. @click="item.disabled ? '' : toRoute(item, index)">
  199. <view class="box" :class="item.unBorBot ? '' : 'borBot'">
  200. <view class="label">
  201. <text class="must" v-if="item.isMust">*</text>
  202. {{ item.label }}:
  203. </view>
  204. <view class="content-box">
  205. <view class="value" v-if="item.value.length">
  206. {{ item.showValue.join(",") }}
  207. </view>
  208. <view v-else class="placeholder" hover-class="none">
  209. {{ item.placeholder || '请选择' + item.label }}
  210. </view>
  211. <view v-if="!item.disabled" class="iconfont icon-a-wodetiaozhuan" />
  212. </view>
  213. </view>
  214. </view>
  215. </block>
  216. </block>
  217. </view>
  218. </template>
  219. <script>
  220. import { formattedFiles, viewImage } from "../utils/settleFiles.js"
  221. export default {
  222. name: "my_form",
  223. props: {
  224. form: {
  225. type: Array,
  226. default: []
  227. },
  228. isUncomplete: {
  229. type: Function
  230. },
  231. onUploading: {
  232. type: Function
  233. },
  234. requiredFieldOnly: {
  235. type: Boolean
  236. },
  237. isShowAll: {
  238. type: Function
  239. },
  240. interrupt: {
  241. type: Function
  242. }
  243. },
  244. data() {
  245. return {
  246. list: [],
  247. focusLabel: "",
  248. unShowAll: false,
  249. }
  250. },
  251. watch: {
  252. form: {
  253. handler: function (newVal) {
  254. if (newVal) {
  255. this.list = JSON.parse(JSON.stringify(newVal));
  256. setTimeout(() => {
  257. this.verify()
  258. }, 200);
  259. }
  260. },
  261. immediate: true,
  262. },
  263. unShowAll: function (newVal) {
  264. this.$emit("isShowAll", newVal)
  265. }
  266. },
  267. async created() {
  268. /* let list = [{
  269. key: "name",
  270. type: "text",
  271. label: "标题",
  272. isMust: true,//是否必填
  273. value: "",
  274. inputmode:"", //https://uniapp.dcloud.net.cn/component/input.html#type
  275. marginTop: 10,
  276. verify:[],
  277. }, {
  278. key: "Class",
  279. type: "customClass",
  280. label: "标题",
  281. isMust: false,//是否必填
  282. isMultipleChoice: true,//是否多选
  283. value: [],// 多选[] 单选 ""
  284. isMust: true,//是否必填
  285. list: await this.getCustomClass('picturespace'),
  286. marginTop: 10
  287. },{
  288. key: "attachmentids",
  289. type: "upload",
  290. label: "图片/视频",
  291. accept:"all",
  292. placeholder: "可上传多个视频或图片",
  293. ownertable: "temporary",
  294. ownerid: 999,
  295. usetype: 'default',
  296. allowUpload: true,
  297. allowDelete: true,
  298. value:[],
  299. marginTop: 10
  300. }, {
  301. key: "region",
  302. type: "region",
  303. label: "所在地区",
  304. isMust: true,//是否必填
  305. value: [],
  306. }, {
  307. key: "address",
  308. type: "textarea",
  309. label: "详细地址",
  310. isMust: true,//是否必填
  311. value: '',
  312. }, {
  313. key: "isdefault",
  314. type: "switch",
  315. label: "设为默认地址",
  316. isMust: false,//是否必填
  317. value: false,
  318. isNum: true,
  319. unBorBot: true
  320. }] */
  321. },
  322. methods: {
  323. toRoute(item, index) {
  324. uni.navigateTo({
  325. url: item.path
  326. });
  327. this.$Http.routeSelected = function (selected) {
  328. this.$emit('interrupt', item, selected, index)
  329. delete this.$Http.routeSelected;
  330. }.bind(this)
  331. },
  332. onInput(e, index) {
  333. let item = this.list[index];
  334. item.errText = "";
  335. this.$set(this.list[index], 'value', e.detail.value)
  336. if (item.verify && item.verify.length && item.value != '') {
  337. let err = item.verify.find(r => !new RegExp(r.reg).test(item.value));
  338. if (err) this.$set(this.list[index], 'errText', err.errText)
  339. }
  340. this.verify()
  341. },
  342. setItem(index, item, back = false) {
  343. this.$set(this.list, index, item)
  344. this.verify()
  345. if (back) uni.navigateBack();
  346. },
  347. setValue(index, value, back = false) {
  348. this.$set(this.list[index], 'value', value)
  349. this.verify()
  350. if (back) uni.navigateBack();
  351. },
  352. onClearInput(index) {
  353. let item = this.list[index];
  354. item.errText = ''
  355. this.$set(this.list[index], 'value', '')
  356. this.verify()
  357. },
  358. switchChange(e, index) {
  359. this.$set(this.list[index], 'value', e)
  360. this.verify()
  361. },
  362. changOptions(value, index) {
  363. let item = this.list[index];
  364. if (item.isMultipleChoice) {
  365. let i = -1;
  366. try {
  367. i = item.value.findIndex(v => v == value)
  368. } catch (error) {
  369. }
  370. if (i == -1) {
  371. item.value.push(value)
  372. } else {
  373. item.value.splice(i, 1)
  374. }
  375. this.$set(this.list[index], 'value', item.value)
  376. } else {
  377. this.$set(this.list[index], 'value', value)
  378. }
  379. this.verify()
  380. },
  381. verify() {
  382. let list = this.list.filter(v => v.isMust);
  383. let Uncomplete = false;
  384. if (list.length) Uncomplete = list.some(v => {
  385. let res = false;
  386. if (v.type == 'customClass') {
  387. if (v.isMultipleChoice) {
  388. res = v.value.length == 0;
  389. } else {
  390. res = v.value == "";
  391. }
  392. } else if (v.type == 'upload') {
  393. res = v.value.length == 0;
  394. } else if (v.type == 'text') {
  395. res = v.value == "";
  396. if (v.errText) res = true;
  397. } else {
  398. res = v.value == "";
  399. }
  400. return res
  401. })
  402. if (!Uncomplete) Uncomplete = this.list.filter(v => !v.isMust).some(v => v.errText);
  403. this.$emit("isUncomplete", Uncomplete)
  404. },
  405. previewImg(item) {
  406. viewImage(item.url)
  407. },
  408. uploadCallback(attachmentids, index) {
  409. let item = this.list[index];
  410. this.$Http.basic({
  411. "classname": "system.attachment.Attachment",
  412. "method": "createFileLink",
  413. "content": {
  414. ownertable: item.ownertable,
  415. ownerid: item.ownerid,
  416. usetype: item.usetype,
  417. attachmentids
  418. }
  419. }).then(res => {
  420. console.log('绑定附件', res)
  421. if (this.cutoff(res.msg)) return;
  422. res.data = formattedFiles(res.data)
  423. item.value.push(res.data[0]);
  424. //临时文件
  425. if (res.data[0].ownertable == "temporary") try {
  426. item.temporarys.push(attachmentids[0])
  427. } catch (error) {
  428. item.temporarys = [attachmentids[0]]
  429. }
  430. this.$set(this.list[index], 'value', item.value)
  431. this.verify()
  432. })
  433. },
  434. deleteFiles() {
  435. this.list.forEach(v => {
  436. if (v.type == 'upload') {
  437. let linksids = v.value.filter(v => v.ownertable == "temporary").map(v => v.linksid)
  438. if (linksids.length) this.$Http.basic({
  439. "classname": "system.attachment.Attachment",
  440. "method": "deleteFileLink",
  441. "content": {
  442. linksids
  443. }
  444. }).then(res => {
  445. console.log("处理删除附件", res)
  446. if (this.cutoff(res.msg)) return;
  447. });
  448. }
  449. });
  450. },
  451. onUploadLoading(e, index) {
  452. this.$set(this.list[index], 'loading', e)
  453. this.$emit("onUploading", e)
  454. },
  455. groupChange(e, index) {
  456. this.$set(this.list[index], 'loading', e)
  457. this.verify()
  458. },
  459. selectRegion({ detail }, index) {
  460. this.$set(this.list[index], 'value', detail.value)
  461. this.verify()
  462. },
  463. deleteFile(flie, index) {
  464. let item = this.list[index];
  465. item.value = item.value.filter(v => v.attachmentid != flie.attachmentid)
  466. //临时文件
  467. if (flie.ownertable == "temporary") {
  468. item.temporarys = item.temporarys.filter(v => v != flie.attachmentid)
  469. this.$Http.basic({
  470. "classname": "system.attachment.Attachment",
  471. "method": "deleteFileLink",
  472. "content": {
  473. linksids: [flie.linksid]
  474. }
  475. }).then(res => {
  476. console.log("处理删除附件", res)
  477. if (this.cutoff(res.msg)) return;
  478. });
  479. } else {
  480. try {
  481. item.linksids.push(flie.linksid)
  482. } catch (error) {
  483. item.linksids = [flie.linksid]
  484. }
  485. }
  486. this.$set(this.list[index], 'value', item.value)
  487. this.verify()
  488. },
  489. submit() {
  490. return new Promise((resolve, reject) => {
  491. let res = {};
  492. this.list.forEach(v => {
  493. if (v.type == 'upload') {
  494. res.files = {
  495. temporarys: [],
  496. linksids: [],
  497. }
  498. try {
  499. res.files.temporarys = v.temporarys || []
  500. } catch (error) {
  501. }
  502. try {
  503. res.files.linksids = v.linksids || []
  504. } catch (error) {
  505. }
  506. } else if (v.type == 'region') {
  507. if (v.value.length) {
  508. res.province = v.value[0];
  509. res.city = v.value[1];
  510. res.county = v.value[2];
  511. } else {
  512. res.province = ''
  513. res.city = ''
  514. res.county = ''
  515. }
  516. } else if (v.type == 'switch') {
  517. if (v.isNum) {
  518. res[v.key] = v.value ? 1 : 0;
  519. } else {
  520. res[v.key] = v.value;
  521. }
  522. } else {
  523. try {
  524. res[v.key] = v.value.trim();
  525. } catch (error) {
  526. res[v.key] = v.value;
  527. }
  528. }
  529. })
  530. resolve(res)
  531. })
  532. }
  533. },
  534. }
  535. </script>
  536. <style lang="scss">
  537. .requiredFieldOnly-head {
  538. display: flex;
  539. align-items: center;
  540. justify-content: space-between;
  541. width: 100vw;
  542. height: 45px;
  543. background: #F7F7F7;
  544. padding: 0 10px;
  545. box-sizing: border-box;
  546. .label {
  547. font-family: PingFang SC, PingFang SC;
  548. font-weight: bold;
  549. font-size: 15px;
  550. color: #333333;
  551. line-height: 22px;
  552. }
  553. .content {
  554. display: flex;
  555. align-items: center;
  556. font-family: PingFang SC, PingFang SC;
  557. font-size: 14px;
  558. color: #999999;
  559. }
  560. }
  561. .borBot {
  562. border-bottom: 1px #DDDDDD solid;
  563. }
  564. .custom-class-box {
  565. width: 100%;
  566. background: #fff;
  567. padding: 15px 0 15px 10px;
  568. box-sizing: border-box;
  569. .head {
  570. width: 355px;
  571. height: 20px;
  572. display: flex;
  573. justify-content: space-between;
  574. align-items: flex-end;
  575. .label {
  576. font-size: 14px;
  577. color: #333333;
  578. line-height: 20px;
  579. }
  580. .state {
  581. font-family: Source Han Sans SC, Source Han Sans SC;
  582. font-size: 12px;
  583. color: #999999;
  584. }
  585. }
  586. .options {
  587. display: flex;
  588. flex-wrap: wrap;
  589. .option {
  590. padding: 6px 10px;
  591. text-align: center;
  592. min-width: 81px;
  593. font-family: PingFang SC, PingFang SC;
  594. font-size: 14px;
  595. color: #333333;
  596. border-radius: 5px;
  597. background: #F2F2F2;
  598. margin-top: 10px;
  599. margin-right: 10px;
  600. box-sizing: border-box;
  601. }
  602. .active {
  603. background: #C30D23;
  604. color: #fff;
  605. }
  606. }
  607. .content {
  608. .file-box {
  609. position: relative;
  610. width: 355px;
  611. height: 240px;
  612. margin-top: 10px;
  613. .video,
  614. .image {
  615. width: 355px;
  616. height: 240px;
  617. border-radius: 5px;
  618. }
  619. .delete {
  620. position: absolute;
  621. width: 30px;
  622. top: 0;
  623. right: 0;
  624. z-index: 1;
  625. }
  626. }
  627. .upload-box {
  628. display: flex;
  629. justify-content: center;
  630. align-items: center;
  631. width: 355px;
  632. height: 45px;
  633. background: #FFFFFF;
  634. border-radius: 5px;
  635. border: 1px dashed #C30D23;
  636. font-family: Source Han Sans SC, Source Han Sans SC;
  637. font-size: 14px;
  638. color: #C30D23;
  639. margin-top: 10px;
  640. }
  641. }
  642. }
  643. .textarea-box {
  644. width: 100%;
  645. .textarea {
  646. width: 355px;
  647. height: 160px;
  648. padding: 15px 10px;
  649. box-sizing: border-box;
  650. margin: 0 auto;
  651. }
  652. }
  653. .input-box {
  654. width: 100vw;
  655. background: #fff;
  656. box-sizing: border-box;
  657. padding-left: 10px;
  658. .box {
  659. display: flex;
  660. width: 100%;
  661. min-height: 54.4px;
  662. padding: 15px 0;
  663. box-sizing: border-box;
  664. align-items: center;
  665. }
  666. .label {
  667. width: 100px;
  668. margin-right: 10px;
  669. line-height: 20px;
  670. font-family: Source Han Sans SC, Source Han Sans SC;
  671. font-size: 14px;
  672. color: #666666;
  673. flex-shrink: 0;
  674. .must {
  675. color: #E3041F;
  676. margin-right: 5px;
  677. }
  678. }
  679. .content-box {
  680. padding-right: 10px;
  681. .content {
  682. flex: 1;
  683. display: flex;
  684. align-items: center;
  685. box-sizing: border-box;
  686. .icon {
  687. padding: 5px;
  688. }
  689. }
  690. .err-text {
  691. font-size: 12px;
  692. color: #E3041F;
  693. margin-bottom: -12px;
  694. .icon {
  695. margin-right: 2px;
  696. }
  697. }
  698. }
  699. }
  700. .region {
  701. width: 100vw;
  702. background: #fff;
  703. box-sizing: border-box;
  704. padding: 15px 0 0 10px;
  705. .box {
  706. display: flex;
  707. padding-bottom: 15px;
  708. padding-right: 10px;
  709. box-sizing: border-box;
  710. .label {
  711. width: 100px;
  712. margin-right: 10px;
  713. line-height: 20px;
  714. font-family: Source Han Sans SC, Source Han Sans SC;
  715. font-size: 14px;
  716. color: #666666;
  717. flex-shrink: 0;
  718. .must {
  719. color: #E3041F;
  720. margin-right: 5px;
  721. }
  722. }
  723. .content-box {
  724. flex: 1;
  725. display: flex;
  726. align-items: center;
  727. justify-content: space-between;
  728. height: 20px;
  729. line-height: 20px;
  730. .placeholder {
  731. font-family: Source Han Sans SC, Source Han Sans SC;
  732. font-size: 14px;
  733. color: #BBBBBB;
  734. }
  735. }
  736. }
  737. }
  738. </style>