"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_day = require("../../../common/libraries/day.js");
const common_libraries_userUserLogin = require("../../../common/libraries/userUserLogin.js");
require("../../../common/libraries/setTabBar.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: "NewsList",
  setup(__props) {
    const auth = common_store_useWeAppAuthStore.useWeAppAuthStore();
    const newsData = common_vendor.ref([]);
    const getNewList = () => {
      common_libraries_apiLoading.getApiLoading(gen_Apis.Apis.Msg.MsgPropertyAnnouncements.List, {}).then((res) => {
        newsData.value = res.data;
        console.log(res);
      });
    };
    common_vendor.watch(
      () => {
        var _a;
        return (_a = auth == null ? void 0 : auth.data) == null ? void 0 : _a.selected_house;
      },
      () => {
        var _a;
        if ((_a = common_libraries_userUserLogin.getUserLogin) == null ? void 0 : _a.getLoginStatus()) {
          getNewList();
        }
      },
      {
        deep: true
      }
    );
    const toMessage = () => {
      common_vendor.index.navigateTo({
        // url: '/INDEX/message_center/index/index'
        url: "/INDEX/message_center/list/index"
      });
    };
    return (_ctx, _cache) => {
      var _a, _b;
      return common_vendor.e({
        a: (_a = newsData.value) == null ? void 0 : _a.length
      }, ((_b = newsData.value) == null ? void 0 : _b.length) ? {
        b: common_vendor.p({
          type: "right",
          size: "15",
          color: "#C4C4C4"
        }),
        c: common_vendor.o(toMessage),
        d: common_vendor.f(newsData.value, (i, index, i0) => {
          return {
            a: common_vendor.t(i == null ? void 0 : i.title),
            b: common_vendor.t(common_vendor.unref(common_libraries_day.getFromNow)(i == null ? void 0 : i.created_at)),
            c: `items_${index}`
          };
        })
      } : {});
    };
  }
});
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-a2a3a4c0"], ["__file", "/Users/zsq/Sources/github/2025property-pay/pay-customer/src/pages/index/components/NewsList.vue"]]);
wx.createComponent(Component);
