person.js 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  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. console.log(item);
  51. };
  52. const toSort = async (item) => {
  53. let list2;
  54. if (item.sort === -1) {
  55. list2 = sortList.value.map((i) => {
  56. if (i.type === item.type) {
  57. i.sort = 1;
  58. i.color1 = "#999999";
  59. i.color2 = "#121212";
  60. } else {
  61. i.color1 = "#121212";
  62. i.color2 = "#121212";
  63. }
  64. return i;
  65. });
  66. } else {
  67. list2 = sortList.value.map((i) => {
  68. if (i.type === item.type) {
  69. i.sort = -1;
  70. i.color1 = "#121212";
  71. i.color2 = "#999999";
  72. } else {
  73. i.color1 = "#121212";
  74. i.color2 = "#121212";
  75. }
  76. return i;
  77. });
  78. }
  79. sortList.value = list2;
  80. };
  81. const toCreate = () => {
  82. popup.value.open();
  83. };
  84. const toClose = () => {
  85. popup.value.close();
  86. };
  87. const toAdd = (data) => {
  88. console.log(data);
  89. };
  90. const change = (e) => {
  91. show.value = e.show;
  92. };
  93. return (_ctx, _cache) => {
  94. return {
  95. a: "overflow:" + (show.value ? "hidden" : "visible"),
  96. b: common_vendor.f(sortList.value, (item, index, i0) => {
  97. return {
  98. a: common_vendor.t(item.name),
  99. b: "fdda92d4-0-" + i0,
  100. c: common_vendor.p({
  101. ["custom-prefix"]: "iconfont",
  102. type: "icon-shangjiantou",
  103. size: "10",
  104. color: item.color1
  105. }),
  106. d: "fdda92d4-1-" + i0,
  107. e: common_vendor.p({
  108. ["custom-prefix"]: "iconfont",
  109. type: "icon-xiajiantou",
  110. size: "10",
  111. color: item.color2
  112. }),
  113. f: index,
  114. g: common_vendor.o(($event) => toSort(item), index)
  115. };
  116. }),
  117. c: common_vendor.p({
  118. ["custom-prefix"]: "iconfont",
  119. type: "icon-yaoqinghuida",
  120. size: "25",
  121. color: "#121212"
  122. }),
  123. d: common_vendor.f(list.value, (item, index, i0) => {
  124. return {
  125. a: common_vendor.t(item.type || ""),
  126. b: item.icon || config.value.logoUrl,
  127. c: common_vendor.t(item.name || item.phone),
  128. d: "fdda92d4-3-" + i0,
  129. e: index,
  130. f: common_vendor.o(($event) => toInfo(item), index)
  131. };
  132. }),
  133. e: common_vendor.p({
  134. ["custom-prefix"]: "iconfont",
  135. type: "icon-31dianhua",
  136. size: "25",
  137. color: "#20B2AA"
  138. }),
  139. f: common_vendor.p({
  140. ["custom-prefix"]: "iconfont",
  141. type: "icon-yaoqinghuida",
  142. size: "25",
  143. color: "#121212"
  144. }),
  145. g: common_vendor.o(toCreate),
  146. h: common_vendor.o(toClose),
  147. i: common_vendor.p({
  148. type: "closeempty",
  149. size: "18",
  150. color: "#999999"
  151. }),
  152. j: form.value.phone,
  153. k: form.value.name,
  154. l: form.value.num,
  155. m: common_vendor.o(toAdd),
  156. n: common_vendor.sr(popup, "fdda92d4-5", {
  157. "k": "popup"
  158. }),
  159. o: common_vendor.o(change),
  160. p: common_vendor.p({
  161. ["background-color"]: "rgba(0,0,0,0)",
  162. type: "center"
  163. })
  164. };
  165. };
  166. }
  167. });
  168. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-fdda92d4"], ["__file", "D:/project/足球比赛/match_applet/pagesHome/team/person.vue"]]);
  169. wx.createPage(MiniProgramPage);