合同小程序前端代码仓库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

889 lines
26 KiB

9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
  1. <template>
  2. <view class="containers" >
  3. <view class="header">
  4. <view class="header_info">
  5. <view class="header_info_icon" @click.native.stop.prevent="toBack" style="display: flex; justify-content: center; align-items: center;">
  6. <uni-icons type="left" size="30" color="#c2d4de" > </uni-icons>
  7. </view>
  8. <text class="header_text">信息录入</text>
  9. </view>
  10. </view>
  11. <view class="section" style="margin-top: 5%;">
  12. <view class="form-item">
  13. <text class="label">付款方式</text>
  14. <l-radio :checked="clientInfo.payType === '全款'" label="全款" fontSize="1rem" style="transform: scale(0.7);">
  15. <template #icon="{checked}">
  16. <image v-show="checked" style="width:1.2rem; height:1.2rem;" src="/static/image/xuanzhong.png"></image>
  17. <image v-show="!checked" style="width:1.2rem; height:1.2rem" src="/static/image/weixuanzhong.png"></image>
  18. </template>
  19. </l-radio>
  20. </view>
  21. <view class="form-item">
  22. <text class="label">客户类型</text>
  23. <l-radio-group @change="onChange" class="radio-group" >
  24. <l-radio :checked= "clientInfo.custType == 0?true:false" value="个人" label="个人" fontSize="1rem" style="margin-right: 1rem; transform: scale(0.7);">
  25. <template #icon="{checked}">
  26. <image v-show="checked" style="width:1.2rem; height:1.2rem;" src="/static/image/xuanzhong.png"></image>
  27. <image v-show="!checked" style="width:1.2rem; height:1.2rem" src="/static/image/weixuanzhong.png"></image>
  28. </template>
  29. </l-radio>
  30. <l-radio :checked= "clientInfo.custType == 1?true:false" value="公司" label="公司" fontSize="1rem" style="transform: scale(0.7);">
  31. <template #icon="{checked}">
  32. <image v-show="checked" style="width:1.2rem; height:1.2rem;" src="/static/image/xuanzhong.png"></image>
  33. <image v-show="!checked" style="width:1.2rem; height:1.2rem" src="/static/image/weixuanzhong.png"></image>
  34. </template>
  35. </l-radio>
  36. </l-radio-group>
  37. </view>
  38. </view>
  39. <view class="idCard-box">
  40. <view class="reverse" @tap.prevent="uploadPositive">
  41. <image :src="clientInfo.certFront == ''?positiveImg:certFront" >
  42. </image>
  43. <text v-if="certFront == ''?true:false">身份证人像面</text>
  44. </view>
  45. <view class="reverse" @tap.prevent="uploadReverse">
  46. <image :src="clientInfo.certBack == ''?reverseImg:certBack" >
  47. </image>
  48. <text v-if="certBack == ''?true:false">身份证国徽面</text>
  49. </view>
  50. <view class="reverse" @tap.prevent="uploadCarCert">
  51. <image :src="clientInfo.carPic == ''?carImg:carPic" >
  52. </image>
  53. <text v-if="carPic == ''?true:false">车辆合格证</text>
  54. </view>
  55. </view>
  56. <!-- 客户基本信息 -->
  57. <view class="section">
  58. <view class="con_size">
  59. <image src="/static/image/矩形 5315.png" class='con_size_img' ></image>
  60. 客户基本信息
  61. </view>
  62. <view class="form-item">
  63. <text class="labels">*</text>
  64. <text class="label">产品名称</text>
  65. <text class="value">{{ clientInfo.productName }}</text>
  66. </view>
  67. <view class="form-item">
  68. <text class="labels">*</text>
  69. <text class="label">经销商</text>
  70. <text class="value">{{ clientInfo.storeName }}</text>
  71. </view>
  72. <view class="form-item">
  73. <text class="labels">*</text>
  74. <text class="label">客户姓名</text>
  75. <textarea auto-height :adjust-position="true" class="input" v-model="clientInfo.custName" placeholder="请输入客户姓名" />
  76. </view>
  77. <view class="form-item">
  78. <text class="labels">*</text>
  79. <text class="label">居住地址</text>
  80. <textarea auto-height :adjust-position="true" class="input" v-model="clientInfo.custAddress" placeholder="请输入居住地址" />
  81. </view>
  82. <view class="form-item">
  83. <text class="labels">*</text>
  84. <text class="label">身份证号码</text>
  85. <textarea auto-height :adjust-position="true" class="input" v-model="clientInfo.custCardNo" placeholder="请输入身份证号码" />
  86. </view>
  87. <view class="form-item">
  88. <text class="labels">*</text>
  89. <text class="label">联系方式</text>
  90. <textarea auto-height :adjust-position="true" class="input" v-model="clientInfo.custPhone" placeholder="请输入联系方式" />
  91. </view>
  92. <view class="form-item">
  93. <text class="labels">*</text>
  94. <text class="label">销售端口</text>
  95. <l-radio-group class="radio-group" @change="handleDepartmentChange">
  96. <label class="radio-label" v-for="item in departments" :key="item">
  97. <l-radio :value="item" :checked="clientInfo.salePort === item" >
  98. <template #icon="{checked}">
  99. <image v-show="checked" style="width:1.2rem; height:1.2rem;" src="/static/image/xuanzhong.png"></image>
  100. <image v-show="!checked" style="width:1.2rem; height:1.2rem" src="/static/image/weixuanzhong.png"></image>
  101. </template>
  102. </l-radio>
  103. <text style="margin-left:0.2rem;">{{ item }}</text>
  104. </label>
  105. </l-radio-group>
  106. </view>
  107. <view class="form-item">
  108. <text class="labels">*</text>
  109. <text class="label">店端销售顾问</text>
  110. <textarea auto-height :adjust-position="true" class="input" v-model="clientInfo.saleName" placeholder="请输入店铺销售顾问" />
  111. </view>
  112. </view>
  113. <!-- 车辆信息 -->
  114. <view class="section">
  115. <view class="con_size">
  116. <image src="/static/image/矩形 5315.png" class='con_size_img' ></image>车辆信息</view>
  117. <view class="form-item">
  118. <text class="labels">*</text>
  119. <text class="label">车牌车系</text>
  120. <view class="picker" @click="getCar">
  121. <view class="picker-text">{{ clientInfo.appOrderCarList[0].carSeries || '请选择车辆品牌 >' }}</view>
  122. </view>
  123. </view>
  124. <view class="form-item">
  125. <text class="labels">*</text>
  126. <text class="label">车辆型号</text>
  127. <textarea auto-height :adjust-position="true" class="input" v-model="clientInfo.appOrderCarList[0].carModel" placeholder="请输入车辆型号" />
  128. </view>
  129. <view class="form-item">
  130. <text class="labels">*</text>
  131. <text class="label">车架号</text>
  132. <textarea auto-height :adjust-position="true" class="input" v-model="clientInfo.appOrderCarList[0].vin" placeholder="请输入车架号" />
  133. </view>
  134. <view class="form-item">
  135. <text class="labels">*</text>
  136. <text class="label">车辆类型</text>
  137. <picker class="picker" @change="bindCarBrandChanges" :value="carBrandIndex" :range="carType">
  138. <view class="picker-text">{{ clientInfo.appOrderCarList[0].carType || '请选择车辆类型 >' }}</view>
  139. </picker>
  140. </view>
  141. <view class="form-item">
  142. <text class="labels">*</text>
  143. <text class="label">使用性质</text>
  144. <picker class="picker" @change="binduseTypeChanges" :value="useTypeIndex" :range="useType">
  145. <view class="picker-text">{{ clientInfo.appOrderCarList[0].useType || '请选择使用性质 >' }}</view>
  146. </picker>
  147. </view>
  148. <view class="form-item">
  149. <text class="labels">*</text>
  150. <text class="label">是否新车</text>
  151. <l-radio-group @change="onChanges" class="radio-group" >
  152. <l-radio :checked= "clientInfo.appOrderCarList[0].newCar == 1?true:false" value="是" label="是" fontSize="1rem" style="margin-right: 1rem; transform: scale(0.7);">
  153. <template #icon="{checked}">
  154. <image v-show="checked" style="width:1.2rem; height:1.2rem;" src="/static/image/xuanzhong.png"></image>
  155. <image v-show="!checked" style="width:1.2rem; height:1.2rem" src="/static/image/weixuanzhong.png"></image>
  156. </template>
  157. </l-radio>
  158. <l-radio :checked= "clientInfo.appOrderCarList[0].newCar == 0?true:false" value="否" label="否" fontSize="1rem" style="transform: scale(0.7);">
  159. <template #icon="{checked}">
  160. <image v-show="checked" style="width:1.2rem; height:1.2rem;" src="/static/image/xuanzhong.png"></image>
  161. <image v-show="!checked" style="width:1.2rem; height:1.2rem" src="/static/image/weixuanzhong.png"></image>
  162. </template>
  163. </l-radio>
  164. </l-radio-group>
  165. </view>
  166. <view class="form-item">
  167. <text class="label">车牌号</text>
  168. <textarea auto-height :adjust-position="true" class="input" v-model="clientInfo.appOrderCarList[0].carNo" placeholder="请输入车牌号" />
  169. </view>
  170. <view class="form-item">
  171. <text class="labels">*</text>
  172. <text class="label">发动机号</text>
  173. <textarea auto-height :adjust-position="true" class="input" v-model="clientInfo.appOrderCarList[0].engineNo" placeholder="请输入发动机号" />
  174. </view>
  175. </view>
  176. <!-- 凭证信息 -->
  177. <view class="section">
  178. <view class="con_size">
  179. <image src="/static/image/矩形 5315.png" class='con_size_img' ></image>凭证信息</view>
  180. <view class="con_size">
  181. <text class="labels">*</text>
  182. <text class="label">支付凭证</text>
  183. <uv-upload
  184. :fileList="fileList1"
  185. name="1"
  186. multiple
  187. :maxCount="1"
  188. @afterRead="afterRead"
  189. @delete="deletePic"
  190. ><image
  191. src="/static/image/组件 5 – 1.png"
  192. mode="widthFix"
  193. style="width: 100px;height: 150px;"
  194. ></image></uv-upload>
  195. </view>
  196. <view class="con_size">
  197. <text class="labels">*</text>
  198. <text class="label">发票信息</text>
  199. <uv-upload
  200. :fileList="fileList2"
  201. name="2"
  202. multiple
  203. :maxCount="1"
  204. @afterRead="afterRead"
  205. @delete="deletePic"
  206. ><image
  207. src="/static/image/组件 5 – 1.png"
  208. mode="widthFix"
  209. style="width: 100px;height: 150px;"
  210. ></image></uv-upload>
  211. </view>
  212. </view>
  213. <view class="sections">
  214. <view class="form-button">
  215. <button class=" button" @click="get_to" style="width: 60%;">提交去录单</button>
  216. </view>
  217. </view>
  218. </view>
  219. </template>
  220. <script>
  221. import {idCardInfo,carCert,upload,getChildListBatch,add,isToken} from '@/api.uts'
  222. export default {
  223. data() {
  224. return {
  225. uploadConfig:{
  226. // 上传地址
  227. url:'https://gpt.aiym.run/contract/miniapp/file/upload',
  228. // 文件字段名
  229. name: 'file',
  230. // 请求头
  231. header: {},
  232. // 附带的表单数据
  233. formData: {
  234. 'biz': 'cert'
  235. },
  236. // 是否开启实际上传
  237. enabled: true
  238. },
  239. clientInfo: {
  240. appOrderCarList: [
  241. {
  242. buyMoney: 0,
  243. buyTax: 0,
  244. carModel: "",
  245. carNo: "",
  246. carSeries: "",
  247. carType: "",
  248. engineNo: "",
  249. newCar: 0,
  250. useType: "",
  251. vin: ""
  252. }
  253. ],
  254. appOrderVoucherList: [
  255. {
  256. dealerAddress: "",
  257. firstBeneficiary: "",
  258. packageMoney: 0,
  259. serviceMoney: 0
  260. }
  261. ],
  262. carPic: "",
  263. certBack: "",
  264. certFront: "",
  265. custAddress: "",
  266. custCardNo: "",
  267. custName: "",
  268. custPhone: "",
  269. custType: 0,
  270. invoiceUrl:"",
  271. payType: '全款', // 默认选中全款
  272. payVoucherUrl: "",
  273. payee: "",
  274. productName: "自动填写所选商品服务分类",
  275. productServiceYear: 1,
  276. saleName: "",
  277. salePort: ''||"售前",
  278. status: 0,
  279. storeName: "自动填写所选择的门店"
  280. },
  281. fileList1:[],
  282. fileList2:[],
  283. departments: ['售前', '售后', '二网车'],
  284. carType : ['燃油车','新能源'],
  285. useType : ['非营运','营运'],
  286. carBrandIndex: -1,
  287. useTypeIndex: -1,
  288. serviceAges: ['1年', '2年', '3年'],
  289. serviceAgeIndex: -1,
  290. payees: [],
  291. payeeIndex: -1,
  292. screenHeight: 0, //屏幕可视高度
  293. curHeight: 0, //页面需要的动态高
  294. // 扫描
  295. positiveImg: '/static/image/组件 4 – 1.png',//自己图片路径
  296. certFront:'',
  297. carPic:'',
  298. certBack:'',
  299. // 反面身份证
  300. reverseImg: '/static/image/组 71663.png', //自己图片路径
  301. // 行车驾驶证
  302. carImg: '/static/image/组件 2 – 1.png' //自己图片路径
  303. }
  304. },
  305. onLoad(options) {
  306. isToken();
  307. this.clientInfo.storeName = getApp().storeName || "自动填写所选择的门店";
  308. this.clientInfo.productName = getApp().productName || "自动填写所选商品服务分类";
  309. this.clientInfo.appOrderVoucherList[0].dealerAddress = getApp().dealerAddress;
  310. for (var index = 0; index < getApp().allMsg.length; index++) {
  311. this.payees.push(getApp().allMsg[index].storeName);
  312. }
  313. this.clientInfo.payee = getApp().storeName;
  314. this.uploadConfig.header = {
  315. 'X-Access-Token':uni.getStorageSync('token')
  316. }
  317. let clientInfo = JSON.parse(decodeURIComponent(options.clientInfo));
  318. // console.log('5',clientInfo)
  319. if(clientInfo){
  320. this.clientInfo= JSON.parse(decodeURIComponent(options.clientInfo))
  321. this.certFront = getApp().certFront;
  322. this.carPic =getApp().carPic;
  323. this.certBack = getApp().certBack;
  324. // console.log('111',this.certFront ,this.carPic,this.certBack)
  325. }
  326. },
  327. onUpload() {
  328. // 页面销毁时移除监听
  329. uni.offKeyboardHeightChange();
  330. },
  331. methods: {
  332. // 凭证上传函数
  333. deletePic(event) {
  334. this[`fileList${event.name}`].splice(event.index, 1)
  335. },
  336. // 新增图片
  337. async afterRead(event) {
  338. // 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
  339. let lists = [].concat(event.file)
  340. let fileListLen = this[`fileList${event.name}`].length
  341. lists.map((item) => {
  342. this[`fileList${event.name}`].push({
  343. ...item,
  344. status: 'uploading',
  345. message: '上传中'
  346. })
  347. })
  348. for (let i = 0; i < lists.length; i++) {
  349. const result = await this.uploadFilePromise(lists[i].url,event.name)
  350. let item = this[`fileList${event.name}`][fileListLen]
  351. this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
  352. status: 'success',
  353. message: '',
  354. url: result
  355. }))
  356. fileListLen++
  357. }
  358. },
  359. uploadFilePromise(url,name) {
  360. let token = uni.getStorageSync('token')
  361. return new Promise((resolve, reject) => {
  362. let a = uni.uploadFile({
  363. url: 'https://www.shengchuangyunkong.com/contract/miniapp/file/upload', // 仅为示例,非真实的接口地址
  364. filePath: url,
  365. name: 'file',
  366. formData: {
  367. biz: 'test'
  368. },
  369. header:{
  370. 'X-Access-Token':token
  371. },
  372. success: (res) => {
  373. if(name == '1'){
  374. this.clientInfo.payVoucherUrl = JSON.parse(res.data).message;
  375. setTimeout(() => {
  376. resolve(res.data.data)
  377. }, 1000)
  378. }else{
  379. this.clientInfo.invoiceUrl = JSON.parse(res.data).message;
  380. setTimeout(() => {
  381. resolve(res.data.data)
  382. }, 1000)
  383. }
  384. }
  385. });
  386. })
  387. },
  388. isEmpty(value) {
  389. if (value === null || value === undefined ) return false;
  390. if (typeof value === "string" && value.trim() === "") return false;
  391. if (Array.isArray(value) && value.length === 0) return false;
  392. if (typeof value === "object" && Object.keys(value).length === 0) return false;
  393. return true;
  394. },
  395. get_to(){
  396. console.log('suss', JSON.parse(JSON.stringify(this.clientInfo) ));
  397. for (var i in this.clientInfo) {
  398. if (typeof this.clientInfo[i] == 'object') {
  399. for (var j in this.clientInfo[i]) {
  400. for (var k in this.clientInfo[i][j]) {
  401. if(!this.isEmpty(this.clientInfo[i][j][k])&& k!="carNo"&&k!="lender"&&k!="lenderMoney"&&k!="lenderYear"){
  402. uni.showToast({
  403. title: "提交失败,请检查字段是否未填!",
  404. icon: 'error',
  405. duration: 500,
  406. success: (res) => {
  407. },
  408. fail: (res) => {
  409. },
  410. });
  411. return false
  412. }
  413. }
  414. }
  415. }else{
  416. if(!this.isEmpty(this.clientInfo[i])){
  417. uni.showToast({
  418. title: "提交失败,请检查字段是否未填!",
  419. icon: 'error',
  420. duration: 500,
  421. success: (res) => {
  422. },
  423. fail: (res) => {
  424. },
  425. });
  426. return false
  427. }
  428. }
  429. }
  430. add(this.clientInfo).then((res)=>{
  431. if(res.success){
  432. uni.showToast({
  433. title: "提交成功",
  434. icon: 'success',
  435. duration: 500,
  436. success: (res) => {
  437. },
  438. fail: (res) => {
  439. },
  440. });
  441. uni.switchTab (
  442. { url: '/pages/index/dingdan' }
  443. )
  444. }else{
  445. uni.showToast({
  446. title: "提交失败,请检查格式!",
  447. icon: 'error',
  448. duration: 500,
  449. success: (res) => {
  450. },
  451. fail: (res) => {
  452. },
  453. });
  454. }
  455. }).catch((err)=>{
  456. console.log('err',err);
  457. })
  458. },
  459. getCar(){
  460. getApp().flag = 1;
  461. uni.navigateTo(
  462. {
  463. url: '/pages/views/carOne?clientInfo=' + encodeURIComponent(JSON.stringify(this.clientInfo))
  464. }
  465. )
  466. getApp().certFront = this.certFront;
  467. getApp().carPic = this.carPic;
  468. getApp().certBack =this.certBack;
  469. },
  470. toBack(){
  471. // console.log('111')
  472. uni.navigateBack({delta: 1})
  473. },
  474. handleDepartmentChange(e) {
  475. this.clientInfo.salePort = e;
  476. },
  477. // 修改车辆类型
  478. bindCarBrandChanges(e){
  479. this.clientInfo.appOrderCarList[0].carType = this.carType[e.detail.value];
  480. },
  481. // 修改车辆类型
  482. binduseTypeChanges(e){
  483. this.clientInfo.appOrderCarList[0].useType = this.useType[e.detail.value];
  484. },
  485. // 取服务年限
  486. bindServiceAgeChange(e) {
  487. this.serviceAgeIndex = e.detail.value
  488. if(this.serviceAges[e.detail.value] == '1年'){
  489. this.clientInfo.productServiceYear = 1;
  490. }else if(this.serviceAges[e.detail.value] == '2年' ){
  491. this.clientInfo.productServiceYear = 2;
  492. }else{
  493. this.clientInfo.productServiceYear = 3;
  494. };
  495. },
  496. // 选择收款方
  497. bindPayeeChange(e) {
  498. this.payeeIndex = e.detail.value
  499. this.clientInfo.payee= this.payees[e.detail.value];
  500. },
  501. msToDate (msec) {
  502. let datetime = new Date(msec);
  503. let year = datetime.getFullYear();
  504. let month = datetime.getMonth();
  505. let date = datetime.getDate();
  506. let hour = datetime.getHours();
  507. let minute = datetime.getMinutes();
  508. let second = datetime.getSeconds();
  509. let result1 = year +
  510. '-' +
  511. ((month + 1) >= 10 ? (month + 1) : '0' + (month + 1)) +
  512. '-' +
  513. ((date + 1) < 10 ? '0' + date : date) +
  514. ' ' +
  515. ((hour + 1) < 10 ? '0' + hour : hour) +
  516. ':' +
  517. ((minute + 1) < 10 ? '0' + minute : minute) +
  518. ':' +
  519. ((second + 1) < 10 ? '0' + second : second);
  520. let result2 = year +
  521. '-' +
  522. ((month + 1) >= 10 ? (month + 1) : '0' + (month + 1)) +
  523. '-' +
  524. ((date + 1) < 10 ? '0' + date : date);
  525. let result = {
  526. hasTime: result1,
  527. withoutTime: result2
  528. };
  529. return result;
  530. },
  531. // 修改生效时间
  532. changeEffectiveTime(e){
  533. var dateTime = new Date(e);
  534. dateTime.setDate(dateTime.getDate() + 2);
  535. dateTime = new Date(dateTime);
  536. // console.log(this.msToDate(dateTime).withoutTime);
  537. this.clientInfo.appOrderVoucherList[0].effectiveTime = this.msToDate(dateTime).withoutTime
  538. },
  539. changeTime(e){
  540. console.log(e)
  541. if(this.clientInfo.appOrderVoucherList[0].effectiveTime){
  542. var dateTime = new Date(this.clientInfo.appOrderVoucherList[0].effectiveTime);
  543. let year = Number(dateTime.getFullYear()) + Number(e.detail.value);
  544. dateTime.setFullYear(year);
  545. dateTime = new Date(dateTime);
  546. // console.log(this.msToDate(dateTime).withoutTime);
  547. this.clientInfo.appOrderVoucherList[0].endTime = this.msToDate(dateTime).withoutTime
  548. }else{
  549. uni.showToast({
  550. title: "请先选择生效时间!",
  551. icon: 'error',
  552. duration: 500,
  553. success: (res) => {
  554. },
  555. fail: (res) => {
  556. },
  557. })
  558. }
  559. },
  560. changebuyTax(){
  561. this.clientInfo.appOrderCarList[0].buyTax = (this.clientInfo.appOrderCarList[0].buyMoney/11.3).toFixed(2)
  562. },
  563. // 身份证正面上传
  564. uploadPositive() {
  565. uni.chooseImage({
  566. count: 1,
  567. sizeType: ['original', 'compressed'],
  568. sourceType: ['album', 'camera'],
  569. success: (res) => {
  570. let filePath = res.tempFilePaths[0];
  571. let token = uni.getStorageSync('token');
  572. this.uploadIdentify(token,'front',filePath,'sfz');
  573. }
  574. })
  575. },
  576. // 身份证反面上传
  577. uploadReverse() {
  578. uni.chooseImage({
  579. count: 1,
  580. sizeType: ['original', 'compressed'],
  581. sourceType: ['album', 'camera'],
  582. success: (res) => {
  583. let filePath = res.tempFilePaths[0];
  584. let token = uni.getStorageSync('token');
  585. this.uploadIdentify(token,'back',filePath,'sfz')
  586. }
  587. })
  588. },
  589. uploadCarCert() {
  590. uni.chooseImage({
  591. count: 1,
  592. sizeType: ['original', 'compressed'],
  593. sourceType: ['album', 'camera'],
  594. success: (res) => {
  595. let filePath = res.tempFilePaths[0];
  596. let token = uni.getStorageSync('token');
  597. this.uploadIdentify(token,'',filePath,'carCert')
  598. }
  599. })
  600. },
  601. // 上传识别
  602. uploadIdentify(token,side,filePath,type) {
  603. uni.uploadFile({
  604. url: 'https://www.shengchuangyunkong.com/contract/miniapp/file/upload', //仅为示例,非真实的接口地址
  605. filePath:filePath,
  606. name: 'file',
  607. formData: {
  608. 'biz': 'cert'
  609. },
  610. header:{
  611. 'X-Access-Token':token
  612. },
  613. success: (res) => {
  614. let image = JSON.parse(res.data).message;
  615. // console.log(image);
  616. if(type == "sfz"){
  617. idCardInfo({'side':side,'url':JSON.parse(res.data).message}).then((res)=>{
  618. if(res.success){
  619. if(side == 'front'){
  620. this.clientInfo.custName =res.result.name;
  621. this.clientInfo.appOrderVoucherList[0].firstBeneficiary = res.result.name;
  622. this.clientInfo.custAddress= res.result.address;
  623. this.clientInfo.custCardNo = res.result.idCard ;
  624. this.clientInfo.certFront = image;
  625. this.certFront=filePath;
  626. }else {
  627. this.clientInfo.certBack=image;
  628. this.certBack=filePath;
  629. }
  630. }else{
  631. uni.showToast({
  632. title: "身份证识别错误,请重新上传!",
  633. icon: 'error',
  634. duration: 500,
  635. success: (res) => {
  636. },
  637. fail: (res) => {
  638. },
  639. })
  640. }
  641. }).catch(err => {
  642. console.log("catch: ", err);
  643. })
  644. }else if(type == 'carCert' ){
  645. // 处理车辆信息
  646. carCert({'url':JSON.parse(res.data).message}).then((res)=>{
  647. if(res.success){
  648. // 车架号
  649. this.clientInfo.appOrderCarList[0].vin = res.result.VinNo;
  650. this.clientInfo.carPic = image;
  651. this.carPic = filePath;
  652. // 发动机号
  653. this.clientInfo.appOrderCarList[0].engineNo = res.result.EngineNo;
  654. // 车辆型号
  655. this.clientInfo.appOrderCarList[0].carModel = res.result.CarModel;
  656. }else{
  657. uni.showToast({
  658. title: "识别错误,请重新上传!",
  659. icon: 'error',
  660. duration: 500,
  661. success: (res) => {
  662. },
  663. fail: (res) => {
  664. },
  665. })
  666. }
  667. }).catch((err)=>{
  668. console.log("catch: ", err);
  669. })
  670. }
  671. },
  672. fail:(err)=>{
  673. console.log(err)
  674. }
  675. });
  676. },
  677. onChange(e){
  678. // console.log(e);
  679. if(e == '个人'){
  680. this.clientInfo.custType = 0;
  681. }else{
  682. this.clientInfo.custType = 1;
  683. }
  684. },
  685. onChanges(e){
  686. if(e == '是'){
  687. this.clientInfo.appOrderCarList[0].newCar = 1;
  688. }else{
  689. this.clientInfo.appOrderCarList[0].newCar = 0;
  690. }
  691. }
  692. }
  693. }
  694. </script>
  695. <style scoped lang="scss">
  696. .containers {
  697. height: 100vh;
  698. width: 100%;
  699. background-color: #fff;
  700. overflow-y:scroll;
  701. }
  702. .footer {
  703. position: fixed;
  704. bottom: 0;
  705. left: 0;
  706. }
  707. .container::-webkit-scrollbar {
  708. display: none;
  709. }
  710. .section {
  711. // margin-bottom: 30rpx;
  712. border-bottom: 1rpx solid #eee;
  713. margin: 0 1rem 0 1rem;
  714. }
  715. .sections{
  716. margin: 0 1rem 1rem 1rem;
  717. }
  718. .form-item {
  719. display: flex;
  720. flex-direction: row;
  721. justify-content: space-between;
  722. align-items: center;
  723. padding: 0.5rem 0;
  724. border-bottom: 0.1rem solid #f2f2f2;
  725. color: #767676;
  726. }
  727. .labels{
  728. color: red;
  729. display: flex;
  730. justify-content: center;
  731. align-items: center;
  732. }
  733. .label {
  734. font-size: 28rpx;
  735. color: #666;
  736. width: 200rpx;
  737. }
  738. .input {
  739. flex: 1;
  740. text-align: right;
  741. font-size: 28rpx;
  742. color: #737373;
  743. height: 100%;
  744. }
  745. .picker {
  746. flex: 1;
  747. }
  748. .picker-text {
  749. text-align: right;
  750. color: #737373;
  751. font-size: 0.8rem;
  752. }
  753. .radio-group {
  754. display: flex;
  755. flex: 1;
  756. justify-content: flex-end;
  757. flex-direction: row;
  758. }
  759. .radio-label {
  760. padding: 0;
  761. margin-left: 10rpx;
  762. display: flex;
  763. flex-direction: row;
  764. font-size: 1rem;
  765. transform: scale(0.7);
  766. }
  767. .value {
  768. flex: 1;
  769. text-align: right;
  770. color: #737373;
  771. font-size: 0.8rem;
  772. }
  773. // .timePiker{
  774. // display: flex;
  775. // justify-content: center;
  776. // align-items: center;
  777. // color: #3f3f3f;
  778. // }
  779. .idCard-box {
  780. margin-top: 10%;
  781. width: 100%;
  782. height: 50%;
  783. display: flex;
  784. flex-direction: row;
  785. /* background-color: red; */
  786. flex-wrap: wrap;
  787. .reverse {
  788. height: 30%;
  789. width: 40%;
  790. display: flex;
  791. align-items: center;
  792. justify-content: center;
  793. // background-color: blue;
  794. margin: 0 5% 0 5%;
  795. image {
  796. width: 100%;
  797. height: 100%;
  798. }
  799. text{
  800. position: absolute;
  801. text-shadow: 1px 1px black, -1px -1px black, 1px -1px black, -1px 1px black;
  802. font-size: 0.8rem;
  803. color:#fff;
  804. }
  805. }
  806. }
  807. /* 表单分区样式 */
  808. .con_size {
  809. font-size: 1rem;
  810. font-weight: bold;
  811. margin: 1rem 0;
  812. color: #000000;
  813. display: flex;
  814. flex-direction: row;
  815. align-items: center;
  816. }
  817. .con_size_img{
  818. height: 100%;
  819. width: 2%;
  820. margin-right: 2%;
  821. }
  822. .form-button{
  823. width: 100%;
  824. height:100%;
  825. // background-color: #000000;
  826. display: flex;
  827. align-items: center;
  828. justify-content: center;
  829. }
  830. .button{
  831. height: 100%;
  832. width: 100%;
  833. background-color: #044f7a;
  834. color: #ffffff;
  835. border-radius: 1rem;
  836. }
  837. </style>