faceCheck.js 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. // pages/make_appointment/faceCheck/faceCheck.js
  2. // const {
  3. // BaiDuFaceComparison,
  4. // } = require("../../utils/api/make_appointment")
  5. const upload_image = require("../../utils/upload/upload_image")
  6. const app = getApp()
  7. const {
  8. doConfirmFaceNotifyNew,
  9. } = require('../../utils/api/api');
  10. import {getWxCode} from '../../utils/util'
  11. Page({
  12. /**
  13. * 页面的初始数据
  14. */
  15. data: {
  16. cardAvatarUrl: null,
  17. form: {},
  18. // (过审专用,禁止删除)- start
  19. fake: null
  20. // (过审专用,禁止删除)- start
  21. },
  22. getPhotoPath(e) {
  23. upload_image({
  24. url: e.detail
  25. }).then((img) => {
  26. if (img.url) {
  27. this.doConfirmFaceNotifyNew(img.url)
  28. }
  29. })
  30. },
  31. // 获取用户信息
  32. doConfirmFaceNotifyNew(img) {
  33. let data = {
  34. avatar: img,
  35. idNumber: this.data.form.inputIdcard,
  36. cardIdEx: this.data.form.cardIdEx,
  37. username: this.data.form.inputName,
  38. phone: this.data.form.phoneNumber,
  39. type:1,
  40. code:wx.getStorageSync('wxCode')
  41. }
  42. doConfirmFaceNotifyNew(data).then(res => {
  43. if (res.code == 200) {
  44. res.data.org = this.data.form.org
  45. res.data.orgId = this.data.form.orgId
  46. res.data.cardIdEx = this.data.form.cardIdEx
  47. wx.setStorageSync('userInfo', res.data);
  48. getWxCode()
  49. this.changePage()
  50. } else {
  51. wx.showToast({
  52. title: res.mag,
  53. icon: 'none',
  54. })
  55. }
  56. })
  57. },
  58. //跳转页面 (是否缓存进入)
  59. changePage() {
  60. let {
  61. form
  62. } = this.data
  63. if (form.isShowApplet != 'false') {
  64. wx.navigateTo({
  65. url: '/pages/wx_airport/rlxf_userMsg/index?orgId=' + form.orgId + '&&org=' + form.org + '&showModal=' + true
  66. })
  67. } else {
  68. wx.reLaunch({
  69. url: '/pages/wx_airport/rlxf_pass/rlxf_pass?orgId=' + this.data.form.orgId + '&org=' + this.data.form.org + '&showModal=' + true,
  70. })
  71. }
  72. },
  73. /**
  74. * 生命周期函数--监听页面加载
  75. */
  76. onLoad: function (options) {
  77. // console.log(options);
  78. if (options) {
  79. this.setData({
  80. form: options
  81. })
  82. }
  83. // this.doConfirmFaceNotifyNew('https://tx.hz-hanghui.com:8088/yx-fyzd/file/upload/imagesnew/20230413/16813663859864213.jpg')
  84. // (过审专用,禁止删除)- start
  85. if (this.data.form.inputIdcard == "330821199603150212" || this.data.form.inputIdcard == null) {
  86. app.data.fake = true
  87. } else {
  88. app.data.fake = false
  89. }
  90. this.setData({
  91. fake: app.data.fake
  92. })
  93. // (过审专用,禁止删除)- end
  94. },
  95. /**
  96. * 生命周期函数--监听页面初次渲染完成
  97. */
  98. onReady: function () {
  99. },
  100. /**
  101. * 生命周期函数--监听页面显示
  102. */
  103. onShow: function () {
  104. },
  105. /**
  106. * 生命周期函数--监听页面隐藏
  107. */
  108. onHide: function () {
  109. },
  110. /**
  111. * 生命周期函数--监听页面卸载
  112. */
  113. onUnload: function () {
  114. },
  115. /**
  116. * 页面相关事件处理函数--监听用户下拉动作
  117. */
  118. onPullDownRefresh: function () {
  119. },
  120. /**
  121. * 页面上拉触底事件的处理函数
  122. */
  123. onReachBottom: function () {
  124. },
  125. /**
  126. * 用户点击右上角分享
  127. */
  128. onShareAppMessage: function () {
  129. }
  130. })