index.js 5.5 KB

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