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

4 months ago
  1. "use strict";
  2. const common_vendor = require("../../common/vendor.js");
  3. const mp_ecard_sdk_constants_log = require("../constants/log.js");
  4. const navigateToEid = (o) => {
  5. 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) {
  6. console.log("success", e), common_vendor.index.eidTokenToCallback = o, reportStat({ module: "NavigateToEid", action: "confirm" }), reportStat({ module: "showNavigateToEidDialog", action: "leave" });
  7. }, fail(e) {
  8. console.log("err", e), reportStat({ module: "NavigateToEid", action: "cancel" });
  9. }, complete(e) {
  10. reportStat({ module: "NavigateToEidDailog", action: "leave" }), common_vendor.index.reportLogToEid({ token: o, event: mp_ecard_sdk_constants_log.Log.navigateToEid, errMsg: e.errMsg });
  11. } });
  12. }, reportStat = async ({ token: e = common_vendor.index.VerifyEid_TOKEN, module: a, action: n }) => {
  13. if (console.log("reportStat", a, n), e)
  14. return console.log("上报埋点:", a, n), new Promise((o, i) => {
  15. 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) {
  16. o(e2);
  17. }, fail(e2) {
  18. i(e2);
  19. } });
  20. });
  21. };
  22. exports.navigateToEid = navigateToEid;
  23. exports.reportStat = reportStat;