"use strict";
const common_vendor = require("../../../../common/vendor.js");
const pagesCrm_business_schemeDetail_template_props = require("./props.js");
require("../../../../config/globalData.js");
const pagesCrm_service_schemeDetail_index = require("../../../service/schemeDetail/index.js");
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
  __name: "announcements",
  props: pagesCrm_business_schemeDetail_template_props.props,
  setup(__props) {
    const props = __props;
    common_vendor.ref([]);
    const option = common_vendor.ref({});
    common_vendor.ref(1);
    const pushContent = common_vendor.ref("");
    const init = async (datas) => {
      if (datas && !datas.length)
        return;
      pushContent.value = datas[0].PushContent;
      option.value = datas[0];
      let readRes = datas[0].IsRead;
      if (!readRes) {
        const resp = await pagesCrm_service_schemeDetail_index.PatientRead({
          Id: datas[0].Id
        });
        readRes = !!resp;
        let pages = getCurrentPages();
        let parentPage = pages[pages.length - 2];
        parentPage.$vm.changeItemReadStatus(props.date, props.index, 1);
      }
    };
    common_vendor.watch(
      () => props.content,
      (v) => {
        init(v);
      },
      {
        immediate: true,
        deep: true
      }
    );
    return (_ctx, _cache) => {
      return {
        a: common_vendor.t(_ctx.memberName),
        b: common_vendor.t(option.value.ExecDate),
        c: common_vendor.t(option.value.ReadTime),
        d: common_vendor.t(pushContent.value)
      };
    };
  }
});
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-0b70c923"]]);
wx.createComponent(Component);
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/pagesCrm/business/schemeDetail/template/announcements.js.map
