中生金域
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.

82 lines
3.3 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. "use strict";
  2. const common_vendor = require("../../common/vendor.js");
  3. const _sfc_main = {
  4. data() {
  5. return {
  6. activeTab: 0,
  7. idcard: "",
  8. username: "",
  9. resultList: []
  10. };
  11. },
  12. onLoad() {
  13. this.getData();
  14. },
  15. methods: {
  16. getData() {
  17. const self = this;
  18. common_vendor.index.request({
  19. url: "http://localhost:8080/zsjyadmin/detection/current",
  20. method: "GET",
  21. success: (res) => {
  22. var _a, _b;
  23. if (((_a = res == null ? void 0 : res.data) == null ? void 0 : _a.code) == 0) {
  24. const data = (_b = res == null ? void 0 : res.data) == null ? void 0 : _b.data;
  25. const { idcard, username, resultList } = data || {};
  26. self.idcard = idcard;
  27. self.username = username;
  28. resultList.sort((a, b) => {
  29. return b.id - a.id;
  30. });
  31. self.resultList = resultList;
  32. }
  33. }
  34. });
  35. },
  36. changeActiveTab(activeTab) {
  37. if (activeTab == 0) {
  38. this.getData();
  39. }
  40. this.activeTab = activeTab;
  41. }
  42. }
  43. };
  44. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  45. var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
  46. return common_vendor.e({
  47. a: common_vendor.t($data.username),
  48. b: common_vendor.t($data.idcard),
  49. c: $data.activeTab == 0
  50. }, $data.activeTab == 0 ? {
  51. d: common_vendor.t(((_a = $data.resultList) == null ? void 0 : _a.length) > 0 ? (_b = $data.resultList[0]) == null ? void 0 : _b.c1 : "0"),
  52. e: common_vendor.t(((_c = $data.resultList) == null ? void 0 : _c.length) > 0 ? (_d = $data.resultList[0]) == null ? void 0 : _d.c2 : "0"),
  53. f: common_vendor.t(((_e = $data.resultList) == null ? void 0 : _e.length) > 0 ? (_f = $data.resultList[0]) == null ? void 0 : _f.c3 : "0"),
  54. g: common_vendor.t(((_g = $data.resultList) == null ? void 0 : _g.length) > 0 ? (_h = $data.resultList[0]) == null ? void 0 : _h.c4 : "0"),
  55. h: common_vendor.t(((_i = $data.resultList) == null ? void 0 : _i.length) > 0 ? (_j = $data.resultList[0]) == null ? void 0 : _j.c5 : "0"),
  56. i: common_vendor.t(((_k = $data.resultList) == null ? void 0 : _k.length) > 0 ? (_l = $data.resultList[0]) == null ? void 0 : _l.c6 : "0")
  57. } : {}, {
  58. j: $data.activeTab == 1
  59. }, $data.activeTab == 1 ? {
  60. k: common_vendor.f($data.resultList, (item, k0, i0) => {
  61. var _a2, _b2;
  62. return {
  63. a: common_vendor.t((_a2 = item.testDate) == null ? void 0 : _a2.split(" ")[0]),
  64. b: common_vendor.t((_b2 = item.testDate) == null ? void 0 : _b2.split(" ")[1]),
  65. c: common_vendor.t(item.c1),
  66. d: common_vendor.t(item.c2),
  67. e: common_vendor.t(item.c3),
  68. f: common_vendor.t(item.c4),
  69. g: common_vendor.t(item.c5),
  70. h: common_vendor.t(item.c6),
  71. i: item.id
  72. };
  73. })
  74. } : {}, {
  75. l: common_vendor.n($data.activeTab == 0 ? "btn active" : "btn"),
  76. m: common_vendor.o(($event) => $options.changeActiveTab(0)),
  77. n: common_vendor.n($data.activeTab == 1 ? "btn active" : "btn"),
  78. o: common_vendor.o(($event) => $options.changeActiveTab(1))
  79. });
  80. }
  81. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/Users/cool/Desktop/code/gold-field/pages/index/index.vue"]]);
  82. wx.createPage(MiniProgramPage);