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

"use strict";
const common_vendor = require("../../../common/vendor.js");
const common_assets = require("../../../common/assets.js");
const mp_ecard_sdk_main = require("../../../mp_ecard_sdk/main.js");
const config_api = require("../../../config/api.js");
const store_index = require("../../../store/index.js");
require("../../../mp_ecard_sdk/utils/validate.js");
require("../../../mp_ecard_sdk/constants/log.js");
require("../../../mp_ecard_sdk/globalConfig.js");
require("../../../mp_ecard_sdk/utils/index.js");
require("../../../uni_modules/uview-plus/index.js");
require("../../../uni_modules/uview-plus/libs/mixin/mixin.js");
require("../../../uni_modules/uview-plus/libs/vue.js");
require("../../../uni_modules/uview-plus/libs/function/index.js");
require("../../../uni_modules/uview-plus/libs/function/test.js");
require("../../../uni_modules/uview-plus/libs/function/digit.js");
require("../../../uni_modules/uview-plus/libs/config/config.js");
require("../../../uni_modules/uview-plus/libs/util/route.js");
require("../../../uni_modules/uview-plus/libs/mixin/mpMixin.js");
require("../../../uni_modules/uview-plus/libs/luch-request/core/Request.js");
require("../../../uni_modules/uview-plus/libs/luch-request/core/dispatchRequest.js");
require("../../../uni_modules/uview-plus/libs/luch-request/adapters/index.js");
require("../../../uni_modules/uview-plus/libs/luch-request/helpers/buildURL.js");
require("../../../uni_modules/uview-plus/libs/luch-request/utils.js");
require("../../../uni_modules/uview-plus/libs/luch-request/core/buildFullPath.js");
require("../../../uni_modules/uview-plus/libs/luch-request/helpers/isAbsoluteURL.js");
require("../../../uni_modules/uview-plus/libs/luch-request/helpers/combineURLs.js");
require("../../../uni_modules/uview-plus/libs/luch-request/core/settle.js");
require("../../../uni_modules/uview-plus/libs/luch-request/core/InterceptorManager.js");
require("../../../uni_modules/uview-plus/libs/luch-request/core/mergeConfig.js");
require("../../../uni_modules/uview-plus/libs/luch-request/core/defaults.js");
require("../../../uni_modules/uview-plus/libs/luch-request/utils/clone.js");
require("../../../uni_modules/uview-plus/libs/function/colorGradient.js");
require("../../../uni_modules/uview-plus/libs/function/debounce.js");
require("../../../uni_modules/uview-plus/libs/function/throttle.js");
require("../../../uni_modules/uview-plus/libs/config/props.js");
require("../../../uni_modules/uview-plus/libs/config/props/actionSheet.js");
require("../../../uni_modules/uview-plus/libs/config/props/album.js");
require("../../../uni_modules/uview-plus/libs/config/props/alert.js");
require("../../../uni_modules/uview-plus/libs/config/props/avatar.js");
require("../../../uni_modules/uview-plus/libs/config/props/avatarGroup.js");
require("../../../uni_modules/uview-plus/libs/config/props/backtop.js");
require("../../../uni_modules/uview-plus/libs/config/props/badge.js");
require("../../../uni_modules/uview-plus/libs/config/props/button.js");
require("../../../uni_modules/uview-plus/libs/config/props/calendar.js");
require("../../../uni_modules/uview-plus/libs/config/props/carKeyboard.js");
require("../../../uni_modules/uview-plus/libs/config/props/cell.js");
require("../../../uni_modules/uview-plus/libs/config/props/cellGroup.js");
require("../../../uni_modules/uview-plus/libs/config/props/checkbox.js");
require("../../../uni_modules/uview-plus/libs/config/props/checkboxGroup.js");
require("../../../uni_modules/uview-plus/libs/config/props/circleProgress.js");
require("../../../uni_modules/uview-plus/libs/config/props/code.js");
require("../../../uni_modules/uview-plus/libs/config/props/codeInput.js");
require("../../../uni_modules/uview-plus/libs/config/props/col.js");
require("../../../uni_modules/uview-plus/libs/config/props/collapse.js");
require("../../../uni_modules/uview-plus/libs/config/props/collapseItem.js");
require("../../../uni_modules/uview-plus/libs/config/props/columnNotice.js");
require("../../../uni_modules/uview-plus/libs/config/props/countDown.js");
require("../../../uni_modules/uview-plus/libs/config/props/countTo.js");
require("../../../uni_modules/uview-plus/libs/config/props/datetimePicker.js");
require("../../../uni_modules/uview-plus/libs/config/props/divider.js");
require("../../../uni_modules/uview-plus/libs/config/props/empty.js");
require("../../../uni_modules/uview-plus/libs/config/props/form.js");
require("../../../uni_modules/uview-plus/libs/config/props/formItem.js");
require("../../../uni_modules/uview-plus/libs/config/props/gap.js");
require("../../../uni_modules/uview-plus/libs/config/props/grid.js");
require("../../../uni_modules/uview-plus/libs/config/props/gridItem.js");
require("../../../uni_modules/uview-plus/libs/config/props/icon.js");
require("../../../uni_modules/uview-plus/libs/config/props/image.js");
require("../../../uni_modules/uview-plus/libs/config/props/indexAnchor.js");
require("../../../uni_modules/uview-plus/libs/config/props/indexList.js");
require("../../../uni_modules/uview-plus/libs/config/props/input.js");
require("../../../uni_modules/uview-plus/libs/config/props/keyboard.js");
require("../../../uni_modules/uview-plus/libs/config/props/line.js");
require("../../../uni_modules/uview-plus/libs/config/props/lineProgress.js");
require("../../../uni_modules/uview-plus/libs/config/props/link.js");
require("../../../uni_modules/uview-plus/libs/config/props/list.js");
require("../../../uni_modules/uview-plus/libs/config/props/listItem.js");
require("../../../uni_modules/uview-plus/libs/config/props/loadingIcon.js");
require("../../../uni_modules/uview-plus/libs/config/props/loadingPage.js");
require("../../../uni_modules/uview-plus/libs/config/props/loadmore.js");
require("../../../uni_modules/uview-plus/libs/config/props/modal.js");
require("../../../uni_modules/uview-plus/libs/config/props/navbar.js");
require("../../../uni_modules/uview-plus/libs/config/color.js");
require("../../../uni_modules/uview-plus/libs/config/props/noNetwork.js");
require("../../../uni_modules/uview-plus/libs/config/props/noticeBar.js");
require("../../../uni_modules/uview-plus/libs/config/props/notify.js");
require("../../../uni_modules/uview-plus/libs/config/props/numberBox.js");
require("../../../uni_modules/uview-plus/libs/config/props/numberKeyboard.js");
require("../../../uni_modules/uview-plus/libs/config/props/overlay.js");
require("../../../uni_modules/uview-plus/libs/config/props/parse.js");
require("../../../uni_modules/uview-plus/libs/config/props/picker.js");
require("../../../uni_modules/uview-plus/libs/config/props/popup.js");
require("../../../uni_modules/uview-plus/libs/config/props/radio.js");
require("../../../uni_modules/uview-plus/libs/config/props/radioGroup.js");
require("../../../uni_modules/uview-plus/libs/config/props/rate.js");
require("../../../uni_modules/uview-plus/libs/config/props/readMore.js");
require("../../../uni_modules/uview-plus/libs/config/props/row.js");
require("../../../uni_modules/uview-plus/libs/config/props/rowNotice.js");
require("../../../uni_modules/uview-plus/libs/config/props/scrollList.js");
require("../../../uni_modules/uview-plus/libs/config/props/search.js");
require("../../../uni_modules/uview-plus/libs/config/props/section.js");
require("../../../uni_modules/uview-plus/libs/config/props/skeleton.js");
require("../../../uni_modules/uview-plus/libs/config/props/slider.js");
require("../../../uni_modules/uview-plus/libs/config/props/statusBar.js");
require("../../../uni_modules/uview-plus/libs/config/props/steps.js");
require("../../../uni_modules/uview-plus/libs/config/props/stepsItem.js");
require("../../../uni_modules/uview-plus/libs/config/props/sticky.js");
require("../../../uni_modules/uview-plus/libs/config/props/subsection.js");
require("../../../uni_modules/uview-plus/libs/config/props/swipeAction.js");
require("../../../uni_modules/uview-plus/libs/config/props/swipeActionItem.js");
require("../../../uni_modules/uview-plus/libs/config/props/swiper.js");
require("../../../uni_modules/uview-plus/libs/config/props/swipterIndicator.js");
require("../../../uni_modules/uview-plus/libs/config/props/switch.js");
require("../../../uni_modules/uview-plus/libs/config/props/tabbar.js");
require("../../../uni_modules/uview-plus/libs/config/props/tabbarItem.js");
require("../../../uni_modules/uview-plus/libs/config/props/tabs.js");
require("../../../uni_modules/uview-plus/libs/config/props/tag.js");
require("../../../uni_modules/uview-plus/libs/config/props/text.js");
require("../../../uni_modules/uview-plus/libs/config/props/textarea.js");
require("../../../uni_modules/uview-plus/libs/config/props/toast.js");
require("../../../uni_modules/uview-plus/libs/config/props/toolbar.js");
require("../../../uni_modules/uview-plus/libs/config/props/tooltip.js");
require("../../../uni_modules/uview-plus/libs/config/props/transition.js");
require("../../../uni_modules/uview-plus/libs/config/props/upload.js");
require("../../../uni_modules/uview-plus/libs/config/zIndex.js");
require("../../../uni_modules/uview-plus/libs/function/platform.js");
if (!Array) {
const _easycom_u_icon2 = common_vendor.resolveComponent("u-icon");
const _easycom_oneBtn2 = common_vendor.resolveComponent("oneBtn");
(_easycom_u_icon2 + _easycom_oneBtn2)();
}
const _easycom_u_icon = () => "../../../uni_modules/uview-plus/components/u-icon/u-icon.js";
const _easycom_oneBtn = () => "../../../components/oneBtn/oneBtn.js";
if (!Math) {
(_easycom_u_icon + _easycom_oneBtn)();
}
const _sfc_main = {
__name: "authentication",
setup(__props) {
const counterStore = store_index.userStore();
const currentStep = common_vendor.ref(0);
const proressWith = common_vendor.computed(() => {
if (currentStep.value == 1)
return "290rpx";
if (currentStep.value == 2)
return "100%";
return 0;
});
const houseStr = common_vendor.computed(() => {
let item = counterStore.chooseHouse;
if (!item.houseId)
return "";
let str = item.communityName + " - " + item.houseTypeName + " - " + item.roomNum;
return str;
});
function nextStep(num) {
if (num == 0 && !counterStore.chooseHouse.houseId)
return;
if (num == 1)
currentStep.value = num;
if (num == 2) {
getpersonfaceFn();
}
if (num == 3) {
counterStore.chooseHouse = {
"roomNum": "",
"houseType": "",
"houseTypeName": "",
"communityId": "",
"communityName": "",
"userName": 0,
"idNo": "",
"houseId": ""
};
common_vendor.index.switchTab({
url: "/pages/tabbar/index/index"
});
}
}
async function getpersonfaceFn() {
const { data: res } = await config_api.getFacetoken();
console.log("获取到token了,很好");
console.log(res);
console.log(res.eidToken);
goSDK(res.eidToken);
}
async function GetDetectInfoEnhancedFn(EidToken) {
const { data: res } = await config_api.getFaceResult({ token: EidToken });
console.log("返回的结果信息");
console.log(res);
counterStore.upDateHouse("idNo", res.idCard);
counterStore.upDateHouse("userName", res.name);
counterStore.upDateUseInfo("idCard", res.idCard);
counterStore.upDateUseInfo("name", res.name);
houseRoomBindFn();
}
async function houseRoomBindFn() {
const { data: res } = await config_api.houseRoomBind(counterStore.chooseHouse);
console.log(res);
currentStep.value = 2;
common_vendor.index.hideLoading();
}
function goSDK(token) {
mp_ecard_sdk_main.startEid({
data: {
token
},
verifyDoneCallback(res) {
const { token: token2, verifyDone } = res;
console.log("收到核身完成的res:", res);
console.log("核身的token是:", token2);
common_vendor.index.showLoading({
title: "正在加载,请稍后……"
});
GetDetectInfoEnhancedFn(token2);
console.log("是否完成核身:", verifyDone);
}
});
}
return (_ctx, _cache) => {
return common_vendor.e({
a: common_vendor.unref(proressWith),
b: currentStep.value ? 1 : "",
c: currentStep.value == 2 ? 1 : "",
d: currentStep.value == 0
}, currentStep.value == 0 ? common_vendor.e({
e: common_vendor.unref(counterStore).chooseHouse.houseId
}, common_vendor.unref(counterStore).chooseHouse.houseId ? {
f: common_vendor.t(common_vendor.unref(houseStr))
} : {}, {
g: common_vendor.p({
name: "arrow-right",
color: "#CCCCCC"
}),
h: common_vendor.o(($event) => _ctx.$goPage("/pages/subPage/authentication/comp/select1")),
i: common_vendor.o(($event) => nextStep(1)),
j: common_vendor.p({
text: "下一步",
disabled: !common_vendor.unref(counterStore).chooseHouse.houseId
})
}) : {}, {
k: currentStep.value == 1
}, currentStep.value == 1 ? {
l: common_vendor.o(($event) => nextStep(2)),
m: common_vendor.p({
text: "点击开始实名认证"
})
} : {}, {
n: currentStep.value == 2
}, currentStep.value == 2 ? {
o: common_assets._imports_0$2,
p: common_vendor.o(($event) => nextStep(3)),
q: common_vendor.p({
text: "返回首页"
})
} : {});
};
}
};
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-0ab17929"], ["__file", "D:/work/xinjiangMiniProgram/pages/subPage/authentication/authentication.vue"]]);
wx.createPage(MiniProgramPage);