input.vue 71 KB

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