Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722
  1. <template>
  2. <!-- 通用表单 modify by ht
  3. @submit="formSubmit"-->
  4. <form>
  5. <view v-for="(item, index) in formData" :key="index">
  6. <view v-show="!item.hide">
  7. <!-- 是否显示-->
  8. <view style="min-height: 80rpx" :class="
  9. item.vertical === 2 ? 'as-layout-vertical' : 'as-layout-horizontal'
  10. ">
  11. <!-- 标题 -->
  12. <view class="as-gravity-center-start" :style="{
  13. minWidth: config.titleWidth + 'rpx',
  14. marginTop: `${item.bg || item.vertical === 2 ? '30rpx' : ''}`,
  15. }" style="
  16. margin-left: 20rpx;
  17. flex-direction: row;
  18. display: flex;
  19. flex-direction: row;
  20. ">
  21. <!-- <image class="img-size" mode="aspectFill" :src="item.required ? '../must.png' : ''"></image> -->
  22. <!-- :class="item.vertical === 2 ? 'text-left' : 'text-justify'" -->
  23. <span v-if="item.star" style="color: red">*</span>
  24. <view class="text-title" :style="{
  25. color: `#${item.labelColor ?item.labelColor:'333333'}`,
  26. width: '100%',
  27. }">
  28. {{ item.title }}
  29. </view>
  30. </view>
  31. <!-- 内容 -->
  32. <view class="as-weight as-gravity-center-start">
  33. <!-- 文本内容 -->
  34. <view v-if="item.type === 1" :class="item.bg ? 'bg' : 'notbg'" class="text-hint"
  35. :style="item.style">{{ item[item.value] }}</view>
  36. <!-- 输入框 -->
  37. <view v-if="item.type === 2" style="width: 100%" :class="item.bg ? 'bg' : 'notbg'">
  38. <view class="as-layout-horizontal" style="align-items: center">
  39. <input :disabled="item.disabled" v-model="item[item.value]" :type="item.inputType"
  40. :placeholder="item.hint ? item.hint : '请输入' + item.title"
  41. placeholder-class="text-hint" class="text" :maxlength="item.maxlength"
  42. :style="item.style" style="min-height: 80rpx; word-break: break-all; flex: 1"
  43. @input="inputChange($event, item)" />
  44. <view v-if="item.btn" class="as-gravity-center">
  45. <!-- 验证码 -->
  46. <verification-code v-if="item.btnType === 'code'"
  47. :mobile="item.codeValue"></verification-code>
  48. <button v-else size="mini" style="background-color: #2ce242; color: #fff"
  49. @click="inputBtnClickHandle(item)">
  50. {{ item.btnTitle }}
  51. </button>
  52. </view>
  53. </view>
  54. </view>
  55. <!-- 多项选择器 -->
  56. <view v-if="item.type === 3" :class="item.bg ? 'bg' : 'notbg'">
  57. <checkbox-group @change="checkboxChange($event, item)" :disabled="item.disabled">
  58. <view class="as-layout-horizontal" style="justify-content: right">
  59. <label style="
  60. display: flex;
  61. flex-direction: row;
  62. margin-right: 30rpx;
  63. " v-for="(itemData, index) in item.itemData" :key="index">
  64. <checkbox style="transform: scale(0.7)" :value="itemData.value"
  65. :checked="itemData.checked" />
  66. <view>{{ itemData.name }}</view>
  67. </label>
  68. </view>
  69. </checkbox-group>
  70. </view>
  71. <!-- 普通选择器 当 range 是一个 Array<Object> 时,通过 range-key 来指定 Object 中 key 的值作为选择器显示内容 :range-key="item[item.value]"-->
  72. <view v-if="item.type === 4" style="width: 100%" :class="item.bg ? 'bg' : 'notbg'">
  73. <!-- range[范围] value[初始选择]-->
  74. <view class="as-layout-horizontal" style="align-items: center">
  75. <view v-if="item.mode === 'custom'" :class="item[item.value] ? 'text' : 'text-hint'"
  76. style="flex: 1" @click="emit('pickerCustom', item)">
  77. {{
  78. item[item.value]
  79. ? item.itemKey
  80. ? item[item.value][item.itemKey]
  81. : item[item.value]
  82. : item.hint
  83. ? item.hint
  84. : "请选择" + item.title
  85. }}
  86. </view>
  87. <template v-else-if="item.mode === 'search' && state.sysType == 'WECHAT'">
  88. <view :disabled="item.disabled" :class="item[item.value] ? 'text' : 'text-hint'"
  89. style="flex: 1" @click="item.searchPickerVisible = true">
  90. {{
  91. item[item.value]
  92. ? item.itemKey
  93. ? item[item.value][item.itemKey]
  94. : item[item.value]
  95. : item.hint
  96. ? item.hint
  97. : "请选择" + item.title
  98. }}
  99. </view>
  100. <search-picker :visible="item.searchPickerVisible" :dataSource="item.itemData"
  101. v-model="item[item.value]"
  102. @hidePicker="item.searchPickerVisible = false"></search-picker>
  103. </template>
  104. <picker v-else mode="selector" :range="item.itemData"
  105. @change="bindPickerChange($event, item)">
  106. <view :class="item[item.value] ? 'text' : 'text-hint'">
  107. {{
  108. item[item.value]
  109. ? item.itemKey
  110. ? item[item.value][item.itemKey]
  111. : item[item.value]
  112. : item.hint
  113. ? item.hint
  114. : "请选择" + item.title
  115. }}
  116. </view>
  117. </picker>
  118. <image class="arror" mode="aspectFill" :src="`${$imgUrl}common/arror-right.png`">
  119. </image>
  120. </view>
  121. </view>
  122. <!-- 富文本框 -->
  123. <view v-if="item.type === 5" style="width: 100%; margin: 30rpx 25rpx 0rpx">
  124. <view>
  125. <textarea :disabled="item.disabled" v-model="item[item.value]"
  126. @input="textareaInput($event, item)" :class="item.bg ? 'textarea-bg' : 'notbg'"
  127. placeholder-class="text-hint" style="width: 100%" :maxlength="item.maxlength"
  128. :placeholder="item.hint ? item.hint : '请输入' + item.title">
  129. </textarea>
  130. </view>
  131. </view>
  132. <!-- 图片选择器 :imgWidth="imgWidth ? imgWidth : 0"-->
  133. <view v-if="item.type === 6" style="width: 100%" :class="item.bg ? 'bg' : 'notbg'">
  134. <form-image @backImg="backImg($event, item)" style="width: 100%" :retract="40"></form-image>
  135. </view>
  136. <!-- 单向选择器 -->
  137. <view v-if="item.type === 7" style="width: 100%" :class="item.bg ? 'bg' : 'notbg'">
  138. <radio-group @change="radioChange($event, item)">
  139. <view class="as-layout-horizontal" style="justify-content: right">
  140. <view style="flex: 1"></view>
  141. <label style="
  142. display: flex;
  143. flex-direction: row;
  144. margin-left: 30rpx;
  145. " v-for="(itemData, index) in item.itemData" :key="index">
  146. <radio style="transform: scale(0.7)" :value="itemData.value"
  147. :checked="itemData.checked" color="#2CE242" />
  148. <view>{{ itemData.name }}</view>
  149. </label>
  150. </view>
  151. </radio-group>
  152. </view>
  153. <!-- 证件照上传 -->
  154. <view v-if="item.type === 8" style="width: 100%" :class="item.bg ? 'bg' : 'notbg'">
  155. <view style="margin: 0 40rpx">
  156. <view class="text-error">{{ item.hint }}</view>
  157. <view class="as-layout-horizontal as-gravity-center"
  158. style="height: 250rpx; margin-top: 20rpx">
  159. <view class="as-layout-vertical" style="width: 90%; height: 100%">
  160. <image :src="
  161. item.placeholderImg1
  162. ? item.placeholderImg1
  163. : `${$imgUrl}license2.png`
  164. " style="width: 100%; height: 80%" @tap="ImageSelection(item, 1)" mode="aspectFill"></image>
  165. <view class="as-gravity-center text-hint" style="margin-top: 5rpx">
  166. {{ item.hint1 }}
  167. </view>
  168. </view>
  169. <view style="width: 40rpx"></view>
  170. <view class="as-layout-vertical" style="width: 90%; height: 100%">
  171. <image :src="
  172. item.placeholderImg2
  173. ? item.placeholderImg2
  174. : `${$imgUrl}license2.png`
  175. " style="width: 100%; height: 80%" @tap="ImageSelection(item, 2)" mode="aspectFill"></image>
  176. <view class="as-gravity-center text-hint" style="margin-top: 5rpx">
  177. {{ item.hint2 }}
  178. </view>
  179. </view>
  180. </view>
  181. </view>
  182. </view>
  183. <!-- 车牌号输入 -->
  184. <view v-if="item.type === 9" style="width: 100%" :class="item.bg ? 'bg' : 'notbg'">
  185. <view style="margin: 20rpx -20rpx 10rpx">
  186. <car-num-ber-input @numberInputResult="numberInputResult($event, item)">
  187. </car-num-ber-input>
  188. </view>
  189. </view>
  190. <!-- 省市区选择 -->
  191. <view v-if="item.type === 10" style="width: 100%" :class="item.bg ? 'bg' : 'notbg'">
  192. <view class="as-layout-horizontal" style="align-items: center">
  193. <picker mode="region" @change="handleGetRegion($event, item)" :value="item.region">
  194. <view class="uni-input">
  195. {{item.region?item.region[0]+item.region[1]+item.region[2]:""}}
  196. </view>
  197. </picker>
  198. </view>
  199. </view>
  200. <!-- 车辆图片上传 -->
  201. <view v-if="item.type === 11" style="width: 100%" :class="item.bg ? 'bg' : 'notbg'">
  202. <view class="imgs-box as-layout-horizontal">
  203. <view class="img-box" v-for="(img, index) in item.imgList">
  204. <form-image @backImg="backImg2($event, img, item)" style="width: 100%"
  205. :imgWidth="120" :retract="-10" :showTxt="false" :count="1"
  206. @removeImg="removeImg2($event, img, item)"></form-image>
  207. <view class="img-hint">{{ img.hint }}</view>
  208. </view>
  209. </view>
  210. </view>
  211. </view>
  212. </view>
  213. <view v-show="index !== formData.length - 1 && !item.underline" class="as-line3"
  214. style="margin: 0rpx 20rpx 0rpx 20rpx"></view>
  215. <view class="divider" v-if="item.divider"></view>
  216. </view>
  217. </view>
  218. <view class="message" v-if="config.submitName=='申请退货'">
  219. <view><text class="red">*</text>申请退货需将原设备寄回</view>
  220. <view>寄回信息:</view>
  221. <view>收件人:ETC售后 联系电话:18798751224(此电话仅用于ETC售后收取快递,如需咨询业务请致电4008008787)</view>
  222. <view>寄回地址:贵州省贵阳市云岩区普天广场11楼</view>
  223. </view>
  224. <view class="subBtn">
  225. <submit-button :title="config ? config.submitName : '提交'" form-type="submit"
  226. @submit="formSubmit"></submit-button>
  227. </view>
  228. </form>
  229. </template>
  230. <script setup lang="ts">
  231. import { onLoad, onShow } from "@dcloudio/uni-app";
  232. import { TypeData, ImgData } from "./tools";
  233. import { request } from "@/utils/network/request.js";
  234. import carNumBerInput from "@/components/car-number-input/car-number-input";
  235. import { pathToBase64 } from "@/utils/util/imageTool.js";
  236. import pickRegions from "@/login/pick-regions/pick-regions.vue";
  237. import { onMounted, ref } from "vue";
  238. import { reactive } from "vue";
  239. onShow((option : any) => {
  240. // #ifdef MP-ALIPAY
  241. state.sysType = 'ALI';
  242. // #endif
  243. // #ifdef MP-WEIXIN
  244. state.sysType = 'WECHAT';
  245. // #endif
  246. });
  247. const defaultRegionCode = "520115";
  248. const props = defineProps({
  249. formData: {
  250. type: Array as () => Array<TypeData>,
  251. default: () => [],
  252. },
  253. config: {
  254. type: Object,
  255. default: function () {
  256. return {
  257. submitName: "提交", //提交按钮名称
  258. titleWidth: 120, //标题宽度
  259. };
  260. },
  261. },
  262. });
  263. const state = reactive({
  264. multiIndex: [0, 0, 0],
  265. sysType: ""
  266. })
  267. //defineEmits
  268. const emit = defineEmits<{
  269. (e : "submit", content : any) : void;
  270. (e : "uploadImg", content : any, item : TypeData, index : Number) : void;
  271. (e : "radioChange", event : any, item : TypeData) : void;
  272. (e : "addressInfo", content : any) : void;
  273. (e : "inputChange", event : any, item : TypeData) : void;
  274. (e : "pickerCustom", item : TypeData) : void;
  275. (e : "handleGetRegion", event : any, item : TypeData) : void;
  276. }>();
  277. //defineExpose 可宏来显式指定在 <script setup> 组件中要暴露出去的属性。
  278. //普通选择器
  279. function bindPickerChange(e : any, item : TypeData) {
  280. let select = e.target.value;
  281. // #ifdef H5
  282. select = e.detail.value;
  283. // #endif
  284. if (item.mode === "date" || item.mode === "time") {
  285. /* 日期选择器*/
  286. item[item.value] = select;
  287. } else {
  288. /* 普通选择器*/
  289. item[item.value] = item.itemData[select];
  290. }
  291. console.log("111111", item.mode, item[item.value])
  292. }
  293. //输入框后按钮点击
  294. const inputBtnClickHandle = (item : TypeData) => {
  295. if (item.btnType === "address") {
  296. //#ifdef MP-WEIXIN
  297. uni.chooseAddress({
  298. success: (res) => {
  299. console.log("addressInfo", res)
  300. emit("addressInfo", res);
  301. },
  302. fail: (err) => {
  303. showToast("获取失败!");
  304. },
  305. });
  306. //#endif
  307. //#ifdef MP-ALIPAY
  308. my.getAddress({
  309. success: (res) => {
  310. console.log("addressInfo", res.result)
  311. emit("addressInfo", res.result);
  312. },
  313. fail: (err) => {
  314. showToast("获取失败!");
  315. },
  316. });
  317. //#endif
  318. } else if (item.btnType === "code") {
  319. //获取验证码
  320. showToast("获取验证码");
  321. }
  322. };
  323. // 获取选择的地区
  324. function handleGetRegion(e : any, item : TypeData) {
  325. item[item.value] = e.detail.value;
  326. emit("handleGetRegion", e, item);
  327. }
  328. //多项选择器
  329. function checkboxChange(e : any, item : TypeData) {
  330. item[item.value] = e.detail.value; /* 赋值*/
  331. }
  332. //单项选择器
  333. function radioChange(e : any, item : TypeData) {
  334. item[item.value] = e.detail.value; /* 赋值*/
  335. emit("radioChange", e, item);
  336. }
  337. //文本输入框
  338. function inputChange(e : Event, item : TypeData) {
  339. emit("inputChange", e, item);
  340. }
  341. //富文本框输入内容
  342. function textareaInput(e : Event, item : TypeData) {
  343. item.num = item[item.value].length;
  344. }
  345. //点击图片按钮
  346. function backImg(e : Event, item : TypeData) {
  347. item[item.value] = e;
  348. }
  349. //点击图片按钮2
  350. function backImg2(e : Event, imgItem : ImgData, item : TypeData) {
  351. imgItem[imgItem.value] = e;
  352. let all = true;
  353. let srcUrl = "";
  354. item.imgList.map((temp) => {
  355. if (!temp[temp.value]) {
  356. all = false;
  357. return;
  358. } else {
  359. srcUrl = srcUrl + temp[temp.value] + ",";
  360. }
  361. });
  362. if (all) {
  363. item[item.value] = srcUrl;
  364. }
  365. }
  366. //删除图片
  367. const removeImg2 = (e : Event, imgItem : ImgData, item : TypeData) => {
  368. imgItem[imgItem.value] = "";
  369. item[item.value] = "";
  370. };
  371. //车牌输入
  372. function numberInputResult(e : Event, item : TypeData) {
  373. item[item.value] = e;
  374. }
  375. //选择图片按钮
  376. function ImageSelection(item : TypeData, index : number) {
  377. uni.chooseImage({
  378. count: 1, //最多可以选择的文件个数
  379. sourceType: ["camera"], //album 从相册选视频,camera 使用相机拍摄,默认为:['album', 'camera']
  380. success(res : any) {
  381. if (res.tempFiles[0].size > 2000000) {
  382. uni.showToast({
  383. title: "图片大于2M,请重新上传",
  384. icon: "none",
  385. duration: 1500,
  386. });
  387. return;
  388. }
  389. // #ifdef MP-WEIXIN
  390. uni.getFileSystemManager().readFile({
  391. filePath: res.tempFiles[0].tempFilePath, //要读取的文件的路径
  392. encoding: "base64", //编码格式
  393. success: (res) => {
  394. let imgBase64 = res.data;
  395. let reqData = {
  396. imageBase: imgBase64,
  397. accountNum: "qtzl_xcx",
  398. secretKey: "4DE47302-EDC7-41D4-888F-59A79DF4EA46",
  399. };
  400. //上传给服务器
  401. uni.showLoading({
  402. title: "正在加载中...",
  403. mask: true,
  404. });
  405. //文件上传
  406. request("", {
  407. baseUrl: "https://etcfile.etcjz.cn/v1/file/uploadImageBaseFile",
  408. data: reqData,
  409. }).then((content) => {
  410. uni.hideLoading();
  411. if (content.rc != "00") {
  412. uni.showModal({
  413. title: "请求错误",
  414. content: "图片上传失败",
  415. showCancel: false,
  416. confirmText: "取消",
  417. });
  418. }
  419. //处理后的 Data
  420. let data = {
  421. source: 2, //来源
  422. imageBase64: imgBase64,
  423. imageType: index,
  424. imageUrl: content.data.fileUrl,
  425. };
  426. emit("uploadImg", data, item, index);
  427. });
  428. },
  429. fail: (err) => {
  430. console.log("错误提示", err);
  431. },
  432. });
  433. // #endif
  434. // #ifdef H5
  435. pathToBase64(res.tempFilePaths[0]).then((data) => {
  436. let base64 = data.replaceAll("data:image/jpeg;base64,", "");
  437. base64 = base64.replaceAll("data:image/png;base64,", "");
  438. base64 = base64.replaceAll("data:image/jpg;base64,", "");
  439. let reqData = {
  440. imageBase: base64,
  441. accountNum: "qtzl_xcx",
  442. secretKey: "4DE47302-EDC7-41D4-888F-59A79DF4EA46",
  443. };
  444. //上传给服务器
  445. uni.showLoading({
  446. title: "文件上传中...",
  447. mask: true,
  448. });
  449. //文件上传
  450. request("", {
  451. baseUrl: "https://etcfile.etcjz.cn/v1/file/uploadImageBaseFile",
  452. data: reqData,
  453. })
  454. .then((content) => {
  455. console.log("上传结果", content);
  456. uni.hideLoading();
  457. if (content.rc != "00" && content.rc != 0) {
  458. uni.showModal({
  459. title: "请求错误",
  460. content: "图片上传失败",
  461. showCancel: false,
  462. confirmText: "取消",
  463. });
  464. }
  465. //展示缩略图
  466. if (index % 2 != 0) {
  467. //奇数第一张 偶数第二张
  468. item.placeholderImg1 = content.data.fileUrl;
  469. item[item.value.split(",")[0]] = content.data.fileUrl;
  470. } else {
  471. item.placeholderImg2 = content.data.fileUrl;
  472. item[item.value.split(",")[1]] = content.data.fileUrl;
  473. }
  474. //只展示缩略图
  475. if (!item.inputType) {
  476. emit("uploadImg", data, item, index);
  477. } else {
  478. //if(item.type === 1)
  479. //证件OCR识别
  480. uni.showLoading({
  481. title: "证件识别中...",
  482. mask: true,
  483. });
  484. let reqData2 = {
  485. imageDriveBase: "",
  486. imageBase64: base64,
  487. imageType: index % 2 != 0 ? 1 : 2, //1代表身份证正面,2代表反面
  488. imageUrl: content.data.fileUrl,
  489. };
  490. //默认身份证
  491. let code = "IF010012019070410001";
  492. if (item.inputType == "2") {
  493. //2为行驶证
  494. code = "IF010012019070410002";
  495. reqData2.imageBase64 = "";
  496. reqData2.imageDriveBase = base64;
  497. }
  498. request(code, {
  499. data: reqData2,
  500. }).then((ocr) => {
  501. uni.hideLoading();
  502. if (ocr.rc !== "00") {
  503. uni.showModal({
  504. title: "请求错误",
  505. content: "证件识别失败",
  506. showCancel: false,
  507. confirmText: "取消",
  508. });
  509. }
  510. let data = ocr.rd;
  511. //[身份证正面]姓名(name) 住址(address) 出生日期(birthday) 身份证号(idno) 民族(nation)
  512. //[身份证反面]证件机关(agency) 有效起始日期(begindate) 有效结束日期(enddate)
  513. emit("uploadImg", data, item, index);
  514. });
  515. }
  516. })
  517. .catch((e) => {
  518. });
  519. });
  520. // #endif
  521. },
  522. fail(res : any) {
  523. if (!res.authSetting["scope.album"]) {
  524. uni.showModal({
  525. title: "授权失败",
  526. content: "需要从您的相机或相册获取图片,请在设置界面打开相关权限",
  527. success: (res) => {
  528. if (res.confirm) {
  529. uni.openSetting();
  530. }
  531. },
  532. });
  533. }
  534. },
  535. });
  536. }
  537. function showToast(hint : string) {
  538. uni.showToast({
  539. icon: "none",
  540. title: hint,
  541. });
  542. }
  543. //内容提交
  544. const formSubmit = () => {
  545. let content = {};
  546. /* 整理数据对象返回内容 */
  547. for (var i = 0; i < props.formData.length; i++) {
  548. let data = props.formData[i];
  549. console.log("data", data)
  550. /* 时间另外判断 */
  551. if (data.required && !data.hide) {
  552. //隐藏的不用进行判断
  553. let reg = new RegExp(":", "g"); //g代表全部
  554. let newMsg = data.title.replace(reg, "");
  555. if (data.value.indexOf(",") != -1 && data.type === 8) {
  556. if (!data[data.value.split(",")[0]]) {
  557. console.log("1111")
  558. showToast(data.emptyHint ? data.emptyHint : `${data.hint1}不能为空`);
  559. return;
  560. } else if (!data[data.value.split(",")[1]]) {
  561. console.log("2222")
  562. showToast(data.emptyHint ? data.emptyHint : `${data.hint2}不能为空`);
  563. return;
  564. }
  565. } else if (!data[data.value]) {
  566. console.log("3333", data[data.value], data)
  567. showToast(data.emptyHint ? data.emptyHint : `${newMsg}不能为空`);
  568. return;
  569. }
  570. }
  571. if (data.value.indexOf(",") != -1 && data.type === 8) {
  572. if (data[data.value.split(",")[0]]) {
  573. content[data.value.split(",")[0]] = data[data.value.split(",")[0]];
  574. }
  575. if (data[data.value.split(",")[1]]) {
  576. content[data.value.split(",")[1]] = data[data.value.split(",")[1]];
  577. }
  578. } else if (data.type === 10) {
  579. // for (var i = 0; i < data.value.split(',').length; i++) {
  580. // content[data.value.split(',')[i]] = data[data.value].split('-')[i]
  581. // }
  582. content[data.value] = data[data.value];
  583. } else {
  584. if (data.type === 4 && data.name) {
  585. content[data.value] = data[data.value][data.name];
  586. } else {
  587. content[data.value] = data[data.value];
  588. }
  589. }
  590. }
  591. emit("submit", content);
  592. };
  593. </script>
  594. <style lang="scss" scoped>
  595. .img-size {
  596. width: 30rpx;
  597. height: 30rpx;
  598. }
  599. .notbg {
  600. background-color: #ffffff;
  601. border-radius: 20rpx;
  602. min-height: 80rpx;
  603. line-height: 80rpx;
  604. padding: 8rpx 28rpx;
  605. }
  606. .bg {
  607. background-color: #f1f1f1;
  608. border-radius: 20rpx;
  609. min-height: 80rpx;
  610. line-height: 80rpx;
  611. padding: 0 28rpx;
  612. margin-right: 29rpx;
  613. margin-left: 25rpx;
  614. margin-top: 30rpx;
  615. }
  616. .textarea-bg {
  617. background-color: #f1f1f1;
  618. border-radius: 20rpx;
  619. height: 245rpx;
  620. padding: 30rpx;
  621. box-sizing: border-box;
  622. -moz-box-sizing: border-box;
  623. /*Firefox*/
  624. -webkit-box-sizing: border-box;
  625. /*Safari*/
  626. }
  627. .text-hint {
  628. font-size: 28rpx;
  629. color: #999999;
  630. }
  631. .text-title {
  632. font-size: 28rpx;
  633. color: #333333;
  634. }
  635. .subBtn {
  636. margin: 112rpx 30rpx 30rpx;
  637. }
  638. .divider {
  639. border-bottom: 1px solid #dcdcdc;
  640. }
  641. .arror {
  642. width: 35rpx;
  643. height: 35rpx;
  644. }
  645. .imgs-box {
  646. flex-wrap: wrap;
  647. margin-top: 20rpx;
  648. margin-bottom: -35rpx;
  649. padding-right: 110rpx;
  650. justify-content: space-between;
  651. .img-box {
  652. margin-bottom: 35rpx;
  653. }
  654. .img-hint {
  655. font-size: 24rpx;
  656. color: #333333;
  657. text-align: center;
  658. }
  659. }
  660. .uni-input {
  661. color: #646464;
  662. font-size: 28rpx;
  663. }
  664. .red {
  665. color: red;
  666. margin-right: 10rpx;
  667. }
  668. .message {
  669. font-size: 30rpx;
  670. margin-top: 30rpx;
  671. padding: 0 20rpx;
  672. }
  673. </style>