zs 1 рік тому
батько
коміт
7701834bd9

+ 41 - 20
pages/home/components/activity.vue

@@ -57,9 +57,11 @@
 </template>
 
 <script setup lang="ts">
-	import { ref } from 'vue';
+	import { ref, toRefs, getCurrentInstance } from 'vue';
 	//该依赖已内置不需要单独安装
 	import { onShow } from "@dcloudio/uni-app";
+	// 请求接口
+	const $api = getCurrentInstance()?.appContext.config.globalProperties.$api;
 	interface PropsItem {
 		id ?: number,
 		name ?: string,
@@ -73,37 +75,56 @@
 		status ?: string,
 		status_name ?: string,
 	};
-	// 基本信息
-	const config = ref({ bottomTitle: '', logoUrl: '' });
+	// 用户信息
+	const user = ref({});
 	// 查询
-	const searchInfo = ref({ name: '' });
+	const searchInfo = ref({ });
 	// 列表
 	const list = ref<PropsItem[]>([{ id: 1, name: '测试球队' }, { id: 1, name: '肝帝集团队' }]);
 	// 分页
-	const skip = ref(0);
-	const limit = ref(6);
-	const page = ref(0);
+	const pageNum = ref(1);
+	const pageSize = ref(10);
 	const total = ref(0);
 	// 数据是否触底
 	const scrollTop = ref(0);
 	const is_bottom = ref(false);
-
-	onShow(() => {
-		searchConfig();
-		search();
+	const props = defineProps({
+		config: { type: Object, default: () => { } },
+	});
+	const { config } = toRefs(props);
+	onShow(async () => {
+		await searchUser();
+		await search();
 	})
-	// config信息
-	const searchConfig = async () => {
-		config.value = uni.getStorageSync('config');
+	// 用户信息
+	const searchUser = async () => {
+		user.value = uni.getStorageSync('user');
 	};
 	// 查询列表
 	const search = async () => {
-		console.log('查询');
+		const info = {
+			pageNum: pageNum.value,
+			pageSize: pageSize.value,
+			userId: user.value.id
+		}
+		const res = await $api('activity/list', 'GET', {
+			...info,
+			...searchInfo.value
+		});
+		if (res.code === 200) {
+			list.value = res.rows
+			total.value = res.total
+		} else {
+			uni.showToast({
+				title: res.msg || '',
+				icon: 'error',
+			});
+		}
 	};
 	//查询
 	const toInput = (e : any) => {
 		if (searchInfo.value.name) searchInfo.value.name = e.detail.value
-		searchInfo.value = { name: '' }
+		searchInfo.value = { }
 		clearPage();
 		search();
 	};
@@ -120,8 +141,8 @@
 				title: '加载中',
 				mask: true
 			})
-			page.value = page.value + 1
-			skip.value = page.value * limit.value;
+			pageNum.value = pageNum.value + 1
+			pageSize.value = pageNum.value * 10;
 			search();
 			uni.hideLoading();
 		} else is_bottom.value = true
@@ -135,8 +156,8 @@
 	// 清空数据
 	const clearPage = () => {
 		list.value = []
-		skip.value = 0
-		limit.value = 6
+		pageNum.value = 1
+		pageSize.value = 10
 		page.value = 0
 	};
 </script>

+ 41 - 20
pages/home/components/game.vue

@@ -35,9 +35,11 @@
 </template>
 
 <script setup lang="ts">
-	import { ref } from 'vue';
+	import { ref, toRefs, getCurrentInstance } from 'vue';
 	//该依赖已内置不需要单独安装
 	import { onShow } from "@dcloudio/uni-app";
+	// 请求接口
+	const $api = getCurrentInstance()?.appContext.config.globalProperties.$api;
 	interface PropsItem {
 		id ?: number,
 		name ?: string,
@@ -48,37 +50,56 @@
 		format ?: string,
 		ranking ?: string,
 	};
-	// 基本信息
-	const config = ref({ bottomTitle: '', logoUrl: '' });
+	// 用户信息
+	const user = ref({});
 	// 查询
-	const searchInfo = ref({ name: '' });
+	const searchInfo = ref({});
 	// 列表
 	const list = ref<PropsItem[]>([{ id: 1, name: '肝帝33联赛' }]);
 	// 分页
-	const skip = ref(0);
-	const limit = ref(6);
-	const page = ref(0);
+	const pageNum = ref(1);
+	const pageSize = ref(10);
 	const total = ref(0);
 	// 数据是否触底
 	const scrollTop = ref(0);
 	const is_bottom = ref(false);
-
-	onShow(() => {
-		searchConfig();
-		search();
+	const props = defineProps({
+		config: { type: Object, default: () => { } },
+	});
+	const { config } = toRefs(props);
+	onShow(async () => {
+		await searchUser();
+		await search();
 	})
-	// config信息
-	const searchConfig = async () => {
-		config.value = uni.getStorageSync('config');
+	// 用户信息
+	const searchUser = async () => {
+		user.value = uni.getStorageSync('user');
 	};
 	// 查询列表
 	const search = async () => {
-		console.log('查询');
+		const info = {
+			pageNum: pageNum.value,
+			pageSize: pageSize.value,
+			userId: user.value.id
+		}
+		const res = await $api('game/list', 'GET', {
+			...info,
+			...searchInfo.value
+		});
+		if (res.code === 200) {
+			list.value = res.rows
+			total.value = res.total
+		} else {
+			uni.showToast({
+				title: res.msg || '',
+				icon: 'error',
+			});
+		}
 	};
 	//查询
 	const toInput = (e : any) => {
 		if (searchInfo.value.name) searchInfo.value.name = e.detail.value
-		searchInfo.value = { name: '' }
+		searchInfo.value = { }
 		clearPage();
 		search();
 	};
@@ -95,8 +116,8 @@
 				title: '加载中',
 				mask: true
 			})
-			page.value = page.value + 1
-			skip.value = page.value * limit.value;
+			pageNum.value = pageNum.value + 1
+			pageSize.value = pageNum.value * 10;
 			search();
 			uni.hideLoading();
 		} else is_bottom.value = true
@@ -110,8 +131,8 @@
 	// 清空数据
 	const clearPage = () => {
 		list.value = []
-		skip.value = 0
-		limit.value = 6
+		pageNum.value = 1
+		pageSize.value = 10
 		page.value = 0
 	};
 </script>

+ 41 - 20
pages/home/components/team.vue

@@ -33,9 +33,11 @@
 </template>
 
 <script setup lang="ts">
-	import { ref } from 'vue';
+	import { ref, toRefs, getCurrentInstance } from 'vue';
 	//该依赖已内置不需要单独安装
 	import { onShow } from "@dcloudio/uni-app";
+	// 请求接口
+	const $api = getCurrentInstance()?.appContext.config.globalProperties.$api;
 	interface PropsItem {
 		id ?: number,
 		name ?: string,
@@ -44,37 +46,56 @@
 		label ?: string,
 		user_type ?: string,
 	};
-	// 基本信息
-	const config = ref({ bottomTitle: '', logoUrl: '' });
+	// 用户信息
+	const user = ref({});
 	// 查询
-	const searchInfo = ref({ name: '' });
+	const searchInfo = ref({});
 	// 列表
 	const list = ref<PropsItem[]>([{ id: 1, name: '测试球队' }, { id: 2, name: '肝帝集团队' }]);
 	// 分页
-	const skip = ref(0);
-	const limit = ref(6);
-	const page = ref(0);
+	const pageNum = ref(1);
+	const pageSize = ref(10);
 	const total = ref(0);
 	// 数据是否触底
 	const scrollTop = ref(0);
 	const is_bottom = ref(false);
-
-	onShow(() => {
-		searchConfig();
-		search();
+	const props = defineProps({
+		config: { type: Object, default: () => { } },
+	});
+	const { config } = toRefs(props);
+	onShow(async () => {
+		await searchUser();
+		await search();
 	})
-	// config信息
-	const searchConfig = async () => {
-		config.value = uni.getStorageSync('config');
+	// 用户信息
+	const searchUser = async () => {
+		user.value = uni.getStorageSync('user');
 	};
 	// 查询列表
 	const search = async () => {
-		console.log('查询');
+		const info = {
+			pageNum: pageNum.value,
+			pageSize: pageSize.value,
+			userId: user.value.id
+		}
+		const res = await $api('matchTeam/list', 'GET', {
+			...info,
+			...searchInfo.value
+		});
+		if (res.code === 200) {
+			list.value = res.rows
+			total.value = res.total
+		} else {
+			uni.showToast({
+				title: res.msg || '',
+				icon: 'error',
+			});
+		}
 	};
 	//查询
 	const toInput = (e : any) => {
 		if (searchInfo.value.name) searchInfo.value.name = e.detail.value
-		searchInfo.value = { name: '' }
+		else searchInfo.value = {}
 		clearPage();
 		search();
 	};
@@ -91,8 +112,8 @@
 				title: '加载中',
 				mask: true
 			})
-			page.value = page.value + 1
-			skip.value = page.value * limit.value;
+			pageNum.value = pageNum.value + 1
+			pageSize.value = pageNum.value * 10;
 			search();
 			uni.hideLoading();
 		} else is_bottom.value = true
@@ -106,8 +127,8 @@
 	// 清空数据
 	const clearPage = () => {
 		list.value = []
-		skip.value = 0
-		limit.value = 6
+		pageNum.value = 1
+		pageSize.value = 10
 		page.value = 0
 	};
 </script>

+ 6 - 6
pages/home/index.vue

@@ -20,13 +20,13 @@
 				activeColor="#dd524d"></uni-segmented-control>
 			<view class="two_1">
 				<view v-show="current === 0">
-					<team></team>
+					<team :config="config"></team>
 				</view>
 				<view v-show="current === 1">
-					<activity></activity>
+					<activity :config="config"></activity>
 				</view>
 				<view v-show="current === 2">
-					<game></game>
+					<game :config="config"></game>
 				</view>
 			</view>
 		</view>
@@ -99,10 +99,10 @@
 	]);
 	// 弹框
 	const popup = ref(null);
-	onShow(() => {
+	onShow(async () => {
 		uni.hideHomeButton();
-		search();
-		searchConfig();
+		await searchConfig();
+		await search();
 	})
 	// 下拉刷新
 	onPullDownRefresh(() => {

+ 1 - 1
pages/index/index.vue

@@ -1,7 +1,7 @@
 <template>
 	<view class="content">
 		<view class="one">
-			<image class="logo" :src="logoUrl||'/static/logo.png'" />
+			<image class="logo" :src="logoUrl||'/static/saishi.png'" />
 		</view>
 	</view>
 </template>

+ 31 - 18
pagesHome/team/index.vue

@@ -8,8 +8,7 @@
 		<view class="thr">
 			<form @submit="formSubmit">
 				<view class="logo">
-					<image name="logo" class="image" mode="aspectFill" :src="form.logo||'/static/qiudui.png'"
-						@tap="Preview">
+					<image class="image" mode="aspectFill" :src="form.logo||'/static/qiudui.png'" @tap="Preview">
 					</image>
 				</view>
 				<view class="value other">
@@ -28,7 +27,7 @@
 				</view>
 				<view class="value other">
 					<view class="title">城市</view>
-					<view class="label" @tap="toCity" name="city">
+					<view class="label" @tap="toCity">
 						<text v-if="form.city">{{form.city}}</text>
 						<text v-else>请选择城市</text>
 					</view>
@@ -73,22 +72,15 @@
 	const openid = computed(() => {
 		return uni.getStorageSync('openid');
 	})
-	// id
-	const id = ref('');
 	// 用户信息
-	const user = ref({ icon: '' });
+	const user = ref({});
 	// 球队表单
 	const form = ref({});
 	// 字典表
 	const typeList = ref([]);
-
-	onLoad(async (options) => {
-		id.value = options && options.id
-		await searchUser();
-		await searchOther();
-		await search();
-	})
 	onShow(() => {
+		searchUser();
+		searchOther();
 		uni.$on('setCity', function (city) {
 			form.value.city = city
 		})
@@ -104,8 +96,6 @@
 		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]
@@ -149,16 +139,39 @@
 		});
 	};
 	// 创建
-	const formSubmit = (e) => {
+	const formSubmit = async (e) => {
 		if (user.value.id) {
-			console.log(e.deatil.value);
+			let data = e.detail.value;
+			data.logo = form.value.logo;
+			data.city = form.value.city;
+			data = delEmptyQueryNodes(data);
+			data.userId = user.value.id;
+			const arr = await $api(`matchTeam`, 'POST', data);
+			if (arr.code === 200) {
+				uni.navigateBack({
+					delta: 1
+				})
+			} else {
+				uni.showToast({
+					title: arr.msg,
+					icon: 'error'
+				});
+			}
 		} else {
 			uni.showToast({
 				title: `无用户信息 无法创建球队`,
 				icon: 'none'
 			});
 		}
-
+	};
+	// 去除obj里为null的数据
+	const delEmptyQueryNodes = (obj = {}) => {
+		Object.keys(obj).forEach((key) => {
+			let value = obj[key];
+			value && typeof value === 'object' && delEmptyQueryNodes(value);
+			(value === '' || value === null || value === undefined || value.length === 0 || Object.keys(value).length === 0) && delete obj[key];
+		});
+		return obj;
 	};
 </script>
 <style lang="scss" scoped>

+ 9 - 9
pagesMy/basic/index.vue

@@ -233,15 +233,6 @@
 			}
 		});
 	};
-	// 去除obj里为null的数据
-	const delEmptyQueryNodes = (obj = {}) => {
-		Object.keys(obj).forEach((key) => {
-			let value = obj[key];
-			value && typeof value === 'object' && delEmptyQueryNodes(value);
-			(value === '' || value === null || value === undefined || value.length === 0 || Object.keys(value).length === 0) && delete obj[key];
-		});
-		return obj;
-	};
 	// 保存
 	const formSubmit = async (e) => {
 		let data = e.detail.value;
@@ -257,6 +248,15 @@
 			});
 		}
 	};
+	// 去除obj里为null的数据
+	const delEmptyQueryNodes = (obj = {}) => {
+		Object.keys(obj).forEach((key) => {
+			let value = obj[key];
+			value && typeof value === 'object' && delEmptyQueryNodes(value);
+			(value === '' || value === null || value === undefined || value.length === 0 || Object.keys(value).length === 0) && delete obj[key];
+		});
+		return obj;
+	};
 </script>
 <style lang="scss" scoped>
 	.content {

BIN
static/logo.png


+ 38 - 0
unpackage/dist/dev/mp-weixin/common/vendor.js

@@ -1896,6 +1896,10 @@ function triggerEffect(effect, debuggerEventExtraInfo) {
     }
   }
 }
+function getDepFromReactive(object, key) {
+  var _a2;
+  return (_a2 = targetMap.get(object)) === null || _a2 === void 0 ? void 0 : _a2.get(key);
+}
 const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`);
 const builtInSymbols = new Set(
   /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol)
@@ -2530,6 +2534,38 @@ const shallowUnwrapHandlers = {
 function proxyRefs(objectWithRefs) {
   return isReactive(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers);
 }
+function toRefs(object) {
+  if (!isProxy(object)) {
+    console.warn(`toRefs() expects a reactive object but received a plain one.`);
+  }
+  const ret = isArray$1(object) ? new Array(object.length) : {};
+  for (const key in object) {
+    ret[key] = toRef(object, key);
+  }
+  return ret;
+}
+class ObjectRefImpl {
+  constructor(_object, _key, _defaultValue) {
+    this._object = _object;
+    this._key = _key;
+    this._defaultValue = _defaultValue;
+    this.__v_isRef = true;
+  }
+  get value() {
+    const val = this._object[this._key];
+    return val === void 0 ? this._defaultValue : val;
+  }
+  set value(newVal) {
+    this._object[this._key] = newVal;
+  }
+  get dep() {
+    return getDepFromReactive(toRaw(this._object), this._key);
+  }
+}
+function toRef(object, key, defaultValue) {
+  const val = object[key];
+  return isRef(val) ? val : new ObjectRefImpl(object, key, defaultValue);
+}
 var _a;
 class ComputedRefImpl {
   constructor(getter, _setter, isReadonly2, isSSR) {
@@ -10785,3 +10821,5 @@ exports.resolveComponent = resolveComponent;
 exports.s = s;
 exports.sr = sr;
 exports.t = t;
+exports.toRefs = toRefs;
+exports.unref = unref;

+ 43 - 19
unpackage/dist/dev/mp-weixin/pages/home/components/activity.js

@@ -2,30 +2,54 @@
 const common_vendor = require("../../../common/vendor.js");
 const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
   __name: "activity",
+  props: {
+    config: { type: Object, default: () => {
+    } }
+  },
   setup(__props) {
-    const config = common_vendor.ref({ bottomTitle: "", logoUrl: "" });
-    const searchInfo = common_vendor.ref({ name: "" });
+    var _a;
+    const props = __props;
+    const $api = (_a = common_vendor.getCurrentInstance()) == null ? void 0 : _a.appContext.config.globalProperties.$api;
+    const user = common_vendor.ref({});
+    const searchInfo = common_vendor.ref({});
     const list = common_vendor.ref([{ id: 1, name: "测试球队" }, { id: 1, name: "肝帝集团队" }]);
-    const skip = common_vendor.ref(0);
-    const limit = common_vendor.ref(6);
-    const page = common_vendor.ref(0);
+    const pageNum = common_vendor.ref(1);
+    const pageSize = common_vendor.ref(10);
     const total = common_vendor.ref(0);
     const scrollTop = common_vendor.ref(0);
     const is_bottom = common_vendor.ref(false);
-    common_vendor.onShow(() => {
-      searchConfig();
-      search();
+    const { config } = common_vendor.toRefs(props);
+    common_vendor.onShow(async () => {
+      await searchUser();
+      await search();
     });
-    const searchConfig = async () => {
-      config.value = common_vendor.index.getStorageSync("config");
+    const searchUser = async () => {
+      user.value = common_vendor.index.getStorageSync("user");
     };
     const search = async () => {
-      console.log("查询");
+      const info = {
+        pageNum: pageNum.value,
+        pageSize: pageSize.value,
+        userId: user.value.id
+      };
+      const res = await $api("activity/list", "GET", {
+        ...info,
+        ...searchInfo.value
+      });
+      if (res.code === 200) {
+        list.value = res.rows;
+        total.value = res.total;
+      } else {
+        common_vendor.index.showToast({
+          title: res.msg || "",
+          icon: "error"
+        });
+      }
     };
     const toInput = (e) => {
       if (searchInfo.value.name)
         searchInfo.value.name = e.detail.value;
-      searchInfo.value = { name: "" };
+      searchInfo.value = {};
       clearPage();
       search();
     };
@@ -40,8 +64,8 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
           title: "加载中",
           mask: true
         });
-        page.value = page.value + 1;
-        skip.value = page.value * limit.value;
+        pageNum.value = pageNum.value + 1;
+        pageSize.value = pageNum.value * 10;
         search();
         common_vendor.index.hideLoading();
       } else
@@ -56,8 +80,8 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
     };
     const clearPage = () => {
       list.value = [];
-      skip.value = 0;
-      limit.value = 6;
+      pageNum.value = 1;
+      pageSize.value = 10;
       page.value = 0;
     };
     return (_ctx, _cache) => {
@@ -76,10 +100,10 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
             c: common_vendor.n(item.status == "0" ? "status0" : item.status == "1" ? "status1" : "status2"),
             d: common_vendor.t(item.name || "暂无活动名称"),
             e: common_vendor.t(item.red_name || "暂无红方名称"),
-            f: item.red_logo || config.value.logoUrl,
+            f: item.red_logo || common_vendor.unref(config).logoUrl,
             g: common_vendor.t(item.red_score || 0),
             h: common_vendor.t(item.blue_score || 0),
-            i: item.blue_logo || config.value.logoUrl,
+            i: item.blue_logo || common_vendor.unref(config).logoUrl,
             j: common_vendor.t(item.blue_name || "暂无蓝方名称"),
             k: index,
             l: common_vendor.o(($event) => toInfo(item), index)
@@ -87,7 +111,7 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
         }),
         e: is_bottom.value
       }, is_bottom.value ? {
-        f: common_vendor.t(config.value.bottomTitle || "到底了!")
+        f: common_vendor.t(common_vendor.unref(config).bottomTitle || "到底了!")
       } : {}, {
         g: common_vendor.o(toPage),
         h: common_vendor.o(toScroll)

+ 42 - 18
unpackage/dist/dev/mp-weixin/pages/home/components/game.js

@@ -2,30 +2,54 @@
 const common_vendor = require("../../../common/vendor.js");
 const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
   __name: "game",
+  props: {
+    config: { type: Object, default: () => {
+    } }
+  },
   setup(__props) {
-    const config = common_vendor.ref({ bottomTitle: "", logoUrl: "" });
-    const searchInfo = common_vendor.ref({ name: "" });
+    var _a;
+    const props = __props;
+    const $api = (_a = common_vendor.getCurrentInstance()) == null ? void 0 : _a.appContext.config.globalProperties.$api;
+    const user = common_vendor.ref({});
+    const searchInfo = common_vendor.ref({});
     const list = common_vendor.ref([{ id: 1, name: "肝帝33联赛" }]);
-    const skip = common_vendor.ref(0);
-    const limit = common_vendor.ref(6);
-    const page = common_vendor.ref(0);
+    const pageNum = common_vendor.ref(1);
+    const pageSize = common_vendor.ref(10);
     const total = common_vendor.ref(0);
     const scrollTop = common_vendor.ref(0);
     const is_bottom = common_vendor.ref(false);
-    common_vendor.onShow(() => {
-      searchConfig();
-      search();
+    const { config } = common_vendor.toRefs(props);
+    common_vendor.onShow(async () => {
+      await searchUser();
+      await search();
     });
-    const searchConfig = async () => {
-      config.value = common_vendor.index.getStorageSync("config");
+    const searchUser = async () => {
+      user.value = common_vendor.index.getStorageSync("user");
     };
     const search = async () => {
-      console.log("查询");
+      const info = {
+        pageNum: pageNum.value,
+        pageSize: pageSize.value,
+        userId: user.value.id
+      };
+      const res = await $api("game/list", "GET", {
+        ...info,
+        ...searchInfo.value
+      });
+      if (res.code === 200) {
+        list.value = res.rows;
+        total.value = res.total;
+      } else {
+        common_vendor.index.showToast({
+          title: res.msg || "",
+          icon: "error"
+        });
+      }
     };
     const toInput = (e) => {
       if (searchInfo.value.name)
         searchInfo.value.name = e.detail.value;
-      searchInfo.value = { name: "" };
+      searchInfo.value = {};
       clearPage();
       search();
     };
@@ -40,8 +64,8 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
           title: "加载中",
           mask: true
         });
-        page.value = page.value + 1;
-        skip.value = page.value * limit.value;
+        pageNum.value = pageNum.value + 1;
+        pageSize.value = pageNum.value * 10;
         search();
         common_vendor.index.hideLoading();
       } else
@@ -56,8 +80,8 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
     };
     const clearPage = () => {
       list.value = [];
-      skip.value = 0;
-      limit.value = 6;
+      pageNum.value = 1;
+      pageSize.value = 10;
       page.value = 0;
     };
     return (_ctx, _cache) => {
@@ -66,7 +90,7 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
         b: searchInfo.value.name,
         c: common_vendor.f(list.value, (item, index, i0) => {
           return {
-            a: item.logo || config.value.logoUrl,
+            a: item.logo || common_vendor.unref(config).logoUrl,
             b: common_vendor.t(item.name || "暂无名称"),
             c: common_vendor.t(item.address || "暂无地点"),
             d: common_vendor.t(item.date || "暂无日期"),
@@ -78,7 +102,7 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
         }),
         d: is_bottom.value
       }, is_bottom.value ? {
-        e: common_vendor.t(config.value.bottomTitle || "到底了!")
+        e: common_vendor.t(common_vendor.unref(config).bottomTitle || "到底了!")
       } : {}, {
         f: common_vendor.o(toPage),
         g: common_vendor.o(toScroll)

+ 43 - 18
unpackage/dist/dev/mp-weixin/pages/home/components/team.js

@@ -2,30 +2,55 @@
 const common_vendor = require("../../../common/vendor.js");
 const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
   __name: "team",
+  props: {
+    config: { type: Object, default: () => {
+    } }
+  },
   setup(__props) {
-    const config = common_vendor.ref({ bottomTitle: "", logoUrl: "" });
-    const searchInfo = common_vendor.ref({ name: "" });
+    var _a;
+    const props = __props;
+    const $api = (_a = common_vendor.getCurrentInstance()) == null ? void 0 : _a.appContext.config.globalProperties.$api;
+    const user = common_vendor.ref({});
+    const searchInfo = common_vendor.ref({});
     const list = common_vendor.ref([{ id: 1, name: "测试球队" }, { id: 2, name: "肝帝集团队" }]);
-    const skip = common_vendor.ref(0);
-    const limit = common_vendor.ref(6);
-    const page = common_vendor.ref(0);
+    const pageNum = common_vendor.ref(1);
+    const pageSize = common_vendor.ref(10);
     const total = common_vendor.ref(0);
     const scrollTop = common_vendor.ref(0);
     const is_bottom = common_vendor.ref(false);
-    common_vendor.onShow(() => {
-      searchConfig();
-      search();
+    const { config } = common_vendor.toRefs(props);
+    common_vendor.onShow(async () => {
+      await searchUser();
+      await search();
     });
-    const searchConfig = async () => {
-      config.value = common_vendor.index.getStorageSync("config");
+    const searchUser = async () => {
+      user.value = common_vendor.index.getStorageSync("user");
     };
     const search = async () => {
-      console.log("查询");
+      const info = {
+        pageNum: pageNum.value,
+        pageSize: pageSize.value,
+        userId: user.value.id
+      };
+      const res = await $api("matchTeam/list", "GET", {
+        ...info,
+        ...searchInfo.value
+      });
+      if (res.code === 200) {
+        list.value = res.rows;
+        total.value = res.total;
+      } else {
+        common_vendor.index.showToast({
+          title: res.msg || "",
+          icon: "error"
+        });
+      }
     };
     const toInput = (e) => {
       if (searchInfo.value.name)
         searchInfo.value.name = e.detail.value;
-      searchInfo.value = { name: "" };
+      else
+        searchInfo.value = {};
       clearPage();
       search();
     };
@@ -40,8 +65,8 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
           title: "加载中",
           mask: true
         });
-        page.value = page.value + 1;
-        skip.value = page.value * limit.value;
+        pageNum.value = pageNum.value + 1;
+        pageSize.value = pageNum.value * 10;
         search();
         common_vendor.index.hideLoading();
       } else
@@ -56,8 +81,8 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
     };
     const clearPage = () => {
       list.value = [];
-      skip.value = 0;
-      limit.value = 6;
+      pageNum.value = 1;
+      pageSize.value = 10;
       page.value = 0;
     };
     return (_ctx, _cache) => {
@@ -66,7 +91,7 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
         b: searchInfo.value.name,
         c: common_vendor.f(list.value, (item, index, i0) => {
           return {
-            a: item.logo || config.value.logoUrl,
+            a: item.logo || common_vendor.unref(config).logoUrl,
             b: common_vendor.t(item.name || "暂无名称"),
             c: common_vendor.t(item.label || "队长"),
             d: common_vendor.n(item.user_type == "0" ? "label_1" : "label_2"),
@@ -77,7 +102,7 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
         }),
         d: is_bottom.value
       }, is_bottom.value ? {
-        e: common_vendor.t(config.value.bottomTitle || "到底了!")
+        e: common_vendor.t(common_vendor.unref(config).bottomTitle || "到底了!")
       } : {}, {
         f: common_vendor.o(toPage),
         g: common_vendor.o(toScroll)

+ 22 - 13
unpackage/dist/dev/mp-weixin/pages/home/index.js

@@ -57,10 +57,10 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
       }
     ]);
     const popup = common_vendor.ref(null);
-    common_vendor.onShow(() => {
+    common_vendor.onShow(async () => {
       common_vendor.index.hideHomeButton();
-      search();
-      searchConfig();
+      await searchConfig();
+      await search();
     });
     common_vendor.onPullDownRefresh(() => {
       common_vendor.index.stopPullDownRefresh();
@@ -142,26 +142,35 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
           styleType: "text",
           activeColor: "#dd524d"
         }),
-        i: current.value === 0,
-        j: current.value === 1,
-        k: current.value === 2,
-        l: common_vendor.o(toClose),
+        i: common_vendor.p({
+          config: config.value
+        }),
+        j: current.value === 0,
+        k: common_vendor.p({
+          config: config.value
+        }),
+        l: current.value === 1,
         m: common_vendor.p({
+          config: config.value
+        }),
+        n: current.value === 2,
+        o: common_vendor.o(toClose),
+        p: common_vendor.p({
           type: "closeempty",
           size: "18",
           color: "#999999"
         }),
-        n: common_vendor.o(toLogin),
-        o: common_vendor.sr(popup, "4978fed5-6", {
+        q: common_vendor.o(toLogin),
+        r: common_vendor.sr(popup, "4978fed5-6", {
           "k": "popup"
         }),
-        p: common_vendor.o(change),
-        q: common_vendor.p({
+        s: common_vendor.o(change),
+        t: common_vendor.p({
           ["background-color"]: "rgba(0,0,0,0)",
           type: "bottom"
         }),
-        r: common_vendor.o(trigger),
-        s: common_vendor.p({
+        v: common_vendor.o(trigger),
+        w: common_vendor.p({
           pattern: pattern.value,
           content: content.value,
           horizontal: "right",

Різницю між файлами не показано, бо вона завелика
+ 1 - 1
unpackage/dist/dev/mp-weixin/pages/home/index.wxml


+ 1 - 1
unpackage/dist/dev/mp-weixin/pages/index/index.js

@@ -67,7 +67,7 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
     };
     return (_ctx, _cache) => {
       return {
-        a: logoUrl.value || "/static/logo.png"
+        a: logoUrl.value || "/static/saishi.png"
       };
     };
   }

+ 28 - 12
unpackage/dist/dev/mp-weixin/pagesHome/team/index.js

@@ -10,17 +10,12 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
     common_vendor.computed(() => {
       return common_vendor.index.getStorageSync("openid");
     });
-    const id = common_vendor.ref("");
-    const user = common_vendor.ref({ icon: "" });
+    const user = common_vendor.ref({});
     const form = common_vendor.ref({});
     const typeList = common_vendor.ref([]);
-    common_vendor.onLoad(async (options) => {
-      id.value = options && options.id;
-      await searchUser();
-      await searchOther();
-      await search();
-    });
     common_vendor.onShow(() => {
+      searchUser();
+      searchOther();
       common_vendor.index.$on("setCity", function(city) {
         form.value.city = city;
       });
@@ -34,8 +29,6 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
       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)
@@ -79,9 +72,24 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
         }
       });
     };
-    const formSubmit = (e) => {
+    const formSubmit = async (e) => {
       if (user.value.id) {
-        console.log(e.deatil.value);
+        let data = e.detail.value;
+        data.logo = form.value.logo;
+        data.city = form.value.city;
+        data = delEmptyQueryNodes(data);
+        data.userId = user.value.id;
+        const arr = await $api(`matchTeam`, "POST", data);
+        if (arr.code === 200) {
+          common_vendor.index.navigateBack({
+            delta: 1
+          });
+        } else {
+          common_vendor.index.showToast({
+            title: arr.msg,
+            icon: "error"
+          });
+        }
       } else {
         common_vendor.index.showToast({
           title: `无用户信息 无法创建球队`,
@@ -89,6 +97,14 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
         });
       }
     };
+    const delEmptyQueryNodes = (obj = {}) => {
+      Object.keys(obj).forEach((key) => {
+        let value = obj[key];
+        value && typeof value === "object" && delEmptyQueryNodes(value);
+        (value === "" || value === null || value === void 0 || value.length === 0 || Object.keys(value).length === 0) && delete obj[key];
+      });
+      return obj;
+    };
     return (_ctx, _cache) => {
       return common_vendor.e({
         a: form.value.logo || "/static/qiudui.png",

Різницю між файлами не показано, бо вона завелика
+ 1 - 1
unpackage/dist/dev/mp-weixin/pagesHome/team/index.wxml


+ 8 - 8
unpackage/dist/dev/mp-weixin/pagesMy/basic/index.js

@@ -124,14 +124,6 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
         }
       });
     };
-    const delEmptyQueryNodes = (obj = {}) => {
-      Object.keys(obj).forEach((key) => {
-        let value = obj[key];
-        value && typeof value === "object" && delEmptyQueryNodes(value);
-        (value === "" || value === null || value === void 0 || value.length === 0 || Object.keys(value).length === 0) && delete obj[key];
-      });
-      return obj;
-    };
     const formSubmit = async (e) => {
       let data = e.detail.value;
       data.icon = form.value.icon;
@@ -146,6 +138,14 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
         });
       }
     };
+    const delEmptyQueryNodes = (obj = {}) => {
+      Object.keys(obj).forEach((key) => {
+        let value = obj[key];
+        value && typeof value === "object" && delEmptyQueryNodes(value);
+        (value === "" || value === null || value === void 0 || value.length === 0 || Object.keys(value).length === 0) && delete obj[key];
+      });
+      return obj;
+    };
     return (_ctx, _cache) => {
       return common_vendor.e({
         a: form.value.id,

BIN
unpackage/dist/dev/mp-weixin/static/logo.png