You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

262 lines
14 KiB

4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
  1. "use strict";
  2. const common_vendor = require("../../../common/vendor.js");
  3. const common_assets = require("../../../common/assets.js");
  4. const mp_ecard_sdk_main = require("../../../mp_ecard_sdk/main.js");
  5. const config_api = require("../../../config/api.js");
  6. const store_index = require("../../../store/index.js");
  7. require("../../../mp_ecard_sdk/utils/validate.js");
  8. require("../../../mp_ecard_sdk/constants/log.js");
  9. require("../../../mp_ecard_sdk/globalConfig.js");
  10. require("../../../mp_ecard_sdk/utils/index.js");
  11. require("../../../uni_modules/uview-plus/index.js");
  12. require("../../../uni_modules/uview-plus/libs/mixin/mixin.js");
  13. require("../../../uni_modules/uview-plus/libs/vue.js");
  14. require("../../../uni_modules/uview-plus/libs/function/index.js");
  15. require("../../../uni_modules/uview-plus/libs/function/test.js");
  16. require("../../../uni_modules/uview-plus/libs/function/digit.js");
  17. require("../../../uni_modules/uview-plus/libs/config/config.js");
  18. require("../../../uni_modules/uview-plus/libs/util/route.js");
  19. require("../../../uni_modules/uview-plus/libs/mixin/mpMixin.js");
  20. require("../../../uni_modules/uview-plus/libs/luch-request/core/Request.js");
  21. require("../../../uni_modules/uview-plus/libs/luch-request/core/dispatchRequest.js");
  22. require("../../../uni_modules/uview-plus/libs/luch-request/adapters/index.js");
  23. require("../../../uni_modules/uview-plus/libs/luch-request/helpers/buildURL.js");
  24. require("../../../uni_modules/uview-plus/libs/luch-request/utils.js");
  25. require("../../../uni_modules/uview-plus/libs/luch-request/core/buildFullPath.js");
  26. require("../../../uni_modules/uview-plus/libs/luch-request/helpers/isAbsoluteURL.js");
  27. require("../../../uni_modules/uview-plus/libs/luch-request/helpers/combineURLs.js");
  28. require("../../../uni_modules/uview-plus/libs/luch-request/core/settle.js");
  29. require("../../../uni_modules/uview-plus/libs/luch-request/core/InterceptorManager.js");
  30. require("../../../uni_modules/uview-plus/libs/luch-request/core/mergeConfig.js");
  31. require("../../../uni_modules/uview-plus/libs/luch-request/core/defaults.js");
  32. require("../../../uni_modules/uview-plus/libs/luch-request/utils/clone.js");
  33. require("../../../uni_modules/uview-plus/libs/function/colorGradient.js");
  34. require("../../../uni_modules/uview-plus/libs/function/debounce.js");
  35. require("../../../uni_modules/uview-plus/libs/function/throttle.js");
  36. require("../../../uni_modules/uview-plus/libs/config/props.js");
  37. require("../../../uni_modules/uview-plus/libs/config/props/actionSheet.js");
  38. require("../../../uni_modules/uview-plus/libs/config/props/album.js");
  39. require("../../../uni_modules/uview-plus/libs/config/props/alert.js");
  40. require("../../../uni_modules/uview-plus/libs/config/props/avatar.js");
  41. require("../../../uni_modules/uview-plus/libs/config/props/avatarGroup.js");
  42. require("../../../uni_modules/uview-plus/libs/config/props/backtop.js");
  43. require("../../../uni_modules/uview-plus/libs/config/props/badge.js");
  44. require("../../../uni_modules/uview-plus/libs/config/props/button.js");
  45. require("../../../uni_modules/uview-plus/libs/config/props/calendar.js");
  46. require("../../../uni_modules/uview-plus/libs/config/props/carKeyboard.js");
  47. require("../../../uni_modules/uview-plus/libs/config/props/cell.js");
  48. require("../../../uni_modules/uview-plus/libs/config/props/cellGroup.js");
  49. require("../../../uni_modules/uview-plus/libs/config/props/checkbox.js");
  50. require("../../../uni_modules/uview-plus/libs/config/props/checkboxGroup.js");
  51. require("../../../uni_modules/uview-plus/libs/config/props/circleProgress.js");
  52. require("../../../uni_modules/uview-plus/libs/config/props/code.js");
  53. require("../../../uni_modules/uview-plus/libs/config/props/codeInput.js");
  54. require("../../../uni_modules/uview-plus/libs/config/props/col.js");
  55. require("../../../uni_modules/uview-plus/libs/config/props/collapse.js");
  56. require("../../../uni_modules/uview-plus/libs/config/props/collapseItem.js");
  57. require("../../../uni_modules/uview-plus/libs/config/props/columnNotice.js");
  58. require("../../../uni_modules/uview-plus/libs/config/props/countDown.js");
  59. require("../../../uni_modules/uview-plus/libs/config/props/countTo.js");
  60. require("../../../uni_modules/uview-plus/libs/config/props/datetimePicker.js");
  61. require("../../../uni_modules/uview-plus/libs/config/props/divider.js");
  62. require("../../../uni_modules/uview-plus/libs/config/props/empty.js");
  63. require("../../../uni_modules/uview-plus/libs/config/props/form.js");
  64. require("../../../uni_modules/uview-plus/libs/config/props/formItem.js");
  65. require("../../../uni_modules/uview-plus/libs/config/props/gap.js");
  66. require("../../../uni_modules/uview-plus/libs/config/props/grid.js");
  67. require("../../../uni_modules/uview-plus/libs/config/props/gridItem.js");
  68. require("../../../uni_modules/uview-plus/libs/config/props/icon.js");
  69. require("../../../uni_modules/uview-plus/libs/config/props/image.js");
  70. require("../../../uni_modules/uview-plus/libs/config/props/indexAnchor.js");
  71. require("../../../uni_modules/uview-plus/libs/config/props/indexList.js");
  72. require("../../../uni_modules/uview-plus/libs/config/props/input.js");
  73. require("../../../uni_modules/uview-plus/libs/config/props/keyboard.js");
  74. require("../../../uni_modules/uview-plus/libs/config/props/line.js");
  75. require("../../../uni_modules/uview-plus/libs/config/props/lineProgress.js");
  76. require("../../../uni_modules/uview-plus/libs/config/props/link.js");
  77. require("../../../uni_modules/uview-plus/libs/config/props/list.js");
  78. require("../../../uni_modules/uview-plus/libs/config/props/listItem.js");
  79. require("../../../uni_modules/uview-plus/libs/config/props/loadingIcon.js");
  80. require("../../../uni_modules/uview-plus/libs/config/props/loadingPage.js");
  81. require("../../../uni_modules/uview-plus/libs/config/props/loadmore.js");
  82. require("../../../uni_modules/uview-plus/libs/config/props/modal.js");
  83. require("../../../uni_modules/uview-plus/libs/config/props/navbar.js");
  84. require("../../../uni_modules/uview-plus/libs/config/color.js");
  85. require("../../../uni_modules/uview-plus/libs/config/props/noNetwork.js");
  86. require("../../../uni_modules/uview-plus/libs/config/props/noticeBar.js");
  87. require("../../../uni_modules/uview-plus/libs/config/props/notify.js");
  88. require("../../../uni_modules/uview-plus/libs/config/props/numberBox.js");
  89. require("../../../uni_modules/uview-plus/libs/config/props/numberKeyboard.js");
  90. require("../../../uni_modules/uview-plus/libs/config/props/overlay.js");
  91. require("../../../uni_modules/uview-plus/libs/config/props/parse.js");
  92. require("../../../uni_modules/uview-plus/libs/config/props/picker.js");
  93. require("../../../uni_modules/uview-plus/libs/config/props/popup.js");
  94. require("../../../uni_modules/uview-plus/libs/config/props/radio.js");
  95. require("../../../uni_modules/uview-plus/libs/config/props/radioGroup.js");
  96. require("../../../uni_modules/uview-plus/libs/config/props/rate.js");
  97. require("../../../uni_modules/uview-plus/libs/config/props/readMore.js");
  98. require("../../../uni_modules/uview-plus/libs/config/props/row.js");
  99. require("../../../uni_modules/uview-plus/libs/config/props/rowNotice.js");
  100. require("../../../uni_modules/uview-plus/libs/config/props/scrollList.js");
  101. require("../../../uni_modules/uview-plus/libs/config/props/search.js");
  102. require("../../../uni_modules/uview-plus/libs/config/props/section.js");
  103. require("../../../uni_modules/uview-plus/libs/config/props/skeleton.js");
  104. require("../../../uni_modules/uview-plus/libs/config/props/slider.js");
  105. require("../../../uni_modules/uview-plus/libs/config/props/statusBar.js");
  106. require("../../../uni_modules/uview-plus/libs/config/props/steps.js");
  107. require("../../../uni_modules/uview-plus/libs/config/props/stepsItem.js");
  108. require("../../../uni_modules/uview-plus/libs/config/props/sticky.js");
  109. require("../../../uni_modules/uview-plus/libs/config/props/subsection.js");
  110. require("../../../uni_modules/uview-plus/libs/config/props/swipeAction.js");
  111. require("../../../uni_modules/uview-plus/libs/config/props/swipeActionItem.js");
  112. require("../../../uni_modules/uview-plus/libs/config/props/swiper.js");
  113. require("../../../uni_modules/uview-plus/libs/config/props/swipterIndicator.js");
  114. require("../../../uni_modules/uview-plus/libs/config/props/switch.js");
  115. require("../../../uni_modules/uview-plus/libs/config/props/tabbar.js");
  116. require("../../../uni_modules/uview-plus/libs/config/props/tabbarItem.js");
  117. require("../../../uni_modules/uview-plus/libs/config/props/tabs.js");
  118. require("../../../uni_modules/uview-plus/libs/config/props/tag.js");
  119. require("../../../uni_modules/uview-plus/libs/config/props/text.js");
  120. require("../../../uni_modules/uview-plus/libs/config/props/textarea.js");
  121. require("../../../uni_modules/uview-plus/libs/config/props/toast.js");
  122. require("../../../uni_modules/uview-plus/libs/config/props/toolbar.js");
  123. require("../../../uni_modules/uview-plus/libs/config/props/tooltip.js");
  124. require("../../../uni_modules/uview-plus/libs/config/props/transition.js");
  125. require("../../../uni_modules/uview-plus/libs/config/props/upload.js");
  126. require("../../../uni_modules/uview-plus/libs/config/zIndex.js");
  127. require("../../../uni_modules/uview-plus/libs/function/platform.js");
  128. if (!Array) {
  129. const _easycom_u_icon2 = common_vendor.resolveComponent("u-icon");
  130. const _easycom_oneBtn2 = common_vendor.resolveComponent("oneBtn");
  131. (_easycom_u_icon2 + _easycom_oneBtn2)();
  132. }
  133. const _easycom_u_icon = () => "../../../uni_modules/uview-plus/components/u-icon/u-icon.js";
  134. const _easycom_oneBtn = () => "../../../components/oneBtn/oneBtn.js";
  135. if (!Math) {
  136. (_easycom_u_icon + _easycom_oneBtn)();
  137. }
  138. const _sfc_main = {
  139. __name: "authentication",
  140. setup(__props) {
  141. const counterStore = store_index.userStore();
  142. const currentStep = common_vendor.ref(0);
  143. const proressWith = common_vendor.computed(() => {
  144. if (currentStep.value == 1)
  145. return "290rpx";
  146. if (currentStep.value == 2)
  147. return "100%";
  148. return 0;
  149. });
  150. const houseStr = common_vendor.computed(() => {
  151. let item = counterStore.chooseHouse;
  152. if (!item.houseId)
  153. return "";
  154. let str = item.communityName + " - " + item.houseTypeName + " - " + item.roomNum;
  155. return str;
  156. });
  157. function nextStep(num) {
  158. if (num == 0 && !counterStore.chooseHouse.houseId)
  159. return;
  160. if (num == 1)
  161. currentStep.value = num;
  162. if (num == 2) {
  163. getpersonfaceFn();
  164. }
  165. if (num == 3) {
  166. counterStore.chooseHouse = {
  167. "roomNum": "",
  168. "houseType": "",
  169. "houseTypeName": "",
  170. "communityId": "",
  171. "communityName": "",
  172. "userName": 0,
  173. "idNo": "",
  174. "houseId": ""
  175. };
  176. common_vendor.index.switchTab({
  177. url: "/pages/tabbar/index/index"
  178. });
  179. }
  180. }
  181. async function getpersonfaceFn() {
  182. const { data: res } = await config_api.getFacetoken();
  183. console.log("获取到token了,很好");
  184. console.log(res);
  185. console.log(res.eidToken);
  186. goSDK(res.eidToken);
  187. }
  188. async function GetDetectInfoEnhancedFn(EidToken) {
  189. const { data: res } = await config_api.getFaceResult({ token: EidToken });
  190. console.log("返回的结果信息");
  191. console.log(res);
  192. counterStore.upDateHouse("idNo", res.idCard);
  193. counterStore.upDateHouse("userName", res.name);
  194. counterStore.upDateUseInfo("idCard", res.idCard);
  195. counterStore.upDateUseInfo("name", res.name);
  196. houseRoomBindFn();
  197. }
  198. async function houseRoomBindFn() {
  199. const { data: res } = await config_api.houseRoomBind(counterStore.chooseHouse);
  200. console.log(res);
  201. currentStep.value = 2;
  202. common_vendor.index.hideLoading();
  203. }
  204. function goSDK(token) {
  205. mp_ecard_sdk_main.startEid({
  206. data: {
  207. token
  208. },
  209. verifyDoneCallback(res) {
  210. const { token: token2, verifyDone } = res;
  211. console.log("收到核身完成的res:", res);
  212. console.log("核身的token是:", token2);
  213. common_vendor.index.showLoading({
  214. title: "正在加载,请稍后……"
  215. });
  216. GetDetectInfoEnhancedFn(token2);
  217. console.log("是否完成核身:", verifyDone);
  218. }
  219. });
  220. }
  221. return (_ctx, _cache) => {
  222. return common_vendor.e({
  223. a: common_vendor.unref(proressWith),
  224. b: currentStep.value ? 1 : "",
  225. c: currentStep.value == 2 ? 1 : "",
  226. d: currentStep.value == 0
  227. }, currentStep.value == 0 ? common_vendor.e({
  228. e: common_vendor.unref(counterStore).chooseHouse.houseId
  229. }, common_vendor.unref(counterStore).chooseHouse.houseId ? {
  230. f: common_vendor.t(common_vendor.unref(houseStr))
  231. } : {}, {
  232. g: common_vendor.p({
  233. name: "arrow-right",
  234. color: "#CCCCCC"
  235. }),
  236. h: common_vendor.o(($event) => _ctx.$goPage("/pages/subPage/authentication/comp/select1")),
  237. i: common_vendor.o(($event) => nextStep(1)),
  238. j: common_vendor.p({
  239. text: "下一步",
  240. disabled: !common_vendor.unref(counterStore).chooseHouse.houseId
  241. })
  242. }) : {}, {
  243. k: currentStep.value == 1
  244. }, currentStep.value == 1 ? {
  245. l: common_vendor.o(($event) => nextStep(2)),
  246. m: common_vendor.p({
  247. text: "点击开始实名认证"
  248. })
  249. } : {}, {
  250. n: currentStep.value == 2
  251. }, currentStep.value == 2 ? {
  252. o: common_assets._imports_0$2,
  253. p: common_vendor.o(($event) => nextStep(3)),
  254. q: common_vendor.p({
  255. text: "返回首页"
  256. })
  257. } : {});
  258. };
  259. }
  260. };
  261. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-0ab17929"], ["__file", "D:/work/xinjiangMiniProgram/pages/subPage/authentication/authentication.vue"]]);
  262. wx.createPage(MiniProgramPage);