"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, _b, _c; const $api = (_a = common_vendor.getCurrentInstance()) == null ? void 0 : _a.appContext.config.globalProperties.$api; (_b = common_vendor.getCurrentInstance()) == null ? void 0 : _b.appContext.config.globalProperties.$config; const $apifile = (_c = common_vendor.getCurrentInstance()) == null ? void 0 : _c.appContext.config.globalProperties.$apifile; 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; }; const Preview = () => { common_vendor.index.chooseImage({ count: 1, sizeType: ["original", "compressed"], sourceType: ["album", "camera"], success: async function(res) { let tempFile = JSON.parse(JSON.stringify(res.tempFilePaths)); const arr = await $apifile( `/common/upload`, "file", tempFile[0], "file" ); if (arr.code == 200) { form.value.icon = arr.url; } else { common_vendor.index.showToast({ title: arr.msg, icon: "none" }); } } }); }; return (_ctx, _cache) => { return { a: form.value.icon || config.value.logoUrl, b: common_vendor.o(Preview), c: form.value.name, d: form.value.nickname, e: common_vendor.t(form.value.sex || "请选择性别"), f: common_vendor.o(sexChange), g: _ctx.index, h: sexList.value, i: form.value.phone, j: common_vendor.o(onSelected), k: common_vendor.p({ showSheetView: showSheetView.value, defaultIndexs: [0, 0, 0] }), l: form.value.height, m: form.value.weight, n: common_vendor.t(form.value.type || "请选择主要项目"), o: common_vendor.o(typeChange), p: _ctx.index, q: typeList.value, r: form.value.ballYears, s: common_vendor.t(form.value.place || "请选择队内位置"), t: common_vendor.o(placeChange), v: _ctx.index, w: placeList.value, x: 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);