input.vue 71 KB

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