2025-08-29 09:51:02 +08:00
|
|
|
"use strict";
|
|
|
|
|
const common_vendor = require("../../../common/vendor.js");
|
|
|
|
|
const common_libraries_IsHouseExist = require("../../../common/libraries/IsHouseExist.js");
|
|
|
|
|
require("../../../common/libraries/request.js");
|
|
|
|
|
const common_store_useWeAppAuthStore = require("../../../common/store/useWeAppAuthStore.js");
|
2025-12-15 18:19:04 +08:00
|
|
|
const common_store_useWorkStore = require("../../../common/store/useWorkStore.js");
|
2025-08-29 09:51:02 +08:00
|
|
|
const pages_index_model = require("../model.js");
|
2025-12-15 18:19:04 +08:00
|
|
|
require("../../../gen/Apis.js");
|
2026-01-30 09:54:26 +08:00
|
|
|
require("../../../common/libraries/setTabBar.js");
|
2025-12-15 18:19:04 +08:00
|
|
|
require("../../../common/libraries/apiLoading.js");
|
2025-08-29 09:51:02 +08:00
|
|
|
if (!Array) {
|
|
|
|
|
const _easycom_up_icon2 = common_vendor.resolveComponent("up-icon");
|
2025-12-15 18:19:04 +08:00
|
|
|
const _easycom_hs_popup_switch_house2 = common_vendor.resolveComponent("hs-popup-switch-house");
|
|
|
|
|
(_easycom_up_icon2 + _easycom_hs_popup_switch_house2)();
|
2025-08-29 09:51:02 +08:00
|
|
|
}
|
|
|
|
|
const _easycom_up_icon = () => "../../../node-modules/uview-plus/components/u-icon/u-icon.js";
|
2025-12-15 18:19:04 +08:00
|
|
|
const _easycom_hs_popup_switch_house = () => "../../../components/hs-popup-switch-house/hs-popup-switch-house.js";
|
2025-08-29 09:51:02 +08:00
|
|
|
if (!Math) {
|
2025-12-15 18:19:04 +08:00
|
|
|
(_easycom_up_icon + _easycom_hs_popup_switch_house)();
|
2025-08-29 09:51:02 +08:00
|
|
|
}
|
|
|
|
|
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
|
|
|
|
__name: "PageHeadTitle",
|
|
|
|
|
props: ["title", "objStyle", "data"],
|
|
|
|
|
setup(__props) {
|
|
|
|
|
const props = __props;
|
2025-12-15 18:19:04 +08:00
|
|
|
const work = common_store_useWorkStore.useWorkStore();
|
2025-08-29 09:51:02 +08:00
|
|
|
const show = common_vendor.ref(false);
|
|
|
|
|
const titleValue = common_vendor.ref("标题");
|
|
|
|
|
const capsuleRect = common_vendor.ref({});
|
|
|
|
|
const userData = common_vendor.ref({});
|
|
|
|
|
const auth = common_store_useWeAppAuthStore.useWeAppAuthStore();
|
|
|
|
|
const handlePopupSwitchHouse = () => {
|
|
|
|
|
if (!common_libraries_IsHouseExist.getIsHouseExist())
|
|
|
|
|
return;
|
|
|
|
|
show.value = true;
|
|
|
|
|
};
|
2025-12-15 18:19:04 +08:00
|
|
|
common_vendor.watch(
|
|
|
|
|
() => work == null ? void 0 : work.selectedHouse,
|
|
|
|
|
() => {
|
|
|
|
|
if (work == null ? void 0 : work.selectedHouse) {
|
|
|
|
|
show.value = true;
|
|
|
|
|
}
|
|
|
|
|
console.log("work?.selectedHouse", work == null ? void 0 : work.selectedHouse);
|
2025-08-29 09:51:02 +08:00
|
|
|
}
|
2025-12-15 18:19:04 +08:00
|
|
|
);
|
|
|
|
|
const handleSelectedHouse = (e) => {
|
|
|
|
|
show.value = false;
|
2025-08-29 09:51:02 +08:00
|
|
|
};
|
2026-01-14 16:52:59 +08:00
|
|
|
const getPageBgFun = () => {
|
2026-01-30 09:54:26 +08:00
|
|
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
|
|
|
let cssStrColor = ((_d = (_c = (_b = (_a = pages_index_model.useModel) == null ? void 0 : _a.pageConfig) == null ? void 0 : _b.value) == null ? void 0 : _c.pageColorValue) == null ? void 0 : _d[0]) || "#d3d7ff";
|
|
|
|
|
let cssEndColor = ((_h = (_g = (_f = (_e = pages_index_model.useModel) == null ? void 0 : _e.pageConfig) == null ? void 0 : _f.value) == null ? void 0 : _g.pageColorValue) == null ? void 0 : _h[1]) || "#dffff3";
|
|
|
|
|
let bhg = `background:linear-gradient(180deg,rgba(208, 229, 255, 0.44) 0%,#f7f7f7 100%,rgba(255, 255, 255, 0) 100%),linear-gradient(145deg, ${cssStrColor} 100%,rgba(255, 255, 255, 0) 100%),linear-gradient(222deg, ${cssEndColor} 100%,#F7F7F7 40%);`;
|
2026-01-14 16:52:59 +08:00
|
|
|
return bhg;
|
|
|
|
|
};
|
|
|
|
|
const truncateString = (str) => {
|
|
|
|
|
if (!str)
|
|
|
|
|
return "-";
|
|
|
|
|
const maxLength = 15;
|
|
|
|
|
if (str.length <= maxLength)
|
|
|
|
|
return str;
|
|
|
|
|
const start = 6;
|
|
|
|
|
const end = 6;
|
|
|
|
|
return str.slice(0, start) + "..." + str.slice(-end);
|
|
|
|
|
};
|
2025-12-15 18:19:04 +08:00
|
|
|
common_vendor.watch(
|
|
|
|
|
() => {
|
|
|
|
|
var _a;
|
|
|
|
|
return (_a = auth == null ? void 0 : auth.data) == null ? void 0 : _a.user;
|
|
|
|
|
},
|
|
|
|
|
() => {
|
|
|
|
|
var _a, _b;
|
|
|
|
|
if (((_a = auth == null ? void 0 : auth.data) == null ? void 0 : _a.house_occupant) && !((_b = auth == null ? void 0 : auth.data) == null ? void 0 : _b.selected_house)) {
|
|
|
|
|
show.value = false;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
deep: true
|
|
|
|
|
}
|
|
|
|
|
);
|
2025-08-29 09:51:02 +08:00
|
|
|
common_vendor.onShow(() => {
|
|
|
|
|
userData.value = auth == null ? void 0 : auth.data;
|
|
|
|
|
console.log("2k2k", userData.value);
|
|
|
|
|
});
|
|
|
|
|
common_vendor.onMounted(() => {
|
|
|
|
|
titleValue.value = props.title;
|
|
|
|
|
capsuleRect.value = common_vendor.index.getMenuButtonBoundingClientRect();
|
|
|
|
|
console.log(capsuleRect.value, "capsuleRect");
|
|
|
|
|
});
|
|
|
|
|
common_vendor.onHide(() => {
|
|
|
|
|
show.value = false;
|
|
|
|
|
});
|
|
|
|
|
return (_ctx, _cache) => {
|
2026-01-14 16:52:59 +08:00
|
|
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
|
2025-08-29 09:51:02 +08:00
|
|
|
return common_vendor.e({
|
2026-01-14 16:52:59 +08:00
|
|
|
a: (_f = (_e = (_d = (_c = (_b = (_a = userData.value) == null ? void 0 : _a.config) == null ? void 0 : _b.companyConfig) == null ? void 0 : _c.config_value) == null ? void 0 : _d.logo) == null ? void 0 : _e[0]) == null ? void 0 : _f.url
|
|
|
|
|
}, ((_l = (_k = (_j = (_i = (_h = (_g = userData.value) == null ? void 0 : _g.config) == null ? void 0 : _h.companyConfig) == null ? void 0 : _i.config_value) == null ? void 0 : _j.logo) == null ? void 0 : _k[0]) == null ? void 0 : _l.url) ? {
|
|
|
|
|
b: ((_r = (_q = (_p = (_o = (_n = (_m = userData.value) == null ? void 0 : _m.config) == null ? void 0 : _n.companyConfig) == null ? void 0 : _o.config_value) == null ? void 0 : _p.logo) == null ? void 0 : _q[0]) == null ? void 0 : _r.url) || ""
|
|
|
|
|
} : {}, {
|
|
|
|
|
c: !((_s = userData.value) == null ? void 0 : _s.user)
|
|
|
|
|
}, !((_t = userData.value) == null ? void 0 : _t.user) ? {} : !((_u = userData.value) == null ? void 0 : _u.selected_house) ? {} : {
|
|
|
|
|
e: common_vendor.t(truncateString(((_w = (_v = userData.value) == null ? void 0 : _v.selected_house) == null ? void 0 : _w.full_name) || ""))
|
2025-08-29 09:51:02 +08:00
|
|
|
}, {
|
2026-01-14 16:52:59 +08:00
|
|
|
d: !((_x = userData.value) == null ? void 0 : _x.selected_house),
|
|
|
|
|
f: common_vendor.p({
|
2025-08-29 09:51:02 +08:00
|
|
|
name: "arrow-down-fill",
|
|
|
|
|
size: "12",
|
|
|
|
|
color: "#333"
|
|
|
|
|
}),
|
2026-01-14 16:52:59 +08:00
|
|
|
g: common_vendor.o(handlePopupSwitchHouse),
|
|
|
|
|
h: common_vendor.o(($event) => show.value = false),
|
|
|
|
|
i: common_vendor.o(handleSelectedHouse),
|
|
|
|
|
j: common_vendor.p({
|
2025-12-15 18:19:04 +08:00
|
|
|
show: show.value
|
2025-08-29 09:51:02 +08:00
|
|
|
}),
|
2026-01-14 16:52:59 +08:00
|
|
|
k: common_vendor.s(`padding-top:${capsuleRect.value.top}px;height:${capsuleRect.value.height}px;line-height:${capsuleRect.value.height}px;${props == null ? void 0 : props.objStyle};${((_z = (_y = common_vendor.unref(pages_index_model.useModel)) == null ? void 0 : _y.scrollTop) == null ? void 0 : _z.value) > 10 ? getPageBgFun() : ""}`)
|
2025-08-29 09:51:02 +08:00
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-f5a8911c"], ["__file", "/Users/zsq/Sources/github/2025property-pay/pay-customer/src/pages/index/components/PageHeadTitle.vue"]]);
|
|
|
|
|
wx.createComponent(Component);
|