person.js 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. "use strict";
  2. const common_vendor = require("../../common/vendor.js");
  3. if (!Array) {
  4. const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons");
  5. const _easycom_uni_popup2 = common_vendor.resolveComponent("uni-popup");
  6. (_easycom_uni_icons2 + _easycom_uni_popup2)();
  7. }
  8. const _easycom_uni_icons = () => "../../uni_modules/uni-icons/components/uni-icons/uni-icons.js";
  9. const _easycom_uni_popup = () => "../../uni_modules/uni-popup/components/uni-popup/uni-popup.js";
  10. if (!Math) {
  11. (_easycom_uni_icons + _easycom_uni_popup)();
  12. }
  13. const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
  14. __name: "person",
  15. setup(__props) {
  16. var _a;
  17. (_a = common_vendor.getCurrentInstance()) == null ? void 0 : _a.appContext.config.globalProperties.$api;
  18. const config = common_vendor.ref({ logoUrl: "" });
  19. const show = common_vendor.ref(false);
  20. const id = common_vendor.ref("");
  21. const sortList = common_vendor.ref([
  22. { name: "A-Z", type: "0", sort: -1, color1: "#121212", color2: "#999999" },
  23. { name: "位置", type: "1", sort: 1, color1: "#121212", color2: "#121212" },
  24. { name: "职位", type: "2", sort: 1, color1: "#121212", color2: "#121212" },
  25. { name: "号码", type: "3", sort: 1, color1: "#121212", color2: "#121212" }
  26. ]);
  27. const list = common_vendor.ref([{ id: 1, phone: "1234567890" }, { id: 1, name: "肝帝集团队" }]);
  28. common_vendor.ref(0);
  29. common_vendor.ref(6);
  30. common_vendor.ref(0);
  31. const total = common_vendor.ref(0);
  32. const popup = common_vendor.ref(null);
  33. const form = common_vendor.ref({});
  34. common_vendor.onLoad(async (options) => {
  35. id.value = options && options.id;
  36. await searchConfig();
  37. await search();
  38. });
  39. const searchConfig = async () => {
  40. config.value = common_vendor.index.getStorageSync("config");
  41. };
  42. const search = async () => {
  43. if (id.value) {
  44. common_vendor.index.setNavigationBarTitle({
  45. title: `球队阵容(${total.value})`
  46. });
  47. }
  48. };
  49. const toInfo = async (item) => {
  50. common_vendor.index.navigateTo({
  51. url: `/pagesHome/person/index?id=${item._id || item.id}`
  52. });
  53. };
  54. const toSort = async (item) => {
  55. let list2;
  56. if (item.sort === -1) {
  57. list2 = sortList.value.map((i) => {
  58. if (i.type === item.type) {
  59. i.sort = 1;
  60. i.color1 = "#999999";
  61. i.color2 = "#121212";
  62. } else {
  63. i.color1 = "#121212";
  64. i.color2 = "#121212";
  65. }
  66. return i;
  67. });
  68. } else {
  69. list2 = sortList.value.map((i) => {
  70. if (i.type === item.type) {
  71. i.sort = -1;
  72. i.color1 = "#121212";
  73. i.color2 = "#999999";
  74. } else {
  75. i.color1 = "#121212";
  76. i.color2 = "#121212";
  77. }
  78. return i;
  79. });
  80. }
  81. sortList.value = list2;
  82. };
  83. const toCreate = () => {
  84. popup.value.open();
  85. };
  86. const toClose = () => {
  87. popup.value.close();
  88. };
  89. const toAdd = (e) => {
  90. console.log(e.deatil.value);
  91. };
  92. const change = (e) => {
  93. show.value = e.show;
  94. };
  95. return (_ctx, _cache) => {
  96. return {
  97. a: "overflow:" + (show.value ? "hidden" : "visible"),
  98. b: common_vendor.f(sortList.value, (item, index, i0) => {
  99. return {
  100. a: common_vendor.t(item.name),
  101. b: "fdda92d4-0-" + i0,
  102. c: common_vendor.p({
  103. ["custom-prefix"]: "iconfont",
  104. type: "icon-shangjiantou",
  105. size: "10",
  106. color: item.color1
  107. }),
  108. d: "fdda92d4-1-" + i0,
  109. e: common_vendor.p({
  110. ["custom-prefix"]: "iconfont",
  111. type: "icon-xiajiantou",
  112. size: "10",
  113. color: item.color2
  114. }),
  115. f: index,
  116. g: common_vendor.o(($event) => toSort(item), index)
  117. };
  118. }),
  119. c: common_vendor.p({
  120. ["custom-prefix"]: "iconfont",
  121. type: "icon-yaoqinghuida",
  122. size: "25",
  123. color: "#121212"
  124. }),
  125. d: common_vendor.f(list.value, (item, index, i0) => {
  126. return {
  127. a: common_vendor.t(item.type || ""),
  128. b: item.icon || config.value.logoUrl,
  129. c: common_vendor.t(item.name || item.phone),
  130. d: "fdda92d4-3-" + i0,
  131. e: index,
  132. f: common_vendor.o(($event) => toInfo(item), index)
  133. };
  134. }),
  135. e: common_vendor.p({
  136. ["custom-prefix"]: "iconfont",
  137. type: "icon-31dianhua",
  138. size: "25",
  139. color: "#20B2AA"
  140. }),
  141. f: common_vendor.p({
  142. ["custom-prefix"]: "iconfont",
  143. type: "icon-yaoqinghuida",
  144. size: "25",
  145. color: "#121212"
  146. }),
  147. g: common_vendor.o(toCreate),
  148. h: common_vendor.o(toClose),
  149. i: common_vendor.p({
  150. type: "closeempty",
  151. size: "18",
  152. color: "#999999"
  153. }),
  154. j: form.value.phone,
  155. k: form.value.name,
  156. l: form.value.num,
  157. m: common_vendor.o(toAdd),
  158. n: common_vendor.sr(popup, "fdda92d4-5", {
  159. "k": "popup"
  160. }),
  161. o: common_vendor.o(change),
  162. p: common_vendor.p({
  163. ["background-color"]: "rgba(0,0,0,0)",
  164. type: "center"
  165. })
  166. };
  167. };
  168. }
  169. });
  170. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-fdda92d4"], ["__file", "D:/project/足球比赛/match_applet/pagesHome/team/person.vue"]]);
  171. wx.createPage(MiniProgramPage);