123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175 |
- "use strict";
- const common_vendor = require("../../common/vendor.js");
- if (!Array) {
- const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons");
- const _easycom_uni_segmented_control2 = common_vendor.resolveComponent("uni-segmented-control");
- const _easycom_uni_popup2 = common_vendor.resolveComponent("uni-popup");
- const _easycom_uni_fab2 = common_vendor.resolveComponent("uni-fab");
- (_easycom_uni_icons2 + _easycom_uni_segmented_control2 + _easycom_uni_popup2 + _easycom_uni_fab2)();
- }
- const _easycom_uni_icons = () => "../../uni_modules/uni-icons/components/uni-icons/uni-icons.js";
- const _easycom_uni_segmented_control = () => "../../uni_modules/uni-segmented-control/components/uni-segmented-control/uni-segmented-control.js";
- const _easycom_uni_popup = () => "../../uni_modules/uni-popup/components/uni-popup/uni-popup.js";
- const _easycom_uni_fab = () => "../../uni_modules/uni-fab/components/uni-fab/uni-fab.js";
- if (!Math) {
- (_easycom_uni_icons + _easycom_uni_segmented_control + team + activity + game + _easycom_uni_popup + _easycom_uni_fab)();
- }
- const activity = () => "./components/activity.js";
- const game = () => "./components/game.js";
- const team = () => "./components/team.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({});
- const user = common_vendor.ref({});
- const show = common_vendor.ref(false);
- const menuList = common_vendor.ref([
- { name: "球队", num: "5", icon: "icon-qi", color: "#1E90FF" },
- { name: "|" },
- { name: "出勤", num: "16%", icon: "icon-kaoqinchuqin", color: "#FF4500" },
- { name: "|" },
- { name: "进球", num: "1", icon: "icon-zuqiu", color: "#FFFFFF" }
- ]);
- const list = common_vendor.ref(["球队", "活动", "赛事"]);
- const current = common_vendor.ref(0);
- const pattern = common_vendor.ref({
- color: "#3c3e49",
- backgroundColor: "#fff",
- selectedColor: "#fff",
- buttonColor: "#fff",
- iconColor: "#3c3e49"
- });
- const content = common_vendor.ref([
- {
- iconPath: "/static/qiudui.png",
- text: "建球队",
- route: "/pagesHome/team/index"
- },
- {
- iconPath: "/static/saishi.png",
- text: "建赛事",
- route: "/pagesHome/match/index"
- }
- ]);
- const popup = common_vendor.ref(null);
- common_vendor.onShow(() => {
- common_vendor.index.hideHomeButton();
- search();
- searchConfig();
- });
- common_vendor.onPullDownRefresh(() => {
- common_vendor.index.stopPullDownRefresh();
- });
- 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
- popup.value.open();
- } else {
- common_vendor.index.showToast({
- title: res.msg || "",
- icon: "error"
- });
- }
- };
- const searchConfig = async () => {
- config.value = common_vendor.index.getStorageSync("config");
- };
- const change = (e) => {
- show.value = e.show;
- };
- const toBasic = () => {
- common_vendor.index.navigateTo({
- url: `/pagesMy/basic/index`
- });
- };
- const toLogin = () => {
- common_vendor.index.navigateTo({
- url: `/pages/login/index`
- });
- };
- const onClickItem = (e) => {
- if (current.value !== e.currentIndex)
- current.value = e.currentIndex;
- };
- const trigger = (e) => {
- common_vendor.index.navigateTo({
- url: e.item.route
- });
- };
- const toClose = () => {
- popup.value.close();
- };
- return (_ctx, _cache) => {
- return {
- a: "overflow:" + (show.value ? "hidden" : "visible"),
- b: user.value.icon || config.value.logoUrl,
- c: common_vendor.t(user.value.nickname || "体验账号"),
- d: common_vendor.p({
- type: "forward",
- size: "20",
- color: "#ffffff"
- }),
- e: common_vendor.o(toBasic),
- f: common_vendor.f(menuList.value, (item, index, i0) => {
- return {
- a: "4978fed5-1-" + i0,
- b: common_vendor.p({
- ["custom-prefix"]: "iconfont",
- type: item.icon,
- size: "18",
- color: item.color
- }),
- c: common_vendor.t(item.name),
- d: common_vendor.t(item.num),
- e: index,
- f: common_vendor.o(($event) => _ctx.toInfo(item), index)
- };
- }),
- g: common_vendor.o(onClickItem),
- h: common_vendor.p({
- current: current.value,
- values: list.value,
- styleType: "text",
- activeColor: "#dd524d"
- }),
- i: current.value === 0,
- j: current.value === 1,
- k: current.value === 2,
- l: common_vendor.o(toClose),
- m: common_vendor.p({
- type: "closeempty",
- size: "18",
- color: "#999999"
- }),
- n: common_vendor.o(toLogin),
- o: common_vendor.sr(popup, "4978fed5-6", {
- "k": "popup"
- }),
- p: common_vendor.o(change),
- q: common_vendor.p({
- ["background-color"]: "#fff",
- type: "bottom"
- }),
- r: common_vendor.o(trigger),
- s: common_vendor.p({
- pattern: pattern.value,
- content: content.value,
- horizontal: "right",
- direction: "vertical"
- })
- };
- };
- }
- });
- const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-4978fed5"], ["__file", "D:/project/足球比赛/match_applet/pages/home/index.vue"]]);
- wx.createPage(MiniProgramPage);
|