info.js 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. "use strict";
  2. const common_vendor = require("../../common/vendor.js");
  3. if (!Array) {
  4. const _easycom_uni_segmented_control2 = common_vendor.resolveComponent("uni-segmented-control");
  5. _easycom_uni_segmented_control2();
  6. }
  7. const _easycom_uni_segmented_control = () => "../../uni_modules/uni-segmented-control/components/uni-segmented-control/uni-segmented-control.js";
  8. if (!Math) {
  9. _easycom_uni_segmented_control();
  10. }
  11. const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
  12. __name: "info",
  13. setup(__props) {
  14. var _a;
  15. (_a = common_vendor.getCurrentInstance()) == null ? void 0 : _a.appContext.config.globalProperties.$api;
  16. const config = common_vendor.ref({ logoUrl: "" });
  17. const info = common_vendor.ref({});
  18. const list = common_vendor.ref(["出勤报名", "数据统计"]);
  19. const current = common_vendor.ref(0);
  20. const id = common_vendor.ref("");
  21. common_vendor.onLoad(async (options) => {
  22. id.value = options && options.id;
  23. common_vendor.index.setNavigationBarTitle({
  24. title: options && options.name || "活动详情"
  25. });
  26. await searchConfig();
  27. await search();
  28. });
  29. const searchConfig = async () => {
  30. config.value = common_vendor.index.getStorageSync("config");
  31. };
  32. const search = async () => {
  33. if (id.value)
  34. ;
  35. };
  36. const onClickItem = (e) => {
  37. if (current.value !== e.currentIndex)
  38. current.value = e.currentIndex;
  39. };
  40. const getDayOfWeek = (dateString) => {
  41. if (dateString) {
  42. const date = new Date(dateString);
  43. const dayOfWeek = date.getDay();
  44. const weekdays = ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"];
  45. return weekdays[dayOfWeek];
  46. } else
  47. return "暂无日期";
  48. };
  49. return (_ctx, _cache) => {
  50. return {
  51. a: common_vendor.t(info.value.number || 0),
  52. b: common_vendor.t(info.value.wheel || 0),
  53. c: info.value.red_logo || config.value.logoUrl,
  54. d: common_vendor.t(info.value.red_name || "暂无红方名称"),
  55. e: common_vendor.t(info.value.red_score || 0),
  56. f: common_vendor.t(info.value.blue_score || 0),
  57. g: info.value.blue_logo || config.value.logoUrl,
  58. h: common_vendor.t(info.value.blue_name || "暂无蓝方名称"),
  59. i: common_vendor.t(getDayOfWeek(info.value.time)),
  60. j: common_vendor.t(info.value.time || "暂无时间"),
  61. k: common_vendor.t(info.value.address || "暂无地点"),
  62. l: common_vendor.o(onClickItem),
  63. m: common_vendor.p({
  64. current: current.value,
  65. values: list.value,
  66. styleType: "text",
  67. activeColor: "#dd524d"
  68. }),
  69. n: current.value === 0,
  70. o: current.value === 1
  71. };
  72. };
  73. }
  74. });
  75. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-24c37ea1"], ["__file", "D:/project/足球比赛/match_applet/pagesHome/activity/info.vue"]]);
  76. wx.createPage(MiniProgramPage);