my_form.vue 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896
  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" 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. <!-- 标签 -->
  216. <view class="tag-box custom-class-box " v-else-if="item.type == 'tag'"
  217. :style="{ marginTop: tovw(item.marginTop || 0) }">
  218. <text class="label">{{ item.label }}</text>
  219. <view class="tag-list">
  220. <view class="tag" v-for="tag in item.value" :key="tag">
  221. <text>{{tag}}</text>
  222. <view @click="delTag(tag,index)" class="del">x</view>
  223. </view>
  224. <view>
  225. <u-modal :title="item.label" :show="showTagModal" style="flex: 0 !important;" confirmColor='#C30D23' ref="uModal" showCancelButton :asyncClose="false"
  226. @confirm="addTagSend(index)" @cancel="showTagModal = false">
  227. <view class="slot-content">
  228. <view v-if="item.errText" class="err-text" style="margin-bottom: 10px;">
  229. <icon class="icon" color="#E3041F" type="clear" size="2.733vw" />
  230. {{ item.errText }}
  231. </view>
  232. <u--input :focus="showUModal" @input="onTagInput($event, index)" :placeholder="item.placeholder || '请输入'" v-model="tagValue" border="bottom" clearable />
  233. </view>
  234. </u-modal>
  235. <view class="add-tag" @click="showTagModal=true">+ 添加</view>
  236. </view>
  237. </view>
  238. </view>
  239. </block>
  240. </block>
  241. </view>
  242. </template>
  243. <script>
  244. import { formattedFiles, viewImage } from "../utils/settleFiles.js"
  245. export default {
  246. name: "my_form",
  247. props: {
  248. form: {
  249. type: Array,
  250. default: []
  251. },
  252. isUncomplete: {
  253. type: Function
  254. },
  255. onUploading: {
  256. type: Function
  257. },
  258. requiredFieldOnly: {
  259. type: Boolean
  260. },
  261. isShowAll: {
  262. type: Function
  263. },
  264. interrupt: {
  265. type: Function
  266. }
  267. },
  268. data() {
  269. return {
  270. list: [],
  271. focusLabel: "",
  272. unShowAll: false,
  273. showTagModal:false,
  274. tagValue:''
  275. }
  276. },
  277. watch: {
  278. form: {
  279. handler: function (newVal) {
  280. if (newVal) {
  281. this.list = JSON.parse(JSON.stringify(newVal));
  282. setTimeout(() => {
  283. this.verify()
  284. }, 200);
  285. }
  286. },
  287. immediate: true,
  288. },
  289. unShowAll: function (newVal) {
  290. this.$emit("isShowAll", newVal)
  291. }
  292. },
  293. async created() {
  294. /* let list = [{
  295. key: "name",
  296. type: "text",
  297. label: "标题",
  298. isMust: true,//是否必填
  299. value: "",
  300. inputmode:"", //https://uniapp.dcloud.net.cn/component/input.html#type
  301. marginTop: 10,
  302. verify:[],
  303. }, {
  304. key: "Class",
  305. type: "customClass",
  306. label: "标题",
  307. isMust: false,//是否必填
  308. isMultipleChoice: true,//是否多选
  309. value: [],// 多选[] 单选 ""
  310. isMust: true,//是否必填
  311. list: await this.getCustomClass('picturespace'),
  312. marginTop: 10
  313. },{
  314. key: "attachmentids",
  315. type: "upload",
  316. label: "图片/视频",
  317. accept:"all",
  318. placeholder: "可上传多个视频或图片",
  319. ownertable: "temporary",
  320. ownerid: 999,
  321. usetype: 'default',
  322. allowUpload: true,
  323. allowDelete: true,
  324. value:[],
  325. marginTop: 10
  326. }, {
  327. key: "region",
  328. type: "region",
  329. label: "所在地区",
  330. isMust: true,//是否必填
  331. value: [],
  332. }, {
  333. key: "address",
  334. type: "textarea",
  335. label: "详细地址",
  336. isMust: true,//是否必填
  337. value: '',
  338. }, {
  339. key: "isdefault",
  340. type: "switch",
  341. label: "设为默认地址",
  342. isMust: false,//是否必填
  343. value: false,
  344. isNum: true,
  345. unBorBot: true
  346. }] */
  347. },
  348. methods: {
  349. delTag (tag,index) {
  350. let item = this.list[index];
  351. console.log(tag);
  352. item.value.splice(item.value.indexOf(tag),1)
  353. this.$set(this.list[index], 'value', item.value)
  354. },
  355. addTagSend (index) {
  356. let item = this.list[index]
  357. if (!item.errText) {
  358. item.value.push(this.tagValue)
  359. this.$set(this.list[index], 'value', item.value)
  360. this.tagValue = ''
  361. this.showTagModal = false
  362. }
  363. },
  364. toRoute(item, index) {
  365. uni.navigateTo({
  366. url: item.path
  367. });
  368. this.$Http.routeSelected = function (selected) {
  369. this.$emit('interrupt', item, selected, index)
  370. delete this.$Http.routeSelected;
  371. }.bind(this)
  372. },
  373. onTagInput(e, index) {
  374. let item = this.list[index];
  375. item.errText = "";
  376. if (item.verify && item.verify.length && this.tagValue != '') {
  377. let err = item.verify.find(r => !new RegExp(r.reg).test(this.tagValue));
  378. if (err) this.$set(this.list[index], 'errText', err.errText)
  379. }
  380. this.verify()
  381. },
  382. onInput(e, index) {
  383. let item = this.list[index];
  384. item.errText = "";
  385. this.$set(this.list[index], 'value', e.detail.value)
  386. if (item.verify && item.verify.length && item.value != '') {
  387. let err = item.verify.find(r => !new RegExp(r.reg).test(item.value));
  388. if (err) this.$set(this.list[index], 'errText', err.errText)
  389. }
  390. this.verify()
  391. },
  392. setItem(index, item, back = false) {
  393. this.$set(this.list, index, item)
  394. this.verify()
  395. if (back) uni.navigateBack();
  396. },
  397. setValue(index, value, back = false) {
  398. this.$set(this.list[index], 'value', value)
  399. this.verify()
  400. if (back) uni.navigateBack();
  401. },
  402. onClearInput(index) {
  403. let item = this.list[index];
  404. item.errText = ''
  405. this.$set(this.list[index], 'value', '')
  406. this.verify()
  407. },
  408. switchChange(e, index) {
  409. this.$set(this.list[index], 'value', e)
  410. this.verify()
  411. },
  412. changOptions(value, index) {
  413. let item = this.list[index];
  414. if (item.isMultipleChoice) {
  415. let i = -1;
  416. try {
  417. i = item.value.findIndex(v => v == value)
  418. } catch (error) {
  419. }
  420. if (i == -1) {
  421. item.value.push(value)
  422. } else {
  423. item.value.splice(i, 1)
  424. }
  425. this.$set(this.list[index], 'value', item.value)
  426. } else {
  427. this.$set(this.list[index], 'value', value)
  428. }
  429. this.verify()
  430. },
  431. verify() {
  432. let list = this.list.filter(v => v.isMust);
  433. let Uncomplete = false;
  434. if (list.length) Uncomplete = list.some(v => {
  435. let res = false;
  436. if (v.type == 'customClass') {
  437. if (v.isMultipleChoice) {
  438. res = v.value.length == 0;
  439. } else {
  440. res = v.value == "";
  441. }
  442. } else if (v.type == 'upload') {
  443. res = v.value.length == 0;
  444. } else if (v.type == 'text') {
  445. res = v.value == "";
  446. if (v.errText) res = true;
  447. } else {
  448. res = v.value == "";
  449. }
  450. return res
  451. })
  452. if (!Uncomplete) Uncomplete = this.list.filter(v => !v.isMust).some(v => v.errText);
  453. this.$emit("isUncomplete", Uncomplete)
  454. },
  455. previewImg(item) {
  456. viewImage(item.url)
  457. },
  458. uploadCallback(attachmentids, index) {
  459. let item = this.list[index];
  460. this.$Http.basic({
  461. "classname": "system.attachment.Attachment",
  462. "method": "createFileLink",
  463. "content": {
  464. ownertable: item.ownertable,
  465. ownerid: item.ownerid,
  466. usetype: item.usetype,
  467. attachmentids
  468. }
  469. }).then(res => {
  470. console.log('绑定附件', res)
  471. if (this.cutoff(res.msg)) return;
  472. res.data = formattedFiles(res.data)
  473. item.value.push(res.data[0]);
  474. //临时文件
  475. if (res.data[0].ownertable == "temporary") try {
  476. item.temporarys.push(attachmentids[0])
  477. } catch (error) {
  478. item.temporarys = [attachmentids[0]]
  479. }
  480. this.$set(this.list[index], 'value', item.value)
  481. this.verify()
  482. })
  483. },
  484. deleteFiles() {
  485. this.list.forEach(v => {
  486. if (v.type == 'upload') {
  487. let linksids = v.value.filter(v => v.ownertable == "temporary").map(v => v.linksid)
  488. if (linksids.length) this.$Http.basic({
  489. "classname": "system.attachment.Attachment",
  490. "method": "deleteFileLink",
  491. "content": {
  492. linksids
  493. }
  494. }).then(res => {
  495. console.log("处理删除附件", res)
  496. if (this.cutoff(res.msg)) return;
  497. });
  498. }
  499. });
  500. },
  501. onUploadLoading(e, index) {
  502. this.$set(this.list[index], 'loading', e)
  503. this.$emit("onUploading", e)
  504. },
  505. groupChange(e, index) {
  506. this.$set(this.list[index], 'loading', e)
  507. this.verify()
  508. },
  509. selectRegion({ detail }, index) {
  510. this.$set(this.list[index], 'value', detail.value)
  511. this.verify()
  512. },
  513. deleteFile(flie, index) {
  514. let item = this.list[index];
  515. item.value = item.value.filter(v => v.attachmentid != flie.attachmentid)
  516. //临时文件
  517. if (flie.ownertable == "temporary") {
  518. item.temporarys = item.temporarys.filter(v => v != flie.attachmentid)
  519. this.$Http.basic({
  520. "classname": "system.attachment.Attachment",
  521. "method": "deleteFileLink",
  522. "content": {
  523. linksids: [flie.linksid]
  524. }
  525. }).then(res => {
  526. console.log("处理删除附件", res)
  527. if (this.cutoff(res.msg)) return;
  528. });
  529. } else {
  530. try {
  531. item.linksids.push(flie.linksid)
  532. } catch (error) {
  533. item.linksids = [flie.linksid]
  534. }
  535. }
  536. this.$set(this.list[index], 'value', item.value)
  537. this.verify()
  538. },
  539. submit() {
  540. return new Promise((resolve, reject) => {
  541. let res = {};
  542. this.list.forEach(v => {
  543. if (v.type == 'upload') {
  544. res.files = {
  545. temporarys: [],
  546. linksids: [],
  547. }
  548. try {
  549. res.files.temporarys = v.temporarys || []
  550. } catch (error) {
  551. }
  552. try {
  553. res.files.linksids = v.linksids || []
  554. } catch (error) {
  555. }
  556. } else if (v.type == 'region') {
  557. if (v.value.length) {
  558. res.province = v.value[0];
  559. res.city = v.value[1];
  560. res.county = v.value[2];
  561. } else {
  562. res.province = ''
  563. res.city = ''
  564. res.county = ''
  565. }
  566. } else if (v.type == 'switch') {
  567. if (v.isNum) {
  568. res[v.key] = v.value ? 1 : 0;
  569. } else {
  570. res[v.key] = v.value;
  571. }
  572. } else {
  573. try {
  574. res[v.key] = v.value.trim();
  575. } catch (error) {
  576. res[v.key] = v.value;
  577. }
  578. }
  579. })
  580. resolve(res)
  581. })
  582. }
  583. },
  584. }
  585. </script>
  586. <style lang="scss">
  587. .requiredFieldOnly-head {
  588. display: flex;
  589. align-items: center;
  590. justify-content: space-between;
  591. width: 100vw;
  592. height: 45px;
  593. background: #F7F7F7;
  594. padding: 0 10px;
  595. box-sizing: border-box;
  596. .label {
  597. font-family: PingFang SC, PingFang SC;
  598. font-weight: bold;
  599. font-size: 15px;
  600. color: #333333;
  601. line-height: 22px;
  602. }
  603. .content {
  604. display: flex;
  605. align-items: center;
  606. font-family: PingFang SC, PingFang SC;
  607. font-size: 14px;
  608. color: #999999;
  609. }
  610. }
  611. .borBot {
  612. border-bottom: 1px #DDDDDD solid;
  613. }
  614. .custom-class-box {
  615. width: 100%;
  616. background: #fff;
  617. padding: 15px 0 15px 10px;
  618. box-sizing: border-box;
  619. .head {
  620. width: 355px;
  621. height: 20px;
  622. display: flex;
  623. justify-content: space-between;
  624. align-items: flex-end;
  625. .label {
  626. font-size: 14px;
  627. color: #333333;
  628. line-height: 20px;
  629. }
  630. .state {
  631. font-family: Source Han Sans SC, Source Han Sans SC;
  632. font-size: 12px;
  633. color: #999999;
  634. }
  635. }
  636. .options {
  637. display: flex;
  638. flex-wrap: wrap;
  639. .option {
  640. padding: 6px 10px;
  641. text-align: center;
  642. min-width: 81px;
  643. font-family: PingFang SC, PingFang SC;
  644. font-size: 14px;
  645. color: #333333;
  646. border-radius: 5px;
  647. background: #F2F2F2;
  648. margin-top: 10px;
  649. margin-right: 10px;
  650. box-sizing: border-box;
  651. }
  652. .active {
  653. background: #C30D23;
  654. color: #fff;
  655. }
  656. }
  657. .content {
  658. .file-box {
  659. position: relative;
  660. width: 355px;
  661. height: 240px;
  662. margin-top: 10px;
  663. .video,
  664. .image {
  665. width: 355px;
  666. height: 240px;
  667. border-radius: 5px;
  668. }
  669. .delete {
  670. position: absolute;
  671. width: 30px;
  672. top: 0;
  673. right: 0;
  674. z-index: 1;
  675. }
  676. }
  677. .upload-box {
  678. display: flex;
  679. justify-content: center;
  680. align-items: center;
  681. width: 355px;
  682. height: 45px;
  683. background: #FFFFFF;
  684. border-radius: 5px;
  685. border: 1px dashed #C30D23;
  686. font-family: Source Han Sans SC, Source Han Sans SC;
  687. font-size: 14px;
  688. color: #C30D23;
  689. margin-top: 10px;
  690. }
  691. }
  692. }
  693. .textarea-box {
  694. width: 100%;
  695. .textarea {
  696. width: 355px;
  697. height: 160px;
  698. padding: 15px 10px;
  699. box-sizing: border-box;
  700. margin: 0 auto;
  701. }
  702. }
  703. .input-box {
  704. width: 100vw;
  705. background: #fff;
  706. box-sizing: border-box;
  707. padding-left: 10px;
  708. .box {
  709. display: flex;
  710. width: 100%;
  711. min-height: 54.4px;
  712. padding: 15px 0;
  713. box-sizing: border-box;
  714. align-items: center;
  715. }
  716. .label {
  717. width: 100px;
  718. margin-right: 10px;
  719. line-height: 20px;
  720. font-family: Source Han Sans SC, Source Han Sans SC;
  721. font-size: 14px;
  722. color: #666666;
  723. flex-shrink: 0;
  724. .must {
  725. color: #E3041F;
  726. margin-right: 5px;
  727. }
  728. }
  729. .content-box {
  730. padding-right: 10px;
  731. .content {
  732. flex: 1;
  733. display: flex;
  734. align-items: center;
  735. box-sizing: border-box;
  736. .icon {
  737. padding: 5px;
  738. }
  739. }
  740. .err-text {
  741. font-size: 12px;
  742. color: #E3041F;
  743. margin-bottom: -12px;
  744. .icon {
  745. margin-right: 2px;
  746. }
  747. }
  748. }
  749. }
  750. .region {
  751. width: 100vw;
  752. background: #fff;
  753. box-sizing: border-box;
  754. padding: 15px 0 0 10px;
  755. .box {
  756. display: flex;
  757. padding-bottom: 15px;
  758. padding-right: 10px;
  759. box-sizing: border-box;
  760. .label {
  761. width: 100px;
  762. margin-right: 10px;
  763. line-height: 20px;
  764. font-family: Source Han Sans SC, Source Han Sans SC;
  765. font-size: 14px;
  766. color: #666666;
  767. flex-shrink: 0;
  768. .must {
  769. color: #E3041F;
  770. margin-right: 5px;
  771. }
  772. }
  773. .content-box {
  774. flex: 1;
  775. display: flex;
  776. align-items: center;
  777. justify-content: space-between;
  778. height: 20px;
  779. line-height: 20px;
  780. .placeholder {
  781. font-family: Source Han Sans SC, Source Han Sans SC;
  782. font-size: 14px;
  783. color: #BBBBBB;
  784. }
  785. }
  786. }
  787. }
  788. .tag-box {
  789. .label {
  790. width: 100px;
  791. margin-right: 10px;
  792. line-height: 20px;
  793. font-family: Source Han Sans SC, Source Han Sans SC;
  794. font-size: 14px;
  795. color: #666666;
  796. flex-shrink: 0;
  797. .must {
  798. color: #E3041F;
  799. margin-right: 5px;
  800. }
  801. }
  802. .tag-list{
  803. display: flex;
  804. align-content: center;
  805. align-items: center;
  806. flex-wrap: wrap;
  807. font-family: PingFang SC, PingFang SC;
  808. margin-top:10px;
  809. .err-text {
  810. font-size: 12px;
  811. color: #E3041F;
  812. margin-bottom: -12px;
  813. .icon {
  814. margin-right: 2px;
  815. }
  816. }
  817. .tag {
  818. padding: 6px 10px;
  819. background: #F2F2F2;
  820. border-radius: 5px 5px 5px 5px;
  821. margin-right: 10px;
  822. margin-bottom: 10px;
  823. font-weight: 400;
  824. font-size: 14px;
  825. color: #333333;
  826. display: flex;
  827. align-items: center;
  828. align-content: center;
  829. text-align:center;
  830. &:last-child {
  831. margin-right: 0 !important;
  832. }
  833. .del {
  834. margin-left: 10px;
  835. padding: 2px;
  836. }
  837. }
  838. .add-tag {
  839. border-radius: 5px 5px 5px 5px;
  840. border: 1px dashed #C30D23;
  841. padding: 6px 20px;
  842. color:#C30D23;
  843. font-weight: 400;
  844. margin-bottom:10px;
  845. font-size: 14px;
  846. }
  847. }
  848. }
  849. </style>