index.js 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  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. const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons");
  6. (_easycom_uni_segmented_control2 + _easycom_uni_icons2)();
  7. }
  8. const _easycom_uni_segmented_control = () => "../../uni_modules/uni-segmented-control/components/uni-segmented-control/uni-segmented-control.js";
  9. const _easycom_uni_icons = () => "../../uni_modules/uni-icons/components/uni-icons/uni-icons.js";
  10. if (!Math) {
  11. (_easycom_uni_segmented_control + match + activity + _easycom_uni_icons)();
  12. }
  13. const activity = () => "./components/activity.js";
  14. const match = () => "./components/match.js";
  15. const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
  16. __name: "index",
  17. setup(__props) {
  18. var _a;
  19. const $api = (_a = common_vendor.getCurrentInstance()) == null ? void 0 : _a.appContext.config.globalProperties.$api;
  20. const config = common_vendor.ref({});
  21. const id = common_vendor.ref("");
  22. const list = common_vendor.ref(["友谊赛", "训练", "活动"]);
  23. const current = common_vendor.ref(0);
  24. const typeList = common_vendor.ref([]);
  25. const numberList = common_vendor.ref([]);
  26. const matchList = common_vendor.ref([]);
  27. const activityList = common_vendor.ref([]);
  28. const durationList = common_vendor.ref([]);
  29. const openList = common_vendor.ref([]);
  30. common_vendor.onLoad(async (options) => {
  31. id.value = options && options.id;
  32. await searchConfig();
  33. await searchOther();
  34. await search();
  35. });
  36. const searchConfig = async () => {
  37. config.value = common_vendor.index.getStorageSync("config");
  38. };
  39. const searchOther = async () => {
  40. let res;
  41. res = await $api(`dict/data/list`, "GET", { dictType: "sys_user_type", status: "0" });
  42. if (res.code === 200 && res.total > 0)
  43. typeList.value = res.rows;
  44. res = await $api(`dict/data/list`, "GET", { dictType: "sys_match_number", status: "0" });
  45. if (res.code === 200 && res.total > 0)
  46. numberList.value = res.rows;
  47. res = await $api(`dict/data/list`, "GET", { dictType: "sys_train_type", status: "0" });
  48. if (res.code === 200 && res.total > 0)
  49. matchList.value = res.rows;
  50. res = await $api(`dict/data/list`, "GET", { dictType: "sys_activity_type", status: "0" });
  51. if (res.code === 200 && res.total > 0)
  52. activityList.value = res.rows;
  53. res = await $api(`dict/data/list`, "GET", { dictType: "sys_match_duration", status: "0" });
  54. if (res.code === 200 && res.total > 0)
  55. durationList.value = res.rows;
  56. res = await $api(`dict/data/list`, "GET", { dictType: "sys_yes_no", status: "0" });
  57. if (res.code === 200 && res.total > 0)
  58. openList.value = res.rows;
  59. };
  60. const search = async () => {
  61. if (id.value)
  62. ;
  63. };
  64. const onClickItem = (e) => {
  65. if (current.value !== e.currentIndex)
  66. current.value = e.currentIndex;
  67. };
  68. const toAdd = async () => {
  69. console.log("保存草稿");
  70. };
  71. const toCopy = async () => {
  72. console.log("复用");
  73. };
  74. return (_ctx, _cache) => {
  75. return {
  76. a: common_vendor.o(onClickItem),
  77. b: common_vendor.p({
  78. current: current.value,
  79. values: list.value,
  80. styleType: "text",
  81. activeColor: "#dd524d"
  82. }),
  83. c: common_vendor.p({
  84. typeList: typeList.value,
  85. numberList: numberList.value,
  86. durationList: durationList.value,
  87. openList: openList.value
  88. }),
  89. d: current.value === 0,
  90. e: common_vendor.p({
  91. typeList: matchList.value,
  92. durationList: durationList.value,
  93. openList: openList.value,
  94. type: "0"
  95. }),
  96. f: current.value === 1,
  97. g: common_vendor.p({
  98. activityList: activityList.value,
  99. durationList: durationList.value,
  100. openList: openList.value,
  101. type: "1"
  102. }),
  103. h: current.value === 2,
  104. i: common_vendor.o(toAdd),
  105. j: common_vendor.p({
  106. ["custom-prefix"]: "iconfont",
  107. type: "icon-caogao04",
  108. size: "20",
  109. color: "#696969"
  110. }),
  111. k: common_vendor.o(toCopy),
  112. l: common_vendor.p({
  113. ["custom-prefix"]: "iconfont",
  114. type: "icon-icon_cz",
  115. size: "20",
  116. color: "#696969"
  117. })
  118. };
  119. };
  120. }
  121. });
  122. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-fe92273c"], ["__file", "D:/project/足球比赛/match_applet/pagesHome/create/index.vue"]]);
  123. wx.createPage(MiniProgramPage);