my_form.vue 30 KB

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