82 lines
2.9 KiB
JavaScript
82 lines
2.9 KiB
JavaScript
"use strict";
|
|
const common_vendor = require("../../common/vendor.js");
|
|
const pages_yuangongindex_api = require("./api.js");
|
|
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
|
__name: "message",
|
|
setup(__props) {
|
|
const hulijigouArray = common_vendor.ref([]);
|
|
common_vendor.ref(false);
|
|
common_vendor.ref("");
|
|
const clickCard = (type) => {
|
|
if (type.izRead == "1") {
|
|
pages_yuangongindex_api.upRead({ id: type.id }).then((res) => {
|
|
if (res.success) {
|
|
search();
|
|
}
|
|
});
|
|
}
|
|
};
|
|
const checkRed = () => {
|
|
if (hulijigouArray.value.every((item) => item.izRead == `0`)) {
|
|
hong.value = false;
|
|
} else {
|
|
hong.value = true;
|
|
}
|
|
};
|
|
const jumpIndex = common_vendor.ref(common_vendor.index.getStorageSync("jumpIndex"));
|
|
const goBack = () => {
|
|
common_vendor.index.__f__("log", "at pages/yuangongindex/message.vue:127", "?????", jumpIndex.value);
|
|
switch (jumpIndex.value) {
|
|
case 1:
|
|
common_vendor.index.reLaunch({ url: "/pages/index/index" });
|
|
break;
|
|
case 2:
|
|
common_vendor.index.reLaunch({ url: "/pages/yuangongindex/index" });
|
|
break;
|
|
case 3:
|
|
common_vendor.index.reLaunch({ url: "/pages/oldmanindex/index" });
|
|
}
|
|
};
|
|
const search = () => {
|
|
pages_yuangongindex_api.getNotice().then((res) => {
|
|
if (res.success) {
|
|
hulijigouArray.value = res.result;
|
|
checkRed();
|
|
}
|
|
});
|
|
};
|
|
common_vendor.ref(false);
|
|
const hong = common_vendor.ref(false);
|
|
common_vendor.onShow(() => {
|
|
search();
|
|
});
|
|
return (_ctx, _cache) => {
|
|
return common_vendor.e({
|
|
a: common_vendor.o(goBack),
|
|
b: `${common_vendor.index.getStorageSync("moveHeight") + 35}px`,
|
|
c: `${common_vendor.index.getStorageSync("moveHeight") + 30}px`,
|
|
d: hulijigouArray.value.length
|
|
}, hulijigouArray.value.length ? common_vendor.e({
|
|
e: hong.value
|
|
}, hong.value ? {} : {}) : {}, {
|
|
f: !hulijigouArray.value.length
|
|
}, !hulijigouArray.value.length ? {} : {}, {
|
|
g: common_vendor.f(hulijigouArray.value, (item, index, i0) => {
|
|
return common_vendor.e({
|
|
a: common_vendor.t(item.title),
|
|
b: common_vendor.t(item.createTime.substring(item.createTime.indexOf("-") + 1, item.createTime.indexOf("-") + 6)),
|
|
c: item.izRead == `1`
|
|
}, item.izRead == `1` ? {} : {}, {
|
|
d: common_vendor.t(item.content),
|
|
e: index,
|
|
f: common_vendor.o(($event) => clickCard(item), index)
|
|
});
|
|
})
|
|
});
|
|
};
|
|
}
|
|
});
|
|
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-c24ad088"]]);
|
|
wx.createPage(MiniProgramPage);
|
|
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/yuangongindex/message.js.map
|