102 lines
4.1 KiB
JavaScript
102 lines
4.1 KiB
JavaScript
"use strict";
|
|
const common_vendor = require("../../../common/vendor.js");
|
|
const common_libraries_apiLoading = require("../../../common/libraries/apiLoading.js");
|
|
const gen_Apis = require("../../../gen/Apis.js");
|
|
require("../../../common/libraries/request.js");
|
|
const common_store_useWeAppAuthStore = require("../../../common/store/useWeAppAuthStore.js");
|
|
require("../../../common/store/useWorkStore.js");
|
|
const common_libraries_getPageConfig = require("../../../common/libraries/getPageConfig.js");
|
|
if (!Array) {
|
|
const _easycom_cc_scroll_loading2 = common_vendor.resolveComponent("cc-scroll-loading");
|
|
_easycom_cc_scroll_loading2();
|
|
}
|
|
const _easycom_cc_scroll_loading = () => "../../../common/components/cc-scroll-loading/cc-scroll-loading.js";
|
|
if (!Math) {
|
|
(MyEventList + MyConvenienceServices + _easycom_cc_scroll_loading)();
|
|
}
|
|
const MyConvenienceServices = () => "./ConvenienceServices.js";
|
|
const MyEventList = () => "./EventList.js";
|
|
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
|
__name: "Tabs",
|
|
setup(__props) {
|
|
const formData = common_vendor.ref({ page: 1 });
|
|
const metaData = common_vendor.ref({});
|
|
const auth = common_store_useWeAppAuthStore.useWeAppAuthStore();
|
|
const tabsList = [{ label: "社区活动" }, { label: "便民服务" }];
|
|
const current = common_vendor.ref(0);
|
|
const convenienceServices = common_vendor.ref([]);
|
|
const handleTabClick = (index) => {
|
|
current.value = index;
|
|
convenienceServices.value = [];
|
|
if (current.value) {
|
|
getConvenienceServices("PropertyExclusive");
|
|
} else {
|
|
getEventList();
|
|
}
|
|
};
|
|
const getEventList = () => {
|
|
common_libraries_apiLoading.getApiLoading(gen_Apis.Apis.Activity.Activities.List, formData.value).then((res) => {
|
|
if (res == null ? void 0 : res.data) {
|
|
convenienceServices.value = [...convenienceServices.value, ...res.data];
|
|
console.log("convenienceServices", convenienceServices.value);
|
|
metaData.value = res.meta;
|
|
}
|
|
console.log("res", res);
|
|
});
|
|
};
|
|
const getConvenienceServices = (type) => {
|
|
var _a, _b;
|
|
common_libraries_apiLoading.getApiLoading(gen_Apis.Apis.Common.ConvenienceServices.List, {
|
|
asset_projects_id: ((_b = (_a = auth == null ? void 0 : auth.data) == null ? void 0 : _a.selected_house) == null ? void 0 : _b.asset_projects_id) || 1,
|
|
type
|
|
}).then((res) => {
|
|
convenienceServices.value = res.data;
|
|
metaData.value = res.meta;
|
|
console.log(res);
|
|
});
|
|
};
|
|
const handleLoadMore = (page) => {
|
|
formData.value.page = page;
|
|
handleTabClick(current.value);
|
|
};
|
|
common_vendor.onMounted(() => {
|
|
getEventList();
|
|
});
|
|
return (_ctx, _cache) => {
|
|
return common_vendor.e({
|
|
a: common_vendor.f(tabsList, (i, index, i0) => {
|
|
return common_vendor.e({
|
|
a: common_vendor.t(i == null ? void 0 : i.label),
|
|
b: index === current.value
|
|
}, index === current.value ? {
|
|
c: common_vendor.s(common_vendor.unref(common_libraries_getPageConfig.getStyleBgInfo)())
|
|
} : {}, {
|
|
d: `tab_${index}`,
|
|
e: common_vendor.n(`tab_item ${index === current.value ? "tab_active" : ""}`),
|
|
f: common_vendor.o(($event) => handleTabClick(index), `tab_${index}`)
|
|
});
|
|
}),
|
|
b: current.value === 0
|
|
}, current.value === 0 ? {
|
|
c: common_vendor.p({
|
|
data: convenienceServices.value
|
|
})
|
|
} : {}, {
|
|
d: current.value === 1
|
|
}, current.value === 1 ? {
|
|
e: common_vendor.o(getConvenienceServices),
|
|
f: common_vendor.p({
|
|
data: convenienceServices.value
|
|
})
|
|
} : {}, {
|
|
g: common_vendor.o(handleLoadMore),
|
|
h: common_vendor.p({
|
|
meta: metaData.value
|
|
})
|
|
});
|
|
};
|
|
}
|
|
});
|
|
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-90a1bf81"], ["__file", "/Users/zsq/Sources/github/2025property-pay/pay-customer/src/pages/index/components/Tabs.vue"]]);
|
|
wx.createComponent(Component);
|