activity.js 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. "use strict";
  2. const common_vendor = require("../../../common/vendor.js");
  3. const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
  4. __name: "activity",
  5. setup(__props) {
  6. var _a, _b, _c;
  7. const $api = (_a = common_vendor.getCurrentInstance()) == null ? void 0 : _a.appContext.config.globalProperties.$api;
  8. (_b = common_vendor.getCurrentInstance()) == null ? void 0 : _b.appContext.config.globalProperties.$config;
  9. (_c = common_vendor.getCurrentInstance()) == null ? void 0 : _c.appContext.config.globalProperties.$apifile;
  10. common_vendor.computed(() => {
  11. return common_vendor.index.getStorageSync("openid");
  12. });
  13. const form = common_vendor.ref({});
  14. const typeList = common_vendor.ref([]);
  15. const numberList = common_vendor.ref([]);
  16. const durationList = common_vendor.ref([]);
  17. common_vendor.onShow(async () => {
  18. await searchOther();
  19. await search();
  20. });
  21. const searchOther = async () => {
  22. let res;
  23. res = await $api(`dict/data/list`, "GET", { dictType: "sys_user_type" });
  24. if (res.code === 200 && res.total > 0)
  25. typeList.value = res.rows;
  26. res = await $api(`dict/data/list`, "GET", { dictType: "sys_match_number" });
  27. if (res.code === 200 && res.total > 0)
  28. numberList.value = res.rows;
  29. res = await $api(`dict/data/list`, "GET", { dictType: "sys_match_duration" });
  30. if (res.code === 200 && res.total > 0)
  31. durationList.value = res.rows;
  32. };
  33. const search = async () => {
  34. };
  35. const typeChange = (e) => {
  36. const data = typeList.value[e.detail.value];
  37. if (data)
  38. form.value.type = data.dictLabel;
  39. };
  40. const numberChange = (e) => {
  41. const data = numberList.value[e.detail.value];
  42. if (data)
  43. form.value.number = data.dictLabel;
  44. };
  45. const durationChange = (e) => {
  46. const data = durationList.value[e.detail.value];
  47. if (data)
  48. form.value.duration = data.dictLabel;
  49. };
  50. const dateChange = (e) => {
  51. form.value.date = e.detail.value;
  52. };
  53. const timeChange = (e) => {
  54. form.value.time = e.detail.value;
  55. };
  56. const formSubmit = (e) => {
  57. console.log(e.deatil.value);
  58. };
  59. return (_ctx, _cache) => {
  60. return {
  61. a: common_vendor.t(form.value.type || "请选择类型"),
  62. b: common_vendor.o(typeChange),
  63. c: _ctx.index,
  64. d: typeList.value,
  65. e: common_vendor.t(form.value.number || "请选择人数"),
  66. f: common_vendor.o(numberChange),
  67. g: _ctx.index,
  68. h: numberList.value,
  69. i: form.value.name,
  70. j: common_vendor.t(form.value.date || "请选择日期"),
  71. k: common_vendor.o(dateChange),
  72. l: _ctx.index,
  73. m: common_vendor.t(form.value.time || "请选择时间"),
  74. n: common_vendor.o(timeChange),
  75. o: _ctx.index,
  76. p: common_vendor.t(form.value.duration || "请选择时长"),
  77. q: common_vendor.o(durationChange),
  78. r: _ctx.index,
  79. s: durationList.value,
  80. t: form.value.address,
  81. v: form.value.color,
  82. w: form.value.money,
  83. x: form.value.address,
  84. y: form.value.address,
  85. z: form.value.address,
  86. A: form.value.address,
  87. B: form.value.address,
  88. C: form.value.address,
  89. D: form.value.title,
  90. E: form.value.brief,
  91. F: common_vendor.o(formSubmit)
  92. };
  93. };
  94. }
  95. });
  96. const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-b4c340fa"], ["__file", "D:/project/足球比赛/match_applet/pagesHome/create/components/activity.vue"]]);
  97. wx.createComponent(Component);