123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196 |
- "use strict";
- const common_vendor = require("../../common/vendor.js");
- if (!Array) {
- const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons");
- const _easycom_uni_popup2 = common_vendor.resolveComponent("uni-popup");
- (_easycom_uni_icons2 + _easycom_uni_popup2)();
- }
- const _easycom_uni_icons = () => "../../uni_modules/uni-icons/components/uni-icons/uni-icons.js";
- const _easycom_uni_popup = () => "../../uni_modules/uni-popup/components/uni-popup/uni-popup.js";
- if (!Math) {
- (_easycom_uni_icons + _easycom_uni_popup)();
- }
- const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
- __name: "person",
- setup(__props) {
- var _a, _b;
- const $api = (_a = common_vendor.getCurrentInstance()) == null ? void 0 : _a.appContext.config.globalProperties.$api;
- const $config = (_b = common_vendor.getCurrentInstance()) == null ? void 0 : _b.appContext.config.globalProperties.$config;
- const config = common_vendor.ref({ logoUrl: "" });
- const show = common_vendor.ref(false);
- const id = common_vendor.ref("");
- const sortList = common_vendor.ref([
- { name: "A-Z", type: "0", sort: -1, color1: "#121212", color2: "#999999" },
- { name: "位置", type: "1", sort: 1, color1: "#121212", color2: "#121212" },
- { name: "职位", type: "2", sort: 1, color1: "#121212", color2: "#121212" },
- { name: "号码", type: "3", sort: 1, color1: "#121212", color2: "#121212" }
- ]);
- const list = common_vendor.ref([{ id: 1, phone: "1234567890" }, { id: 1, name: "肝帝集团队" }]);
- common_vendor.ref(0);
- common_vendor.ref(6);
- common_vendor.ref(0);
- const total = common_vendor.ref(0);
- const popup = common_vendor.ref(null);
- const form = common_vendor.ref({});
- const user = common_vendor.ref({});
- const teamInfo = common_vendor.ref({});
- common_vendor.onLoad(async (options) => {
- id.value = options && options.id;
- await searchUser();
- await searchConfig();
- await search();
- await searchShare();
- });
- const searchUser = async () => {
- user.value = common_vendor.index.getStorageSync("user");
- };
- const searchConfig = async () => {
- config.value = common_vendor.index.getStorageSync("config");
- };
- const search = async () => {
- if (id.value) {
- common_vendor.index.setNavigationBarTitle({
- title: `球队阵容(${total.value})`
- });
- const res = await $api(`team/${id.value}`, "GET", {});
- if (res.code === 200) {
- if (res.data)
- teamInfo.value = res.data;
- } else {
- common_vendor.index.showToast({
- title: res.msg || "",
- icon: "error"
- });
- }
- }
- };
- const toInfo = async (item) => {
- common_vendor.index.navigateTo({
- url: `/pagesHome/share/index?id=${id.value}`
- });
- };
- const toSort = async (item) => {
- let list2;
- if (item.sort === -1) {
- list2 = sortList.value.map((i) => {
- if (i.type === item.type) {
- i.sort = 1;
- i.color1 = "#999999";
- i.color2 = "#121212";
- } else {
- i.color1 = "#121212";
- i.color2 = "#121212";
- }
- return i;
- });
- } else {
- list2 = sortList.value.map((i) => {
- if (i.type === item.type) {
- i.sort = -1;
- i.color1 = "#121212";
- i.color2 = "#999999";
- } else {
- i.color1 = "#121212";
- i.color2 = "#121212";
- }
- return i;
- });
- }
- sortList.value = list2;
- };
- const searchShare = () => {
- $config.share = {
- title: `${user.value.name || "暂无名称"}邀请你加入${teamInfo.value.name || "暂无团队"}`,
- path: `/pagesHome/share/index?id=${id.value}`
- //后面是路径上要传递的参数
- };
- };
- const toCreate = () => {
- popup.value.open();
- };
- const toClose = () => {
- popup.value.close();
- };
- const toAdd = (e) => {
- console.log(e.deatil.value);
- };
- const change = (e) => {
- show.value = e.show;
- };
- return (_ctx, _cache) => {
- return {
- a: "overflow:" + (show.value ? "hidden" : "visible"),
- b: common_vendor.f(sortList.value, (item, index, i0) => {
- return {
- a: common_vendor.t(item.name),
- b: "fdda92d4-0-" + i0,
- c: common_vendor.p({
- ["custom-prefix"]: "iconfont",
- type: "icon-shangjiantou",
- size: "10",
- color: item.color1
- }),
- d: "fdda92d4-1-" + i0,
- e: common_vendor.p({
- ["custom-prefix"]: "iconfont",
- type: "icon-xiajiantou",
- size: "10",
- color: item.color2
- }),
- f: index,
- g: common_vendor.o(($event) => toSort(item), index)
- };
- }),
- c: common_vendor.p({
- ["custom-prefix"]: "iconfont",
- type: "icon-yaoqinghuida",
- size: "20",
- color: "#121212"
- }),
- d: common_vendor.f(list.value, (item, index, i0) => {
- return {
- a: common_vendor.t(item.type || ""),
- b: item.icon || config.value.logoUrl,
- c: common_vendor.t(item.name || item.phone),
- d: "fdda92d4-3-" + i0,
- e: index,
- f: common_vendor.o(($event) => toInfo(), index)
- };
- }),
- e: common_vendor.p({
- ["custom-prefix"]: "iconfont",
- type: "icon-31dianhua",
- size: "25",
- color: "#20B2AA"
- }),
- f: common_vendor.p({
- ["custom-prefix"]: "iconfont",
- type: "icon-yaoqinghuida",
- size: "25",
- color: "#121212"
- }),
- g: common_vendor.o(toCreate),
- h: common_vendor.o(toClose),
- i: common_vendor.p({
- type: "closeempty",
- size: "18",
- color: "#999999"
- }),
- j: form.value.phone,
- k: form.value.name,
- l: form.value.num,
- m: common_vendor.o(toAdd),
- n: common_vendor.sr(popup, "fdda92d4-5", {
- "k": "popup"
- }),
- o: common_vendor.o(change),
- p: common_vendor.p({
- ["background-color"]: "rgba(0,0,0,0)",
- type: "center"
- })
- };
- };
- }
- });
- const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-fdda92d4"], ["__file", "D:/project/足球比赛/match_applet/pagesHome/team/person.vue"]]);
- wx.createPage(MiniProgramPage);
|