123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- "use strict";
- const common_vendor = require("../../common/vendor.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;
- common_vendor.computed(() => {
- return common_vendor.index.getStorageSync("openid");
- });
- const id = common_vendor.ref("");
- const form = common_vendor.ref({ icon: "" });
- const typeList = common_vendor.ref([]);
- common_vendor.onLoad(async (options) => {
- id.value = options && options.id;
- await searchOther();
- await search();
- });
- common_vendor.onShow(() => {
- common_vendor.index.$on("setCity", function(city) {
- form.value.city = city;
- });
- });
- const searchOther = async () => {
- let res;
- res = await $api(`dict/data/list`, "GET", { dictType: "sys_user_type" });
- if (res.code === 200 && res.total > 0)
- typeList.value = res.rows;
- };
- const search = async () => {
- };
- const typeChange = (e) => {
- const data = typeList.value[e.detail.value];
- if (data)
- form.value.type = data.dictLabel;
- };
- const dateChange = (e) => {
- form.value.date = e.detail.value;
- };
- const toCity = () => {
- if (form.value.city) {
- common_vendor.index.navigateTo({
- url: `/pagesHome/city/index?city=${form.value.city}`
- });
- } else {
- common_vendor.index.navigateTo({
- url: `/pagesHome/city/index`
- });
- }
- };
- 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.logo = arr.url;
- } else {
- common_vendor.index.showToast({
- title: arr.msg,
- icon: "none"
- });
- }
- }
- });
- };
- return (_ctx, _cache) => {
- return common_vendor.e({
- a: form.value.logo || "/static/qiudui.png",
- b: common_vendor.o(Preview),
- c: form.value.name,
- d: common_vendor.t(form.value.type || "请选择类型"),
- e: common_vendor.o(typeChange),
- f: _ctx.index,
- g: typeList.value,
- h: form.value.city
- }, form.value.city ? {
- i: common_vendor.t(form.value.city)
- } : {}, {
- j: common_vendor.o(toCity),
- k: common_vendor.t(form.value.date || "请选择成立时间"),
- l: common_vendor.o(dateChange),
- m: _ctx.index,
- n: form.value.color,
- o: form.value.brief,
- p: common_vendor.o(
- //@ts-ignore
- (...args) => _ctx.formSubmit && _ctx.formSubmit(...args)
- )
- });
- };
- }
- });
- const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-01c8185c"], ["__file", "D:/project/足球比赛/match_applet/pagesHome/team/index.vue"]]);
- wx.createPage(MiniProgramPage);
|