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
110 lines
3.4 KiB
"use strict";
|
|
const common_vendor = require("../../common/vendor.js");
|
|
const _sfc_main = {
|
|
__name: "expense",
|
|
setup(__props) {
|
|
const filterType = common_vendor.ref("all");
|
|
const expenses = common_vendor.ref([
|
|
{
|
|
id: 1,
|
|
room: "706",
|
|
exp_amount: 39,
|
|
exp_date: "2025-09-08 14:27:21",
|
|
username: "李慧琳",
|
|
exp_method: "微信支付",
|
|
exp_type: 1,
|
|
remark: "电卡充值"
|
|
},
|
|
{
|
|
id: 2,
|
|
room: "706",
|
|
exp_amount: 11,
|
|
exp_date: "2025-09-08 14:28:40",
|
|
username: "李慧琳",
|
|
exp_method: "微信支付",
|
|
exp_type: 1,
|
|
remark: "电卡充值"
|
|
},
|
|
{
|
|
id: 3,
|
|
room: "706",
|
|
exp_amount: 50,
|
|
exp_date: "2025-08-15 09:20:30",
|
|
username: "李慧琳",
|
|
exp_method: "支付宝",
|
|
exp_type: 0,
|
|
remark: "8月水费"
|
|
},
|
|
{
|
|
id: 4,
|
|
room: "706",
|
|
exp_amount: 120,
|
|
exp_date: "2025-09-01 16:45:12",
|
|
username: "李慧琳",
|
|
exp_method: "微信支付",
|
|
exp_type: 2,
|
|
remark: "购买扫帚、拖把等清洁用品"
|
|
},
|
|
{
|
|
id: 5,
|
|
room: "706",
|
|
exp_amount: 35,
|
|
exp_date: "2025-08-22 11:10:25",
|
|
username: "李慧琳",
|
|
exp_method: "现金",
|
|
exp_type: 2,
|
|
remark: "购买垃圾桶2个"
|
|
}
|
|
]);
|
|
common_vendor.onShow(() => {
|
|
const isLogin = common_vendor.index.getStorageSync("isLogin");
|
|
common_vendor.index.__f__("log", "at pages/expense/expense.vue:117", isLogin);
|
|
if (!isLogin) {
|
|
common_vendor.index.redirectTo({
|
|
url: "/pages/login/login"
|
|
});
|
|
}
|
|
});
|
|
common_vendor.computed(() => {
|
|
switch (filterType.value) {
|
|
case "water":
|
|
return expenses.value.filter((item) => item.exp_type === "0");
|
|
case "electric":
|
|
return expenses.value.filter((item) => item.exp_type === "1");
|
|
case "public":
|
|
return expenses.value.filter((item) => item.exp_type === "1");
|
|
default:
|
|
return expenses.value;
|
|
}
|
|
});
|
|
return (_ctx, _cache) => {
|
|
return {
|
|
a: filterType.value === "all" ? 1 : "",
|
|
b: common_vendor.o(($event) => filterType.value = "all"),
|
|
c: filterType.value === "water" ? 1 : "",
|
|
d: common_vendor.o(($event) => filterType.value = "water"),
|
|
e: filterType.value === "electric" ? 1 : "",
|
|
f: common_vendor.o(($event) => filterType.value = "electric"),
|
|
g: filterType.value === "public" ? 1 : "",
|
|
h: common_vendor.o(($event) => filterType.value = "public"),
|
|
i: common_vendor.f(expenses.value, (item, index, i0) => {
|
|
return common_vendor.e({
|
|
a: common_vendor.t(item.room),
|
|
b: common_vendor.t(item.exp_amount),
|
|
c: common_vendor.t(item.exp_method),
|
|
d: common_vendor.t(item.exp_date),
|
|
e: common_vendor.t(item.username),
|
|
f: item.remark
|
|
}, item.remark ? {
|
|
g: common_vendor.t(item.remark)
|
|
} : {}, {
|
|
h: index
|
|
});
|
|
})
|
|
};
|
|
};
|
|
}
|
|
};
|
|
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-eb996adb"]]);
|
|
wx.createPage(MiniProgramPage);
|
|
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/expense/expense.js.map
|