index.js 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. "use strict";
  2. const common_vendor = require("../../common/vendor.js");
  3. const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
  4. __name: "index",
  5. setup(__props) {
  6. var _a;
  7. const $api = (_a = common_vendor.getCurrentInstance()) == null ? void 0 : _a.appContext.config.globalProperties.$api;
  8. const config = common_vendor.ref({ logoUrl: "" });
  9. const id = common_vendor.ref("");
  10. const teamInfo = common_vendor.ref({});
  11. const list = common_vendor.ref([{ title: "球队活动通知 无缝对接微信群助手" }, { title: "球队数据记录 考勤/胜负/进球,记录运动回忆" }, { title: "队费明细管理 缴费收费实时提醒" }, { title: "团队共享相册 高清视频相册共享管理" }]);
  12. const teamList = common_vendor.ref([{ name: "入驻", num: "3年" }, { name: "|" }, { name: "活动", num: "21次" }, { name: "|" }, { name: "队员", num: "6人" }]);
  13. common_vendor.onLoad(async (options) => {
  14. id.value = options && options.id;
  15. await searchConfig();
  16. await search();
  17. });
  18. const searchConfig = async () => {
  19. config.value = common_vendor.index.getStorageSync("config");
  20. };
  21. const search = async () => {
  22. if (id.value) {
  23. const res = await $api(`team/${id.value}`, "GET", {});
  24. if (res.code === 200) {
  25. if (res.data)
  26. teamInfo.value = res.data;
  27. } else {
  28. common_vendor.index.showToast({
  29. title: res.msg || "",
  30. icon: "error"
  31. });
  32. }
  33. }
  34. };
  35. const toAdd = async () => {
  36. console.log("立即加入");
  37. };
  38. return (_ctx, _cache) => {
  39. return {
  40. a: teamInfo.value.logo || "/static/qiudui.png",
  41. b: teamInfo.value.logo || "/static/qiudui.png",
  42. c: common_vendor.t(teamInfo.value.name || "暂无名称"),
  43. d: common_vendor.f(teamList.value, (item, index, i0) => {
  44. return {
  45. a: common_vendor.t(item.num),
  46. b: common_vendor.t(item.name || "暂无"),
  47. c: index
  48. };
  49. }),
  50. e: common_vendor.f(list.value, (item, index, i0) => {
  51. return {
  52. a: common_vendor.t(item.title),
  53. b: index
  54. };
  55. }),
  56. f: common_vendor.o(toAdd)
  57. };
  58. };
  59. }
  60. });
  61. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-167827a6"], ["__file", "D:/project/足球比赛/match_applet/pagesHome/share/index.vue"]]);
  62. wx.createPage(MiniProgramPage);