"use strict";
const common_vendor = require("../../../common/vendor.js");
require("../../../common/libraries/request.js");
const common_store_useWeAppAuthStore = require("../../../common/store/useWeAppAuthStore.js");
require("../../../common/store/useWorkStore.js");
require("../../../gen/Apis.js");
require("../../../common/libraries/setTabBar.js");
require("../../../common/libraries/apiLoading.js");
if (!Array) {
  const _easycom_up_avatar2 = common_vendor.resolveComponent("up-avatar");
  const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons");
  (_easycom_up_avatar2 + _easycom_uni_icons2)();
}
const _easycom_up_avatar = () => "../../../node-modules/uview-plus/components/u-avatar/u-avatar.js";
const _easycom_uni_icons = () => "../../../uni_modules/uni-icons/components/uni-icons/uni-icons.js";
if (!Math) {
  (_easycom_up_avatar + _easycom_uni_icons)();
}
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
  __name: "header",
  setup(__props) {
    const userData = common_vendor.ref({});
    const auth = common_store_useWeAppAuthStore.useWeAppAuthStore();
    const capsuleRect = common_vendor.ref({});
    const handleToPageMe = (url) => {
      var _a;
      common_vendor.index.navigateTo({
        url: ((_a = userData == null ? void 0 : userData.value) == null ? void 0 : _a.user) ? url : "/pages/login"
      });
    };
    common_vendor.onShow((e) => {
      userData.value = auth == null ? void 0 : auth.data;
    });
    common_vendor.onMounted(() => {
      capsuleRect.value = common_vendor.index.getMenuButtonBoundingClientRect();
      console.log(capsuleRect.value, "capsuleRect");
    });
    return (_ctx, _cache) => {
      var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o;
      return common_vendor.e({
        a: (_a = userData.value) == null ? void 0 : _a.user
      }, ((_b = userData.value) == null ? void 0 : _b.user) ? common_vendor.e({
        b: common_vendor.p({
          size: "60",
          src: ((_d = (_c = userData.value) == null ? void 0 : _c.user) == null ? void 0 : _d.avatar) && ((_g = (_f = (_e = userData.value) == null ? void 0 : _e.user) == null ? void 0 : _f.avatar[0]) == null ? void 0 : _g.url)
        }),
        c: (_i = (_h = userData.value) == null ? void 0 : _h.user) == null ? void 0 : _i.name
      }, ((_k = (_j = userData.value) == null ? void 0 : _j.user) == null ? void 0 : _k.name) ? {
        d: common_vendor.t(((_m = (_l = userData.value) == null ? void 0 : _l.user) == null ? void 0 : _m.name) || "比较懒还没设置名字")
      } : {}, {
        e: common_vendor.t((_o = (_n = userData.value) == null ? void 0 : _n.user) == null ? void 0 : _o.phone)
      }) : {
        f: common_vendor.p({
          size: "60"
        })
      }, {
        g: common_vendor.p({
          type: "right",
          size: "17",
          color: "#969799"
        }),
        h: common_vendor.o(($event) => handleToPageMe("/INDEX/me/index")),
        i: common_vendor.s(`padding-top:${capsuleRect.value.top + capsuleRect.value.height}px;`)
      });
    };
  }
});
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-ec3dc2f4"], ["__file", "/Users/zsq/Sources/github/2025property-pay/pay-customer/src/pages/me/components/header.vue"]]);
wx.createComponent(Component);
