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.
 
 
 

23 lines
1.9 KiB

"use strict";
const common_vendor = require("../../common/vendor.js");
const mp_ecard_sdk_constants_log = require("../constants/log.js");
const navigateToEid = (o) => {
console.log("navigateToEid", common_vendor.index.eidEnvVersion), reportStat({ module: "showNavigateToEidDialog", action: "enter" }), (common_vendor.index.enableEmbedded && common_vendor.index.openEmbeddedMiniProgram ? common_vendor.index.openEmbeddedMiniProgram : common_vendor.index.navigateToMiniProgram)({ appId: "wx0e2cb0b052a91c92", path: "pages/huiyan/index", envVersion: common_vendor.index.eidEnvVersion, allowFullScreen: common_vendor.index.allowFullScreen, extraData: { useHuiyan: true, huiyanToken: o }, success(e) {
console.log("success", e), common_vendor.index.eidTokenToCallback = o, reportStat({ module: "NavigateToEid", action: "confirm" }), reportStat({ module: "showNavigateToEidDialog", action: "leave" });
}, fail(e) {
console.log("err", e), reportStat({ module: "NavigateToEid", action: "cancel" });
}, complete(e) {
reportStat({ module: "NavigateToEidDailog", action: "leave" }), common_vendor.index.reportLogToEid({ token: o, event: mp_ecard_sdk_constants_log.Log.navigateToEid, errMsg: e.errMsg });
} });
}, reportStat = async ({ token: e = common_vendor.index.VerifyEid_TOKEN, module: a, action: n }) => {
if (console.log("reportStat", a, n), e)
return console.log("上报埋点:", a, n), new Promise((o, i) => {
common_vendor.index.request({ url: common_vendor.index.eidBaseUrl + "/api/report/EidEvents?token=" + e, method: "POST", data: { token: e, eidSDKVersion: mp_ecard_sdk_constants_log.Log.version, enableEmbedded: common_vendor.index.enableEmbedded, dataList: [{ startTimestamp: Date.now(), module: a, action: n }] }, success(e2) {
o(e2);
}, fail(e2) {
i(e2);
} });
});
};
exports.navigateToEid = navigateToEid;
exports.reportStat = reportStat;