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.

63 lines
2.7 KiB

3 weeks ago
  1. "use strict";
  2. const common_vendor = require("../../common/vendor.js");
  3. const _sfc_main = {
  4. __name: "payment",
  5. setup(__props) {
  6. const filterType = common_vendor.ref("all");
  7. const payments = common_vendor.ref([
  8. { id: 1, username: "李慧琳", room: "706", pay_amount: 75, pay_date: "2025-07-31", pay_status: "0", remark: "7月宿舍费" },
  9. { id: 2, username: "李慧琳", room: "706", pay_amount: 75, pay_date: "2025-06-30", pay_status: "0", remark: "6月宿舍费" },
  10. { id: 3, username: "李慧琳", room: "706", pay_amount: 75, pay_date: "2025-05-28", pay_status: "0", remark: "5月宿舍费" },
  11. { id: 4, username: "李慧琳", room: "706", pay_amount: 80, pay_date: "2025-08-31", pay_status: "1", remark: "8月宿舍费" }
  12. ]);
  13. const res = common_vendor.computed(() => {
  14. switch (filterType.value) {
  15. case "pass":
  16. return payments.value.filter((item) => item.pay_status === "0");
  17. case "pending":
  18. return payments.value.filter((item) => item.pay_status === "1");
  19. default:
  20. return payments.value;
  21. }
  22. });
  23. common_vendor.onShow(() => {
  24. const isLogin = common_vendor.index.getStorageSync("isLogin");
  25. common_vendor.index.__f__("log", "at pages/payment/payment.vue:86", isLogin);
  26. if (!isLogin) {
  27. common_vendor.index.redirectTo({
  28. url: "/pages/login/login"
  29. });
  30. }
  31. });
  32. return (_ctx, _cache) => {
  33. return common_vendor.e({
  34. a: filterType.value === "all" ? 1 : "",
  35. b: common_vendor.o(($event) => filterType.value = "all"),
  36. c: filterType.value === "pass" ? 1 : "",
  37. d: common_vendor.o(($event) => filterType.value = "pass"),
  38. e: filterType.value === "pending" ? 1 : "",
  39. f: common_vendor.o(($event) => filterType.value = "pending"),
  40. g: common_vendor.f(res.value, (item, index, i0) => {
  41. return common_vendor.e({
  42. a: common_vendor.t(item.room),
  43. b: common_vendor.t(item.pay_status === "0" ? "已缴费" : "待缴费"),
  44. c: item.pay_status === "0" ? 1 : "",
  45. d: item.pay_status === "1" ? 1 : "",
  46. e: common_vendor.t(item.pay_amount),
  47. f: common_vendor.t(item.pay_date),
  48. g: common_vendor.t(item.username),
  49. h: item.remark
  50. }, item.remark ? {
  51. i: common_vendor.t(item.remark)
  52. } : {}, {
  53. j: index
  54. });
  55. }),
  56. h: res.value.length === 0
  57. }, res.value.length === 0 ? {} : {});
  58. };
  59. }
  60. };
  61. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-eade9ab2"]]);
  62. wx.createPage(MiniProgramPage);
  63. //# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/payment/payment.js.map