69 lines
3.5 KiB
JavaScript
Raw Normal View History

2025-12-15 18:27:46 +08:00
"use strict";
const common_vendor = require("../../../common/vendor.js");
const pages_index_model = require("../model.js");
require("../../../common/libraries/request.js");
const common_store_useWeAppAuthStore = require("../../../common/store/useWeAppAuthStore.js");
require("../../../common/store/useWorkStore.js");
const common_libraries_userUserLogin = require("../../../common/libraries/userUserLogin.js");
require("../../../common/libraries/day.js");
require("../../../gen/Apis.js");
require("../../../common/libraries/apiLoading.js");
if (!Array) {
const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons");
_easycom_uni_icons2();
}
const _easycom_uni_icons = () => "../../../uni_modules/uni-icons/components/uni-icons/uni-icons.js";
if (!Math) {
_easycom_uni_icons();
}
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
__name: "HeaderTitle",
props: ["title", "objStyle"],
setup(__props) {
const props = __props;
const titleValue = common_vendor.ref("标题");
const capsuleRect = common_vendor.ref({});
const auth = common_store_useWeAppAuthStore.useWeAppAuthStore();
const user = common_vendor.ref({});
const handleToPage = () => {
var _a;
common_vendor.index.navigateTo({
url: ((_a = common_libraries_userUserLogin.getUser) == null ? void 0 : _a.getLoginStatus()) ? "/ME/update/index" : "/pages/login"
});
};
common_vendor.onMounted(() => {
titleValue.value = props.title;
capsuleRect.value = common_vendor.index.getMenuButtonBoundingClientRect();
console.log(capsuleRect.value, "capsuleRect");
});
common_vendor.onShow(async () => {
var _a, _b;
await ((_a = common_vendor.getCurrentInstance()) == null ? void 0 : _a.appContext.config.globalProperties.$onLaunched);
user.value = (_b = auth == null ? void 0 : auth.data) == null ? void 0 : _b.user;
console.log("onShow", user.value);
});
return (_ctx, _cache) => {
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
return common_vendor.e({
a: common_vendor.t(((_b = (_a = user.value) == null ? void 0 : _a.company) == null ? void 0 : _b.name) || "-"),
b: common_vendor.s(`height:${capsuleRect.value.height}px;line-height:${capsuleRect.value.height}px;`),
c: (_d = (_c = common_vendor.unref(auth)) == null ? void 0 : _c.data) == null ? void 0 : _d.user
}, ((_f = (_e = common_vendor.unref(auth)) == null ? void 0 : _e.data) == null ? void 0 : _f.user) ? {
d: common_vendor.t(((_g = user.value) == null ? void 0 : _g.name) || "-")
} : {}, {
e: common_vendor.p({
type: "right",
size: "19",
color: "#666"
}),
f: common_vendor.o(handleToPage),
g: common_vendor.t(((_i = (_h = common_vendor.unref(pages_index_model.useModel).userData.value) == null ? void 0 : _h.position) == null ? void 0 : _i.name) || "-"),
h: common_vendor.t(((_j = common_vendor.unref(pages_index_model.useModel).userData.value) == null ? void 0 : _j.house_num) ? `${((_k = common_vendor.unref(pages_index_model.useModel).userData.value) == null ? void 0 : _k.house_num) || "-"}户房屋` : "-"),
i: common_vendor.s(`padding-top:${capsuleRect.value.top + 10}px;${props == null ? void 0 : props.objStyle}`)
});
};
}
});
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-6179032e"], ["__file", "/Users/zsq/Sources/github/2025property-pay/pay-employee/src/pages/index/components/HeaderTitle.vue"]]);
wx.createComponent(Component);