activity.js 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. common_vendor.onShow(async () => {
  16. await searchOther();
  17. await search();
  18. });
  19. const searchOther = async () => {
  20. let res;
  21. res = await $api(`dict/data/list`, "GET", { dictType: "sys_user_type" });
  22. if (res.code === 200 && res.total > 0)
  23. typeList.value = res.rows;
  24. };
  25. const search = async () => {
  26. };
  27. const typeChange = (e) => {
  28. const data = typeList.value[e.detail.value];
  29. if (data)
  30. form.value.type = data.dictLabel;
  31. };
  32. const dateChange = (e) => {
  33. form.value.date = e.detail.value;
  34. };
  35. const formSubmit = (e) => {
  36. console.log(e.deatil.value);
  37. };
  38. return (_ctx, _cache) => {
  39. return {
  40. a: form.value.name,
  41. b: common_vendor.t(form.value.type || "请选择类型"),
  42. c: common_vendor.o(typeChange),
  43. d: _ctx.index,
  44. e: typeList.value,
  45. f: common_vendor.t(form.value.date || "请选择成立时间"),
  46. g: common_vendor.o(dateChange),
  47. h: _ctx.index,
  48. i: common_vendor.t(form.value.date || "请选择成立时间"),
  49. j: common_vendor.o(dateChange),
  50. k: _ctx.index,
  51. l: common_vendor.t(form.value.date || "请选择成立时间"),
  52. m: common_vendor.o(dateChange),
  53. n: _ctx.index,
  54. o: common_vendor.t(form.value.date || "请选择成立时间"),
  55. p: common_vendor.o(dateChange),
  56. q: _ctx.index,
  57. r: form.value.color,
  58. s: form.value.brief,
  59. t: common_vendor.o(formSubmit)
  60. };
  61. };
  62. }
  63. });
  64. const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-b4c340fa"], ["__file", "D:/project/足球比赛/match_applet/pagesHome/create/components/activity.vue"]]);
  65. wx.createComponent(Component);