index.js 35 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219
  1. const regeneratorRuntime = require("../utils/regenerator-runtime/runtime"),
  2. util = require("../utils/util");
  3. var sysFailInfo = require("../config").sysFailInfo,
  4. BASE_URL = "";
  5. const main = require("../main");
  6. var tokenExceptionArr = [14, 15],
  7. idExceptionArr = [2002, 2003, 2006],
  8. ctx = "";
  9. Page({
  10. data: {
  11. curPage: 1,
  12. cmsConfig: {},
  13. skipConfig: {},
  14. bizData: {},
  15. token: "",
  16. preClickBtnTime: 0,
  17. isNotCamera: !0,
  18. iKnowFuncs: [],
  19. index_rule: !1,
  20. show_about_dlg: !1,
  21. indexChecked: !0,
  22. indexDisableBtn: !1,
  23. show_auth_panel: !1,
  24. authInfo: "",
  25. isInfinityDisplay: !1,
  26. notice: {
  27. titie: "",
  28. content: ""
  29. },
  30. sms: {
  31. isForbiddenSmsBtn: !0,
  32. hintError: "",
  33. isEnableSendSms: !1,
  34. is60sGap: !1,
  35. sendSmsTtitle: "获取验证码",
  36. gapSec: 60,
  37. phoneNum: "",
  38. verifyCode: ""
  39. },
  40. ocr: {
  41. isShowTakePhoto: !1,
  42. isShowResult: !1,
  43. isShowGuide: !0,
  44. isShowPhotoPreView: !1,
  45. isPhotoFromCamera: !1,
  46. isFrontIdCard: !0,
  47. hintError: "",
  48. hintErrorResult: "",
  49. isForbiddenManualBtn: !0,
  50. isForbiddenResultBtn: !1,
  51. idcard: "",
  52. idname: "",
  53. idaddress: "",
  54. tempImagePath: "",
  55. ocrTitle: "请拍摄身份证人像面",
  56. verifycamFullScreen: "verifycamFullScreen",
  57. isToolsShow: !0,
  58. isEditTheOcrIsManualInput: !1,
  59. isInfinityDisplayOcrTitle: "",
  60. isInfinityDisplayOcrBottom: "",
  61. isInfinityDisplayOcrMiddle: "",
  62. frontMediaKey: "",
  63. backendMediaKey: ""
  64. },
  65. livingbody: {
  66. isShowGuide: !0,
  67. isShowCamera: !1,
  68. isShowProcess: !1,
  69. isShowDialog: !1,
  70. livingbodyNumber: "",
  71. isNotPrepareOk: !0,
  72. getCodeErrMsg: "",
  73. livingbodyTitle: "请保持正脸对准框内",
  74. isPrepare: !0,
  75. curNumberStatus: ["verifyCurrentNumber", "", "", ""],
  76. curNumber: ["·", "·", "·", "·"],
  77. isActionSeqNormal: "",
  78. livingbodyActionText: "",
  79. livingbodySilentText: "",
  80. uploadProcess: 0,
  81. showTestVideo: !1,
  82. video_preview: "",
  83. video_src: "",
  84. isInfinityDisplayHTTitle: "",
  85. isInfinityDisplayHTBottom: "",
  86. isInfinityDisplayHTMiddle: "",
  87. isInfinityDisplayHTActionPre: "",
  88. isInfinityDisplayHTNumberPre: "",
  89. isInfinityDisplayHTActionHint: "",
  90. isInfinityDisplayHTNumberHint: ""
  91. },
  92. failPage: {
  93. is_modal_showing: !1
  94. },
  95. successPage: {},
  96. failInfo: {}
  97. },
  98. onLoad: function(i) {
  99. if (console.log(i), this.setData({
  100. cmsConfig: wx.verify_CMSConfig,
  101. token: wx.verify_TOKEN,
  102. bizData: wx.verify_BizData
  103. }), console.log("this.data.cmsConfig =", this.data.cmsConfig), console.log(
  104. `this.data.token = ${this.data.token}`), console.log(
  105. `wx.verifyBaseUrl = ${wx.verifyBaseUrl}`), console.log(this.data.cmsConfig.page.ocr
  106. .backend), BASE_URL = wx.verifyBaseUrl, wx.setNavigationBarTitle({
  107. title: this.data.cmsConfig.justForJumpVer.title,
  108. success: function() {
  109. console.log("setNavigationBarTitle success!")
  110. },
  111. fail: function(i) {
  112. console.log("setNavigationBarTitle failure!"), console.log(i)
  113. }
  114. }), "true" === i.isNotice) return console.log("is notice"), this.setData({
  115. curPage: 7
  116. }), void this.getTheNotice();
  117. console.log("is not notice"), this.data.cmsConfig.isGetUserLocation && this.getUserLocation(), wx
  118. .getSystemInfo({
  119. success: i => {
  120. console.log(i);
  121. var o = i.screenHeight / i.screenWidth >= 2;
  122. i.screenHeight > 700 && o && this.setData({
  123. isInfinityDisplay: !0,
  124. "ocr.isInfinityDisplayOcrBottom": "isInfinityDisplayOcrBottom",
  125. "ocr.isInfinityDisplayOcrMiddle": "isInfinityDisplayOcrMiddle",
  126. "ocr.isInfinityDisplayOcrTitle": "isInfinityDisplayOcrTitle",
  127. "livingbody.isInfinityDisplayHTBottom": "isInfinityDisplayHTBottom",
  128. "livingbody.isInfinityDisplayHTMiddle": "isInfinityDisplayHTMiddle",
  129. "livingbody.isInfinityDisplayHTTitle": "isInfinityDisplayHTTitle",
  130. "livingbody.isInfinityDisplayHTActionPre": "isInfinityDisplayHTActionPre",
  131. "livingbody.isInfinityDisplayHTNumberPre": "isInfinityDisplayHTNumberPre",
  132. "livingbody.isInfinityDisplayHTActionHint": "isInfinityDisplayHTActionHint",
  133. "livingbody.isInfinityDisplayHTNumberHint": "isInfinityDisplayHTNumberHint"
  134. })
  135. }
  136. })
  137. },
  138. getTheNotice() {
  139. var i = {
  140. url: BASE_URL + "notices.php",
  141. data: {
  142. appid: this.data.bizData.appid
  143. }
  144. };
  145. util.request(i, i => {
  146. if (console.log(i), 0 === i.ErrorCode) {
  147. var o = JSON.parse(i.Data);
  148. this.setData({
  149. "notice.content": o[0].content,
  150. "notice.title": o[0].title
  151. })
  152. } else wx.showModal({
  153. title: "提示",
  154. content: "获取公告信息失败," + i.ErrorMsg,
  155. confirmText: "重试",
  156. showCancel: !1,
  157. confirmColor: "#2d72f1",
  158. success: i => {
  159. i.confirm && this.getTheNotice()
  160. }
  161. })
  162. })
  163. },
  164. onReady: function() {},
  165. onShow: function() {
  166. this.data.show_auth_panel && setTimeout(() => {
  167. this.isAuthOk()
  168. }, 500)
  169. },
  170. onHide: function() {},
  171. onUnload: function() {},
  172. onPullDownRefresh: function() {},
  173. onReachBottom: function() {},
  174. onShareAppMessage: function() {},
  175. showErrorToast: function(i) {
  176. if (console.log("showErrorToast", i), 3 === this.data.curPage) {
  177. if (this.data.ocr.isShowResult) return void this.setData({
  178. "ocr.hintErrorResult": i.error_msg
  179. });
  180. this.data.ocr.isShowTakePhoto && 101 !== i.ErrorCode && -107 !== i.ErrorCode && this.data
  181. .iKnowFuncs.push(() => {
  182. this.reTakePhoto()
  183. })
  184. }
  185. this.setData({
  186. showErrorMsg: !0,
  187. err: i
  188. })
  189. },
  190. switchDialog: function() {
  191. if (this.setData({
  192. showErrorMsg: !this.data.showErrorMsg
  193. }), 1 === this.data.iKnowFuncs.length) {
  194. this.data.iKnowFuncs.pop()()
  195. }
  196. },
  197. checkNetWork: function(i) {
  198. var o = this;
  199. wx.getNetworkType({
  200. success: function(e) {
  201. "none" !== e.networkType ? i() : (console.log("Network is none"), o
  202. .showErrorToast({
  203. ErrorCode: 101,
  204. ErrorMsg: "网络异常,请稍后重试"
  205. }))
  206. },
  207. fail: function(i) {
  208. console.log("Get Network exception"), o.showErrorToast({
  209. ErrorCode: 101,
  210. ErrorMsg: "网络异常,请稍后重试"
  211. })
  212. }
  213. })
  214. },
  215. checkRecordNetworkOk: function(i, o) {
  216. wx.getNetworkType({
  217. success: function(e) {
  218. "none" !== e.networkType ? (console.log("network is OK"), i(e.networkType)) : (
  219. console.log("Network is none"), o({
  220. ErrorCode: 101,
  221. ErrorMsg: "网络异常,请稍后再试"
  222. }))
  223. },
  224. fail: function(i) {
  225. console.log("Get Network exception"), o({
  226. ErrorCode: 101,
  227. ErrorMsg: "网络异常,请稍后再试"
  228. })
  229. }
  230. })
  231. },
  232. returnAllCheckNetWork(i) {
  233. wx.getNetworkType({
  234. success: function(o) {
  235. i(o.networkType)
  236. },
  237. fail: function(o) {
  238. i("none")
  239. }
  240. })
  241. },
  242. isNotAllowClick: function() {
  243. var i = +new Date;
  244. return i - this.data.preClickBtnTime < 1e3 ? (console.log("Click button gap < 1s, not allow exec"),
  245. !0) : (this.data.preClickBtnTime = i, console.log("Click button gap > 1s, allow exec"), !1)
  246. },
  247. exitVerify(i) {
  248. i.BizToken = this.data.token, i.ErrorCode = 0, this.data.bizData.endPath ? wx.verifySuccessFunc(i) : wx
  249. .navigateBack({
  250. success: function(o) {
  251. wx.verifySuccessFunc(i)
  252. }
  253. })
  254. },
  255. exitVerifyFail(i) {
  256. i.BizToken = this.data.token, this.data.bizData.endPath ? -999 === i.ErrorCode ? wx.navigateBack({
  257. success: () => {}
  258. }) : (console.log("exitVerifyFail: this.data.bizData.endPath", this.data.bizData.endPath), wx
  259. .verifyFailureFunc(i)) : wx.navigateBack({
  260. success: () => {
  261. -999 !== i.ErrorCode && wx.verifyFailureFunc(i)
  262. }
  263. })
  264. },
  265. switchIndexRule: function() {
  266. this.setData({
  267. index_rule: !this.data.index_rule
  268. })
  269. },
  270. switchAboutDlg: function() {
  271. this.setData({
  272. show_about_dlg: !this.data.show_about_dlg
  273. })
  274. },
  275. checkboxChange(i) {
  276. this.setData({
  277. indexDisableBtn: !this.data.indexDisableBtn
  278. })
  279. },
  280. getUserLocation: function() {
  281. var i = this;
  282. wx.getLocation({
  283. type: "wgs84",
  284. success: function(o) {
  285. console.log("Get the location success!", o);
  286. var e = {
  287. url: BASE_URL + `/api/auth/saveLocation?BizToken=${i.data.token}`,
  288. data: {
  289. Longitude: o.longitude,
  290. Latitude: o.latitude
  291. }
  292. };
  293. util.request(e, function(o) {
  294. if (0 === o.ErrorCode) console.log("Report location success!");
  295. else {
  296. if (console.log(o.ErrorCode), tokenExceptionArr.includes(o
  297. .ErrorCode)) return void i.exitVerifyFail({
  298. ErrorCode: o.ErrorCode,
  299. ErrorMsg: o.ErrorMsg
  300. });
  301. i.showErrorToast(o)
  302. }
  303. })
  304. },
  305. fail: function(i) {
  306. console.log("Get location failure!"), console.log(i)
  307. }
  308. })
  309. },
  310. startNativeVerify: function() {
  311. console.log("直接调用微信原生接口");
  312. let i = this.data.cmsConfig,
  313. o = i.Common.WxVerifyTypeIsVideo,
  314. e = i.Common.WxCheckAliveType;
  315. util.startNativeVerify(o, e, BASE_URL, this.data.token, this.exitVerifyFail, i => {
  316. let o = {
  317. BizToken: this.data.token,
  318. ErrorCode: i.ErrorCode,
  319. ErrorMsg: i.ErrorMsg
  320. };
  321. 0 === i.ErrorCode ? this.exitVerify(o) : this.exitVerifyFail(o)
  322. })
  323. },
  324. indexToNext: async function() {
  325. if (!this.isNotAllowClick()) {
  326. var i = this;
  327. this.checkNetWork(function() {
  328. var o = i.data.cmsConfig;
  329. if (!i.data.cmsConfig.Common.IsWxNative || i.data.cmsConfig.Common.Flow.includes(
  330. "Ocr")) {
  331. var e = 2;
  332. o.isHideSmsPage && (e = o.isHideOcrPage ? 4 : 3), i.setData({
  333. curPage: e
  334. }), (4 === e || 3 === e && !i.data.cmsConfig.page.ocr.isManualInput) && i
  335. .preLivingbodyExec()
  336. } else i.startNativeVerify()
  337. })
  338. }
  339. },
  340. phoneNumChanged(i) {
  341. this.setData({
  342. "sms.hintError": ""
  343. });
  344. var o = i.detail.value;
  345. this.data.sms.phoneNum = o;
  346. var e = util.validate(o, "sms_phone");
  347. console.log(`isPhoneOk: ${e}`), e && !this.data.sms.is60sGap && this.setData({
  348. "sms.isEnableSendSms": !0
  349. }), e || this.setData({
  350. "sms.isEnableSendSms": !1
  351. });
  352. var t = util.validate(this.data.sms.verifyCode, "sms_verifyCode");
  353. e && t ? this.setData({
  354. "sms.isForbiddenSmsBtn": !1
  355. }) : this.setData({
  356. "sms.isForbiddenSmsBtn": !0
  357. }), console.log(`isEnableSendSms: ${this.data.sms.isEnableSendSms}`)
  358. },
  359. sendVerifyCodeReq: function() {
  360. if (!this.isNotAllowClick()) {
  361. var i = this;
  362. this.checkNetWork(function() {
  363. let o = {
  364. url: `${BASE_URL}/api/common/sendSmsCode?BizToken=${i.data.token}`,
  365. data: {
  366. PhoneNum: i.data.sms.phoneNum
  367. }
  368. };
  369. wx.showLoading({
  370. title: "短信发送中...",
  371. mask: !0
  372. }), util.request(o, function(o) {
  373. if (wx.hideLoading(), 0 === o.ErrorCode) {
  374. i.setData({
  375. "sms.is60sGap": !0,
  376. "sms.isEnableSendSms": !1,
  377. "sms.sendSmsTtitle": "重新发送"
  378. });
  379. var e = setInterval(function() {
  380. i.data.sms.gapSec <= 1 && (clearInterval(e), i.setData({
  381. "sms.is60sGap": !1,
  382. "sms.gapSec": 60
  383. }), util.validate(i.data.sms.phoneNum,
  384. "sms_phone") && i.setData({
  385. "sms.isEnableSendSms": !0
  386. })), i.setData({
  387. "sms.gapSec": i.data.sms.gapSec - 1
  388. })
  389. }, 1e3)
  390. } else {
  391. if (tokenExceptionArr.includes(o.ErrorCode)) return void i
  392. .exitVerifyFail(o);
  393. i.setData({
  394. "sms.hintError": o.ErrorMsg
  395. })
  396. }
  397. })
  398. })
  399. }
  400. },
  401. verifyCodeChanged(i) {
  402. this.setData({
  403. "sms.hintError": ""
  404. }), this.data.sms.verifyCode = i.detail.value;
  405. var o = util.validate(this.data.sms.verifyCode, "sms_verifyCode");
  406. util.validate(this.data.sms.phoneNum, "sms_phone") && o ? this.setData({
  407. "sms.isForbiddenSmsBtn": !1
  408. }) : this.setData({
  409. "sms.isForbiddenSmsBtn": !0
  410. })
  411. },
  412. smsToNext() {
  413. if (!this.isNotAllowClick()) {
  414. var i = this;
  415. this.checkNetWork(function() {
  416. console.log(i.data.sms.phoneNum + " | " + i.data.sms.verifyCode);
  417. let o = {
  418. url: `${BASE_URL}/api/common/verifySmsCode?BizToken=${i.data.token}`,
  419. data: {
  420. PhoneNum: i.data.sms.phoneNum,
  421. VerifyCode: i.data.sms.verifyCode
  422. }
  423. };
  424. wx.showLoading({
  425. title: "加载中...",
  426. mask: !0
  427. }), util.request(o, function(o) {
  428. if (wx.hideLoading(), 0 === o.ErrorCode) {
  429. var e = i.data.cmsConfig;
  430. if (e.isJustSms) i.exitVerify({});
  431. else {
  432. var t = 3;
  433. e.isHideOcrPage && (t = 4), i.setData({
  434. curPage: t
  435. }), (4 === t || 3 === t && !i.data.cmsConfig.page.ocr
  436. .isManualInput) && i.preLivingbodyExec()
  437. }
  438. } else {
  439. if (tokenExceptionArr.includes(o.ErrorCode)) return void i
  440. .exitVerifyFail(o);
  441. i.setData({
  442. "sms.hintError": o.ErrorMsg
  443. })
  444. }
  445. })
  446. })
  447. }
  448. },
  449. idcartManualInputChanged(i) {
  450. var o = i.detail.value;
  451. this.data.ocr.idcard = o, this.manualInputChanged()
  452. },
  453. idnameManualInputChanged(i) {
  454. var o = i.detail.value;
  455. this.data.ocr.idname = o, this.manualInputChanged()
  456. },
  457. manualInputChanged(i) {
  458. this.setData({
  459. "ocr.hintError": ""
  460. });
  461. var o = util.validate(this.data.ocr.idcard, "idcard"),
  462. e = util.validate(this.data.ocr.idname, "idname"),
  463. t = !0;
  464. o || 18 !== this.data.ocr.idcard.length ? o && (e && (t = !1), this.setData({
  465. "ocr.isForbiddenManualBtn": t
  466. })) : this.setData({
  467. "ocr.hintError": "身份证号有误,请确认后重新输入"
  468. })
  469. },
  470. manualInputGoNext() {
  471. this.ocrCommonInputGoNext(!0)
  472. },
  473. ocrCommonInputGoNext(i) {
  474. var o = this;
  475. this.checkNetWork(function() {
  476. o.data.cmsConfig;
  477. wx.showLoading({
  478. title: "校验身份信息中...",
  479. mask: !0
  480. });
  481. let e = 0;
  482. "android" === wx.verifySysInfo.platform && (e = 300), setTimeout(() => {
  483. var e = {
  484. url: `${BASE_URL}/api/ocr/updateidinfo?BizToken=${o.data.token}`,
  485. data: {
  486. Name: o.data.ocr.idname,
  487. IdCard: o.data.ocr.idcard
  488. }
  489. };
  490. o.data.ocr.idaddress && (e.data.Address = o.data.ocr.idaddress), util.request(e,
  491. function(e) {
  492. if (wx.hideLoading(), 0 !== e.ErrorCode) {
  493. if (tokenExceptionArr.includes(e.ErrorCode)) return void o
  494. .exitVerifyFail(e);
  495. let t = {
  496. "ocr.hintError": e.ErrorMsg
  497. };
  498. return i || (t = {
  499. "ocr.hintErrorResult": e.ErrorMsg
  500. }), void o.setData(t)
  501. }
  502. o.ocrGoNext(i)
  503. })
  504. }, e)
  505. })
  506. },
  507. ocrGoNext(i) {
  508. var o = this;
  509. if (o.data.cmsConfig.page.ocr.isCheckIDInfo) {
  510. let e = {
  511. url: `${BASE_URL}/api/ocr/checkidinfo?BizToken=${this.data.token}`,
  512. data: {
  513. Name: this.data.ocr.idname,
  514. IdCard: this.data.ocr.idcard
  515. }
  516. };
  517. util.request(e, e => {
  518. if (0 !== e.ErrorCode) {
  519. if (tokenExceptionArr.includes(e.ErrorCode)) return void o.exitVerifyFail(e);
  520. let t = {
  521. "ocr.hintError": e.ErrorMsg
  522. };
  523. return console.log(e.ErrorMsg), i || (t = {
  524. "ocr.hintErrorResult": e.ErrorMsg
  525. }), void o.setData(t)
  526. }
  527. this.ocrGoNextEnd()
  528. })
  529. } else this.ocrGoNextEnd()
  530. },
  531. ocrGoNextEnd() {
  532. if (this.data.cmsConfig.isJustOcr) this.exitVerify({
  533. id_name: this.data.ocr.idname,
  534. id_number: this.data.ocr.idcard,
  535. id_address: this.data.ocr.idaddress
  536. });
  537. else {
  538. if (this.data.cmsConfig.Common.IsWxNative) return void this.startNativeVerify();
  539. this.setData({
  540. curPage: 4
  541. }), this.preLivingbodyExec()
  542. }
  543. },
  544. manualInputTakePhone() {
  545. this.setData({
  546. "cmsConfig.page.ocr.isManualInput": !1,
  547. "ocr.isEditTheOcrIsManualInput": !0
  548. })
  549. },
  550. btnclick: function() {
  551. var i = this.data.cmsConfig.page.ocr.backend;
  552. console.log(i)
  553. },
  554. ocrStartTakePhoto() {
  555. var i = this;
  556. this.checkNetWork(function() {
  557. i.setData({
  558. "ocr.isShowTakePhoto": !0,
  559. isNotCamera: !1
  560. })
  561. })
  562. },
  563. takePhotoWithCamera() {
  564. var i = this;
  565. wx.createCameraContext().takePhoto({
  566. quality: "noraml",
  567. success: o => {
  568. console.log(o.tempImagePath), this.setData({
  569. "ocr.tempImagePath": o.tempImagePath,
  570. "ocr.isShowPhotoPreView": !0,
  571. "ocr.ocrTitle": "照片预览",
  572. "ocr.isPhotoFromCamera": !0
  573. }), console.log(i.data.ocr.tempImagePath)
  574. },
  575. fail: i => {
  576. wx.showToast({
  577. title: "takePhoto function exception",
  578. icon: "none"
  579. })
  580. }
  581. })
  582. },
  583. chooseImg() {
  584. var i = this;
  585. wx.chooseImage({
  586. count: 1,
  587. sizeType: ["compressed"],
  588. sourceType: ["album"],
  589. success: function(o) {
  590. var e = o.tempFilePaths;
  591. i.setData({
  592. "ocr.tempImagePath": e[0],
  593. "ocr.isShowPhotoPreView": !0,
  594. "ocr.ocrTitle": "照片预览",
  595. "ocr.isPhotoFromCamera": !1
  596. }), i.setData({
  597. "ocr.isToolsShow": !1
  598. }), i.setData({
  599. "ocr.isToolsShow": !0
  600. })
  601. }
  602. })
  603. },
  604. reTakePhoto() {
  605. let i = this.data.ocr.isFrontIdCard ? "请拍摄身份证人像面" : "请拍摄身份证国徽面";
  606. this.setData({
  607. "ocr.tempImagePath": "",
  608. "ocr.isShowPhotoPreView": !1,
  609. "ocr.ocrTitle": i
  610. })
  611. },
  612. startUploadAndOcr() {
  613. var i = this;
  614. this.checkNetWork(() => {
  615. wx.showLoading({
  616. title: "系统识别中",
  617. mask: !0
  618. });
  619. let o = {
  620. file: i.data.ocr.tempImagePath
  621. };
  622. console.log("upfile data", o), wx.uploadFile({
  623. url: `${BASE_URL}/api/common/upLoadWxAppFile?BizToken=${i.data.token}`,
  624. filePath: this.data.ocr.tempImagePath,
  625. name: "file",
  626. formData: o,
  627. success: o => {
  628. if (console.log("uploadFile | ", o), 200 === o.statusCode) {
  629. let e = JSON.parse(o.data);
  630. if (0 === e.ErrorCode) {
  631. let o = {
  632. url: `${BASE_URL}/api/ocr/ocrinfo?BizToken=${this.data.token}`,
  633. data: {
  634. MediaKey: e.Data.MediaKey,
  635. PicType: this.data.ocr.isFrontIdCard ? 0 : 1
  636. }
  637. };
  638. console.log("ocrinfo data", o), util.request(o, o => {
  639. if (wx.hideLoading(), 0 === o.ErrorCode) {
  640. if (this.data.ocr.isFrontIdCard && this
  641. .setData({
  642. "ocr.idcard": o.Data.id,
  643. "ocr.idname": o.Data.name,
  644. "ocr.idaddress": o.Data.address
  645. }), this.data.ocr.isFrontIdCard && this.data
  646. .cmsConfig.page.ocr.backend)
  647. return void this.setData({
  648. "ocr.tempImagePath": "",
  649. "ocr.isShowPhotoPreView": !1,
  650. "ocr.ocrTitle": "请拍摄身份证国徽面",
  651. "ocr.isFrontIdCard": !1
  652. });
  653. this.setData({
  654. "ocr.isShowResult": !0,
  655. isNotCamera: !0,
  656. "ocr.verifycamFullScreen": "verifycamFullScreen"
  657. })
  658. } else {
  659. if (tokenExceptionArr.includes(o.ErrorCode))
  660. return void i.exitVerifyFail(o);
  661. this.showErrorToast(o)
  662. }
  663. })
  664. } else wx.hideLoading(), this.showErrorToast({
  665. ErrorCode: 101,
  666. ErrorMsg: e.ErrorMsg
  667. })
  668. } else wx.hideLoading(), this.showErrorToast({
  669. ErrorCode: 101,
  670. ErrorMsg: "上传图片失败"
  671. })
  672. },
  673. fail: i => {
  674. console.log("upload img fail", i), wx.hideLoading(), this
  675. .showErrorToast({
  676. ErrorCode: 101,
  677. ErrorMsg: "上传图片失败"
  678. })
  679. }
  680. })
  681. })
  682. },
  683. idnameInputChanged(i) {
  684. this.data.ocr.idname = i.detail.value, this.ocrCommonInputCheck()
  685. },
  686. idcartInputChanged(i) {
  687. this.data.ocr.idcard = i.detail.value, this.ocrCommonInputCheck()
  688. },
  689. idaddressInputChanged(i) {
  690. this.data.ocr.idaddress = i.detail.value, this.ocrCommonInputCheck()
  691. },
  692. ocrCommonInputCheck() {
  693. this.setData({
  694. "ocr.hintErrorResult": ""
  695. });
  696. var i = util.validate(this.data.ocr.idcard, "idcard"),
  697. o = util.validate(this.data.ocr.idname, "idname"),
  698. e = util.validate(this.data.ocr.idaddress, "idaddress"),
  699. t = !0;
  700. i && o && (t = !1), this.data.cmsConfig.page.ocr.isAddress && !e && (t = !0), this.setData({
  701. "ocr.isForbiddenResultBtn": t
  702. })
  703. },
  704. ocrInputGoNext(i) {
  705. if (util.validate(this.data.ocr.idcard, "idcard"))
  706. if (util.validate(this.data.ocr.idname, "idname")) {
  707. if (this.data.cmsConfig.page.ocr.isAddress)
  708. if (!util.validate(this.data.ocr.idaddress, "idaddress")) return void this.setData({
  709. "ocr.hintErrorResult": "住址格式错误"
  710. });
  711. console.log("go next"), this.ocrCommonInputGoNext(!1)
  712. } else this.setData({
  713. "ocr.hintErrorResult": "姓名格式错误"
  714. });
  715. else this.setData({
  716. "ocr.hintErrorResult": "身份证号格式错误"
  717. })
  718. },
  719. switchLivingbodyDialog(i) {
  720. this.setData({
  721. "livingbody.isShowDialog": !this.data.livingbody.isShowDialog
  722. })
  723. },
  724. preLivingbodyExec() {
  725. var i = this;
  726. if (4 !== this.data.curPage || 0 !== this.data.cmsConfig.livingbodyType && 1 !== this.data.cmsConfig
  727. .livingbodyType) i.getAuth();
  728. else {
  729. let o = {
  730. url: `${BASE_URL}/api/liveness/lipcode?BizToken=${i.data.token}`,
  731. data: {}
  732. };
  733. 1 === i.data.cmsConfig.livingbodyType && (o.url =
  734. `${BASE_URL}/api/liveness/actioncode?BizToken=${i.data.token}`), util.request(o, o => {
  735. if (0 === o.ErrorCode) {
  736. console.log("Got the LipCode:" + o.Data.LipCode), console.log(
  737. "Got the ActionCode:" + o.Data.ActionCode);
  738. var e = {
  739. "livingbody.livingbodyNumber": o.Data.LipCode
  740. };
  741. 1 === i.data.cmsConfig.livingbodyType && (e = {
  742. "livingbody.isActionSeqNormal": "21" === o.Data.ActionCode.join("")
  743. }), this.setData(e), i.getAuth()
  744. } else {
  745. if (tokenExceptionArr.includes(o.ErrorCode)) return void i.exitVerifyFail(o);
  746. this.setData({
  747. "livingbody.getCodeErrMsg": o.ErrorMsg
  748. }), i.getAuth()
  749. }
  750. })
  751. }
  752. },
  753. getAuth: function() {
  754. let i = this;
  755. wx.authorize({
  756. scope: "scope.camera",
  757. success() {},
  758. fail: function() {
  759. console.log("您未允许使用摄像头权限")
  760. },
  761. complete: function() {
  762. 4 === i.data.curPage ? wx.authorize({
  763. scope: "scope.record",
  764. success() {},
  765. fail: function() {
  766. console.log("您未允许使用录音权限")
  767. },
  768. complete: function() {
  769. console.log("开始判断是否有权限"), i.isAuthOk()
  770. }
  771. }) : i.isAuthOk()
  772. }
  773. })
  774. },
  775. isAuthOk: function() {
  776. var i = this;
  777. wx.getSetting({
  778. success(o) {
  779. console.log("获取授权信息成功");
  780. var e = o.authSetting["scope.record"],
  781. t = o.authSetting["scope.camera"];
  782. if (4 === i.data.curPage)
  783. if (e && t) i.setData({
  784. show_auth_panel: !1,
  785. authInfo: "摄像头、录音功能都已授权"
  786. }), i.authOkToDo(), console.log("摄像头、录音功能都已授权");
  787. else {
  788. var a = "";
  789. t || (a = "摄像头 "), e || (a += "录音功能"), a += "还未授权", console.log(a), i
  790. .setData({
  791. show_auth_panel: !0,
  792. authInfo: a
  793. })
  794. }
  795. else t ? i.setData({
  796. show_auth_panel: !1,
  797. authInfo: "摄像头已授权"
  798. }) : i.setData({
  799. show_auth_panel: !0,
  800. authInfo: "摄像头未授权"
  801. })
  802. },
  803. fail: function(i) {
  804. console.log("获取收取信息失败", i)
  805. }
  806. })
  807. },
  808. authOkToDo() {
  809. console.log(this.data.livingbody.livingbodyNumber, this.data.cmsConfig.livingbodyType), 0 === this.data
  810. .cmsConfig.livingbodyType && "" === this.data.livingbody.livingbodyNumber || 1 === this.data
  811. .cmsConfig.livingbodyType && "" === this.data.livingbody.isActionSeqNormal ? this
  812. .theLivingBodyNumberMustBeOk() : (this.livingbodyAutoShowDialog(), this.setData({
  813. "livingbody.isNotPrepareOk": !1
  814. }))
  815. },
  816. theLivingBodyNumberMustBeOk() {
  817. var i = this;
  818. wx.showModal({
  819. title: "提示",
  820. content: "获取code失败," + i.data.livingbody.getCodeErrMsg,
  821. showCancel: !1,
  822. confirmText: "重新获取",
  823. confirmColor: "#2d72f1",
  824. success: function(o) {
  825. if (o.confirm) {
  826. console.log("开始重新获取"), wx.showLoading({
  827. title: "重新获取中...",
  828. mask: !0
  829. });
  830. let o = {
  831. url: `${BASE_URL}/api/liveness/lipcode?BizToken=${i.data.token}`,
  832. data: {}
  833. };
  834. 1 === i.data.cmsConfig.livingbodyType && (o.url =
  835. `${BASE_URL}/api/liveness/actioncode?BizToken=${i.data.token}`), util
  836. .request(o, o => {
  837. if (wx.hideLoading(), 0 === o.ErrorCode) console.log(
  838. "Got the LipCode:" + o.Data.LipCode), console.log(
  839. "Got the ActionCode:" + o.Data.ActionCode), i
  840. .livingbodyAutoShowDialog(), 1 === i.data.cmsConfig
  841. .livingbodyType ? i.setData({
  842. "livingbody.isActionSeqNormal": "21" === o.Data
  843. .ActionCode.join(""),
  844. "livingbody.isNotPrepareOk": !1
  845. }) : i.setData({
  846. "livingbody.livingbodyNumber": o.Data.LipCode,
  847. "livingbody.isNotPrepareOk": !1
  848. });
  849. else {
  850. if (tokenExceptionArr.includes(o.ErrorCode)) return void i
  851. .exitVerifyFail(o);
  852. i.setData({
  853. "livingbody.getCodeErrMsg": o.ErrorMsg
  854. }), i.theLivingBodyNumberMustBeOk()
  855. }
  856. })
  857. }
  858. }
  859. })
  860. },
  861. livingbodyAutoShowDialog() {
  862. let i = wx.getStorageSync("isAlreadyShowVideoRule");
  863. console.log("isAlreadyShowVideoRule:" + i), i || (this.setData({
  864. "livingbody.isShowDialog": !this.data.livingbody.isShowDialog
  865. }), wx.setStorage({
  866. key: "isAlreadyShowVideoRule",
  867. data: "true"
  868. }))
  869. },
  870. livingbodyStartToRecord() {
  871. this.checkNetWork(() => {
  872. console.log("go"), this.setData({
  873. "livingbody.isShowCamera": !0,
  874. isNotCamera: !1
  875. }), setTimeout(() => {
  876. this.checkRecordNetworkOk(() => {
  877. ctx = wx.createCameraContext(), console.log("start startRecord", +
  878. new Date), ctx.startRecord({
  879. success: i => {
  880. console.log("startRecord success", +new Date);
  881. let o = this.data.cmsConfig.livingbodyType,
  882. e = {
  883. "livingbody.isPrepare": !1
  884. },
  885. t = 0,
  886. a = 1200,
  887. s = 1e3,
  888. r = this.data.livingbody.livingbodyNumber +
  889. "",
  890. n = ["", "", "", ""],
  891. d = ["·", "·", "·", "·"],
  892. l = this.data.cmsConfig.page.livingbody
  893. .silentRecordTime - 1;
  894. if (0 === o) d[t] = r[t], n[t] =
  895. "verifyCurrentNumber", e[
  896. "livingbody.livingbodyTitle"] =
  897. "请大声朗读以下数字", e[
  898. "livingbody.curNumberStatus"] = n, e[
  899. "livingbody.curNumber"] = d, s = 1500;
  900. else if (1 === o) {
  901. let i = this.data.livingbody
  902. .isActionSeqNormal;
  903. e["livingbody.livingbodyTitle"] = "请做以下动作",
  904. e["livingbody.livingbodyActionText"] =
  905. i ? "眨眨眼" : "张张嘴", a = 2e3
  906. } else e["livingbody.livingbodySilentText"] = l,
  907. a = 1e3;
  908. this.setData(e);
  909. let c = setInterval(() => {
  910. if (0 === o) {
  911. if (3 === t)
  912. return clearInterval(c),
  913. void this
  914. .stopRecordAndProcess(s);
  915. d[++t] = r[t], n[t] =
  916. "verifyCurrentNumber", this
  917. .setData({
  918. "livingbody.curNumberStatus": n,
  919. "livingbody.curNumber": d
  920. })
  921. } else if (1 === o) {
  922. if (1 === t)
  923. return clearInterval(c),
  924. void this
  925. .stopRecordAndProcess(s);
  926. t++, this.setData({
  927. "livingbody.livingbodyActionText": this
  928. .data.livingbody
  929. .isActionSeqNormal ?
  930. "张张嘴" : "眨眨眼"
  931. })
  932. } else {
  933. if (0 === l)
  934. return clearInterval(c),
  935. void this
  936. .stopRecordAndProcess(s);
  937. l--, this.setData({
  938. "livingbody.livingbodySilentText": l
  939. })
  940. }
  941. }, a)
  942. },
  943. fail: i => {
  944. this.setData({
  945. "livingbody.isShowGuide": !0,
  946. "livingbody.isShowCamera": !1,
  947. isNotCamera: !0,
  948. "livingbody.isPrepare": !0
  949. }), console.log("start record fail", +
  950. new Date, i), this.showErrorToast({
  951. ErrorCode: -108,
  952. ErrorMsg: `网络异常,${i.errMsg}`
  953. })
  954. },
  955. timeoutCallback: i => {
  956. console.log("timeoutCallback", i), this
  957. .setData({
  958. "livingbody.isShowGuide": !0,
  959. "livingbody.isShowCamera": !1,
  960. isNotCamera: !0,
  961. "livingbody.isPrepare": !0
  962. }), this.showErrorToast({
  963. ErrorCode: -108,
  964. ErrorMsg: "startRecord timeoutCallback, 请重试!"
  965. })
  966. }
  967. })
  968. }, i => {
  969. this.setData({
  970. "livingbody.isShowGuide": !0,
  971. "livingbody.isShowCamera": !1,
  972. isNotCamera: !0
  973. }), this.showErrorToast(i)
  974. })
  975. }, 2e3)
  976. })
  977. },
  978. stopRecordAndProcess(i) {
  979. console.log("start stopRecord", +new Date), setTimeout(() => {
  980. console.log("stopTimeGap" + i), console.log(ctx.stopRecord), ctx.stopRecord({
  981. success: i => {
  982. console.log("stopRecord success", +new Date, i), wx.getFileInfo({
  983. filePath: i.tempVideoPath,
  984. success: o => {
  985. var e = Math.round(o.size / 1024);
  986. e > 30720 ? (this.setData({
  987. "livingbody.isShowGuide": !0,
  988. "livingbody.isShowCamera": !1,
  989. isNotCamera: !0,
  990. "livingbody.isPrepare": !0
  991. }), this.showErrorToast({
  992. ErrorCode: -108,
  993. ErrorMsg: "视频大小超过限制"
  994. })) : this.processTheVideo(i.tempVideoPath, e +
  995. "K")
  996. },
  997. fail: i => {
  998. this.setData({
  999. "livingbody.isShowGuide": !0,
  1000. "livingbody.isShowCamera": !1,
  1001. isNotCamera: !0,
  1002. "livingbody.isPrepare": !0
  1003. }), this.showErrorToast({
  1004. ErrorCode: -108,
  1005. ErrorMsg: `getFileInfo异常,${i.errMsg}`
  1006. })
  1007. }
  1008. })
  1009. },
  1010. fail: i => {
  1011. this.setData({
  1012. "livingbody.isShowGuide": !0,
  1013. "livingbody.isShowCamera": !1,
  1014. isNotCamera: !0,
  1015. "livingbody.isPrepare": !0
  1016. }), this.showErrorToast({
  1017. ErrorCode: -108,
  1018. ErrorMsg: `stopRecord异常,${i.errMsg}`
  1019. })
  1020. },
  1021. complete(i) {
  1022. console.log("complete", i)
  1023. }
  1024. })
  1025. }, i)
  1026. },
  1027. processTheVideo(i, o) {
  1028. this.checkRecordNetworkOk(e => {
  1029. this.goToProcessPage(i, o)
  1030. }, e => {
  1031. this.setData({
  1032. "livingbody.isShowGuide": !0,
  1033. "livingbody.isShowCamera": !1,
  1034. isNotCamera: !0,
  1035. "livingbody.isPrepare": !0
  1036. }), wx.showModal({
  1037. title: "提示",
  1038. content: "网络异常,请检查网络后重试",
  1039. confirmText: "重试",
  1040. confirmColor: "#2d72f1",
  1041. success: e => {
  1042. e.confirm && this.processTheVideo(i, o)
  1043. }
  1044. })
  1045. })
  1046. },
  1047. goToProcessPage(i, o) {
  1048. this.setData({
  1049. "livingbody.isShowGuide": !1,
  1050. "livingbody.isShowCamera": !1,
  1051. "livingbody.isShowProcess": !0,
  1052. isNotCamera: !0,
  1053. "livingbody.isPrepare": !0
  1054. });
  1055. let e = {
  1056. url: `${BASE_URL}/api/common/upLoadWxAppFile?BizToken=${this.data.token}`,
  1057. filePath: i,
  1058. data: {
  1059. file: i
  1060. }
  1061. };
  1062. this.uploadTheVideo(e, o)
  1063. },
  1064. uploadTheVideo(i, o) {
  1065. this.returnAllCheckNetWork(e => {
  1066. "wifi" !== e && "none" !== e ? wx.showModal({
  1067. title: "提示",
  1068. content: `视频大约${o},在移动网络环境下上传会产生手机流量,确认继续?`,
  1069. confirmText: "继续",
  1070. confirmColor: "#2d72f1",
  1071. success: e => {
  1072. e.confirm ? this.uploadTheVideoMain(i, o) : this.setData({
  1073. "livingbody.isShowGuide": !0,
  1074. "livingbody.isShowCamera": !1,
  1075. "livingbody.isShowProcess": !1,
  1076. isNotCamera: !0,
  1077. "livingbody.isPrepare": !0
  1078. })
  1079. }
  1080. }) : this.uploadTheVideoMain(i, o)
  1081. })
  1082. },
  1083. uploadTheVideoMain(i, o) {
  1084. util.uploadFile.call(this, i, e => {
  1085. if (console.log("上传视频成功"), console.log(e), 0 === e.ErrorCode) console.log("uploadSuccess"),
  1086. console.log(e.Data.Data.MediaKey), this.livingbodyVerify(e.Data.Data.MediaKey);
  1087. else {
  1088. var t = "网络异常,上传视频失败";
  1089. 101 !== e.ErrorCode && (t = e.ErrorMsg), wx.showModal({
  1090. title: "提示",
  1091. content: t,
  1092. showCancel: !1,
  1093. confirmText: "重试",
  1094. confirmColor: "#2d72f1",
  1095. success: e => {
  1096. e.confirm && this.uploadTheVideo(i, o)
  1097. }
  1098. })
  1099. }
  1100. })
  1101. },
  1102. livingbodyVerify(i) {
  1103. let o = this.data.cmsConfig.livingbodyType,
  1104. e = "/api/liveness/lipliveness";
  1105. 1 === o ? e = "/api/liveness/actionliveness" : 2 === o && (e = "/api/liveness/silentliveness");
  1106. let t = {
  1107. url: `${BASE_URL}${e}?BizToken=${this.data.token}`,
  1108. data: {
  1109. MediaKey: i
  1110. }
  1111. };
  1112. console.log(t), util.request(t, o => {
  1113. if (console.log(o), 0 === o.ErrorCode) this.data.cmsConfig.page.success.isAutoSkip ? this
  1114. .exitVerify({}) : this.setData({
  1115. curPage: 6
  1116. });
  1117. else if (-107 === o.ErrorCode || 101 === o.ErrorCode) wx.showModal({
  1118. title: "提示",
  1119. content: o.error_msg,
  1120. showCancel: !1,
  1121. confirmText: "重试",
  1122. confirmColor: "#2d72f1",
  1123. success: o => {
  1124. o.confirm && this.livingbodyVerify(i)
  1125. }
  1126. });
  1127. else if (tokenExceptionArr.includes(o.ErrorCode)) this.exitVerifyFail(o);
  1128. else {
  1129. void 0 === o.ErrorCode && (o.ErrorCode = "9999", sysFailInfo[9999].tips1 = o.Data);
  1130. var e = o.ErrorCode + "",
  1131. t = {};
  1132. (t = this.data.cmsConfig.failInfo && this.data.cmsConfig.failInfo[e] ? this.data
  1133. .cmsConfig.failInfo[e] : sysFailInfo[e] ? sysFailInfo[e] : {
  1134. img: "",
  1135. msg: o.ErrorMsg,
  1136. error_code: o.ErrorCode
  1137. }).Data = o.Data || {}, console.log("failInfo: ", t), this.setData({
  1138. failInfo: t,
  1139. curPage: 5
  1140. })
  1141. }
  1142. })
  1143. },
  1144. failReVerify() {
  1145. if (console.log(this.data.failInfo), "无效请求" !== this.data.failInfo.msg && 14 !== this.data.failInfo
  1146. .error_code) {
  1147. var i = 4;
  1148. if (idExceptionArr.includes(this.data.failInfo.error_code)) {
  1149. if (this.data.cmsConfig.isHideOcrPage) return void this.exitVerifyFail({
  1150. Token: this.data.token,
  1151. ErrorCode: this.data.failInfo.error_code,
  1152. ErrorMsg: this.data.failInfo.msg
  1153. });
  1154. i = 3, this.setData({
  1155. "ocr.isShowTakePhoto": !1,
  1156. "ocr.isShowResult": !1,
  1157. "ocr.isShowGuide": !0,
  1158. "ocr.isShowPhotoPreView": !1,
  1159. "ocr.isPhotoFromCamera": !1,
  1160. "ocr.isFrontIdCard": !0,
  1161. "ocr.hintError": "",
  1162. "ocr.hintErrorResult": "",
  1163. "ocr.isForbiddenManualBtn": !0,
  1164. "ocr.isForbiddenResultBtn": !1,
  1165. "ocr.idcard": "",
  1166. "ocr.idname": "",
  1167. "ocr.idaddress": "",
  1168. "ocr.tempImagePath": "",
  1169. "ocr.ocrTitle": "请拍摄身份证人像面",
  1170. "ocr.isToolsShow": !0
  1171. }), this.data.ocr.isEditTheOcrIsManualInput && this.setData({
  1172. "cmsConfig.page.ocr.isManualInput": !0
  1173. })
  1174. }
  1175. this.setData({
  1176. curPage: i,
  1177. "livingbody.isShowGuide": !0,
  1178. "livingbody.isShowCamera": !1,
  1179. "livingbody.isShowProcess": !1,
  1180. "livingbody.isShowDialog": !1,
  1181. "livingbody.livingbodyNumber": "",
  1182. "livingbody.isNotPrepareOk": !0,
  1183. "livingbody.getCodeErrMsg": "",
  1184. "livingbody.livingbodyTitle": "请保持正脸对准框内",
  1185. "livingbody.isPrepare": !0,
  1186. "livingbody.curNumberStatus": ["verifyCurrentNumber", "", "", ""],
  1187. "livingbody.curNumber": ["·", "·", "·", "·"],
  1188. "livingbody.isActionSeqNormal": !0,
  1189. "livingbody.livingbodyActionText": "",
  1190. "livingbody.livingbodySilentText": "",
  1191. "livingbody.uploadProcess": 0
  1192. }), this.preLivingbodyExec()
  1193. } else {
  1194. this.exitVerifyFail({
  1195. ErrorCode: 14,
  1196. ErrorMsg: "由于活体验证时出现网络异常,导致无效请求,需要您重新验证,验证时请保持网络畅通!"
  1197. })
  1198. }
  1199. },
  1200. successGoToNext() {
  1201. this.exitVerify({})
  1202. },
  1203. verifyBackToIndex() {
  1204. var i = {};
  1205. i.Token = this.data.token, i.ErrorCode = -999, i.ErrorMsg = "返回首页成功,如多次验证不通过,可将当前页面截图提供给相关工作人员排查问题 " +
  1206. this.data.bizData.appid + " | " + i.token, this.exitVerifyFail(i)
  1207. },
  1208. switchfailModal() {
  1209. this.setData({
  1210. "failInfo.is_modal_showing": !this.data.failInfo.is_modal_showing
  1211. })
  1212. },
  1213. ocrCameraError: function(i) {
  1214. console.log("ocrCameraError", i)
  1215. },
  1216. bindstop: function(i) {
  1217. console.log(i)
  1218. }
  1219. });