input.vue 68 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131
  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="#"
  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: true,
  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. this.listData.forEach((item) => {
  751. if (item.fieldKey == "idcard") {
  752. this.form.idcard = this.userInfo.idCard;
  753. }
  754. if (item.fieldKey == "telphone") {
  755. this.form.telphone = this.userInfo.telphone;
  756. }
  757. if (item.fieldKey == "name") {
  758. this.form.name = this.userInfo.realname;
  759. }
  760. });
  761. }
  762. },
  763. },
  764. methods: {
  765. ...mapActions(["getUserInfo"]),
  766. inputName(event) {
  767. console.log("enevt", event, this.form.name);
  768. },
  769. clickIndex(inds) {
  770. if (inds === 0) {
  771. this.uploadImgs();
  772. }
  773. if (inds === 1) {
  774. this.uploadFieds();
  775. }
  776. },
  777. getChast() {
  778. this.showTableDown = true;
  779. },
  780. seePhotos(url) {
  781. uni.previewImage({
  782. urls: [url],
  783. });
  784. },
  785. async downDocx(url) {
  786. let self = this;
  787. var ast = this.listData.some((item) => {
  788. return item.fieldKey === "commitment_electr_signature";
  789. });
  790. if (ast) {
  791. await this.subCanvas();
  792. }
  793. let data = JSON.parse(JSON.stringify(this.form));
  794. if (data["commitment_electr_signature"]) {
  795. data.commitment_electr_signature = await this.$method.uploadFile(
  796. data.commitment_electr_signature,
  797. 0
  798. );
  799. }
  800. if (this.remarkStatus) {
  801. var arsty = {};
  802. for (let k in data) {
  803. for (let j in self.copyData) {
  804. if (k === j) {
  805. if (self.copyData[j].value === data[k]) {
  806. arsty[k] = {
  807. fieldKey: k,
  808. value: data[k],
  809. fieldName: (function () {
  810. for (let i = 0; i < self.listData.length; i++) {
  811. if (self.listData[i].fieldKey == k) {
  812. return self.listData[i].fieldName;
  813. }
  814. }
  815. })(),
  816. status: 0,
  817. };
  818. } else {
  819. arsty[k] = {
  820. fieldKey: k,
  821. value: data[k],
  822. fieldName: (function () {
  823. for (let i = 0; i < self.listData.length; i++) {
  824. if (self.listData[i].fieldKey == k) {
  825. return self.listData[i].fieldName;
  826. }
  827. }
  828. })(),
  829. status: 1,
  830. };
  831. }
  832. }
  833. }
  834. }
  835. } else {
  836. var arsty = {};
  837. for (let k in data) {
  838. arsty[k] = {
  839. fieldKey: k,
  840. value: data[k],
  841. fieldName: (function () {
  842. for (let i = 0; i < self.listData.length; i++) {
  843. if (self.listData[i].fieldKey == k) {
  844. return self.listData[i].fieldName;
  845. }
  846. }
  847. })(),
  848. status: 0,
  849. };
  850. }
  851. }
  852. console.log(arsty);
  853. this.$api
  854. .baseProfileStampV2AddWord({
  855. goodsId: this.goodsId,
  856. keyValue: JSON.stringify(arsty),
  857. })
  858. .then((res) => {
  859. uni.downloadFile({
  860. url: this.$method.splitImgHost(res.data.msg),
  861. success: (result) => {
  862. if (result.statusCode === 200) {
  863. const filePath = result.tempFilePath;
  864. console.log(this.$method.splitImgHost(res.data.msg));
  865. this.$method.showToast("下载成功");
  866. uni.saveImageToPhotosAlbum({
  867. filePath: filePath,
  868. success: function (errMsg) {
  869. uni.showToast({
  870. mask: true,
  871. title: "保存成功",
  872. });
  873. },
  874. fail: (errMsg) => {
  875. uni.showToast({
  876. mask: true,
  877. title: "保存失败",
  878. });
  879. },
  880. complete: (errMsg) => {},
  881. });
  882. }
  883. },
  884. });
  885. });
  886. },
  887. getGoodsDetail() {
  888. return new Promise((resolve) => {
  889. this.$api
  890. .orderInfo({
  891. orderGoodsId: this.orderGoodsId,
  892. })
  893. .then((res) => {
  894. this.goodsData = res.data.data;
  895. if (this.goodsData.categoryName) {
  896. this.$set(this.form, "apply_post", this.goodsData.categoryName);
  897. console.log(this.form);
  898. if (this.goodsData.categoryName) {
  899. this.apply_post_disabled = true;
  900. }
  901. }
  902. if (this.userInfo && this.userInfo.companyName) {
  903. this.$set(this.form, "work_unit", this.userInfo.companyName);
  904. }
  905. resolve();
  906. });
  907. });
  908. },
  909. uploadImgs() {
  910. uni.chooseImage({
  911. count: 1, //默认9
  912. sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
  913. success: (res) => {
  914. if (res.tempFiles[0].size > 2097152) {
  915. // this.$method.showToast("上传图片不得大于2M");
  916. // 需要压缩
  917. let canvasId = "zipCanvas";
  918. let imagePath = res.tempFiles[0].path; //原图的路径
  919. let limitSize = 2048; //大小限制2048kb
  920. let drawWidth = wx.getSystemInfoSync().windowWidth; //初始绘画区域是画布自身的宽度也就是屏幕宽度
  921. getLessLimitSizeImage(
  922. canvasId,
  923. imagePath,
  924. limitSize,
  925. drawWidth,
  926. async (resPath) => {
  927. //resPath就是压缩后图片的路径
  928. this.uploadImgsChild(resPath);
  929. }
  930. );
  931. return;
  932. } else {
  933. this.uploadImgsChild(res.tempFiles[0].path);
  934. }
  935. },
  936. });
  937. },
  938. uploadImgsChild(path) {
  939. var type = path.split(".").splice(-1);
  940. if (type[0] != "jpg" && type[0] != "png" && type[0] != "jpeg") {
  941. this.$method.showToast("请上传图片格式");
  942. return;
  943. }
  944. this.$set(this.form, "commitment_seal", path);
  945. this.$nextTick(() => {
  946. this.resultForm();
  947. });
  948. },
  949. uploadFieds() {
  950. var self = this;
  951. wx.chooseMessageFile({
  952. count: 1,
  953. size: 2097152,
  954. type: "file",
  955. success(res) {
  956. if (res.tempFiles[0].size > 2097152) {
  957. self.$method.showToast("上传文件不得大于2M");
  958. return;
  959. } else {
  960. var type = res.tempFiles[0].path.split(".").splice(-1);
  961. if (
  962. type[0] != "jpg" &&
  963. type[0] != "png" &&
  964. type[0] != "jpeg" &&
  965. type[0] != "docx" &&
  966. type[0] != "doc"
  967. ) {
  968. self.$method.showToast("请上传word文档或图片");
  969. return;
  970. }
  971. self.titleName = res.tempFiles[0].name;
  972. self.$set(self.form, "commitment_seal", res.tempFiles[0].path);
  973. self.$nextTick(function () {
  974. this.resultForm();
  975. });
  976. }
  977. },
  978. });
  979. },
  980. agree() {
  981. this.agreementModal = false;
  982. setTimeout(() => {
  983. this.$refs.collapse.init();
  984. }, 1000);
  985. },
  986. refuseAgreement() {
  987. uni.navigateBack({
  988. delta: 2,
  989. });
  990. },
  991. clearFun(key) {
  992. this.form[key] = "";
  993. },
  994. //清除按钮
  995. clearWatch(key) {
  996. if (this.form[key]) {
  997. return true;
  998. } else {
  999. return false;
  1000. }
  1001. },
  1002. async uploadDatas(data) {
  1003. console.log("sfsfg---data", data);
  1004. if (this.form.recent_photos && this.form.idcard_face_photo) {
  1005. let base64 = await this.$method.imageToBase64(
  1006. this.form.idcard_face_photo
  1007. );
  1008. let resData = await this.faceCertificationIDCardOCR(1, base64);
  1009. if (!resData.data) {
  1010. uni.showModal({
  1011. title: "提示",
  1012. content: "身份证人像面照片异常,请重新上传",
  1013. showCancel: false,
  1014. });
  1015. this.isUploading = false;
  1016. return;
  1017. }
  1018. base64 = await this.$method.imageToBase64(this.form.recent_photos);
  1019. this.$api
  1020. .faceCertificationIdCardCompareFace({
  1021. urlA: this.form.idcard_face_photo,
  1022. oneInchPhotos: base64,
  1023. })
  1024. .then((res1) => {
  1025. if (res1.data.data >= 70) {
  1026. var self = this;
  1027. if (self.remarkStatus) {
  1028. var arsty = {};
  1029. for (let k in data) {
  1030. for (let j in self.copyData) {
  1031. if (k === j) {
  1032. if (self.copyData[j].value === data[k]) {
  1033. arsty[k] = {
  1034. fieldKey: k,
  1035. value: data[k],
  1036. fieldName: (function () {
  1037. for (let i = 0; i < self.listData.length; i++) {
  1038. if (self.listData[i].fieldKey == k) {
  1039. return self.listData[i].fieldName;
  1040. }
  1041. }
  1042. })(),
  1043. status: 0,
  1044. };
  1045. } else {
  1046. arsty[k] = {
  1047. fieldKey: k,
  1048. value: data[k],
  1049. fieldName: (function () {
  1050. for (let i = 0; i < self.listData.length; i++) {
  1051. if (self.listData[i].fieldKey == k) {
  1052. return self.listData[i].fieldName;
  1053. }
  1054. }
  1055. })(),
  1056. status: 1,
  1057. };
  1058. }
  1059. }
  1060. }
  1061. }
  1062. var datas = {
  1063. id: this.id,
  1064. goodsId: this.goodsId,
  1065. orderGoodsId: this.orderGoodsId,
  1066. keyValue: JSON.stringify(arsty),
  1067. };
  1068. console.log(datas, "datas0");
  1069. // this.isUploading = false;
  1070. // return;
  1071. this.$api.editbaseprofiletp(datas).then((res) => {
  1072. this.isUploading = false;
  1073. if (res.data.code === 200) {
  1074. this.$method.showToast("提交成功");
  1075. this.getUserInfo();
  1076. setTimeout(() => {
  1077. console.log("延迟");
  1078. uni.navigateBack();
  1079. }, 1500);
  1080. } else {
  1081. this.$method.showToast(res.data.msg);
  1082. this.isUploading = false;
  1083. }
  1084. });
  1085. } else {
  1086. var objs = {};
  1087. for (let k in data) {
  1088. objs[k] = {
  1089. fieldKey: k,
  1090. value: data[k],
  1091. fieldName: (function () {
  1092. for (let i = 0; i < self.listData.length; i++) {
  1093. if (self.listData[i].fieldKey == k) {
  1094. return self.listData[i].fieldName;
  1095. }
  1096. }
  1097. })(),
  1098. status: 0,
  1099. };
  1100. }
  1101. var datas = {
  1102. goodsId: this.goodsId,
  1103. profileTpId: this.goodsId,
  1104. orderGoodsId: this.orderGoodsId,
  1105. keyValue: JSON.stringify(objs),
  1106. };
  1107. console.log(data, "datas");
  1108. // this.isUploading = false;
  1109. // return;
  1110. this.$api.addbaseprofiletp(datas).then((res) => {
  1111. this.isUploading = false;
  1112. if (res.data.code === 200) {
  1113. this.$method.showToast("提交成功");
  1114. this.getUserInfo();
  1115. setTimeout(() => {
  1116. console.log("延迟");
  1117. uni.navigateBack();
  1118. }, 1500);
  1119. } else {
  1120. this.$method.showToast(res.data.msg);
  1121. this.isUploading = false;
  1122. }
  1123. });
  1124. }
  1125. } else {
  1126. this.isUploading = false;
  1127. uni.showModal({
  1128. title: "提示",
  1129. content: "个人近照和身份证人像面照片不匹配",
  1130. showCancel: false,
  1131. });
  1132. }
  1133. });
  1134. return;
  1135. }
  1136. var self = this;
  1137. if (self.remarkStatus) {
  1138. var arsty = {};
  1139. for (let k in data) {
  1140. for (let j in self.copyData) {
  1141. if (k === j) {
  1142. if (self.copyData[j].value === data[k]) {
  1143. arsty[k] = {
  1144. fieldKey: k,
  1145. value: data[k],
  1146. fieldName: (function () {
  1147. for (let i = 0; i < self.listData.length; i++) {
  1148. if (self.listData[i].fieldKey == k) {
  1149. return self.listData[i].fieldName;
  1150. }
  1151. }
  1152. })(),
  1153. status: 0,
  1154. };
  1155. } else {
  1156. arsty[k] = {
  1157. fieldKey: k,
  1158. value: data[k],
  1159. fieldName: (function () {
  1160. for (let i = 0; i < self.listData.length; i++) {
  1161. if (self.listData[i].fieldKey == k) {
  1162. return self.listData[i].fieldName;
  1163. }
  1164. }
  1165. })(),
  1166. status: 1,
  1167. };
  1168. }
  1169. }
  1170. }
  1171. }
  1172. console.log(arsty, "arsty");
  1173. if (Object.keys(arsty).length == 0) {
  1174. uni.showModal({
  1175. title: "提示",
  1176. content: "数据错误,请联系管理员",
  1177. });
  1178. this.isUploading = false;
  1179. return;
  1180. }
  1181. var datas = {
  1182. id: this.id,
  1183. goodsId: this.goodsId,
  1184. orderGoodsId: this.orderGoodsId,
  1185. keyValue: JSON.stringify(arsty),
  1186. };
  1187. console.log(datas, "datas1");
  1188. this.$api.editbaseprofiletp(datas).then((res) => {
  1189. this.isUploading = false;
  1190. if (res.data.code === 200) {
  1191. this.$method.showToast("提交成功");
  1192. this.getUserInfo();
  1193. setTimeout(() => {
  1194. console.log("延迟");
  1195. uni.navigateBack();
  1196. }, 1500);
  1197. } else {
  1198. this.$method.showToast(res.data.msg);
  1199. this.isUploading = false;
  1200. }
  1201. });
  1202. } else {
  1203. var objs = {};
  1204. for (let k in data) {
  1205. objs[k] = {
  1206. fieldKey: k,
  1207. value: data[k],
  1208. fieldName: (function () {
  1209. for (let i = 0; i < self.listData.length; i++) {
  1210. if (self.listData[i].fieldKey == k) {
  1211. return self.listData[i].fieldName;
  1212. }
  1213. }
  1214. })(),
  1215. status: 0,
  1216. };
  1217. }
  1218. var datas = {
  1219. goodsId: this.goodsId,
  1220. profileTpId: this.goodsId,
  1221. orderGoodsId: this.orderGoodsId,
  1222. keyValue: JSON.stringify(objs),
  1223. };
  1224. console.log(datas, "datas2");
  1225. // this.isUploading = false;
  1226. // return;
  1227. this.$api
  1228. .addbaseprofiletp(datas)
  1229. .then((res) => {
  1230. this.isUploading = false;
  1231. if (res.data.code === 200) {
  1232. this.$method.showToast("提交成功");
  1233. this.getUserInfo();
  1234. setTimeout(() => {
  1235. console.log("延迟");
  1236. uni.navigateBack();
  1237. }, 1500);
  1238. } else {
  1239. this.$method.showToast(res.data.msg);
  1240. this.isUploading = false;
  1241. }
  1242. })
  1243. .catch((err) => {});
  1244. }
  1245. },
  1246. clearWord() {
  1247. this.$set(this.form, "commitment_seal", "");
  1248. this.titleName = "";
  1249. },
  1250. //提交表单
  1251. async submitApi() {
  1252. var data = JSON.parse(JSON.stringify(this.form));
  1253. if (data["sex"]) {
  1254. data.sex = this.dictObj["sys_user_sex"][Number(data.sex)];
  1255. }
  1256. if (data["education"]) {
  1257. data.education = this.dictObj["edu_level"][Number(data.education)];
  1258. }
  1259. if (data["working_years"]) {
  1260. data.working_years =
  1261. this.dictObj["working_years"][Number(data.working_years)];
  1262. }
  1263. if (data["recent_photos"]) {
  1264. data.recent_photos = await this.$method.uploadFile(
  1265. data.recent_photos,
  1266. 0
  1267. );
  1268. }
  1269. if (data["idcard_face_photo"]) {
  1270. data.idcard_face_photo = await this.$method.uploadFile(
  1271. data.idcard_face_photo,
  1272. 0
  1273. );
  1274. }
  1275. if (data["idcard_national_photo"]) {
  1276. data.idcard_national_photo = await this.$method.uploadFile(
  1277. data.idcard_national_photo,
  1278. 0
  1279. );
  1280. }
  1281. if (data["commitment_electr_signature"]) {
  1282. data.commitment_electr_signature = await this.$method.uploadFile(
  1283. data.commitment_electr_signature,
  1284. 0
  1285. );
  1286. }
  1287. if (data["commitment_seal"]) {
  1288. data.commitment_seal = await this.$method.uploadFile(
  1289. data.commitment_seal,
  1290. 0
  1291. );
  1292. }
  1293. this.uploadDatas(data);
  1294. },
  1295. //验证表单
  1296. resultForm(int) {
  1297. console.log(this.openVerify, "openVerify");
  1298. console.log(this.isRequired, "isRequired");
  1299. if (this.openVerify) {
  1300. if (this.isRequired) {
  1301. this.submitApi();
  1302. } else {
  1303. if (int === 1) {
  1304. this.errorType = ["toast"];
  1305. } else {
  1306. this.errorType = ["message"];
  1307. }
  1308. this.$nextTick(() => {
  1309. this.$refs.uForm.validate((valid) => {
  1310. if (valid) {
  1311. if (int === 1) {
  1312. this.submitApi();
  1313. }
  1314. } else {
  1315. this.isUploading = false;
  1316. this.errorType = ["message"];
  1317. console.log(this.form);
  1318. console.log("验证失败");
  1319. }
  1320. });
  1321. });
  1322. }
  1323. }
  1324. },
  1325. async submits() {
  1326. if (this.isUploading) {
  1327. return;
  1328. }
  1329. this.isUploading = true;
  1330. var ast = this.listData.some((item) => {
  1331. return item.fieldKey === "commitment_electr_signature";
  1332. });
  1333. if (ast) {
  1334. await this.subCanvas();
  1335. }
  1336. this.openVerify = true;
  1337. this.resultForm(1);
  1338. },
  1339. async faceCertificationIDCardOCR(cardSide, base64) {
  1340. if (!this.$method.isBase64(base64)) {
  1341. base64 = await this.$method.fileToBase64(base64);
  1342. }
  1343. let res = await this.$api.faceCertificationIDCardOCR({
  1344. cardSide: cardSide, //1人像 2 国徽
  1345. cardImageBase64: base64,
  1346. gradeId: this.gradeId,
  1347. });
  1348. return Promise.resolve(res.data);
  1349. },
  1350. async changePhotoListHeader(lists, key) {
  1351. const map = {
  1352. recent_photos: 1,
  1353. idcard_face_photo: 2,
  1354. idcard_national_photo: 3,
  1355. };
  1356. const index = map[key];
  1357. if (lists.length) {
  1358. this["fileList" + index] = lists;
  1359. // #ifdef MP-WEIXIN
  1360. const isJPG =
  1361. lists[0].url.indexOf("//tmp") !== -1 ||
  1362. lists[0].url.indexOf("//temp") !== -1;
  1363. // #endif
  1364. // #ifdef H5
  1365. const isJPG =
  1366. lists[0].file.type === "image/jpeg" ||
  1367. lists[0].file.type === "image/png" ||
  1368. lists[0].file.type === "image/jpg";
  1369. // #endif
  1370. if (isJPG) {
  1371. let size = lists[0].file.size;
  1372. if (size < 2 * 1024 * 1024) {
  1373. if (index == 1) {
  1374. let url = lists[0].url;
  1375. // #ifdef MP-WEIXIN
  1376. url = await this.$method.imageInfos(url);
  1377. // #endif
  1378. // #ifdef H5
  1379. url = await this.$method.uploadFile(url, 0);
  1380. // #endif
  1381. this.$set(this.form, "recent_photos", url);
  1382. } else {
  1383. // #ifdef MP-WEIXIN
  1384. let url = lists[0].url;
  1385. // #endif
  1386. // #ifdef H5
  1387. let url = lists[0].file;
  1388. // #endif
  1389. this.$refs[key][0].remove(0);
  1390. let titleMsg =
  1391. "请上传正确清晰的身份证" +
  1392. (index == 2 ? "人像" : "国徽") +
  1393. "面照片";
  1394. this.checkIdCard(index - 1, url, titleMsg, key);
  1395. }
  1396. } else {
  1397. uni.showModal({
  1398. title: "提示",
  1399. content: "上传图片大小不能超过 2MB!",
  1400. showCancel: false,
  1401. });
  1402. return;
  1403. }
  1404. }
  1405. } else {
  1406. this.fileList3 = [];
  1407. this.$set(this.form, "idcard_national_photo", "");
  1408. }
  1409. this.openVerify = false;
  1410. this.$nextTick(function () {
  1411. this.resultForm();
  1412. });
  1413. },
  1414. async changePhotoListHeader1(lists, name) {
  1415. if (lists.length) {
  1416. this.fileList1 = lists;
  1417. // console.log(lists, "lists1");
  1418. if (
  1419. lists[0].url.indexOf("//tmp") !== -1 ||
  1420. lists[0].url.indexOf("//temp") !== -1
  1421. ) {
  1422. if (lists[0].file.size < 2 * 1024 * 1024) {
  1423. // 以前的
  1424. this.$set(
  1425. this.form,
  1426. "recent_photos",
  1427. await this.$method.imageInfos(lists[0].url)
  1428. );
  1429. } else {
  1430. // 需要压缩
  1431. let canvasId = "zipCanvas";
  1432. let imagePath = lists[0].url; //原图的路径
  1433. let limitSize = 2048; //大小限制2048kb
  1434. let drawWidth = wx.getSystemInfoSync().windowWidth; //初始绘画区域是画布自身的宽度也就是屏幕宽度
  1435. getLessLimitSizeImage(
  1436. canvasId,
  1437. imagePath,
  1438. limitSize,
  1439. drawWidth,
  1440. async (resPath) => {
  1441. //resPath就是压缩后图片的路径
  1442. this.$set(
  1443. this.form,
  1444. "recent_photos",
  1445. await this.$method.imageInfos(resPath)
  1446. );
  1447. }
  1448. );
  1449. }
  1450. }
  1451. } else {
  1452. this.fileList1 = [];
  1453. this.$set(this.form, "recent_photos", "");
  1454. }
  1455. this.openVerify = false;
  1456. this.$nextTick(function () {
  1457. this.resultForm();
  1458. });
  1459. },
  1460. async changePhotoListHeader2(lists, name) {
  1461. // console.log('身份证照片zhengmian:', lists, this.$refs.idcard_face_photo)
  1462. if (lists.length) {
  1463. this.fileList2 = lists;
  1464. if (
  1465. lists[0].url.indexOf("//tmp") !== -1 ||
  1466. lists[0].url.indexOf("//temp") !== -1
  1467. ) {
  1468. let url = lists[0].url;
  1469. let size = lists[0].file.size;
  1470. this.$refs.idcard_face_photo[0].remove(0);
  1471. // console.log('url', url, size)
  1472. let titleMsg = "请上传正确清晰的身份证人像面照片";
  1473. if (size < 2 * 1024 * 1024) {
  1474. this.checkIdCard(1, url, titleMsg, "idcard_face_photo");
  1475. } else {
  1476. // 需要压缩
  1477. let canvasId = "zipCanvas";
  1478. let imagePath = url; //原图的路径
  1479. let limitSize = 2048; //大小限制2048kb
  1480. let drawWidth = wx.getSystemInfoSync().windowWidth; //初始绘画区域是画布自身的宽度也就是屏幕宽度
  1481. getLessLimitSizeImage(
  1482. canvasId,
  1483. imagePath,
  1484. limitSize,
  1485. drawWidth,
  1486. async (resPath) => {
  1487. //resPath就是压缩后图片的路径
  1488. this.checkIdCard(1, resPath, titleMsg, "idcard_face_photo");
  1489. }
  1490. );
  1491. }
  1492. }
  1493. } else {
  1494. this.fileList2 = [];
  1495. this.$set(this.form, "idcard_face_photo", "");
  1496. }
  1497. this.openVerify = false;
  1498. this.$nextTick(function () {
  1499. this.resultForm();
  1500. });
  1501. },
  1502. async changePhotoListHeader3(lists, name) {
  1503. if (lists.length) {
  1504. this.fileList3 = lists;
  1505. // #ifdef MP-WEIXIN
  1506. const isJPG =
  1507. lists[0].url.indexOf("//tmp") !== -1 ||
  1508. lists[0].url.indexOf("//temp") !== -1;
  1509. // #endif
  1510. // #ifdef H5
  1511. const isJPG =
  1512. lists[0].file.type === "image/jpeg" ||
  1513. lists[0].file.type === "image/png" ||
  1514. lists[0].file.type === "image/jpg";
  1515. // #endif
  1516. if (isJPG) {
  1517. console.log("//tem", lists[0]);
  1518. // #ifdef MP-WEIXIN
  1519. let url = lists[0].url;
  1520. // #endif
  1521. // #ifdef H5
  1522. let url = lists[0].file;
  1523. // #endif
  1524. let size = lists[0].file.size;
  1525. this.$refs.idcard_national_photo[0].remove(0);
  1526. let titleMsg = "请上传正确清晰的身份证国徽面照片";
  1527. if (size < 2 * 1024 * 1024) {
  1528. this.checkIdCard(2, url, titleMsg, "idcard_national_photo");
  1529. } else {
  1530. uni.showModal({
  1531. title: "提示",
  1532. content: "上传图片大小不能超过 2MB!",
  1533. showCancel: false,
  1534. });
  1535. return;
  1536. // 需要压缩
  1537. let canvasId = "zipCanvas";
  1538. let imagePath = url; //原图的路径
  1539. let limitSize = 2048; //大小限制2048kb
  1540. let drawWidth = wx.getSystemInfoSync().windowWidth; //初始绘画区域是画布自身的宽度也就是屏幕宽度
  1541. getLessLimitSizeImage(
  1542. canvasId,
  1543. imagePath,
  1544. limitSize,
  1545. drawWidth,
  1546. async (resPath) => {
  1547. //resPath就是压缩后图片的路径
  1548. this.checkIdCard(2, resPath, titleMsg, "idcard_national_photo");
  1549. }
  1550. );
  1551. }
  1552. }
  1553. } else {
  1554. this.fileList3 = [];
  1555. this.$set(this.form, "idcard_national_photo", "");
  1556. }
  1557. this.openVerify = false;
  1558. this.$nextTick(function () {
  1559. this.resultForm();
  1560. });
  1561. },
  1562. async checkIdCard(cardSide, url, titleMsg, paramType) {
  1563. let res = await this.faceCertificationIDCardOCR(cardSide, url);
  1564. if (res.code == 500) {
  1565. uni.showToast({
  1566. icon: "none",
  1567. title: titleMsg,
  1568. });
  1569. return;
  1570. }
  1571. let { IdName, IdNum } = res.data;
  1572. if (IdName != this.form.name || IdNum != this.form.idcard) {
  1573. uni.showModal({
  1574. content:
  1575. IdName != this.form.name
  1576. ? "输入的姓名和身份证人像面照片姓名不匹配,请联系客服"
  1577. : "输入的身份证号和身份证人像面照片身份证号不匹配,请联系客服",
  1578. showCancel: false,
  1579. success: (resultst) => {
  1580. if (resultst.confirm) {
  1581. uni.navigateBack();
  1582. }
  1583. },
  1584. });
  1585. return;
  1586. }
  1587. this.$refs[paramType][0].lists = [
  1588. {
  1589. url: this.$method.splitImgHost(res.data.IdImgPath),
  1590. },
  1591. ];
  1592. this.$set(this.form, paramType, res.data.IdImgPath);
  1593. },
  1594. getTimes(key) {
  1595. if (this.form[key]) {
  1596. return this.form[key];
  1597. } else {
  1598. return "请选择时间";
  1599. }
  1600. },
  1601. getarrays(key) {
  1602. if (!this.dictObj) return;
  1603. if (key === "sex") {
  1604. return this.dictObj["sys_user_sex"];
  1605. }
  1606. if (key === "education") {
  1607. return this.dictObj["edu_level"];
  1608. }
  1609. if (key === "working_years") {
  1610. return this.dictObj["working_years"];
  1611. }
  1612. },
  1613. returnName(key) {
  1614. if (!this.dictObj) return;
  1615. if (key === "sex") {
  1616. if (this.form[key]) {
  1617. return this.dictObj["sys_user_sex"][Number(this.form[key])];
  1618. } else {
  1619. return "请选择性别";
  1620. }
  1621. }
  1622. if (key === "education") {
  1623. if (this.form[key]) {
  1624. return this.dictObj["edu_level"][Number(this.form[key])];
  1625. } else {
  1626. return "请选择学历";
  1627. }
  1628. }
  1629. if (key === "working_years") {
  1630. if (this.form[key]) {
  1631. return this.dictObj["working_years"][Number(this.form[key])];
  1632. } else {
  1633. return "请选择工作年限";
  1634. }
  1635. }
  1636. },
  1637. /**
  1638. * getbaseprofiletpgetInfo接口返回值result.data.data不存在的话说明是第一次填写资料
  1639. */
  1640. getInfo() {
  1641. return new Promise((resolve) => {
  1642. var self = this;
  1643. this.$api.getbaseprofiletpId(this.goodsId).then((res) => {
  1644. self.listData = JSON.parse(res.data.data.keyValue);
  1645. var ast = JSON.parse(res.data.data.keyValue2);
  1646. self.listData = [...self.listData, ...ast];
  1647. self.listData.forEach((item) => {
  1648. if (item.fieldKey == "idcard") {
  1649. this.form.idcard = this.userInfo.idCard;
  1650. this.disCard = this.form.idcard ? true : false;
  1651. }
  1652. if (item.fieldKey == "telphone") {
  1653. this.form.telphone = this.userInfo.telphone;
  1654. }
  1655. if (item.fieldKey == "name") {
  1656. this.form.name = this.userInfo.realname;
  1657. this.disName = this.form.name ? true : false;
  1658. }
  1659. });
  1660. self.isRequired = self.listData.every((ims) => {
  1661. return ims.required === false;
  1662. });
  1663. this.$nextTick(() => {
  1664. this.agreementModal = true;
  1665. });
  1666. self.$api
  1667. .getbaseprofiletpgetInfo({
  1668. goodsId: self.goodsId,
  1669. orderGoodsId: self.orderGoodsId,
  1670. })
  1671. .then((result) => {
  1672. if (result.data.code === 200) {
  1673. if (!result.data.data) {
  1674. self.$api
  1675. .getbaseprofiletplistProfile({ pageNum: 1, pageSize: 1 })
  1676. .then((kit) => {
  1677. if (kit.data.rows.length) {
  1678. var ajson = JSON.parse(kit.data.rows[0].keyValue);
  1679. self.listData.forEach((zyitem, zyindex) => {
  1680. for (let k in ajson) {
  1681. if (zyitem.fieldKey == k && ajson[k].value) {
  1682. if (k === "sex") {
  1683. const sexIndex =
  1684. self.dictObj["sys_user_sex"].indexOf(
  1685. ajson[k].value
  1686. ) + "";
  1687. self.$set(self.form, k, sexIndex);
  1688. } else if (k === "education") {
  1689. const sexIndex =
  1690. self.dictObj["edu_level"].indexOf(
  1691. ajson[k].value
  1692. ) + "";
  1693. self.$set(self.form, k, sexIndex);
  1694. } else if (k === "working_years") {
  1695. const sexIndex =
  1696. self.dictObj["working_years"].indexOf(
  1697. ajson[k].value
  1698. ) + "";
  1699. self.$set(self.form, k, sexIndex);
  1700. } else if (k === "recent_photos") {
  1701. self.$set(self.form, k, ajson[k].value);
  1702. if (ajson[k].value) {
  1703. self.fileList1 = [
  1704. {
  1705. url: baseUrls + ajson[k].value,
  1706. },
  1707. ];
  1708. }
  1709. } else if (k === "idcard_face_photo") {
  1710. self.$set(self.form, k, ajson[k].value);
  1711. if (ajson[k].value) {
  1712. self.fileList2 = [
  1713. {
  1714. url: baseUrls + ajson[k].value,
  1715. },
  1716. ];
  1717. }
  1718. } else if (k === "idcard_national_photo") {
  1719. self.$set(self.form, k, ajson[k].value);
  1720. if (ajson[k].value) {
  1721. self.fileList3 = [
  1722. {
  1723. url: baseUrls + ajson[k].value,
  1724. },
  1725. ];
  1726. }
  1727. } else {
  1728. if (k === "name") {
  1729. self.$set(
  1730. self.form,
  1731. k,
  1732. this.$store.state.userInfo.realname
  1733. );
  1734. } else if (k === "idcard") {
  1735. self.$set(
  1736. self.form,
  1737. k,
  1738. this.$store.state.userInfo.idCard
  1739. );
  1740. } else if (k === "telphone") {
  1741. self.$set(
  1742. self.form,
  1743. k,
  1744. this.$store.state.userInfo.telphone
  1745. );
  1746. } else if (
  1747. k !== "commitment_electr_signature"
  1748. ) {
  1749. self.$set(self.form, k, ajson[k].value);
  1750. }
  1751. }
  1752. }
  1753. }
  1754. });
  1755. resolve();
  1756. } else {
  1757. resolve();
  1758. }
  1759. });
  1760. }
  1761. if (result.data.data && result.data.data.status === 3) {
  1762. self.remark = result.data.data.text;
  1763. self.remarkStatus = true;
  1764. self.id = result.data.data.id;
  1765. var arrays = JSON.parse(result.data.data.keyValue);
  1766. // var arrays1 = JSON.parse(result.data.data.keyValue2);
  1767. self.copyData = JSON.parse(JSON.stringify(arrays));
  1768. for (let k in arrays) {
  1769. if (k === "sex") {
  1770. if (arrays[k].value) {
  1771. const sexIndex =
  1772. self.dictObj["sys_user_sex"].indexOf(
  1773. arrays[k].value
  1774. ) + "";
  1775. self.$set(self.form, k, sexIndex);
  1776. }
  1777. } else if (k === "education") {
  1778. if (arrays[k].value) {
  1779. const sexIndex =
  1780. self.dictObj["edu_level"].indexOf(arrays[k].value) +
  1781. "";
  1782. self.$set(self.form, k, sexIndex);
  1783. }
  1784. } else if (k === "working_years") {
  1785. if (arrays[k].value) {
  1786. const sexIndex =
  1787. self.dictObj["working_years"].indexOf(
  1788. arrays[k].value
  1789. ) + "";
  1790. self.$set(self.form, k, sexIndex);
  1791. }
  1792. } else if (k === "recent_photos") {
  1793. self.$set(self.form, k, arrays[k].value);
  1794. if (arrays[k].value) {
  1795. self.fileList1 = [{ url: baseUrls + arrays[k].value }];
  1796. }
  1797. } else if (k === "idcard_face_photo") {
  1798. self.$set(self.form, k, arrays[k].value);
  1799. if (arrays[k].value) {
  1800. self.fileList2 = [{ url: baseUrls + arrays[k].value }];
  1801. }
  1802. } else if (k === "idcard_national_photo") {
  1803. self.$set(self.form, k, arrays[k].value);
  1804. if (arrays[k].value) {
  1805. self.fileList3 = [{ url: baseUrls + arrays[k].value }];
  1806. }
  1807. } else if (k === "name") {
  1808. self.$set(
  1809. self.form,
  1810. k,
  1811. this.$store.state.userInfo.realname
  1812. );
  1813. } else if (k === "idcard") {
  1814. self.$set(
  1815. self.form,
  1816. k,
  1817. this.$store.state.userInfo.idCard
  1818. );
  1819. } else if (k === "telphone") {
  1820. self.$set(
  1821. self.form,
  1822. k,
  1823. this.$store.state.userInfo.telphone
  1824. );
  1825. } else {
  1826. self.$set(self.form, k, arrays[k].value);
  1827. }
  1828. }
  1829. resolve();
  1830. } else if (
  1831. result.data.data &&
  1832. (result.data.data.status === 1 ||
  1833. result.data.data.status === 2)
  1834. ) {
  1835. uni.showModal({
  1836. showCancel: false,
  1837. content:
  1838. result.data.data.status === 1
  1839. ? "该商品审核资料已通过,不可重复提交资料"
  1840. : result.data.data.status === 2
  1841. ? "该商品审核资料处于待审核状态,不可重复提交资料"
  1842. : "请联系管理员",
  1843. success: function (k) {
  1844. if (k.confirm) {
  1845. uni.navigateBack();
  1846. }
  1847. },
  1848. });
  1849. }
  1850. }
  1851. });
  1852. });
  1853. });
  1854. },
  1855. bindPickerChange(key, e) {
  1856. this.$set(this.form, key, e.detail.value + "");
  1857. this.openVerify = false;
  1858. this.$nextTick(function () {
  1859. this.resultForm();
  1860. });
  1861. },
  1862. bindDateChange(key, e) {
  1863. this.form[key] = e.detail.value;
  1864. },
  1865. retDraw() {
  1866. this.handwriting.retDraw();
  1867. this.$set(this.form, "commitment_electr_signature", "");
  1868. this.openVerify = false;
  1869. this.$nextTick(function () {
  1870. this.resultForm();
  1871. });
  1872. },
  1873. uploadScaleStart(event) {
  1874. this.handwriting.uploadScaleStart(event);
  1875. },
  1876. uploadScaleMove(event) {
  1877. this.handwriting.uploadScaleMove(event);
  1878. },
  1879. uploadScaleEnd(event) {
  1880. this.handwriting.uploadScaleEnd(event);
  1881. },
  1882. subCanvas() {
  1883. return new Promise((resolve, reject) => {
  1884. var self = this;
  1885. if (self.form.commitment_electr_signature) {
  1886. resolve();
  1887. return;
  1888. }
  1889. self.handwriting
  1890. .saveCanvas()
  1891. .then((res) => {
  1892. if (this.handwriting.linePrack.length) {
  1893. this.$set(this.form, "commitment_electr_signature", res);
  1894. }
  1895. resolve(res);
  1896. })
  1897. .catch((err) => {
  1898. uni.showToast({
  1899. title: "签名上传失败",
  1900. icon: "error",
  1901. });
  1902. this.isUploading = false;
  1903. });
  1904. });
  1905. },
  1906. },
  1907. };
  1908. </script>
  1909. <style>
  1910. page {
  1911. background: #eaeef1;
  1912. }
  1913. </style>
  1914. <style scope lang="scss">
  1915. .infos {
  1916. position: relative;
  1917. top: 0rpx;
  1918. left: 0rpx;
  1919. .photo_can {
  1920. width: 100%;
  1921. height: 100%;
  1922. position: absolute;
  1923. z-index: -1;
  1924. left: -10000rpx;
  1925. top: -10000rpx;
  1926. }
  1927. .zip_canvas {
  1928. width: 100%;
  1929. height: 600rpx;
  1930. border: 2rpx solid #333;
  1931. }
  1932. }
  1933. .ctoples {
  1934. position: absolute;
  1935. top: 0;
  1936. left: 0;
  1937. padding: 2rpx 23rpx;
  1938. display: inline-block;
  1939. background-color: rgba(0, 0, 0, 0.4);
  1940. font-size: 28rpx;
  1941. color: #fff;
  1942. border-bottom-right-radius: 24rpx;
  1943. }
  1944. .quzw {
  1945. width: 638rpx;
  1946. height: 638rpx;
  1947. position: relative;
  1948. border: 2rpx solid #eee;
  1949. border-radius: 8rpx;
  1950. }
  1951. .handWriting {
  1952. width: 100%;
  1953. height: 100%;
  1954. }
  1955. /deep/ .u-collapse-title {
  1956. color: #ff3b30;
  1957. font-size: 24rpx;
  1958. }
  1959. // /deep/ .u-input {
  1960. // text-align: right !important;
  1961. // }
  1962. .picker {
  1963. flex: 1;
  1964. }
  1965. /deep/ .u-form-item--right {
  1966. .u-input__input {
  1967. text-align: right;
  1968. }
  1969. uni-picker {
  1970. flex: 1;
  1971. }
  1972. }
  1973. .collapse-item {
  1974. color: #666;
  1975. font-size: 24rpx;
  1976. padding-bottom: 30rpx;
  1977. }
  1978. .dis_stys {
  1979. display: flex;
  1980. align-items: center;
  1981. justify-content: space-between;
  1982. }
  1983. .handCenter {
  1984. background: #f7f7f7;
  1985. border: 2rpx solid #eeeeee;
  1986. border-radius: 24rpx;
  1987. width: 100%;
  1988. height: 400rpx;
  1989. overflow: hidden;
  1990. }
  1991. .headerSDels {
  1992. height: 58rpx;
  1993. padding: 0rpx 24rpx;
  1994. font-weight: bold;
  1995. display: flex;
  1996. align-items: center;
  1997. flex-direction: row-reverse;
  1998. }
  1999. .listBox {
  2000. margin: 24rpx 32rpx 0rpx;
  2001. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  2002. border-radius: 32rpx;
  2003. background-color: #fff;
  2004. overflow: hidden;
  2005. }
  2006. .imgBoxs {
  2007. width: 156rpx;
  2008. height: 203rpx;
  2009. }
  2010. .imgBoxs2 {
  2011. width: 171rpx;
  2012. height: 108rpx;
  2013. }
  2014. .submit_btn {
  2015. width: 526rpx;
  2016. height: 80rpx;
  2017. background: #007aff;
  2018. border-radius: 40rpx;
  2019. text-align: center;
  2020. line-height: 80rpx;
  2021. color: #ffffff;
  2022. margin: 30rpx auto;
  2023. }
  2024. .picker {
  2025. text-align: right;
  2026. }
  2027. input {
  2028. text-align: right;
  2029. }
  2030. .bodyBox {
  2031. background: #ffffff;
  2032. border-radius: 24rpx;
  2033. width: 100%;
  2034. }
  2035. .topBox {
  2036. height: 80rpx;
  2037. background: #ffffff;
  2038. border-radius: 24rpx;
  2039. width: 100%;
  2040. display: flex;
  2041. justify-content: space-between;
  2042. line-height: 80rpx;
  2043. padding: 0 20rpx;
  2044. font-size: 24rpx;
  2045. }
  2046. .modal {
  2047. .agreement {
  2048. width: 640rpx;
  2049. height: 740rpx;
  2050. background: #ffffff;
  2051. display: flex;
  2052. flex-direction: column;
  2053. .body {
  2054. flex: 1;
  2055. .content {
  2056. padding: 30rpx 40rpx 28rpx;
  2057. line-height: 40rpx;
  2058. font-size: 26rpx;
  2059. color: #666;
  2060. .bold {
  2061. color: #333;
  2062. font-size: 26rpx;
  2063. font-weight: bold;
  2064. }
  2065. .center {
  2066. text-align: center;
  2067. }
  2068. }
  2069. }
  2070. .footer {
  2071. height: 140rpx;
  2072. border-top: 1px solid #eeeeee;
  2073. display: flex;
  2074. align-items: center;
  2075. justify-content: center;
  2076. .btn {
  2077. margin: 0 12rpx;
  2078. width: 200rpx;
  2079. height: 80rpx;
  2080. color: #007aff;
  2081. font-size: 30rpx;
  2082. text-align: center;
  2083. line-height: 80rpx;
  2084. background: #f5f5f5;
  2085. border-radius: 40rpx 40rpx 40rpx 40rpx;
  2086. &.ok {
  2087. width: 336rpx;
  2088. height: 80rpx;
  2089. background: #007aff;
  2090. color: #fff;
  2091. }
  2092. &.close {
  2093. color: #fff;
  2094. width: 560rpx;
  2095. height: 80rpx;
  2096. background: #007aff;
  2097. border-radius: 40rpx 40rpx 40rpx 40rpx;
  2098. }
  2099. }
  2100. }
  2101. }
  2102. }
  2103. </style>