index.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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 openid = common_vendor.computed(() => {
  9. return common_vendor.index.getStorageSync("openid");
  10. });
  11. const config = common_vendor.ref({});
  12. common_vendor.onShow(() => {
  13. common_vendor.index.hideHomeButton();
  14. });
  15. const initUser = async () => {
  16. const res = await $api(`/system/matchUser/find`, "GET", {
  17. openid: openid.value
  18. });
  19. if (res.code === 200) {
  20. if (res.data)
  21. console.log(res.data);
  22. } else {
  23. common_vendor.index.showToast({
  24. title: res.msg || "",
  25. icon: "error"
  26. });
  27. }
  28. };
  29. const searchConfig = async () => {
  30. config.value = common_vendor.index.getStorageSync("config");
  31. };
  32. initUser();
  33. searchConfig();
  34. return (_ctx, _cache) => {
  35. return {};
  36. };
  37. }
  38. });
  39. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-4978fed5"], ["__file", "D:/project/足球比赛/match_applet/pages/home/index.vue"]]);
  40. wx.createPage(MiniProgramPage);