You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

85 lines
2.5 KiB

4 months ago
3 months ago
4 months ago
3 months ago
4 months ago
3 months ago
4 months ago
3 months ago
2 weeks ago
4 months ago
  1. "use strict";
  2. const common_vendor = require("../../../../common/vendor.js");
  3. const store_index = require("../../../../store/index.js");
  4. const config_api = require("../../../../config/api.js");
  5. if (!Array) {
  6. const _easycom_oneBtn2 = common_vendor.resolveComponent("oneBtn");
  7. const _easycom_up_popup2 = common_vendor.resolveComponent("up-popup");
  8. (_easycom_oneBtn2 + _easycom_up_popup2)();
  9. }
  10. const _easycom_oneBtn = () => "../../../../components/oneBtn/oneBtn.js";
  11. const _easycom_up_popup = () => "../../../../uni_modules/uview-plus/components/u-popup/u-popup.js";
  12. if (!Math) {
  13. (_easycom_oneBtn + _easycom_up_popup)();
  14. }
  15. const _sfc_main = {
  16. __name: "notice",
  17. props: {
  18. list: {
  19. type: Array,
  20. default: []
  21. }
  22. },
  23. setup(__props) {
  24. const counterStore = store_index.userStore();
  25. const showPop = common_vendor.ref(false);
  26. function goDetail(item) {
  27. if (!counterStore.userInfo.myHouse) {
  28. getHousesFn();
  29. }
  30. common_vendor.index.navigateTo({
  31. url: "/pages/subPage/notice/noticeDetail?id=" + item.id
  32. });
  33. }
  34. function oneBtnClickFn() {
  35. showPop.value = false;
  36. common_vendor.index.navigateTo({
  37. url: "/pages/subPage/authentication/authentication"
  38. });
  39. }
  40. async function getHousesFn() {
  41. if (!counterStore.token) {
  42. common_vendor.index.navigateTo({
  43. url: "/pages/subPage/login/login"
  44. });
  45. return;
  46. }
  47. const {
  48. data: res
  49. } = await config_api.getHouses();
  50. if (!res.length) {
  51. return showPop.value = true;
  52. }
  53. counterStore.upDateUseInfo("myHouse", res);
  54. }
  55. return (_ctx, _cache) => {
  56. return {
  57. a: common_vendor.f(__props.list, (item, index, i0) => {
  58. return {
  59. a: common_vendor.t(item.title),
  60. b: common_vendor.t(item.timeDesc),
  61. c: item.picture,
  62. d: index,
  63. e: common_vendor.o(($event) => goDetail(item), index)
  64. };
  65. }),
  66. b: common_vendor.o(oneBtnClickFn),
  67. c: common_vendor.p({
  68. text: "点击认证业主"
  69. }),
  70. d: common_vendor.o(($event) => showPop.value = false),
  71. e: common_vendor.p({
  72. show: showPop.value,
  73. mode: "center",
  74. round: 10,
  75. customStyle: {
  76. width: "90%"
  77. },
  78. closeable: true
  79. })
  80. };
  81. };
  82. }
  83. };
  84. const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-95913b5f"]]);
  85. wx.createComponent(Component);