input.vue 77 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335
  1. <template>
  2. <view class="infos" style="padding: 30rpx">
  3. <nav-bar title="填写审核资料"></nav-bar>
  4. <view v-show="!agreementModal">
  5. <view class="topBox">
  6. <view>
  7. <u-icon name="error-circle-fill" color="#FF3B30" size="28"></u-icon>
  8. <text style="color: #ff3b30; margin-left: 10rpx"
  9. >学习前请提交完整审核资料</text
  10. >
  11. </view>
  12. <view style="color: #007aff" @click="refuseAgreement">稍后再填</view>
  13. </view>
  14. <u-collapse
  15. v-show="remarkStatus"
  16. :item-style="itemStyle"
  17. event-type="close"
  18. ref="collapse"
  19. >
  20. <u-collapse-item title="审核结果反馈">
  21. <view style="padding-bottom: 30rpx">
  22. <text class="collapse-item">{{ remark || "" }}</text>
  23. </view>
  24. </u-collapse-item>
  25. </u-collapse>
  26. <view class="bodyBox" style="margin-top: 30rpx; padding: 0 20rpx">
  27. <u-form :model="form" ref="uForm" :error-type="errorType">
  28. <template v-for="(item, index) in listData">
  29. <u-form-item
  30. :key="index"
  31. v-if="item.fieldKey == 'name'"
  32. :label="item.fieldName"
  33. :required="item.required"
  34. :label-width="auto"
  35. :prop="item.required ? item.fieldKey : ''"
  36. >
  37. <u-input
  38. v-model="form.name"
  39. :disabled="disName"
  40. :placeholder="`请输入${item.fieldName}`"
  41. />
  42. </u-form-item>
  43. <u-form-item
  44. :key="index"
  45. v-if="item.fieldKey == 'idcard'"
  46. :label="item.fieldName"
  47. :required="item.required"
  48. :label-width="auto"
  49. :prop="item.required ? item.fieldKey : ''"
  50. >
  51. <u-input
  52. :disabled="disCard"
  53. v-model="form.idcard"
  54. :placeholder="`请输入${item.fieldName}`"
  55. />
  56. </u-form-item>
  57. <u-form-item
  58. :key="index"
  59. v-if="item.fieldKey == 'telphone'"
  60. :label="item.fieldName"
  61. :required="item.required"
  62. :label-width="auto"
  63. :disabled="true"
  64. :prop="item.required ? item.fieldKey : ''"
  65. >
  66. <u-input
  67. disabled
  68. v-model="form.telphone"
  69. :placeholder="`请输入${item.fieldName}`"
  70. />
  71. </u-form-item>
  72. <u-form-item
  73. :key="index"
  74. v-if="item.fieldKey == 'school'"
  75. :label="item.fieldName"
  76. :required="item.required"
  77. :label-width="auto"
  78. :prop="item.required ? item.fieldKey : ''"
  79. >
  80. <u-input
  81. v-model="form.school"
  82. :placeholder="`请输入${item.fieldName}`"
  83. />
  84. </u-form-item>
  85. <u-form-item
  86. :key="index"
  87. v-if="item.fieldKey == 'work_unit'"
  88. :label="item.fieldName"
  89. :required="item.required"
  90. :label-width="auto"
  91. :prop="item.required ? item.fieldKey : ''"
  92. >
  93. <u-input
  94. v-model="form.work_unit"
  95. :placeholder="`请输入${item.fieldName}`"
  96. />
  97. </u-form-item>
  98. <u-form-item
  99. :key="index"
  100. v-if="item.fieldKey == 'unit_contact'"
  101. :label="item.fieldName"
  102. :required="item.required"
  103. :label-width="auto"
  104. :prop="item.required ? item.fieldKey : ''"
  105. >
  106. <u-input
  107. v-model="form.unit_contact"
  108. :placeholder="`请输入${item.fieldName}`"
  109. />
  110. </u-form-item>
  111. <u-form-item
  112. :key="index"
  113. v-if="item.fieldKey == 'unit_tel'"
  114. :label="item.fieldName"
  115. :required="item.required"
  116. :label-width="auto"
  117. :prop="item.required ? item.fieldKey : ''"
  118. >
  119. <u-input
  120. v-model="form.unit_tel"
  121. :placeholder="`请输入${item.fieldName}`"
  122. />
  123. </u-form-item>
  124. <u-form-item
  125. :key="index"
  126. v-if="item.fieldKey == 'apply_post'"
  127. :label="item.fieldName"
  128. :required="item.required"
  129. :label-width="auto"
  130. :prop="item.required ? item.fieldKey : ''"
  131. >
  132. <u-input
  133. v-model="form.apply_post"
  134. :disabled="apply_post_disabled"
  135. :placeholder="`请输入${item.fieldName}`"
  136. />
  137. </u-form-item>
  138. <u-form-item
  139. :key="index"
  140. v-if="item.fieldKey == 'major'"
  141. :label="item.fieldName"
  142. :required="item.required"
  143. :label-width="auto"
  144. :prop="item.required ? item.fieldKey : ''"
  145. >
  146. <u-input
  147. v-model="form.major"
  148. :placeholder="`请输入${item.fieldName}`"
  149. />
  150. </u-form-item>
  151. <u-form-item
  152. :key="index"
  153. v-if="item.inputType == 2"
  154. :label="item.fieldName"
  155. :label-width="auto"
  156. :required="item.required"
  157. :prop="item.required ? item.fieldKey : ''"
  158. >
  159. <picker
  160. @change="bindPickerChange(item.fieldKey, $event)"
  161. :value="form[item.fieldKey]"
  162. :range="getarrays(item.fieldKey)"
  163. >
  164. <view class="picker">
  165. {{ returnName(item.fieldKey) }}
  166. <image
  167. src="@/static/icon/clears.png"
  168. v-if="clearWatch(item.fieldKey)"
  169. @click.stop="clearFun(item.fieldKey)"
  170. mode=""
  171. style="
  172. width: 30rpx;
  173. height: 30rpx;
  174. vertical-align: middle;
  175. margin-left: 10rpx;
  176. "
  177. ></image>
  178. </view>
  179. </picker>
  180. </u-form-item>
  181. <u-form-item
  182. :key="index"
  183. v-if="item.inputType == 5"
  184. :label="item.fieldName"
  185. :label-width="auto"
  186. :required="item.required"
  187. :prop="item.required ? item.fieldKey : ''"
  188. >
  189. <picker
  190. mode="date"
  191. :value="form[item.fieldKey]"
  192. @change="bindDateChange(item.fieldKey, $event)"
  193. >
  194. <view class="picker">
  195. {{ getTimes(item.fieldKey) }}
  196. <image
  197. src="@/static/icon/clears.png"
  198. v-if="clearWatch(item.fieldKey)"
  199. @click.stop="clearFun(item.fieldKey)"
  200. mode=""
  201. style="
  202. width: 30rpx;
  203. height: 30rpx;
  204. vertical-align: middle;
  205. margin-left: 10rpx;
  206. "
  207. ></image>
  208. </view>
  209. </picker>
  210. </u-form-item>
  211. <u-form-item
  212. :key="index"
  213. v-if="
  214. item.inputType == 3 &&
  215. item.fieldKey !== 'commitment_electr_signature'
  216. "
  217. :label="item.fieldName"
  218. :required="item.required"
  219. :label-width="auto"
  220. label-position="top"
  221. :prop="item.required ? item.fieldKey : ''"
  222. >
  223. <text
  224. v-if="item.fieldKey === 'recent_photos'"
  225. style="
  226. color: #999999;
  227. position: absolute;
  228. top: 20rpx;
  229. left: 130rpx;
  230. "
  231. >竖向白底证件照 文件大小≤2M</text
  232. >
  233. <text
  234. v-if="
  235. item.fieldKey === 'idcard_face_photo' ||
  236. item.fieldKey === 'idcard_national_photo'
  237. "
  238. style="
  239. color: #999999;
  240. position: absolute;
  241. top: 20rpx;
  242. left: 180rpx;
  243. "
  244. >
  245. 文件大小≤2M
  246. </text>
  247. <!-- :max-size="2097152" -->
  248. <!-- @on-list-change="
  249. item.fieldKey === 'recent_photos'
  250. ? changePhotoListHeader1($event)
  251. : item.fieldKey === 'idcard_face_photo'
  252. ? changePhotoListHeader2($event)
  253. : item.fieldKey === 'idcard_national_photo'
  254. ? changePhotoListHeader3($event)
  255. : ''
  256. " -->
  257. <u-upload
  258. :show-progress="false"
  259. :ref="
  260. item.fieldKey === 'recent_photos'
  261. ? 'recent_photos'
  262. : item.fieldKey === 'idcard_face_photo'
  263. ? 'idcard_face_photo'
  264. : item.fieldKey === 'idcard_national_photo'
  265. ? 'idcard_national_photo'
  266. : ''
  267. "
  268. @on-list-change="changePhotoListHeader($event, item.fieldKey)"
  269. :auto-upload="false"
  270. custom-btn="true"
  271. :action="action"
  272. :file-list="
  273. item.fieldKey === 'recent_photos'
  274. ? fileList1
  275. : item.fieldKey === 'idcard_face_photo'
  276. ? fileList2
  277. : item.fieldKey === 'idcard_national_photo'
  278. ? fileList3
  279. : ''
  280. "
  281. width="120"
  282. height="120"
  283. size-type="['compressed']"
  284. max-count="1"
  285. >
  286. <template v-slot:addBtn>
  287. <image
  288. :src="
  289. item.fieldKey === 'recent_photos'
  290. ? '/static/info_1.png'
  291. : item.fieldKey === 'idcard_face_photo'
  292. ? '/static/info_2.png'
  293. : item.fieldKey === 'idcard_national_photo'
  294. ? '/static/info_3.png'
  295. : ''
  296. "
  297. :style="
  298. item.fieldKey === 'recent_photos'
  299. ? 'width: 120rpx; height: 169rpx;'
  300. : item.fieldKey === 'idcard_face_photo'
  301. ? 'width: 120rpx; height: 82rpx;'
  302. : item.fieldKey === 'idcard_national_photo'
  303. ? 'width: 120rpx; height: 82rpx;'
  304. : ''
  305. "
  306. ></image>
  307. </template>
  308. </u-upload>
  309. </u-form-item>
  310. <view
  311. :key="index"
  312. v-if="
  313. item.inputType == 3 &&
  314. item.fieldKey === 'commitment_electr_signature'
  315. "
  316. >
  317. <u-form-item
  318. v-if="
  319. item.inputType == 3 &&
  320. item.fieldKey === 'commitment_electr_signature'
  321. "
  322. label="承诺书"
  323. :required="item.required"
  324. :label-width="auto"
  325. label-position="top"
  326. >
  327. <view style="line-height: 40rpx; text-indent: 2em">
  328. <text>
  329. 本人自愿做出如下承诺:本人己仔细阅读《广东省住房和城乡建设厅关于推进住房和城乡建设领域施工现场专业人员职业培训工作的通知》
  330. 全部内容并知晓和理解,本人的学历证书、身份证、工作年限、相片等所有资料完全真实、符合报名条件、资格审查要求和相关规定,本人在报名、审查、培训、测试等有关的事项中会严格道守相关规定和要求,如有虛假或与实际规定不符等情况造成的一切后果由本人承担。
  331. </text>
  332. <view style="line-height: 40rpx; text-indent: 2em"
  333. ><text>特此承诺!</text></view
  334. >
  335. </view>
  336. </u-form-item>
  337. <u-form-item
  338. v-if="
  339. item.inputType == 3 &&
  340. item.fieldKey === 'commitment_electr_signature'
  341. "
  342. label="签名板"
  343. :required="item.required"
  344. :label-width="auto"
  345. label-position="top"
  346. :prop="item.required ? item.fieldKey : ''"
  347. >
  348. <view class="dis_stys">
  349. <text style="color: #999999">请在下方签名区进行签名</text>
  350. <text @click="retDraw" mode="">清空</text>
  351. </view>
  352. <view class="handCenter">
  353. <canvas
  354. v-if="!form[item.fieldKey]"
  355. class="handWriting"
  356. disable-scroll="true"
  357. :catchtouchmove="true"
  358. @touchstart="uploadScaleStart"
  359. @touchmove="uploadScaleMove"
  360. @touchend="uploadScaleEnd"
  361. canvas-id="handWriting"
  362. ></canvas>
  363. <view
  364. v-else
  365. style="width: 100%; height: 100%; position: relative"
  366. >
  367. <view class="ctoples">图片</view>
  368. <image
  369. style="width: 100%; height: 100%"
  370. :src="$method.splitImgHost(form[item.fieldKey])"
  371. mode=""
  372. ></image>
  373. </view>
  374. </view>
  375. </u-form-item>
  376. </view>
  377. <u-form-item
  378. v-if="item.inputType == 4"
  379. :key="index"
  380. :label="item.fieldName"
  381. :required="item.required"
  382. :label-width="auto"
  383. :prop="item.required ? item.fieldKey : ''"
  384. label-position="top"
  385. >
  386. <text
  387. style="
  388. color: #007aff;
  389. position: absolute;
  390. top: 20rpx;
  391. left: 180rpx;
  392. text-decoration: underline;
  393. "
  394. @click="downDocx(item.url)"
  395. >点击下载</text
  396. >
  397. <view class="dis_stys"
  398. ><text style="color: #999999"
  399. >下载承诺书进行填写并签名盖章后上传(≤2M)</text
  400. ></view
  401. >
  402. <image
  403. v-if="!form[item.fieldKey]"
  404. style="width: 169rpx; height: 169rpx"
  405. @click="getChast"
  406. src="@/static/info_4.png"
  407. ></image>
  408. <view class="quzw" v-if="form[item.fieldKey]">
  409. <view
  410. v-if="
  411. form[item.fieldKey].split('.').splice(-1)[0] == 'docx' ||
  412. form[item.fieldKey].split('.').splice(-1)[0] == 'doc'
  413. "
  414. class="borsrs"
  415. >
  416. <image
  417. src="@/static/icon/jy_icon.png"
  418. style="width: 168rpx; height: 168rpx"
  419. ></image>
  420. <text>{{ titleName }}</text>
  421. </view>
  422. <image
  423. v-else
  424. :src="$method.splitImgHost(form[item.fieldKey])"
  425. style="width: 100%; height: 100%"
  426. mode="aspectFit"
  427. @click="seePhotos(form[item.fieldKey])"
  428. ></image>
  429. <u-icon
  430. name="close-circle-fill"
  431. color="red"
  432. size="44"
  433. class="optionsAbs"
  434. @click="clearWord"
  435. ></u-icon>
  436. </view>
  437. </u-form-item>
  438. </template>
  439. </u-form>
  440. </view>
  441. <view @click="submits" class="submit_btn">提交资料</view>
  442. </view>
  443. <u-popup
  444. class="modal"
  445. catchtouchmove="return"
  446. v-model="agreementModal"
  447. mode="center"
  448. border-radius="24"
  449. :mask-close-able="false"
  450. >
  451. <view class="agreement">
  452. <view class="body">
  453. <scroll-view scroll-y="true" style="height: 600rpx">
  454. <view class="content">
  455. <view
  456. >本产品(或服务)提供【{{
  457. goodsData.goodsName
  458. }}】课程的在线学习功能,为使用这些功能,我们需要使用您设备上的摄像头,并收集以下个人信息:
  459. <text v-for="(item, listIndex) in listData" :key="listIndex"
  460. >{{ item.fieldName }}、</text
  461. >
  462. <!-- 姓名、性别、身份证号码、移动电话号码、身份证照片、一寸照、证书名称/岗位、证书编号、有效期、人脸照片(每节课随机拍摄三张)、 -->
  463. 学习详细记录。</view
  464. >
  465. <view
  466. >我们会将上述信息提供至广东省建设执业注册管理中心等第三方组织使用,用于继续教育备案等。如果您拒绝,将导致这些功能无法实现,但不影响您使用本产品(或服务)的其他业务功能。</view
  467. >
  468. </view>
  469. </scroll-view>
  470. </view>
  471. <view class="footer">
  472. <view class="btn cancel" @click="refuseAgreement">取消</view>
  473. <view class="btn ok" @click="agree">同意并继续</view>
  474. </view>
  475. </view>
  476. </u-popup>
  477. <u-action-sheet
  478. :list="list"
  479. v-model="showTableDown"
  480. @click="clickIndex"
  481. ></u-action-sheet>
  482. <!--用于图片压缩的canvas画布,不在页面中展示,且id固定不可变 position: absolute; z-index: -1; left: -10000rpx;; top: -10000rpx;-->
  483. <!-- style="width: {{cw}}px; height: {{cw}}px;" -->
  484. <view class="photo_can">
  485. <canvas class="zip_canvas" canvas-id="zipCanvas"></canvas>
  486. </view>
  487. </view>
  488. </template>
  489. <script>
  490. import config from "@/common/config";
  491. import { mapGetters, mapActions } from "vuex";
  492. import Handwriting from "@/common/signature.js";
  493. import getLessLimitSizeImage from "@/common/compressPhoto.js";
  494. export default {
  495. data() {
  496. return {
  497. baseUrls: config.BASE_IMG_URL,
  498. cw: wx.getSystemInfoSync().windowWidth, //画板边长默认是屏幕宽度,正方形画布
  499. list: [
  500. {
  501. text: "上传图片",
  502. },
  503. // {
  504. // text: '上传文件'
  505. // }
  506. ],
  507. showTableDown: false,
  508. gradeId: 0,
  509. errorType: ["message"],
  510. agreementModal: false,
  511. goodsData: {},
  512. itemStyle: {
  513. marginTop: "20px",
  514. backgroundColor: "#fff",
  515. borderRadius: "24rpx",
  516. padding: "0rpx 20rpx",
  517. },
  518. isUploading: false,
  519. form: {
  520. name: "",
  521. sex: "男",
  522. idcard: "",
  523. telphone: "",
  524. education: "",
  525. school: "",
  526. graduation_time: "",
  527. work_unit: "",
  528. unit_contact: "",
  529. unit_tel: "",
  530. apply_post: "",
  531. major: "",
  532. working_years: "",
  533. recent_photos: "oss/images/avatar/131/1686271592764_1781951949",
  534. idcard_face_photo: "oss/images/IDCard/131/1686271688971.jpg",
  535. idcard_national_photo: "oss/images/IDCard/131/1686271714573.jpg",
  536. commitment_electr_signature: "",
  537. commitment_seal: "",
  538. },
  539. lineColor: "black",
  540. slideValue: 50,
  541. handwriting: "",
  542. goodsId: null,
  543. listData: [], //页面数据
  544. ast: [],
  545. fileList1: [], //个人近照
  546. fileList2: [], //人像
  547. fileList3: [], //国徽
  548. openVerify: false, // 控制是否手动验证
  549. id: null, //获取修改ID内容
  550. remark: "", //反馈文本
  551. remarkStatus: false, //是否存在审核结果反馈
  552. // nextStatus: false, //是否有下一步
  553. copyData: [], //备份数据
  554. rules: {
  555. name: [
  556. {
  557. required: true,
  558. message: "请输入姓名",
  559. trigger: ["change", "blur"],
  560. },
  561. ],
  562. sex: [
  563. {
  564. required: true,
  565. message: "请选择性别",
  566. trigger: "change",
  567. },
  568. ],
  569. idcard: [
  570. {
  571. required: true,
  572. message: "请输入身份证号",
  573. trigger: ["change", "blur"],
  574. },
  575. // {
  576. // validator: (rule, value, callback) => {
  577. // return this.$u.test.idCard(value);
  578. // },
  579. // message: '身份证号不正确',
  580. // trigger: ['change', 'blur']
  581. // }
  582. ],
  583. telphone: [
  584. {
  585. required: true,
  586. message: "请输入手机号码",
  587. trigger: ["change", "blur"],
  588. },
  589. // {
  590. // validator: (rule, value, callback) => {
  591. // var vartest = /^([0-9]{3,4}-)?[0-9]{7,8}$/;
  592. // if (this.$u.test.mobile(value) || vartest.test(value)) {
  593. // return true;
  594. // } else {
  595. // return false;
  596. // }
  597. // },
  598. // message: '手机号码不正确',
  599. // trigger: ['change', 'blur']
  600. // }
  601. ],
  602. education: [
  603. {
  604. required: true,
  605. message: "请选择学历",
  606. trigger: "change",
  607. },
  608. ],
  609. school: [
  610. {
  611. required: true,
  612. message: "请输入毕业院校",
  613. trigger: ["change", "blur"],
  614. },
  615. ],
  616. graduation_time: [
  617. {
  618. required: true,
  619. message: "请选择毕业时间",
  620. trigger: "change",
  621. },
  622. ],
  623. work_unit: [
  624. {
  625. required: true,
  626. message: "请输入工作单位",
  627. trigger: ["change", "blur"],
  628. },
  629. ],
  630. unit_contact: [
  631. {
  632. required: true,
  633. message: "请输入单位联系人",
  634. trigger: ["change", "blur"],
  635. },
  636. ],
  637. unit_tel: [
  638. {
  639. required: true,
  640. message: "请输入单位联系电话",
  641. trigger: ["change", "blur"],
  642. },
  643. {
  644. validator: (rule, value, callback) => {
  645. var vartest = /^([0-9]{3,4}-)?[0-9]{7,8}$/;
  646. var vartest1 = /^([0-9]{3,4})?[0-9]{7,8}$/;
  647. if (
  648. this.$u.test.mobile(value) ||
  649. vartest.test(value) ||
  650. vartest1.test(value)
  651. ) {
  652. return true;
  653. } else {
  654. return false;
  655. }
  656. },
  657. message: "单位联系电话不正确",
  658. trigger: ["change", "blur"],
  659. },
  660. ],
  661. apply_post: [
  662. {
  663. required: true,
  664. message: "请输入报名岗位",
  665. trigger: ["change", "blur"],
  666. },
  667. ],
  668. major: [
  669. {
  670. required: true,
  671. message: "请输入所学专业",
  672. trigger: ["change", "blur"],
  673. },
  674. ],
  675. working_years: [
  676. {
  677. required: true,
  678. message: "请选择工作年限",
  679. trigger: "change",
  680. },
  681. ],
  682. recent_photos: [
  683. {
  684. required: true,
  685. message: "请上传个人近照",
  686. trigger: ["change", "blur"],
  687. },
  688. ],
  689. idcard_face_photo: [
  690. {
  691. required: true,
  692. message: "请上传身份证人像面",
  693. trigger: ["change", "blur"],
  694. },
  695. ],
  696. idcard_national_photo: [
  697. {
  698. required: true,
  699. message: "请上传身份证国徽面",
  700. trigger: ["change", "blur"],
  701. },
  702. ],
  703. commitment_electr_signature: [
  704. {
  705. required: true,
  706. message: "请签写承诺书电子签",
  707. trigger: ["change", "blur"],
  708. },
  709. ],
  710. commitment_seal: [
  711. {
  712. required: true,
  713. message: "请上传承诺书盖章",
  714. trigger: ["change", "blur"],
  715. },
  716. ],
  717. },
  718. apply_post_disabled: false,
  719. isRequired: false,
  720. orderGoodsId: 0,
  721. disName: false, // 姓名是否禁止输入
  722. disCard: false, // 身份证是否禁止输入
  723. auto: "180rpx",
  724. };
  725. },
  726. created() {
  727. this.$store.getters.dictObj;
  728. },
  729. async onLoad(option) {
  730. this.orderGoodsId = Number(option.orderGoodsId);
  731. this.goodsId = Number(option.id);
  732. this.gradeId = Number(option.gradeId);
  733. !this.userInfo && this.$api.refreshUserInfo();
  734. await this.getInfo();
  735. await this.getGoodsDetail();
  736. },
  737. onReady(res) {
  738. this.handwriting = new Handwriting({
  739. lineColor: this.lineColor,
  740. slideValue: this.slideValue, // 0, 25, 50, 75, 100
  741. canvasName: "handWriting",
  742. });
  743. this.$refs.uForm.setRules(this.rules);
  744. },
  745. computed: { ...mapGetters(["dictObj", "userInfo"]) },
  746. watch: {
  747. userInfo(val, oldVal) {
  748. //普通的watch监听
  749. if (val) {
  750. console.log(val, "val");
  751. this.listData.forEach((item) => {
  752. if (item.fieldKey == "idcard") {
  753. this.form.idcard = this.userInfo.idCard;
  754. console.log("监听监听111");
  755. }
  756. if (item.fieldKey == "telphone") {
  757. this.form.telphone = this.userInfo.telphone;
  758. }
  759. if (item.fieldKey == "name") {
  760. this.form.name = this.userInfo.realname;
  761. console.log("监听监听");
  762. }
  763. });
  764. }
  765. },
  766. },
  767. methods: {
  768. ...mapActions(["getUserInfo"]),
  769. inputName(event) {
  770. console.log("enevt", event, this.form.name);
  771. },
  772. clickIndex(inds) {
  773. if (inds === 0) {
  774. this.uploadImgs();
  775. }
  776. if (inds === 1) {
  777. this.uploadFieds();
  778. }
  779. },
  780. getChast() {
  781. this.showTableDown = true;
  782. },
  783. seePhotos(url) {
  784. uni.previewImage({
  785. urls: [url],
  786. });
  787. },
  788. async downDocx(url) {
  789. let self = this;
  790. var ast = this.listData.some((item) => {
  791. return item.fieldKey === "commitment_electr_signature";
  792. });
  793. if (ast) {
  794. await this.subCanvas();
  795. }
  796. let data = JSON.parse(JSON.stringify(this.form));
  797. if (data["commitment_electr_signature"]) {
  798. data.commitment_electr_signature = await this.$method.uploadFile(
  799. data.commitment_electr_signature,
  800. 0
  801. );
  802. }
  803. if (this.remarkStatus) {
  804. var arsty = {};
  805. for (let k in data) {
  806. for (let j in self.copyData) {
  807. if (k === j) {
  808. if (self.copyData[j].value === data[k]) {
  809. arsty[k] = {
  810. fieldKey: k,
  811. value: data[k],
  812. fieldName: (function () {
  813. for (let i = 0; i < self.listData.length; i++) {
  814. if (self.listData[i].fieldKey == k) {
  815. return self.listData[i].fieldName;
  816. }
  817. }
  818. })(),
  819. status: 0,
  820. };
  821. } else {
  822. arsty[k] = {
  823. fieldKey: k,
  824. value: data[k],
  825. fieldName: (function () {
  826. for (let i = 0; i < self.listData.length; i++) {
  827. if (self.listData[i].fieldKey == k) {
  828. return self.listData[i].fieldName;
  829. }
  830. }
  831. })(),
  832. status: 1,
  833. };
  834. }
  835. }
  836. }
  837. }
  838. } else {
  839. var arsty = {};
  840. for (let k in data) {
  841. arsty[k] = {
  842. fieldKey: k,
  843. value: data[k],
  844. fieldName: (function () {
  845. for (let i = 0; i < self.listData.length; i++) {
  846. if (self.listData[i].fieldKey == k) {
  847. return self.listData[i].fieldName;
  848. }
  849. }
  850. })(),
  851. status: 0,
  852. };
  853. }
  854. }
  855. console.log(arsty);
  856. this.$api
  857. .baseProfileStampV2AddWord({
  858. goodsId: this.goodsId,
  859. keyValue: JSON.stringify(arsty),
  860. })
  861. .then((res) => {
  862. uni.downloadFile({
  863. url: this.$method.splitImgHost(res.data.msg),
  864. success: (result) => {
  865. if (result.statusCode === 200) {
  866. const filePath = result.tempFilePath;
  867. console.log(this.$method.splitImgHost(res.data.msg));
  868. this.$method.showToast("下载成功");
  869. uni.saveImageToPhotosAlbum({
  870. filePath: filePath,
  871. success: function (errMsg) {
  872. uni.showToast({
  873. mask: true,
  874. title: "保存成功",
  875. });
  876. },
  877. fail: (errMsg) => {
  878. uni.showToast({
  879. mask: true,
  880. title: "保存失败",
  881. });
  882. },
  883. complete: (errMsg) => {},
  884. });
  885. }
  886. },
  887. });
  888. });
  889. },
  890. getGoodsDetail() {
  891. return new Promise((resolve) => {
  892. this.$api
  893. .orderInfo({
  894. orderGoodsId: this.orderGoodsId,
  895. })
  896. .then((res) => {
  897. this.goodsData = res.data.data;
  898. if (this.goodsData.categoryName) {
  899. this.$set(this.form, "apply_post", this.goodsData.categoryName);
  900. console.log(this.form);
  901. if (this.goodsData.categoryName) {
  902. this.apply_post_disabled = true;
  903. }
  904. }
  905. if (this.userInfo && this.userInfo.companyName) {
  906. this.$set(this.form, "work_unit", this.userInfo.companyName);
  907. }
  908. resolve();
  909. });
  910. });
  911. },
  912. uploadImgs() {
  913. uni.chooseImage({
  914. count: 1, //默认9
  915. sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
  916. success: (res) => {
  917. if (res.tempFiles[0].size > 2097152) {
  918. // this.$method.showToast("上传图片不得大于2M");
  919. // 需要压缩
  920. let canvasId = "zipCanvas";
  921. let imagePath = res.tempFiles[0].path; //原图的路径
  922. let limitSize = 2048; //大小限制2048kb
  923. let drawWidth = wx.getSystemInfoSync().windowWidth; //初始绘画区域是画布自身的宽度也就是屏幕宽度
  924. getLessLimitSizeImage(
  925. canvasId,
  926. imagePath,
  927. limitSize,
  928. drawWidth,
  929. async (resPath) => {
  930. //resPath就是压缩后图片的路径
  931. this.uploadImgsChild(resPath);
  932. }
  933. );
  934. return;
  935. } else {
  936. this.uploadImgsChild(res.tempFiles[0].path);
  937. }
  938. },
  939. });
  940. },
  941. uploadImgsChild(path) {
  942. var type = path.split(".").splice(-1);
  943. if (type[0] != "jpg" && type[0] != "png" && type[0] != "jpeg") {
  944. this.$method.showToast("请上传图片格式");
  945. return;
  946. }
  947. this.$set(this.form, "commitment_seal", path);
  948. this.$nextTick(() => {
  949. this.resultForm();
  950. });
  951. },
  952. uploadFieds() {
  953. var self = this;
  954. wx.chooseMessageFile({
  955. count: 1,
  956. size: 2097152,
  957. type: "file",
  958. success(res) {
  959. if (res.tempFiles[0].size > 2097152) {
  960. self.$method.showToast("上传文件不得大于2M");
  961. return;
  962. } else {
  963. var type = res.tempFiles[0].path.split(".").splice(-1);
  964. if (
  965. type[0] != "jpg" &&
  966. type[0] != "png" &&
  967. type[0] != "jpeg" &&
  968. type[0] != "docx" &&
  969. type[0] != "doc"
  970. ) {
  971. self.$method.showToast("请上传word文档或图片");
  972. return;
  973. }
  974. self.titleName = res.tempFiles[0].name;
  975. self.$set(self.form, "commitment_seal", res.tempFiles[0].path);
  976. self.$nextTick(function () {
  977. this.resultForm();
  978. });
  979. }
  980. },
  981. });
  982. },
  983. agree() {
  984. this.agreementModal = false;
  985. setTimeout(() => {
  986. this.$refs.collapse.init();
  987. }, 1000);
  988. },
  989. refuseAgreement() {
  990. uni.navigateBack({
  991. delta: 2,
  992. });
  993. },
  994. clearFun(key) {
  995. this.form[key] = "";
  996. },
  997. //清除按钮
  998. clearWatch(key) {
  999. if (this.form[key]) {
  1000. return true;
  1001. } else {
  1002. return false;
  1003. }
  1004. },
  1005. async uploadDatas(data) {
  1006. console.log("sfsfg---data", data);
  1007. if (this.form.recent_photos && this.form.idcard_face_photo) {
  1008. let base64 = await this.$method.imageToBase64(
  1009. this.form.idcard_face_photo
  1010. );
  1011. let resData = await this.faceCertificationIDCardOCR(1, base64);
  1012. if (!resData.data) {
  1013. uni.showModal({
  1014. title: "提示",
  1015. content: "身份证人像面照片异常,请重新上传",
  1016. showCancel: false,
  1017. });
  1018. this.isUploading = false;
  1019. return;
  1020. }
  1021. base64 = await this.$method.imageToBase64(this.form.recent_photos);
  1022. this.$api
  1023. .faceCertificationIdCardCompareFace({
  1024. urlA: this.form.idcard_face_photo,
  1025. oneInchPhotos: base64,
  1026. })
  1027. .then((res1) => {
  1028. if (res1.data.data >= 70) {
  1029. var self = this;
  1030. if (self.remarkStatus) {
  1031. var arsty = {};
  1032. for (let k in data) {
  1033. for (let j in self.copyData) {
  1034. if (k === j) {
  1035. if (self.copyData[j].value === data[k]) {
  1036. arsty[k] = {
  1037. fieldKey: k,
  1038. value: data[k],
  1039. fieldName: (function () {
  1040. for (let i = 0; i < self.listData.length; i++) {
  1041. if (self.listData[i].fieldKey == k) {
  1042. return self.listData[i].fieldName;
  1043. }
  1044. }
  1045. })(),
  1046. status: 0,
  1047. };
  1048. } else {
  1049. arsty[k] = {
  1050. fieldKey: k,
  1051. value: data[k],
  1052. fieldName: (function () {
  1053. for (let i = 0; i < self.listData.length; i++) {
  1054. if (self.listData[i].fieldKey == k) {
  1055. return self.listData[i].fieldName;
  1056. }
  1057. }
  1058. })(),
  1059. status: 1,
  1060. };
  1061. }
  1062. }
  1063. }
  1064. }
  1065. var datas = {
  1066. id: this.id,
  1067. goodsId: this.goodsId,
  1068. orderGoodsId: this.orderGoodsId,
  1069. keyValue: JSON.stringify(arsty),
  1070. };
  1071. console.log(datas, "datas0");
  1072. // this.isUploading = false;
  1073. // return;
  1074. this.$api.editbaseprofiletp(datas).then((res) => {
  1075. this.isUploading = false;
  1076. if (res.data.code === 200) {
  1077. this.$method.showToast("提交成功");
  1078. this.getUserInfo();
  1079. setTimeout(() => {
  1080. console.log("延迟");
  1081. uni.navigateBack();
  1082. }, 1500);
  1083. } else {
  1084. this.$method.showToast(res.data.msg);
  1085. this.isUploading = false;
  1086. }
  1087. });
  1088. } else {
  1089. var objs = {};
  1090. for (let k in data) {
  1091. objs[k] = {
  1092. fieldKey: k,
  1093. value: data[k],
  1094. fieldName: (function () {
  1095. for (let i = 0; i < self.listData.length; i++) {
  1096. if (self.listData[i].fieldKey == k) {
  1097. return self.listData[i].fieldName;
  1098. }
  1099. }
  1100. })(),
  1101. status: 0,
  1102. };
  1103. }
  1104. var datas = {
  1105. goodsId: this.goodsId,
  1106. profileTpId: this.goodsId,
  1107. orderGoodsId: this.orderGoodsId,
  1108. keyValue: JSON.stringify(objs),
  1109. };
  1110. console.log(data, "datas");
  1111. // this.isUploading = false;
  1112. // return;
  1113. this.$api.addbaseprofiletp(datas).then((res) => {
  1114. this.isUploading = false;
  1115. if (res.data.code === 200) {
  1116. this.$method.showToast("提交成功");
  1117. this.getUserInfo();
  1118. setTimeout(() => {
  1119. console.log("延迟");
  1120. uni.navigateBack();
  1121. }, 1500);
  1122. } else {
  1123. this.$method.showToast(res.data.msg);
  1124. this.isUploading = false;
  1125. }
  1126. });
  1127. }
  1128. } else {
  1129. this.isUploading = false;
  1130. uni.showModal({
  1131. title: "提示",
  1132. content: "个人近照和身份证人像面照片不匹配",
  1133. showCancel: false,
  1134. });
  1135. }
  1136. });
  1137. return
  1138. }
  1139. return;
  1140. if (this.form.recent_photos && this.form.idcard_face_photo) {
  1141. uni.downloadFile({
  1142. url: this.$method.splitImgHost(this.form.idcard_face_photo),
  1143. success: async (res) => {
  1144. console.log(res, 8585858);
  1145. if (res.statusCode === 200) {
  1146. let resData = await this.faceCertificationIDCardOCR(
  1147. 1,
  1148. res.tempFilePath
  1149. );
  1150. if (!resData.data.data) {
  1151. uni.showModal({
  1152. title: "提示",
  1153. content: "身份证人像面照片异常,请重新上传",
  1154. showCancel: false,
  1155. });
  1156. this.isUploading = false;
  1157. return;
  1158. }
  1159. uni.downloadFile({
  1160. url: this.$method.splitImgHost(this.form.recent_photos),
  1161. success: (res) => {
  1162. if (res.statusCode === 200) {
  1163. console.log("下载成功");
  1164. let fileSystem = uni.getFileSystemManager();
  1165. fileSystem.readFile({
  1166. filePath: res.tempFilePath,
  1167. encoding: "base64",
  1168. position: 0,
  1169. success: (res) => {
  1170. let base64 = "data:image/jpg;base64," + res.data;
  1171. let newdata = {
  1172. urlA: this.form.idcard_face_photo,
  1173. oneInchPhotos: base64,
  1174. };
  1175. this.$api
  1176. .faceCertificationIdCardCompareFace(newdata)
  1177. .then((res1) => {
  1178. if (res1.data.data >= 70) {
  1179. var self = this;
  1180. if (self.remarkStatus) {
  1181. var arsty = {};
  1182. for (let k in data) {
  1183. for (let j in self.copyData) {
  1184. if (k === j) {
  1185. if (self.copyData[j].value === data[k]) {
  1186. arsty[k] = {
  1187. fieldKey: k,
  1188. value: data[k],
  1189. fieldName: (function () {
  1190. for (
  1191. let i = 0;
  1192. i < self.listData.length;
  1193. i++
  1194. ) {
  1195. if (
  1196. self.listData[i].fieldKey == k
  1197. ) {
  1198. return self.listData[i]
  1199. .fieldName;
  1200. }
  1201. }
  1202. })(),
  1203. status: 0,
  1204. };
  1205. } else {
  1206. arsty[k] = {
  1207. fieldKey: k,
  1208. value: data[k],
  1209. fieldName: (function () {
  1210. for (
  1211. let i = 0;
  1212. i < self.listData.length;
  1213. i++
  1214. ) {
  1215. if (
  1216. self.listData[i].fieldKey == k
  1217. ) {
  1218. return self.listData[i]
  1219. .fieldName;
  1220. }
  1221. }
  1222. })(),
  1223. status: 1,
  1224. };
  1225. }
  1226. }
  1227. }
  1228. }
  1229. var datas = {
  1230. id: this.id,
  1231. goodsId: this.goodsId,
  1232. orderGoodsId: this.orderGoodsId,
  1233. keyValue: JSON.stringify(arsty),
  1234. };
  1235. console.log(datas, "datas0");
  1236. // this.isUploading = false;
  1237. // return;
  1238. this.$api
  1239. .editbaseprofiletp(datas)
  1240. .then((res) => {
  1241. this.isUploading = false;
  1242. if (res.data.code === 200) {
  1243. this.$method.showToast("提交成功");
  1244. this.getUserInfo();
  1245. setTimeout(() => {
  1246. console.log("延迟");
  1247. uni.navigateBack();
  1248. }, 1500);
  1249. } else {
  1250. this.$method.showToast(res.data.msg);
  1251. this.isUploading = false;
  1252. }
  1253. });
  1254. } else {
  1255. var objs = {};
  1256. for (let k in data) {
  1257. objs[k] = {
  1258. fieldKey: k,
  1259. value: data[k],
  1260. fieldName: (function () {
  1261. for (
  1262. let i = 0;
  1263. i < self.listData.length;
  1264. i++
  1265. ) {
  1266. if (self.listData[i].fieldKey == k) {
  1267. return self.listData[i].fieldName;
  1268. }
  1269. }
  1270. })(),
  1271. status: 0,
  1272. };
  1273. }
  1274. var datas = {
  1275. goodsId: this.goodsId,
  1276. profileTpId: this.goodsId,
  1277. orderGoodsId: this.orderGoodsId,
  1278. keyValue: JSON.stringify(objs),
  1279. };
  1280. console.log(data, "datas");
  1281. // this.isUploading = false;
  1282. // return;
  1283. this.$api
  1284. .addbaseprofiletp(datas)
  1285. .then((res) => {
  1286. this.isUploading = false;
  1287. if (res.data.code === 200) {
  1288. this.$method.showToast("提交成功");
  1289. this.getUserInfo();
  1290. setTimeout(() => {
  1291. console.log("延迟");
  1292. uni.navigateBack();
  1293. }, 1500);
  1294. } else {
  1295. this.$method.showToast(res.data.msg);
  1296. this.isUploading = false;
  1297. }
  1298. });
  1299. }
  1300. } else {
  1301. this.isUploading = false;
  1302. uni.showModal({
  1303. title: "提示",
  1304. content: "个人近照和身份证人像面照片不匹配",
  1305. showCancel: false,
  1306. });
  1307. }
  1308. });
  1309. },
  1310. fail(err) {
  1311. this.isUploading = false;
  1312. console.error(err, "err");
  1313. },
  1314. });
  1315. }
  1316. },
  1317. });
  1318. }
  1319. },
  1320. });
  1321. return;
  1322. }
  1323. var self = this;
  1324. if (self.remarkStatus) {
  1325. var arsty = {};
  1326. for (let k in data) {
  1327. for (let j in self.copyData) {
  1328. if (k === j) {
  1329. if (self.copyData[j].value === data[k]) {
  1330. arsty[k] = {
  1331. fieldKey: k,
  1332. value: data[k],
  1333. fieldName: (function () {
  1334. for (let i = 0; i < self.listData.length; i++) {
  1335. if (self.listData[i].fieldKey == k) {
  1336. return self.listData[i].fieldName;
  1337. }
  1338. }
  1339. })(),
  1340. status: 0,
  1341. };
  1342. } else {
  1343. arsty[k] = {
  1344. fieldKey: k,
  1345. value: data[k],
  1346. fieldName: (function () {
  1347. for (let i = 0; i < self.listData.length; i++) {
  1348. if (self.listData[i].fieldKey == k) {
  1349. return self.listData[i].fieldName;
  1350. }
  1351. }
  1352. })(),
  1353. status: 1,
  1354. };
  1355. }
  1356. }
  1357. }
  1358. }
  1359. console.log(arsty, "arsty");
  1360. if (Object.keys(arsty).length == 0) {
  1361. uni.showModal({
  1362. title: "提示",
  1363. content: "数据错误,请联系管理员",
  1364. });
  1365. this.isUploading = false;
  1366. return;
  1367. }
  1368. var datas = {
  1369. id: this.id,
  1370. goodsId: this.goodsId,
  1371. orderGoodsId: this.orderGoodsId,
  1372. keyValue: JSON.stringify(arsty),
  1373. };
  1374. console.log(datas, "datas1");
  1375. return;
  1376. this.$api.editbaseprofiletp(datas).then((res) => {
  1377. this.isUploading = false;
  1378. if (res.data.code === 200) {
  1379. this.$method.showToast("提交成功");
  1380. this.getUserInfo();
  1381. setTimeout(() => {
  1382. console.log("延迟");
  1383. uni.navigateBack();
  1384. }, 1500);
  1385. } else {
  1386. this.$method.showToast(res.data.msg);
  1387. this.isUploading = false;
  1388. }
  1389. });
  1390. } else {
  1391. var objs = {};
  1392. for (let k in data) {
  1393. objs[k] = {
  1394. fieldKey: k,
  1395. value: data[k],
  1396. fieldName: (function () {
  1397. for (let i = 0; i < self.listData.length; i++) {
  1398. if (self.listData[i].fieldKey == k) {
  1399. return self.listData[i].fieldName;
  1400. }
  1401. }
  1402. })(),
  1403. status: 0,
  1404. };
  1405. }
  1406. var datas = {
  1407. goodsId: this.goodsId,
  1408. profileTpId: this.goodsId,
  1409. orderGoodsId: this.orderGoodsId,
  1410. keyValue: JSON.stringify(objs),
  1411. };
  1412. console.log(datas, "datas2");
  1413. // this.isUploading = false;
  1414. // return;
  1415. this.$api
  1416. .addbaseprofiletp(datas)
  1417. .then((res) => {
  1418. this.isUploading = false;
  1419. if (res.data.code === 200) {
  1420. this.$method.showToast("提交成功");
  1421. this.getUserInfo();
  1422. setTimeout(() => {
  1423. console.log("延迟");
  1424. uni.navigateBack();
  1425. }, 1500);
  1426. } else {
  1427. this.$method.showToast(res.data.msg);
  1428. this.isUploading = false;
  1429. }
  1430. })
  1431. .catch((err) => {});
  1432. }
  1433. },
  1434. clearWord() {
  1435. this.$set(this.form, "commitment_seal", "");
  1436. this.titleName = "";
  1437. },
  1438. //提交表单
  1439. async submitApi() {
  1440. var data = JSON.parse(JSON.stringify(this.form));
  1441. if (data["sex"]) {
  1442. data.sex = this.dictObj["sys_user_sex"][Number(data.sex)];
  1443. }
  1444. if (data["education"]) {
  1445. data.education = this.dictObj["edu_level"][Number(data.education)];
  1446. }
  1447. if (data["working_years"]) {
  1448. data.working_years =
  1449. this.dictObj["working_years"][Number(data.working_years)];
  1450. }
  1451. if (data["recent_photos"]) {
  1452. data.recent_photos = await this.$method.uploadFile(
  1453. data.recent_photos,
  1454. 0
  1455. );
  1456. }
  1457. if (data["idcard_face_photo"]) {
  1458. data.idcard_face_photo = await this.$method.uploadFile(
  1459. data.idcard_face_photo,
  1460. 0
  1461. );
  1462. }
  1463. if (data["idcard_national_photo"]) {
  1464. data.idcard_national_photo = await this.$method.uploadFile(
  1465. data.idcard_national_photo,
  1466. 0
  1467. );
  1468. }
  1469. if (data["commitment_electr_signature"]) {
  1470. data.commitment_electr_signature = await this.$method.uploadFile(
  1471. data.commitment_electr_signature,
  1472. 0
  1473. );
  1474. }
  1475. if (data["commitment_seal"]) {
  1476. data.commitment_seal = await this.$method.uploadFile(
  1477. data.commitment_seal,
  1478. 0
  1479. );
  1480. }
  1481. this.uploadDatas(data);
  1482. },
  1483. //验证表单
  1484. resultForm(int) {
  1485. console.log(this.openVerify, "openVerify");
  1486. console.log(this.isRequired, "isRequired");
  1487. if (this.openVerify) {
  1488. if (this.isRequired) {
  1489. this.submitApi();
  1490. } else {
  1491. if (int === 1) {
  1492. this.errorType = ["toast"];
  1493. } else {
  1494. this.errorType = ["message"];
  1495. }
  1496. this.$nextTick(() => {
  1497. this.$refs.uForm.validate((valid) => {
  1498. if (valid) {
  1499. if (int === 1) {
  1500. this.submitApi();
  1501. }
  1502. } else {
  1503. this.isUploading = false;
  1504. this.errorType = ["message"];
  1505. console.log(this.form);
  1506. console.log("验证失败");
  1507. }
  1508. });
  1509. });
  1510. }
  1511. }
  1512. },
  1513. async submits() {
  1514. if (this.isUploading) {
  1515. return;
  1516. }
  1517. this.isUploading = true;
  1518. var ast = this.listData.some((item) => {
  1519. return item.fieldKey === "commitment_electr_signature";
  1520. });
  1521. if (ast) {
  1522. await this.subCanvas();
  1523. }
  1524. this.openVerify = true;
  1525. this.resultForm(1);
  1526. },
  1527. async faceCertificationIDCardOCR(cardSide, base64) {
  1528. if (!this.$method.isBase64(base64)) {
  1529. base64 = await this.$method.fileToBase64(base64);
  1530. }
  1531. let res = await this.$api.faceCertificationIDCardOCR({
  1532. cardSide: cardSide, //1人像 2 国徽
  1533. cardImageBase64: base64,
  1534. gradeId: this.gradeId,
  1535. });
  1536. return Promise.resolve(res.data);
  1537. },
  1538. async changePhotoListHeader(lists, key) {
  1539. const map = {
  1540. recent_photos: 1,
  1541. idcard_face_photo: 2,
  1542. idcard_national_photo: 3,
  1543. };
  1544. const index = map[key];
  1545. if (lists.length) {
  1546. this["fileList" + index] = lists;
  1547. // #ifdef MP-WEIXIN
  1548. const isJPG =
  1549. lists[0].url.indexOf("//tmp") !== -1 ||
  1550. lists[0].url.indexOf("//temp") !== -1;
  1551. // #endif
  1552. // #ifdef H5
  1553. const isJPG =
  1554. lists[0].file.type === "image/jpeg" ||
  1555. lists[0].file.type === "image/png" ||
  1556. lists[0].file.type === "image/jpg";
  1557. // #endif
  1558. if (isJPG) {
  1559. let size = lists[0].file.size;
  1560. if (size < 2 * 1024 * 1024) {
  1561. if (index == 1) {
  1562. let url = lists[0].url;
  1563. // #ifdef MP-WEIXIN
  1564. url = await this.$method.imageInfos(url);
  1565. // #endif
  1566. // #ifdef H5
  1567. url = await this.$method.uploadFile(url, 0);
  1568. // #endif
  1569. this.$set(this.form, "recent_photos", url);
  1570. console.log(url, 789);
  1571. } else {
  1572. // #ifdef MP-WEIXIN
  1573. let url = lists[0].url;
  1574. // #endif
  1575. // #ifdef H5
  1576. let url = lists[0].file;
  1577. // #endif
  1578. this.$refs[key][0].remove(0);
  1579. let titleMsg =
  1580. "请上传正确清晰的身份证" +
  1581. (index == 2 ? "人像" : "国徽") +
  1582. "面照片";
  1583. this.checkIdCard(index - 1, url, titleMsg, key);
  1584. }
  1585. } else {
  1586. uni.showModal({
  1587. title: "提示",
  1588. content: "上传图片大小不能超过 2MB!",
  1589. showCancel: false,
  1590. });
  1591. return;
  1592. }
  1593. }
  1594. } else {
  1595. this.fileList3 = [];
  1596. this.$set(this.form, "idcard_national_photo", "");
  1597. }
  1598. this.openVerify = false;
  1599. this.$nextTick(function () {
  1600. this.resultForm();
  1601. });
  1602. },
  1603. async changePhotoListHeader1(lists, name) {
  1604. if (lists.length) {
  1605. this.fileList1 = lists;
  1606. // console.log(lists, "lists1");
  1607. if (
  1608. lists[0].url.indexOf("//tmp") !== -1 ||
  1609. lists[0].url.indexOf("//temp") !== -1
  1610. ) {
  1611. if (lists[0].file.size < 2 * 1024 * 1024) {
  1612. // 以前的
  1613. this.$set(
  1614. this.form,
  1615. "recent_photos",
  1616. await this.$method.imageInfos(lists[0].url)
  1617. );
  1618. } else {
  1619. // 需要压缩
  1620. let canvasId = "zipCanvas";
  1621. let imagePath = lists[0].url; //原图的路径
  1622. let limitSize = 2048; //大小限制2048kb
  1623. let drawWidth = wx.getSystemInfoSync().windowWidth; //初始绘画区域是画布自身的宽度也就是屏幕宽度
  1624. getLessLimitSizeImage(
  1625. canvasId,
  1626. imagePath,
  1627. limitSize,
  1628. drawWidth,
  1629. async (resPath) => {
  1630. //resPath就是压缩后图片的路径
  1631. this.$set(
  1632. this.form,
  1633. "recent_photos",
  1634. await this.$method.imageInfos(resPath)
  1635. );
  1636. }
  1637. );
  1638. }
  1639. }
  1640. } else {
  1641. this.fileList1 = [];
  1642. this.$set(this.form, "recent_photos", "");
  1643. }
  1644. this.openVerify = false;
  1645. this.$nextTick(function () {
  1646. this.resultForm();
  1647. });
  1648. },
  1649. async changePhotoListHeader2(lists, name) {
  1650. // console.log('身份证照片zhengmian:', lists, this.$refs.idcard_face_photo)
  1651. if (lists.length) {
  1652. this.fileList2 = lists;
  1653. if (
  1654. lists[0].url.indexOf("//tmp") !== -1 ||
  1655. lists[0].url.indexOf("//temp") !== -1
  1656. ) {
  1657. let url = lists[0].url;
  1658. let size = lists[0].file.size;
  1659. this.$refs.idcard_face_photo[0].remove(0);
  1660. // console.log('url', url, size)
  1661. let titleMsg = "请上传正确清晰的身份证人像面照片";
  1662. if (size < 2 * 1024 * 1024) {
  1663. this.checkIdCard(1, url, titleMsg, "idcard_face_photo");
  1664. } else {
  1665. // 需要压缩
  1666. let canvasId = "zipCanvas";
  1667. let imagePath = url; //原图的路径
  1668. let limitSize = 2048; //大小限制2048kb
  1669. let drawWidth = wx.getSystemInfoSync().windowWidth; //初始绘画区域是画布自身的宽度也就是屏幕宽度
  1670. getLessLimitSizeImage(
  1671. canvasId,
  1672. imagePath,
  1673. limitSize,
  1674. drawWidth,
  1675. async (resPath) => {
  1676. //resPath就是压缩后图片的路径
  1677. this.checkIdCard(1, resPath, titleMsg, "idcard_face_photo");
  1678. }
  1679. );
  1680. }
  1681. }
  1682. } else {
  1683. this.fileList2 = [];
  1684. this.$set(this.form, "idcard_face_photo", "");
  1685. }
  1686. this.openVerify = false;
  1687. this.$nextTick(function () {
  1688. this.resultForm();
  1689. });
  1690. },
  1691. async changePhotoListHeader3(lists, name) {
  1692. if (lists.length) {
  1693. this.fileList3 = lists;
  1694. // #ifdef MP-WEIXIN
  1695. const isJPG =
  1696. lists[0].url.indexOf("//tmp") !== -1 ||
  1697. lists[0].url.indexOf("//temp") !== -1;
  1698. // #endif
  1699. // #ifdef H5
  1700. const isJPG =
  1701. lists[0].file.type === "image/jpeg" ||
  1702. lists[0].file.type === "image/png" ||
  1703. lists[0].file.type === "image/jpg";
  1704. // #endif
  1705. if (isJPG) {
  1706. console.log("//tem", lists[0]);
  1707. // #ifdef MP-WEIXIN
  1708. let url = lists[0].url;
  1709. // #endif
  1710. // #ifdef H5
  1711. let url = lists[0].file;
  1712. // #endif
  1713. let size = lists[0].file.size;
  1714. this.$refs.idcard_national_photo[0].remove(0);
  1715. let titleMsg = "请上传正确清晰的身份证国徽面照片";
  1716. if (size < 2 * 1024 * 1024) {
  1717. this.checkIdCard(2, url, titleMsg, "idcard_national_photo");
  1718. } else {
  1719. uni.showModal({
  1720. title: "提示",
  1721. content: "上传图片大小不能超过 2MB!",
  1722. showCancel: false,
  1723. });
  1724. return;
  1725. // 需要压缩
  1726. let canvasId = "zipCanvas";
  1727. let imagePath = url; //原图的路径
  1728. let limitSize = 2048; //大小限制2048kb
  1729. let drawWidth = wx.getSystemInfoSync().windowWidth; //初始绘画区域是画布自身的宽度也就是屏幕宽度
  1730. getLessLimitSizeImage(
  1731. canvasId,
  1732. imagePath,
  1733. limitSize,
  1734. drawWidth,
  1735. async (resPath) => {
  1736. //resPath就是压缩后图片的路径
  1737. this.checkIdCard(2, resPath, titleMsg, "idcard_national_photo");
  1738. }
  1739. );
  1740. }
  1741. }
  1742. } else {
  1743. this.fileList3 = [];
  1744. this.$set(this.form, "idcard_national_photo", "");
  1745. }
  1746. this.openVerify = false;
  1747. this.$nextTick(function () {
  1748. this.resultForm();
  1749. });
  1750. },
  1751. async checkIdCard(cardSide, url, titleMsg, paramType) {
  1752. let res = await this.faceCertificationIDCardOCR(cardSide, url);
  1753. if (res.code == 500) {
  1754. uni.showToast({
  1755. icon: "none",
  1756. title: titleMsg,
  1757. });
  1758. return;
  1759. }
  1760. let { IdName, IdNum } = res.data;
  1761. if (IdName != this.form.name || IdNum != this.form.idcard) {
  1762. // uni.showModal({
  1763. // content:
  1764. // IdName != this.form.name
  1765. // ? "输入的姓名和身份证人像面照片姓名不匹配,请联系客服"
  1766. // : "输入的身份证号和身份证人像面照片身份证号不匹配,请联系客服",
  1767. // showCancel: false,
  1768. // success: (resultst) => {
  1769. // if (resultst.confirm) {
  1770. // uni.navigateBack();
  1771. // }
  1772. // },
  1773. // });
  1774. // return;
  1775. }
  1776. this.$refs[paramType][0].lists = [
  1777. {
  1778. url: this.$method.splitImgHost(res.data.IdImgPath),
  1779. },
  1780. ];
  1781. this.$set(this.form, paramType, res.data.IdImgPath);
  1782. },
  1783. getTimes(key) {
  1784. if (this.form[key]) {
  1785. return this.form[key];
  1786. } else {
  1787. return "请选择时间";
  1788. }
  1789. },
  1790. getarrays(key) {
  1791. if (key === "sex") {
  1792. return this.dictObj["sys_user_sex"];
  1793. }
  1794. if (key === "education") {
  1795. return this.dictObj["edu_level"];
  1796. }
  1797. if (key === "working_years") {
  1798. return this.dictObj["working_years"];
  1799. }
  1800. },
  1801. returnName(key) {
  1802. if (key === "sex") {
  1803. if (this.form[key]) {
  1804. return this.dictObj["sys_user_sex"][Number(this.form[key])];
  1805. } else {
  1806. return "请选择性别";
  1807. }
  1808. }
  1809. if (key === "education") {
  1810. if (this.form[key]) {
  1811. return this.dictObj["edu_level"][Number(this.form[key])];
  1812. } else {
  1813. return "请选择学历";
  1814. }
  1815. }
  1816. if (key === "working_years") {
  1817. if (this.form[key]) {
  1818. return this.dictObj["working_years"][Number(this.form[key])];
  1819. } else {
  1820. return "请选择工作年限";
  1821. }
  1822. }
  1823. },
  1824. /**
  1825. * getbaseprofiletpgetInfo接口返回值result.data.data不存在的话说明是第一次填写资料
  1826. */
  1827. getInfo() {
  1828. console.log("getInfo", this.userInfo);
  1829. return new Promise((resolve) => {
  1830. var self = this;
  1831. this.$api.getbaseprofiletpId(this.goodsId).then((res) => {
  1832. self.listData = JSON.parse(res.data.data.keyValue);
  1833. var ast = JSON.parse(res.data.data.keyValue2);
  1834. self.listData = [...self.listData, ...ast];
  1835. console.log(self.listData, "listData");
  1836. self.listData.forEach((item) => {
  1837. if (item.fieldKey == "idcard") {
  1838. console.log(this.userInfo.idCard, "this.userInfo.idCard");
  1839. this.form.idcard = this.userInfo.idCard;
  1840. this.disCard = this.form.idcard ? true : false;
  1841. console.log(this.form.idcard);
  1842. }
  1843. if (item.fieldKey == "telphone") {
  1844. console.log(this.userInfo.telphone, "this.userInfo.telphone");
  1845. this.form.telphone = this.userInfo.telphone;
  1846. console.log(this.form.telphone);
  1847. }
  1848. if (item.fieldKey == "name") {
  1849. console.log(this.userInfo.realname, "this.userInfo.realname");
  1850. this.form.name = this.userInfo.realname;
  1851. this.disName = this.form.name ? true : false;
  1852. console.log("this.disName", this.form.name, this.disName);
  1853. }
  1854. });
  1855. self.isRequired = self.listData.every((ims) => {
  1856. return ims.required === false;
  1857. });
  1858. console.log(self.isRequired, "self.isRequired ");
  1859. this.$nextTick(() => {
  1860. // this.agreementModal = true;
  1861. });
  1862. self.$api
  1863. .getbaseprofiletpgetInfo({
  1864. goodsId: self.goodsId,
  1865. orderGoodsId: self.orderGoodsId,
  1866. })
  1867. .then((result) => {
  1868. if (result.data.code === 200) {
  1869. if (!result.data.data) {
  1870. self.$api
  1871. .getbaseprofiletplistProfile({ pageNum: 1, pageSize: 1 })
  1872. .then((kit) => {
  1873. if (kit.data.rows.length) {
  1874. var ajson = JSON.parse(kit.data.rows[0].keyValue);
  1875. self.listData.forEach((zyitem, zyindex) => {
  1876. for (let k in ajson) {
  1877. if (zyitem.fieldKey == k && ajson[k].value) {
  1878. if (k === "sex") {
  1879. const sexIndex =
  1880. self.dictObj["sys_user_sex"].indexOf(
  1881. ajson[k].value
  1882. ) + "";
  1883. self.$set(self.form, k, sexIndex);
  1884. } else if (k === "education") {
  1885. const sexIndex =
  1886. self.dictObj["edu_level"].indexOf(
  1887. ajson[k].value
  1888. ) + "";
  1889. self.$set(self.form, k, sexIndex);
  1890. } else if (k === "working_years") {
  1891. const sexIndex =
  1892. self.dictObj["working_years"].indexOf(
  1893. ajson[k].value
  1894. ) + "";
  1895. self.$set(self.form, k, sexIndex);
  1896. } else if (k === "recent_photos") {
  1897. self.$set(self.form, k, ajson[k].value);
  1898. if (ajson[k].value) {
  1899. self.fileList1 = [
  1900. {
  1901. url: baseUrls + ajson[k].value,
  1902. },
  1903. ];
  1904. }
  1905. } else if (k === "idcard_face_photo") {
  1906. self.$set(self.form, k, ajson[k].value);
  1907. if (ajson[k].value) {
  1908. self.fileList2 = [
  1909. {
  1910. url: baseUrls + ajson[k].value,
  1911. },
  1912. ];
  1913. }
  1914. } else if (k === "idcard_national_photo") {
  1915. self.$set(self.form, k, ajson[k].value);
  1916. if (ajson[k].value) {
  1917. self.fileList3 = [
  1918. {
  1919. url: baseUrls + ajson[k].value,
  1920. },
  1921. ];
  1922. }
  1923. } else {
  1924. if (k === "name") {
  1925. self.$set(
  1926. self.form,
  1927. k,
  1928. this.$store.state.userInfo.realname
  1929. );
  1930. } else if (k === "idcard") {
  1931. self.$set(
  1932. self.form,
  1933. k,
  1934. this.$store.state.userInfo.idCard
  1935. );
  1936. } else if (k === "telphone") {
  1937. self.$set(
  1938. self.form,
  1939. k,
  1940. this.$store.state.userInfo.telphone
  1941. );
  1942. } else if (
  1943. k !== "commitment_electr_signature"
  1944. ) {
  1945. self.$set(self.form, k, ajson[k].value);
  1946. }
  1947. }
  1948. }
  1949. }
  1950. });
  1951. resolve();
  1952. } else {
  1953. resolve();
  1954. }
  1955. });
  1956. }
  1957. console.log(result.data.data, "result.data.data");
  1958. if (result.data.data && result.data.data.status === 3) {
  1959. self.remark = result.data.data.text;
  1960. self.remarkStatus = true;
  1961. self.id = result.data.data.id;
  1962. console.log(result.data.data, "result.data.data");
  1963. var arrays = JSON.parse(result.data.data.keyValue);
  1964. // var arrays1 = JSON.parse(result.data.data.keyValue2);
  1965. self.copyData = JSON.parse(JSON.stringify(arrays));
  1966. for (let k in arrays) {
  1967. if (k === "sex") {
  1968. if (arrays[k].value) {
  1969. const sexIndex =
  1970. self.dictObj["sys_user_sex"].indexOf(
  1971. arrays[k].value
  1972. ) + "";
  1973. self.$set(self.form, k, sexIndex);
  1974. }
  1975. } else if (k === "education") {
  1976. if (arrays[k].value) {
  1977. const sexIndex =
  1978. self.dictObj["edu_level"].indexOf(arrays[k].value) +
  1979. "";
  1980. self.$set(self.form, k, sexIndex);
  1981. }
  1982. } else if (k === "working_years") {
  1983. if (arrays[k].value) {
  1984. const sexIndex =
  1985. self.dictObj["working_years"].indexOf(
  1986. arrays[k].value
  1987. ) + "";
  1988. self.$set(self.form, k, sexIndex);
  1989. }
  1990. } else if (k === "recent_photos") {
  1991. self.$set(self.form, k, arrays[k].value);
  1992. if (arrays[k].value) {
  1993. self.fileList1 = [{ url: baseUrls + arrays[k].value }];
  1994. }
  1995. } else if (k === "idcard_face_photo") {
  1996. self.$set(self.form, k, arrays[k].value);
  1997. if (arrays[k].value) {
  1998. self.fileList2 = [{ url: baseUrls + arrays[k].value }];
  1999. }
  2000. } else if (k === "idcard_national_photo") {
  2001. self.$set(self.form, k, arrays[k].value);
  2002. if (arrays[k].value) {
  2003. self.fileList3 = [{ url: baseUrls + arrays[k].value }];
  2004. }
  2005. } else if (k === "name") {
  2006. self.$set(
  2007. self.form,
  2008. k,
  2009. this.$store.state.userInfo.realname
  2010. );
  2011. } else if (k === "idcard") {
  2012. self.$set(
  2013. self.form,
  2014. k,
  2015. this.$store.state.userInfo.idCard
  2016. );
  2017. } else if (k === "telphone") {
  2018. self.$set(
  2019. self.form,
  2020. k,
  2021. this.$store.state.userInfo.telphone
  2022. );
  2023. } else {
  2024. self.$set(self.form, k, arrays[k].value);
  2025. }
  2026. }
  2027. resolve();
  2028. } else if (
  2029. result.data.data &&
  2030. (result.data.data.status === 1 ||
  2031. result.data.data.status === 2)
  2032. ) {
  2033. // uni.showModal({
  2034. // showCancel: false,
  2035. // content:
  2036. // result.data.data.status === 1
  2037. // ? "该商品审核资料已通过,不可重复提交资料"
  2038. // : result.data.data.status === 2
  2039. // ? "该商品审核资料处于待审核状态,不可重复提交资料"
  2040. // : "请联系管理员",
  2041. // success: function (k) {
  2042. // if (k.confirm) {
  2043. // uni.navigateBack();
  2044. // }
  2045. // },
  2046. // });
  2047. }
  2048. }
  2049. });
  2050. });
  2051. });
  2052. },
  2053. bindPickerChange(key, e) {
  2054. this.$set(this.form, key, e.detail.value + "");
  2055. this.openVerify = false;
  2056. this.$nextTick(function () {
  2057. this.resultForm();
  2058. });
  2059. },
  2060. bindDateChange(key, e) {
  2061. this.form[key] = e.detail.value;
  2062. },
  2063. retDraw() {
  2064. this.handwriting.retDraw();
  2065. this.$set(this.form, "commitment_electr_signature", "");
  2066. this.openVerify = false;
  2067. this.$nextTick(function () {
  2068. this.resultForm();
  2069. });
  2070. },
  2071. uploadScaleStart(event) {
  2072. this.handwriting.uploadScaleStart(event);
  2073. },
  2074. uploadScaleMove(event) {
  2075. this.handwriting.uploadScaleMove(event);
  2076. },
  2077. uploadScaleEnd(event) {
  2078. this.handwriting.uploadScaleEnd(event);
  2079. },
  2080. subCanvas() {
  2081. return new Promise((resolve, reject) => {
  2082. var self = this;
  2083. console.log(self.form, "self.form");
  2084. if (self.form.commitment_electr_signature) {
  2085. resolve();
  2086. return;
  2087. }
  2088. self.handwriting
  2089. .saveCanvas()
  2090. .then((res) => {
  2091. if (this.handwriting.linePrack.length) {
  2092. this.$set(this.form, "commitment_electr_signature", res);
  2093. }
  2094. resolve(res);
  2095. })
  2096. .catch((err) => {
  2097. uni.showToast({
  2098. title: "签名上传失败",
  2099. icon: "error",
  2100. });
  2101. this.isUploading = false;
  2102. });
  2103. });
  2104. },
  2105. },
  2106. };
  2107. </script>
  2108. <style>
  2109. page {
  2110. background: #eaeef1;
  2111. }
  2112. </style>
  2113. <style scope lang="scss">
  2114. .infos {
  2115. position: relative;
  2116. top: 0rpx;
  2117. left: 0rpx;
  2118. .photo_can {
  2119. width: 100%;
  2120. height: 100%;
  2121. position: absolute;
  2122. z-index: -1;
  2123. left: -10000rpx;
  2124. top: -10000rpx;
  2125. }
  2126. .zip_canvas {
  2127. width: 100%;
  2128. height: 600rpx;
  2129. border: 2rpx solid #333;
  2130. }
  2131. }
  2132. .ctoples {
  2133. position: absolute;
  2134. top: 0;
  2135. left: 0;
  2136. padding: 2rpx 23rpx;
  2137. display: inline-block;
  2138. background-color: rgba(0, 0, 0, 0.4);
  2139. font-size: 28rpx;
  2140. color: #fff;
  2141. border-bottom-right-radius: 24rpx;
  2142. }
  2143. .quzw {
  2144. width: 638rpx;
  2145. height: 638rpx;
  2146. position: relative;
  2147. border: 2rpx solid #eee;
  2148. border-radius: 8rpx;
  2149. }
  2150. .handWriting {
  2151. width: 100%;
  2152. height: 100%;
  2153. }
  2154. /deep/ .u-collapse-title {
  2155. color: #ff3b30;
  2156. font-size: 24rpx;
  2157. }
  2158. // /deep/ .u-input {
  2159. // text-align: right !important;
  2160. // }
  2161. .picker {
  2162. flex: 1;
  2163. }
  2164. /deep/ .u-form-item--right {
  2165. .u-input__input {
  2166. text-align: right;
  2167. }
  2168. uni-picker {
  2169. flex: 1;
  2170. }
  2171. }
  2172. .collapse-item {
  2173. color: #666;
  2174. font-size: 24rpx;
  2175. padding-bottom: 30rpx;
  2176. }
  2177. .dis_stys {
  2178. display: flex;
  2179. align-items: center;
  2180. justify-content: space-between;
  2181. }
  2182. .handCenter {
  2183. background: #f7f7f7;
  2184. border: 2rpx solid #eeeeee;
  2185. border-radius: 24rpx;
  2186. width: 100%;
  2187. height: 400rpx;
  2188. overflow: hidden;
  2189. }
  2190. .headerSDels {
  2191. height: 58rpx;
  2192. padding: 0rpx 24rpx;
  2193. font-weight: bold;
  2194. display: flex;
  2195. align-items: center;
  2196. flex-direction: row-reverse;
  2197. }
  2198. .listBox {
  2199. margin: 24rpx 32rpx 0rpx;
  2200. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  2201. border-radius: 32rpx;
  2202. background-color: #fff;
  2203. overflow: hidden;
  2204. }
  2205. .imgBoxs {
  2206. width: 156rpx;
  2207. height: 203rpx;
  2208. }
  2209. .imgBoxs2 {
  2210. width: 171rpx;
  2211. height: 108rpx;
  2212. }
  2213. .submit_btn {
  2214. width: 526rpx;
  2215. height: 80rpx;
  2216. background: #007aff;
  2217. border-radius: 40rpx;
  2218. text-align: center;
  2219. line-height: 80rpx;
  2220. color: #ffffff;
  2221. margin: 30rpx auto;
  2222. }
  2223. .picker {
  2224. text-align: right;
  2225. }
  2226. input {
  2227. text-align: right;
  2228. }
  2229. .bodyBox {
  2230. background: #ffffff;
  2231. border-radius: 24rpx;
  2232. width: 100%;
  2233. }
  2234. .topBox {
  2235. height: 80rpx;
  2236. background: #ffffff;
  2237. border-radius: 24rpx;
  2238. width: 100%;
  2239. display: flex;
  2240. justify-content: space-between;
  2241. line-height: 80rpx;
  2242. padding: 0 20rpx;
  2243. font-size: 24rpx;
  2244. }
  2245. .modal {
  2246. .agreement {
  2247. width: 640rpx;
  2248. height: 740rpx;
  2249. background: #ffffff;
  2250. display: flex;
  2251. flex-direction: column;
  2252. .body {
  2253. flex: 1;
  2254. .content {
  2255. padding: 30rpx 40rpx 28rpx;
  2256. line-height: 40rpx;
  2257. font-size: 26rpx;
  2258. color: #666;
  2259. .bold {
  2260. color: #333;
  2261. font-size: 26rpx;
  2262. font-weight: bold;
  2263. }
  2264. .center {
  2265. text-align: center;
  2266. }
  2267. }
  2268. }
  2269. .footer {
  2270. height: 140rpx;
  2271. border-top: 1px solid #eeeeee;
  2272. display: flex;
  2273. align-items: center;
  2274. justify-content: center;
  2275. .btn {
  2276. margin: 0 12rpx;
  2277. width: 200rpx;
  2278. height: 80rpx;
  2279. color: #007aff;
  2280. font-size: 30rpx;
  2281. text-align: center;
  2282. line-height: 80rpx;
  2283. background: #f5f5f5;
  2284. border-radius: 40rpx 40rpx 40rpx 40rpx;
  2285. &.ok {
  2286. width: 336rpx;
  2287. height: 80rpx;
  2288. background: #007aff;
  2289. color: #fff;
  2290. }
  2291. &.close {
  2292. color: #fff;
  2293. width: 560rpx;
  2294. height: 80rpx;
  2295. background: #007aff;
  2296. border-radius: 40rpx 40rpx 40rpx 40rpx;
  2297. }
  2298. }
  2299. }
  2300. }
  2301. }
  2302. </style>