"use strict"; const common_vendor = require("../../../common/vendor.js"); if (!Array) { const _easycom_uni_datetime_picker2 = common_vendor.resolveComponent("uni-datetime-picker"); const _easycom_uni_file_picker2 = common_vendor.resolveComponent("uni-file-picker"); (_easycom_uni_datetime_picker2 + _easycom_uni_file_picker2)(); } const _easycom_uni_datetime_picker = () => "../../../uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.js"; const _easycom_uni_file_picker = () => "../../../uni_modules/uni-file-picker/components/uni-file-picker/uni-file-picker.js"; if (!Math) { (_easycom_uni_datetime_picker + _easycom_uni_file_picker)(); } const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({ __name: "match", props: { typeList: { type: Array, default: () => [] }, numberList: { type: Array, default: () => [] }, openList: { type: Array, default: () => [] }, durationList: { type: Array, default: () => [] } }, setup(__props) { var _a, _b; const props = __props; (_a = common_vendor.getCurrentInstance()) == null ? void 0 : _a.appContext.config.globalProperties.$api; const $apifile = (_b = common_vendor.getCurrentInstance()) == null ? void 0 : _b.appContext.config.globalProperties.$apifile; const form = common_vendor.ref({ file: [] }); const opponent_name = common_vendor.ref(""); common_vendor.ref({ width: 64, height: 64, border: { color: "#ff5a5f", width: 2, style: "dashed", radius: "2px" } }); const { typeList, durationList, numberList, openList } = common_vendor.toRefs(props); common_vendor.onShow(() => { common_vendor.index.$on("opponentInfo", function(item) { form.value.opponent = item.id; opponent_name.value = item.name; }); }); const typeChange = (e) => { const data = typeList.value[e.detail.value]; if (data) form.value.type = data.dictLabel; }; const numberChange = (e) => { const data = numberList.value[e.detail.value]; if (data) form.value.number = data.dictLabel; }; const dateChange = (e) => { form.value.date = e.detail.value; }; const timeChange = (e) => { form.value.time = e.detail.value; }; const durationChange = (e) => { const data = durationList.value[e.detail.value]; if (data) form.value.duration = data.dictLabel; }; const openChange = (e) => { form.value.is_open = e.detail.value; }; const toLocaltion = (e) => { common_vendor.index.chooseLocation({ success: function(res) { searchAddress(res); } }); }; const searchAddress = (e) => { form.value.address = e.address; }; const toUpload = async (e) => { const arr = await $apifile( `/common/upload`, "file", e.tempFilePaths[0], "file" ); if (arr.code == 200) { form.value.file.push({ newFileName: arr.newFileName, originalFilename: arr.originalFilename, url: arr.url }); console.log(form.value.file); } else { common_vendor.index.showToast({ title: arr.msg, icon: "none" }); } }; const toDelete = async (e) => { form.value.file = form.value.file.filter((i) => i.originalFilename != e.tempFile.name); console.log(form.value.file); }; const toOpponent = () => { common_vendor.index.navigateTo({ url: `/pagesHome/create/person` }); }; return (_ctx, _cache) => { return common_vendor.e({ a: common_vendor.t(form.value.type || "请选择类型"), b: common_vendor.o(typeChange), c: _ctx.index, d: common_vendor.unref(typeList), e: common_vendor.t(form.value.number || "请选择人数"), f: common_vendor.o(numberChange), g: _ctx.index, h: common_vendor.unref(numberList), i: form.value.opponent }, form.value.opponent ? { j: common_vendor.t(opponent_name.value) } : {}, { k: common_vendor.o(toOpponent), l: common_vendor.t(form.value.date || "请选择日期"), m: common_vendor.o(dateChange), n: _ctx.index, o: common_vendor.t(form.value.time || "请选择时间"), p: common_vendor.o(timeChange), q: _ctx.index, r: common_vendor.t(form.value.duration || "请选择时长"), s: common_vendor.o(durationChange), t: _ctx.index, v: common_vendor.unref(durationList), w: form.value.address }, form.value.address ? { x: common_vendor.t(form.value.address) } : {}, { y: common_vendor.o(toLocaltion), z: form.value.color, A: form.value.money, B: form.value.max_person, C: common_vendor.t(form.value.is_open || "请选择"), D: common_vendor.o(openChange), E: _ctx.index, F: common_vendor.unref(openList), G: form.value.date && form.value.time }, form.value.date && form.value.time ? { H: common_vendor.o(($event) => form.value.end_time = $event), I: common_vendor.p({ start: form.value.date, border: false, modelValue: form.value.end_time }) } : {}, { J: form.value.title, K: form.value.brief, L: common_vendor.o(toUpload), M: common_vendor.o(toDelete), N: common_vendor.o(($event) => form.value.file = $event), O: common_vendor.p({ fileMediatype: "image", ["list-styles"]: _ctx.imageStyles, limit: "6", title: "最多选择6张图片", modelValue: form.value.file }), P: common_vendor.o( //@ts-ignore (...args) => _ctx.formSubmit && _ctx.formSubmit(...args) ) }); }; } }); const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-6bad03e0"], ["__file", "D:/project/足球比赛/match_applet/pagesHome/create/components/match.vue"]]); wx.createComponent(Component);