123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176 |
- "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);
|