"use strict";
const common_vendor = require("../../common/vendor.js");
const common_assets = require("../../common/assets.js");
const utils_api = require("../../utils/api.js");
if (!Array) {
  const _easycom_wd_icon2 = common_vendor.resolveComponent("wd-icon");
  _easycom_wd_icon2();
}
const _easycom_wd_icon = () => "../../uni_modules/wot-design-uni/components/wd-icon/wd-icon.js";
if (!Math) {
  _easycom_wd_icon();
}
const _sfc_main = {
  __name: "identity",
  setup(__props) {
    const paddingTop = common_vendor.ref(0);
    const userInfo = common_vendor.index.getStorageSync("carUserInfo");
    const mineXin = common_vendor.ref({});
    const typeList = common_vendor.ref([
      {
        cardType: "教师认证"
      },
      {
        cardType: "暖心认证"
      }
    ]);
    common_vendor.onMounted(() => {
      paddingTop.value = common_vendor.index.getMenuButtonBoundingClientRect().top;
      getMyVetry();
    });
    async function getMyVetry() {
      const res = await utils_api.myRequest({
        url: "/vertifyqueryOwn.action",
        data: {
          mobile: userInfo.mobile
        }
      });
      if (res.code == 200) {
        if (res.data[0].type == 1) {
          mineXin.value = res.data[0];
        } else if (res.data[0].type == 2) {
          mineXin.value = res.data[0];
        }
      } else if (res.message == "未查询到认证信息")
        ;
    }
    const clickItem = (item) => {
      if (item.cardType == "教师认证") {
        if (mineXin.value.type == 1) {
          const info = encodeURIComponent(JSON.stringify(mineXin.value));
          common_vendor.index.navigateTo({
            url: `/pages/authenticate/authenticate?info=${info}&cardType=${item.cardType}`
          });
          return;
        }
      } else {
        if (mineXin.value.type == 2) {
          const info = encodeURIComponent(JSON.stringify(mineXin.value));
          common_vendor.index.navigateTo({
            url: `/pages/authenticate/authenticate?info=${info}&cardType=${item.cardType}`
          });
          return;
        }
      }
      common_vendor.index.navigateTo({
        url: `/pages/authenticate/authenticate?cardType=${item.cardType}`
      });
    };
    const handleBack = () => {
      common_vendor.index.navigateBack();
    };
    return (_ctx, _cache) => {
      return {
        a: common_assets._imports_0$1,
        b: common_vendor.p({
          name: "thin-arrow-left",
          color: "#001713",
          size: "18"
        }),
        c: common_vendor.o(handleBack),
        d: `${paddingTop.value * 2}rpx`,
        e: common_vendor.f(typeList.value, (item, index, i0) => {
          return common_vendor.e({
            a: item.cardType == "优行认证"
          }, item.cardType == "优行认证" ? {} : {}, {
            b: item.cardType == "教师认证"
          }, item.cardType == "教师认证" ? {} : {}, {
            c: item.cardType == "暖心认证"
          }, item.cardType == "暖心认证" ? {} : {}, {
            d: common_vendor.t(item.cardType),
            e: common_vendor.n({
              line_excellent: item.cardType == "优行认证"
            }),
            f: common_vendor.n({
              line_teacher: item.cardType == "教师认证"
            }),
            g: common_vendor.n({
              line_warm: item.cardType == "暖心认证"
            }),
            h: index,
            i: common_vendor.n({
              excellent: item.cardType == "优行认证"
            }),
            j: common_vendor.n({
              teacher: item.cardType == "教师认证"
            }),
            k: common_vendor.n({
              warm: item.cardType == "暖心认证"
            }),
            l: common_vendor.o(($event) => clickItem(item), index)
          });
        })
      };
    };
  }
};
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-3712ab3a"], ["__file", "D:/创海项目/CH2025/约车小程序/yueche_app/pages/identity/identity.vue"]]);
wx.createPage(MiniProgramPage);
