"use strict";
const common_vendor = require("../../common/vendor.js");
const common_assets = require("../../common/assets.js");
const utils_navTo = require("../../utils/navTo.js");
const api_api = require("../../api/api.js");
if (!Array) {
  const _easycom_up__image2 = common_vendor.resolveComponent("up--image");
  const _easycom_u_icon2 = common_vendor.resolveComponent("u-icon");
  (_easycom_up__image2 + _easycom_u_icon2)();
}
const _easycom_up__image = () => "../../node-modules/uview-plus/components/u--image/u--image.js";
const _easycom_u_icon = () => "../../node-modules/uview-plus/components/u-icon/u-icon.js";
if (!Math) {
  (dNav + _easycom_up__image + _easycom_u_icon)();
}
const dNav = () => "../../components/backNav/backNav.js";
const _sfc_main = {
  __name: "my",
  setup(__props) {
    const userInfo = common_vendor.reactive({});
    const numInfo = common_vendor.reactive({});
    const hospitalInfo = common_vendor.reactive({});
    const getInfo = () => {
      api_api.api.getUserInfo().then((res) => {
        const result = res.data.data;
        Object.assign(userInfo, result);
        common_vendor.index.__f__("log", "at pages/my/my.vue:102", result);
        if (userInfo.doctor_id) {
          getNum(userInfo.doctor_id);
        }
        if (userInfo.hospital_id) {
          getHospitalNum(userInfo.hospital_id);
        }
      });
    };
    const getNum = (id) => {
      api_api.api.getStaticDoctor(id).then((res) => {
        const result = res.data.data;
        Object.assign(numInfo, result);
      });
    };
    const getHospitalNum = (id) => {
      api_api.api.getStaticHospital(id).then((res) => {
        const result = res.data.data;
        Object.assign(hospitalInfo, result);
      });
    };
    common_vendor.onLoad(() => {
      getInfo();
    });
    const goCert = () => {
      utils_navTo.navTo({
        url: "/pages/certList/certList?doctor_id=" + userInfo.doctor_id
      });
    };
    const goDoctor = (id, name) => {
      utils_navTo.navTo({
        url: "/pages/searchList/searchList?type=doctor&id=" + id + "&name=" + name
      });
    };
    const goHospital = (id, name) => {
      utils_navTo.navTo({
        url: "/pages/searchList/searchList?type=hospital&id=" + id + "&name=" + name
      });
    };
    const mySpecial = () => {
      utils_navTo.navTo({
        url: "/pages/specialList/specialList?userId=" + userInfo.user_id
      });
    };
    const goJoin = () => {
      utils_navTo.navTo({
        url: "/pages/myJoin/myJoin"
      });
    };
    const goCollect = () => {
      utils_navTo.navTo({
        url: "/pages/myCollect/myCollect"
      });
    };
    const goPublish = () => {
      utils_navTo.navTo({
        url: "/pages/publish/publish"
      });
    };
    return (_ctx, _cache) => {
      return common_vendor.e({
        a: common_vendor.p({
          src: userInfo.avatar ? userInfo.avatar : common_vendor.unref(common_assets.headImg),
          width: "154rpx",
          height: "154rpx",
          radius: "50%"
        }),
        b: common_vendor.t(userInfo.user_name),
        c: common_vendor.t(userInfo.title),
        d: common_vendor.t(userInfo.hospital_name),
        e: common_vendor.t(numInfo.article_num),
        f: common_vendor.t(numInfo.video_num),
        g: common_vendor.t(numInfo.video_read_num + numInfo.article_read_num),
        h: numInfo.article_num > 0
      }, numInfo.article_num > 0 ? {
        i: common_vendor.p({
          name: "chat-fill",
          color: "#000",
          size: "28"
        }),
        j: common_vendor.p({
          name: "arrow-right",
          color: "#9CA3AF",
          size: "18"
        }),
        k: common_vendor.o(($event) => goDoctor(userInfo.doctor_id, userInfo.user_name))
      } : {}, {
        l: common_vendor.p({
          name: "chat-fill",
          color: "#000",
          size: "28"
        }),
        m: common_vendor.p({
          name: "arrow-right",
          color: "#9CA3AF",
          size: "18"
        }),
        n: common_vendor.o(goCert),
        o: hospitalInfo.video_read_num > 0 || hospitalInfo.article_read_num > 0
      }, hospitalInfo.video_read_num > 0 || hospitalInfo.article_read_num > 0 ? {
        p: common_vendor.p({
          name: "chat-fill",
          color: "#000",
          size: "28"
        }),
        q: common_vendor.t(userInfo.hospital_name),
        r: common_vendor.p({
          name: "arrow-right",
          color: "#9CA3AF",
          size: "18"
        }),
        s: common_vendor.o(($event) => goHospital(userInfo.hospital_id, userInfo.hospital_name))
      } : {}, {
        t: common_vendor.p({
          name: "chat-fill",
          color: "#000",
          size: "28"
        }),
        v: common_vendor.p({
          name: "arrow-right",
          color: "#9CA3AF",
          size: "18"
        }),
        w: common_vendor.o(mySpecial),
        x: common_vendor.p({
          name: "chat-fill",
          color: "#000",
          size: "28"
        }),
        y: common_vendor.p({
          name: "arrow-right",
          color: "#9CA3AF",
          size: "18"
        }),
        z: common_vendor.o(goJoin),
        A: common_vendor.p({
          name: "chat-fill",
          color: "#000",
          size: "28"
        }),
        B: common_vendor.p({
          name: "arrow-right",
          color: "#9CA3AF",
          size: "18"
        }),
        C: common_vendor.o(goCollect),
        D: common_vendor.p({
          name: "plus",
          color: "#fff",
          size: "18"
        }),
        E: common_vendor.o(goPublish)
      });
    };
  }
};
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-2f1ef635"]]);
wx.createPage(MiniProgramPage);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/my/my.js.map
