"use strict"; const common_vendor = require("../../common/vendor.js"); if (!Math) { cityPicker(); } const cityPicker = () => "../../components/cityPicker.js"; const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({ __name: "index", setup(__props) { var _a; const $api = (_a = common_vendor.getCurrentInstance()) == null ? void 0 : _a.appContext.config.globalProperties.$api; const openid = common_vendor.computed(() => { return common_vendor.index.getStorageSync("openid"); }); const config = common_vendor.ref({ logoUrl: "" }); const form = common_vendor.ref({ icon: "" }); const showSheetView = common_vendor.ref(true); const sexList = common_vendor.ref([]); const typeList = common_vendor.ref([]); const placeList = common_vendor.ref([]); common_vendor.onLoad(async () => { await searchOther(); await searchConfig(); await search(); }); const searchOther = async () => { let res; res = await $api(`dict/data/list`, "GET", { dictType: "sys_user_sex" }); if (res.code === 200 && res.total > 0) sexList.value = res.rows; res = await $api(`dict/data/list`, "GET", { dictType: "sys_user_type" }); if (res.code === 200 && res.total > 0) typeList.value = res.rows; res = await $api(`dict/data/list`, "GET", { dictType: "sys_user_place" }); if (res.code === 200 && res.total > 0) placeList.value = res.rows; }; const searchConfig = async () => { config.value = common_vendor.index.getStorageSync("config"); }; const search = async () => { const res = await $api(`matchUser/find`, "GET", { openid: openid.value }); if (res.code === 200) { if (res.data) console.log(res.data); else { common_vendor.index.navigateTo({ url: `/pages/login/index` }); } } else { common_vendor.index.showToast({ title: res.msg || "", icon: "error" }); } }; const onSelected = (row) => { console.log(row, "1"); showSheetView.value = false; }; const sexChange = (e) => { const data = sexList.value[e.detail.value]; if (data) form.value.sex = data.dictLabel; }; const typeChange = (e) => { const data = typeList.value[e.detail.value]; if (data) form.value.type = data.dictLabel; }; const placeChange = (e) => { const data = placeList.value[e.detail.value]; if (data) form.value.place = data.dictLabel; }; return (_ctx, _cache) => { return { a: form.value.icon || config.value.logoUrl, b: form.value.name, c: form.value.nickname, d: common_vendor.t(form.value.sex || "请选择性别"), e: common_vendor.o(sexChange), f: _ctx.index, g: sexList.value, h: form.value.phone, i: common_vendor.o(onSelected), j: common_vendor.p({ showSheetView: showSheetView.value, defaultIndexs: [0, 0, 0] }), k: form.value.height, l: form.value.weight, m: common_vendor.t(form.value.type || "请选择主要项目"), n: common_vendor.o(typeChange), o: _ctx.index, p: typeList.value, q: form.value.ballYears, r: common_vendor.t(form.value.place || "请选择队内位置"), s: common_vendor.o(placeChange), t: _ctx.index, v: placeList.value, w: common_vendor.o( //@ts-ignore (...args) => _ctx.formSubmit && _ctx.formSubmit(...args) ) }; }; } }); const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-bf1a7b85"], ["__file", "D:/project/足球比赛/match_applet/pagesMy/basic/index.vue"]]); wx.createPage(MiniProgramPage);