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.

110 lines
3.4 KiB

3 weeks ago
  1. "use strict";
  2. const common_vendor = require("../../common/vendor.js");
  3. const _sfc_main = {
  4. __name: "expense",
  5. setup(__props) {
  6. const filterType = common_vendor.ref("all");
  7. const expenses = common_vendor.ref([
  8. {
  9. id: 1,
  10. room: "706",
  11. exp_amount: 39,
  12. exp_date: "2025-09-08 14:27:21",
  13. username: "李慧琳",
  14. exp_method: "微信支付",
  15. exp_type: 1,
  16. remark: "电卡充值"
  17. },
  18. {
  19. id: 2,
  20. room: "706",
  21. exp_amount: 11,
  22. exp_date: "2025-09-08 14:28:40",
  23. username: "李慧琳",
  24. exp_method: "微信支付",
  25. exp_type: 1,
  26. remark: "电卡充值"
  27. },
  28. {
  29. id: 3,
  30. room: "706",
  31. exp_amount: 50,
  32. exp_date: "2025-08-15 09:20:30",
  33. username: "李慧琳",
  34. exp_method: "支付宝",
  35. exp_type: 0,
  36. remark: "8月水费"
  37. },
  38. {
  39. id: 4,
  40. room: "706",
  41. exp_amount: 120,
  42. exp_date: "2025-09-01 16:45:12",
  43. username: "李慧琳",
  44. exp_method: "微信支付",
  45. exp_type: 2,
  46. remark: "购买扫帚、拖把等清洁用品"
  47. },
  48. {
  49. id: 5,
  50. room: "706",
  51. exp_amount: 35,
  52. exp_date: "2025-08-22 11:10:25",
  53. username: "李慧琳",
  54. exp_method: "现金",
  55. exp_type: 2,
  56. remark: "购买垃圾桶2个"
  57. }
  58. ]);
  59. common_vendor.onShow(() => {
  60. const isLogin = common_vendor.index.getStorageSync("isLogin");
  61. common_vendor.index.__f__("log", "at pages/expense/expense.vue:117", isLogin);
  62. if (!isLogin) {
  63. common_vendor.index.redirectTo({
  64. url: "/pages/login/login"
  65. });
  66. }
  67. });
  68. common_vendor.computed(() => {
  69. switch (filterType.value) {
  70. case "water":
  71. return expenses.value.filter((item) => item.exp_type === "0");
  72. case "electric":
  73. return expenses.value.filter((item) => item.exp_type === "1");
  74. case "public":
  75. return expenses.value.filter((item) => item.exp_type === "1");
  76. default:
  77. return expenses.value;
  78. }
  79. });
  80. return (_ctx, _cache) => {
  81. return {
  82. a: filterType.value === "all" ? 1 : "",
  83. b: common_vendor.o(($event) => filterType.value = "all"),
  84. c: filterType.value === "water" ? 1 : "",
  85. d: common_vendor.o(($event) => filterType.value = "water"),
  86. e: filterType.value === "electric" ? 1 : "",
  87. f: common_vendor.o(($event) => filterType.value = "electric"),
  88. g: filterType.value === "public" ? 1 : "",
  89. h: common_vendor.o(($event) => filterType.value = "public"),
  90. i: common_vendor.f(expenses.value, (item, index, i0) => {
  91. return common_vendor.e({
  92. a: common_vendor.t(item.room),
  93. b: common_vendor.t(item.exp_amount),
  94. c: common_vendor.t(item.exp_method),
  95. d: common_vendor.t(item.exp_date),
  96. e: common_vendor.t(item.username),
  97. f: item.remark
  98. }, item.remark ? {
  99. g: common_vendor.t(item.remark)
  100. } : {}, {
  101. h: index
  102. });
  103. })
  104. };
  105. };
  106. }
  107. };
  108. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-eb996adb"]]);
  109. wx.createPage(MiniProgramPage);
  110. //# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/expense/expense.js.map