input.vue 64 KB

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