index.js 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  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. const childRef0 = common_vendor.ref();
  31. const childRef1 = common_vendor.ref();
  32. const childRef2 = common_vendor.ref();
  33. common_vendor.onLoad(async (options) => {
  34. id.value = options && options.id;
  35. await searchConfig();
  36. await searchOther();
  37. await search();
  38. });
  39. const searchConfig = async () => {
  40. config.value = common_vendor.index.getStorageSync("config");
  41. };
  42. const searchOther = async () => {
  43. let res;
  44. res = await $api(`dict/data/list`, "GET", { dictType: "sys_user_type", status: "0" });
  45. if (res.code === 200 && res.total > 0)
  46. typeList.value = res.rows;
  47. res = await $api(`dict/data/list`, "GET", { dictType: "sys_match_number", status: "0" });
  48. if (res.code === 200 && res.total > 0)
  49. numberList.value = res.rows;
  50. res = await $api(`dict/data/list`, "GET", { dictType: "sys_train_type", status: "0" });
  51. if (res.code === 200 && res.total > 0)
  52. matchList.value = res.rows;
  53. res = await $api(`dict/data/list`, "GET", { dictType: "sys_activity_type", status: "0" });
  54. if (res.code === 200 && res.total > 0)
  55. activityList.value = res.rows;
  56. res = await $api(`dict/data/list`, "GET", { dictType: "sys_match_duration", status: "0" });
  57. if (res.code === 200 && res.total > 0)
  58. durationList.value = res.rows;
  59. res = await $api(`dict/data/list`, "GET", { dictType: "sys_yes_no", status: "0" });
  60. if (res.code === 200 && res.total > 0)
  61. openList.value = res.rows;
  62. };
  63. const search = async () => {
  64. if (id.value)
  65. ;
  66. };
  67. const onClickItem = (e) => {
  68. if (current.value !== e.currentIndex)
  69. current.value = e.currentIndex;
  70. };
  71. const toAdd = async () => {
  72. console.log("保存草稿");
  73. };
  74. const toCopy = async () => {
  75. console.log("复用");
  76. };
  77. const onSubmit = async () => {
  78. if (current.value == 0)
  79. childRef0.value.formSubmit();
  80. else if (current.value == 1)
  81. childRef1.value.formSubmit();
  82. else
  83. childRef2.value.formSubmit();
  84. };
  85. return (_ctx, _cache) => {
  86. return {
  87. a: common_vendor.o(onClickItem),
  88. b: common_vendor.p({
  89. current: current.value,
  90. values: list.value,
  91. styleType: "text",
  92. activeColor: "#dd524d"
  93. }),
  94. c: common_vendor.sr(childRef0, "fe92273c-1", {
  95. "k": "childRef0"
  96. }),
  97. d: id.value,
  98. e: common_vendor.p({
  99. id: id.value,
  100. typeList: typeList.value,
  101. numberList: numberList.value,
  102. durationList: durationList.value,
  103. openList: openList.value
  104. }),
  105. f: current.value === 0,
  106. g: common_vendor.sr(childRef1, "fe92273c-2", {
  107. "k": "childRef1"
  108. }),
  109. h: id.value,
  110. i: common_vendor.p({
  111. id: id.value,
  112. typeList: matchList.value,
  113. durationList: durationList.value,
  114. openList: openList.value,
  115. type: current.value
  116. }),
  117. j: current.value === 1,
  118. k: common_vendor.sr(childRef2, "fe92273c-3", {
  119. "k": "childRef2"
  120. }),
  121. l: id.value,
  122. m: common_vendor.p({
  123. id: id.value,
  124. activityList: activityList.value,
  125. durationList: durationList.value,
  126. openList: openList.value,
  127. type: current.value
  128. }),
  129. n: current.value === 2,
  130. o: common_vendor.o(toAdd),
  131. p: common_vendor.p({
  132. ["custom-prefix"]: "iconfont",
  133. type: "icon-caogao04",
  134. size: "20",
  135. color: "#696969"
  136. }),
  137. q: common_vendor.o(toCopy),
  138. r: common_vendor.p({
  139. ["custom-prefix"]: "iconfont",
  140. type: "icon-icon_cz",
  141. size: "20",
  142. color: "#696969"
  143. }),
  144. s: common_vendor.o(onSubmit)
  145. };
  146. };
  147. }
  148. });
  149. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-fe92273c"], ["__file", "D:/project/足球比赛/match_applet/pagesHome/create/index.vue"]]);
  150. wx.createPage(MiniProgramPage);