Selaa lähdekoodia

修改用户信息

zs 1 vuosi sitten
vanhempi
commit
aa0ab3667f
40 muutettua tiedostoa jossa 650 lisäystä ja 98 poistoa
  1. 12 0
      pages.json
  2. 2 1
      pages/home/index.vue
  3. 8 11
      pages/login/index.vue
  4. 138 2
      pagesHome/activity/info.vue
  5. 45 0
      pagesHome/create/index.vue
  6. 11 7
      pagesHome/match/index.vue
  7. 2 2
      pagesHome/match/info.vue
  8. 44 0
      pagesHome/person/index.vue
  9. 11 7
      pagesHome/team/index.vue
  10. 5 1
      pagesHome/team/info.vue
  11. 8 6
      pagesHome/team/person.vue
  12. 61 12
      pagesMy/basic/index.vue
  13. 2 0
      unpackage/dist/dev/mp-weixin/app.js
  14. 3 1
      unpackage/dist/dev/mp-weixin/app.json
  15. 1 1
      unpackage/dist/dev/mp-weixin/pages/home/index.js
  16. 1 0
      unpackage/dist/dev/mp-weixin/pages/home/index.wxss
  17. 8 15
      unpackage/dist/dev/mp-weixin/pages/login/index.js
  18. 46 1
      unpackage/dist/dev/mp-weixin/pagesHome/activity/info.js
  19. 3 1
      unpackage/dist/dev/mp-weixin/pagesHome/activity/info.json
  20. 1 1
      unpackage/dist/dev/mp-weixin/pagesHome/activity/info.wxml
  21. 74 0
      unpackage/dist/dev/mp-weixin/pagesHome/activity/info.wxss
  22. 28 0
      unpackage/dist/dev/mp-weixin/pagesHome/create/index.js
  23. 4 0
      unpackage/dist/dev/mp-weixin/pagesHome/create/index.json
  24. 1 0
      unpackage/dist/dev/mp-weixin/pagesHome/create/index.wxml
  25. 11 0
      unpackage/dist/dev/mp-weixin/pagesHome/create/index.wxss
  26. 4 4
      unpackage/dist/dev/mp-weixin/pagesHome/match/index.js
  27. 1 1
      unpackage/dist/dev/mp-weixin/pagesHome/match/index.wxml
  28. 1 1
      unpackage/dist/dev/mp-weixin/pagesHome/match/info.js
  29. 1 1
      unpackage/dist/dev/mp-weixin/pagesHome/match/info.wxml
  30. 28 0
      unpackage/dist/dev/mp-weixin/pagesHome/person/index.js
  31. 4 0
      unpackage/dist/dev/mp-weixin/pagesHome/person/index.json
  32. 1 0
      unpackage/dist/dev/mp-weixin/pagesHome/person/index.wxml
  33. 11 0
      unpackage/dist/dev/mp-weixin/pagesHome/person/index.wxss
  34. 4 4
      unpackage/dist/dev/mp-weixin/pagesHome/team/index.js
  35. 1 1
      unpackage/dist/dev/mp-weixin/pagesHome/team/index.wxml
  36. 3 0
      unpackage/dist/dev/mp-weixin/pagesHome/team/info.js
  37. 5 3
      unpackage/dist/dev/mp-weixin/pagesHome/team/person.js
  38. 1 1
      unpackage/dist/dev/mp-weixin/pagesHome/team/person.wxml
  39. 54 12
      unpackage/dist/dev/mp-weixin/pagesMy/basic/index.js
  40. 1 1
      unpackage/dist/dev/mp-weixin/pagesMy/basic/index.wxml

+ 12 - 0
pages.json

@@ -116,6 +116,18 @@
 					"style": {
 						"navigationBarTitleText": "活动详情"
 					}
+				},
+				{
+					"path": "person/index",
+					"style": {
+						"navigationBarTitleText": "Ta的球队名片"
+					}
+				},
+				{
+					"path": "create/index",
+					"style": {
+						"navigationBarTitleText": "创建"
+					}
 				}
 			]
 		},

+ 2 - 1
pages/home/index.vue

@@ -114,7 +114,7 @@
 			openid: openid.value
 		});
 		if (res.code === 200) {
-			if (res.data) console.log(res.data);
+			if (res.data) user.value = res.data
 			else popup.value.open();
 		} else {
 			uni.showToast({
@@ -176,6 +176,7 @@
 					width: 15vw;
 					height: 15vw;
 					border-radius: 20vw;
+					background: var(--mainColor);
 				}
 
 				.name {

+ 8 - 11
pages/login/index.vue

@@ -39,20 +39,13 @@
 					success: async function (res) {
 						let parmas = {
 							openid: openid.value,
-							icon: res.userInfo.avatarUrl,
 							nickname: res.userInfo.nickName + moment().valueOf()
 						}
-						const arr = await that.$api(`matchUser`, 'POST', parmas);
+						const arr = await $api(`matchUser`, 'POST', parmas);
 						if (arr.code === 200) {
-							uni.setStorage({
-								key: 'user',
-								data: arr.data,
-								success: function () {
-									uni.navigateBack({
-										delta: 1
-									})
-								}
-							});
+							uni.navigateBack({
+								delta: 1
+							})
 						} else {
 							uni.showToast({
 								title: arr.msg,
@@ -83,6 +76,10 @@
 			url: `/pagesHome/agree/index`
 		})
 	};
+	// 同意隐私协议
+	const changeAgree = () => {
+		agree.value = !agree.value;
+	};
 </script>
 <style lang="scss" scoped>
 	.content {

+ 138 - 2
pagesHome/activity/info.vue

@@ -1,7 +1,38 @@
 <template>
 	<view class="content">
 		<view class="one">
-			活动详情
+			<view class="one_1">
+				·{{info.number||0}}制 | 共{{info.wheel||0}}轮
+			</view>
+			<view class="one_2">
+				<view class="left">
+					<image class="image" mode="aspectFill" :src="info.red_logo||config.logoUrl">
+					</image>
+					<view class="name">{{info.red_name||'暂无红方名称'}}</view>
+				</view>
+				<view class="center">{{info.red_score||0}} : {{info.blue_score||0}}</view>
+				<view class="right">
+					<image class="image" mode="aspectFill" :src="info.blue_logo||config.logoUrl">
+					</image>
+					<view class="name">{{info.blue_name||'暂无蓝方名称'}}</view>
+				</view>
+			</view>
+			<view class="one_3"> <text>{{getDayOfWeek(info.time)}}</text> {{info.time||'暂无时间'}} </view>
+			<view class="one_4"> <text>{{info.address||'暂无地点'}}</text> </view>
+		</view>
+		<view class="position">
+			<view class="two">
+				<uni-segmented-control :current="current" :values="list" @clickItem="onClickItem" styleType="text"
+					activeColor="#dd524d"></uni-segmented-control>
+				<view class="two_1">
+					<view v-show="current === 0">
+						出勤报名
+					</view>
+					<view v-show="current === 1">
+						数据统计
+					</view>
+				</view>
+			</view>
 		</view>
 	</view>
 </template>
@@ -14,6 +45,9 @@
 	const $api = getCurrentInstance()?.appContext.config.globalProperties.$api;
 	// 基本信息
 	const config = ref({ logoUrl: '' });
+	const info = ref({});
+	const list = ref(['出勤报名', '数据统计']);
+	const current = ref(0);
 	// 详情信息id
 	const id = ref('');
 	onLoad(async (options) => {
@@ -32,6 +66,19 @@
 	const search = async () => {
 		if (id.value) { }
 	};
+	// 点击分页器
+	const onClickItem = (e) => {
+		if (current.value !== e.currentIndex) current.value = e.currentIndex
+	};
+	// 日期换算星期几
+	const getDayOfWeek = (dateString) => {
+		if (dateString) {
+			const date = new Date(dateString);
+			const dayOfWeek = date.getDay();
+			const weekdays = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'];
+			return weekdays[dayOfWeek];
+		} else return '暂无日期';
+	};
 </script>
 <style lang="scss" scoped>
 	.content {
@@ -41,7 +88,96 @@
 		height: 100vh;
 
 		.one {
-			padding: 2vw;
+			background-color: var(--f12Color);
+			padding: 0 0 10vw 0;
+
+			.one_1 {
+				padding: 2vw;
+				text-align: center;
+				font-size: var(--font14Size);
+				color: var(--f99Color);
+			}
+
+			.one_2 {
+				display: flex;
+				justify-content: space-around;
+				align-items: center;
+				color: var(--mainColor);
+
+				.left {
+					display: flex;
+					flex-direction: column;
+					align-items: center;
+
+					.image {
+						width: 12vw;
+						height: 12vw;
+						border-radius: 12vw;
+					}
+
+					.name {
+						margin: 2vw 0 0 0;
+					}
+				}
+
+				.center {
+					font-size: 25px;
+				}
+
+				.right {
+					display: flex;
+					flex-direction: column;
+					align-items: center;
+
+					.image {
+						width: 12vw;
+						height: 12vw;
+						border-radius: 12vw;
+					}
+
+					.name {
+						margin: 2vw 0 0 0;
+					}
+				}
+			}
+
+			.one_3 {
+				color: var(--mainColor);
+				text-align: center;
+				padding: 2vw;
+				font-size: var(--font16Size);
+
+				text {
+					padding: 2px 5px;
+					background-color: rgba(105, 105, 105, 0.9);
+					border-radius: 2vw;
+				}
+			}
+
+			.one_4 {
+				text-align: center;
+				padding: 2vw;
+
+				text {
+					font-size: var(--font14Size);
+					padding: 2px 5px;
+					background-color: rgba(105, 105, 105, 0.9);
+					border-radius: 10vw;
+					color: var(--mainColor);
+				}
+			}
+		}
+
+		.position {
+			position: absolute;
+			top: 50vw;
+
+			.two {
+				width: 100vw;
+				border-top-left-radius: 25px;
+				border-top-right-radius: 25px;
+				background-color: var(--mainColor);
+			}
 		}
 	}
 </style>

+ 45 - 0
pagesHome/create/index.vue

@@ -0,0 +1,45 @@
+<template>
+	<view class="content">
+		<view class="one">
+			创建
+		</view>
+	</view>
+</template>
+
+<script setup lang="ts">
+	import { getCurrentInstance, ref } from 'vue';
+	//该依赖已内置不需要单独安装
+	import { onLoad } from "@dcloudio/uni-app";
+	// 请求接口
+	const $api = getCurrentInstance()?.appContext.config.globalProperties.$api;
+	// 基本信息
+	const config = ref({ logoUrl: '' });
+	// 详情信息id
+	const id = ref('');
+	onLoad(async (options) => {
+		// 球队id
+		id.value = options && options.id
+		await searchConfig();
+		await search();
+	})
+	// config信息
+	const searchConfig = async () => {
+		config.value = uni.getStorageSync('config');
+	};
+	// 查询
+	const search = async () => {
+		if (id.value) { }
+	};
+</script>
+<style lang="scss" scoped>
+	.content {
+		display: flex;
+		flex-direction: column;
+		width: 100vw;
+		height: 100vh;
+
+		.one {
+			padding: 2vw;
+		}
+	}
+</style>

+ 11 - 7
pagesHome/match/index.vue

@@ -8,26 +8,26 @@
 		<view class="thr">
 			<form @submit="formSubmit">
 				<view class="logo">
-					<image class="image" mode="aspectFill" :src="form.logo||'/static/qiudui.png'" @tap="Preview">
+					<image name="logo" class="image" mode="aspectFill" :src="form.logo||'/static/qiudui.png'" @tap="Preview">
 					</image>
 				</view>
 				<view class="value other">
 					<view class="title">名称</view>
 					<view class="label">
-						<input class="input" :value="form.name" placeholder="请输入名称" />
+						<input  name="name" class="input" :value="form.name" placeholder="请输入名称" />
 					</view>
 				</view>
 				<view class="value other">
 					<view class="title">类型</view>
 					<view class="label">
-						<picker @change="typeChange" :value="index" :range="typeList" range-key="dictLabel">
+						<picker  name="type" @change="typeChange" :value="index" :range="typeList" range-key="dictLabel">
 							<view class="picker">{{form.type||'请选择类型'}}</view>
 						</picker>
 					</view>
 				</view>
 				<view class="value other">
 					<view class="title">城市</view>
-					<view class="label" @tap="toCity">
+					<view class="label" @tap="toCity" name="city">
 						<text v-if="form.city">{{form.city}}</text>
 						<text v-else>请选择城市</text>
 					</view>
@@ -35,7 +35,7 @@
 				<view class="value other">
 					<view class="title">成立时间</view>
 					<view class="label">
-						<picker mode="date" @change="dateChange" :value="index" fields="month">
+						<picker name="date" mode="date" @change="dateChange" :value="index" fields="month">
 							<view class="picker">{{form.date||'请选择成立时间'}}</view>
 						</picker>
 					</view>
@@ -43,13 +43,13 @@
 				<view class="value other">
 					<view class="title">队服颜色</view>
 					<view class="label">
-						<input class="input" :value="form.color" placeholder="请输入队服颜色" />
+						<input name="color" class="input" :value="form.color" placeholder="请输入队服颜色" />
 					</view>
 				</view>
 				<view class="remark">
 					<view class="title">简介</view>
 					<view class="label">
-						<textarea :value="form.brief" placeholder="请简单描述球队" />
+						<textarea name="brief" :value="form.brief" placeholder="请简单描述球队" />
 					</view>
 				</view>
 				<view class="button">
@@ -140,6 +140,10 @@
 			}
 		});
 	};
+	// 创建
+	const formSubmit = (e) => {
+		console.log(e.deatil.value);
+	};
 </script>
 <style lang="scss" scoped>
 	.content {

+ 2 - 2
pagesHome/match/info.vue

@@ -1,7 +1,7 @@
 <template>
 	<view class="content">
 		<view class="one">
-			赛事详情
+			创建
 		</view>
 	</view>
 </template>
@@ -19,7 +19,7 @@
 	onLoad(async (options) => {
 		id.value = options && options.id
 		uni.setNavigationBarTitle({
-			title: options && options.name || '赛事详情'
+			title: options && options.name || '创建'
 		});
 		await searchConfig();
 		await search();

+ 44 - 0
pagesHome/person/index.vue

@@ -0,0 +1,44 @@
+<template>
+	<view class="content">
+		<view class="one">
+			ta的球队名片
+		</view>
+	</view>
+</template>
+
+<script setup lang="ts">
+	import { getCurrentInstance, ref } from 'vue';
+	//该依赖已内置不需要单独安装
+	import { onLoad } from "@dcloudio/uni-app";
+	// 请求接口
+	const $api = getCurrentInstance()?.appContext.config.globalProperties.$api;
+	// 基本信息
+	const config = ref({ logoUrl: '' });
+	// 详情信息id
+	const id = ref('');
+	onLoad(async (options) => {
+		id.value = options && options.id
+		await searchConfig();
+		await search();
+	})
+	// config信息
+	const searchConfig = async () => {
+		config.value = uni.getStorageSync('config');
+	};
+	// 查询
+	const search = async () => {
+		if (id.value) { }
+	};
+</script>
+<style lang="scss" scoped>
+	.content {
+		display: flex;
+		flex-direction: column;
+		width: 100vw;
+		height: 100vh;
+
+		.one {
+			padding: 2vw;
+		}
+	}
+</style>

+ 11 - 7
pagesHome/team/index.vue

@@ -8,26 +8,26 @@
 		<view class="thr">
 			<form @submit="formSubmit">
 				<view class="logo">
-					<image class="image" mode="aspectFill" :src="form.logo||'/static/qiudui.png'" @tap="Preview">
+					<image name="logo" class="image" mode="aspectFill" :src="form.logo||'/static/qiudui.png'" @tap="Preview">
 					</image>
 				</view>
 				<view class="value other">
 					<view class="title">名称</view>
 					<view class="label">
-						<input class="input" :value="form.name" placeholder="请输入名称" />
+						<input  name="name" class="input" :value="form.name" placeholder="请输入名称" />
 					</view>
 				</view>
 				<view class="value other">
 					<view class="title">类型</view>
 					<view class="label">
-						<picker @change="typeChange" :value="index" :range="typeList" range-key="dictLabel">
+						<picker  name="type" @change="typeChange" :value="index" :range="typeList" range-key="dictLabel">
 							<view class="picker">{{form.type||'请选择类型'}}</view>
 						</picker>
 					</view>
 				</view>
 				<view class="value other">
 					<view class="title">城市</view>
-					<view class="label" @tap="toCity">
+					<view class="label" @tap="toCity" name="city">
 						<text v-if="form.city">{{form.city}}</text>
 						<text v-else>请选择城市</text>
 					</view>
@@ -35,7 +35,7 @@
 				<view class="value other">
 					<view class="title">成立时间</view>
 					<view class="label">
-						<picker mode="date" @change="dateChange" :value="index" fields="month">
+						<picker name="date" mode="date" @change="dateChange" :value="index" fields="month">
 							<view class="picker">{{form.date||'请选择成立时间'}}</view>
 						</picker>
 					</view>
@@ -43,13 +43,13 @@
 				<view class="value other">
 					<view class="title">队服颜色</view>
 					<view class="label">
-						<input class="input" :value="form.color" placeholder="请输入队服颜色" />
+						<input name="color" class="input" :value="form.color" placeholder="请输入队服颜色" />
 					</view>
 				</view>
 				<view class="remark">
 					<view class="title">简介</view>
 					<view class="label">
-						<textarea :value="form.brief" placeholder="请简单描述球队" />
+						<textarea name="brief" :value="form.brief" placeholder="请简单描述球队" />
 					</view>
 				</view>
 				<view class="button">
@@ -140,6 +140,10 @@
 			}
 		});
 	};
+	// 创建
+	const formSubmit = (e) => {
+		console.log(e.deatil.value);
+	};
 </script>
 <style lang="scss" scoped>
 	.content {

+ 5 - 1
pagesHome/team/info.vue

@@ -181,7 +181,11 @@
 		})
 	};
 	// 创建
-	const toSave = () => { };
+	const toSave = () => {
+		uni.navigateTo({
+			url: `/pagesHome/create/index?id=${id.value}`,
+		})
+	};
 </script>
 <style lang="scss" scoped>
 	.content {

+ 8 - 6
pagesHome/team/person.vue

@@ -46,19 +46,19 @@
 						<view class="value">
 							<view class="title">手机号码</view>
 							<view class="label">
-								<input class="input" :value="form.phone" placeholder="请输入手机号码" />
+								<input name="phone" class="input" :value="form.phone" placeholder="请输入手机号码" />
 							</view>
 						</view>
 						<view class="value">
 							<view class="title">球员姓名</view>
 							<view class="label">
-								<input class="input" :value="form.name" placeholder="请输入球员姓名" />
+								<input name="name" class="input" :value="form.name" placeholder="请输入球员姓名" />
 							</view>
 						</view>
 						<view class="value">
 							<view class="title">球衣号码</view>
 							<view class="label">
-								<input class="input" :value="form.num" placeholder="请输入球衣号码" />
+								<input name="num" class="input" :value="form.num" placeholder="请输入球衣号码" />
 							</view>
 						</view>
 						<view class="button">
@@ -128,7 +128,9 @@
 	};
 	// 用户详细信息
 	const toInfo = async (item : any) => {
-		console.log(item);
+		uni.navigateTo({
+			url: `/pagesHome/person/index?id=${item._id || item.id}`,
+		})
 	};
 	// 去排序
 	const toSort = async (item : any) => {
@@ -169,8 +171,8 @@
 		popup.value.close();
 	};
 	// 添加临时成员
-	const toAdd = (data) => {
-		console.log(data);
+	const toAdd = (e) => {
+		console.log(e.deatil.value);
 	};
 	const change = (e) => {
 		show.value = e.show

+ 61 - 12
pagesMy/basic/index.vue

@@ -5,7 +5,8 @@
 				<view class="value icon">
 					<view class="title">头像</view>
 					<view class="label">
-						<image class="image" mode="aspectFill" :src="form.icon||config.logoUrl" @tap="Preview"></image>
+						<image name="icon" class="image" mode="aspectFill" :src="form.icon||config.logoUrl"
+							@tap="Preview"></image>
 					</view>
 				</view>
 				<view class="remark">
@@ -14,19 +15,19 @@
 				<view class="value other">
 					<view class="title">姓名</view>
 					<view class="label">
-						<input class="input" :value="form.name" placeholder="点击登录" />
+						<input name="name" class="input" :value="form.name" placeholder="请输入真实姓名" />
 					</view>
 				</view>
 				<view class="value other margin">
 					<view class="title">昵称</view>
 					<view class="label">
-						<input class="input" :value="form.nickname" placeholder="请输入昵称" />
+						<input name="nickname" class="input" :value="form.nickname" placeholder="请输入昵称" />
 					</view>
 				</view>
 				<view class="value other">
 					<view class="title">性别</view>
 					<view class="label">
-						<picker @change="sexChange" :value="index" :range="sexList" range-key="dictLabel">
+						<picker name="sex" @change="sexChange" :value="index" :range="sexList" range-key="dictLabel">
 							<view class="picker">{{form.sex||'请选择性别'}}</view>
 						</picker>
 					</view>
@@ -34,12 +35,12 @@
 				<view class="value other">
 					<view class="title">手机号</view>
 					<view class="label">
-						<input class="input" :value="form.phone" placeholder="请输入手机号" />
+						<input name="phone" class="input" :value="form.phone" placeholder="请输入手机号" />
 					</view>
 				</view>
 				<view class="value other">
 					<view class="title">城市</view>
-					<view class="label" @tap="toCity">
+					<view class="label" @tap="toCity" name="city">
 						<text v-if="form.city">{{form.city}}</text>
 						<text v-else>请选择城市</text>
 					</view>
@@ -47,19 +48,19 @@
 				<view class="value other">
 					<view class="title">身高</view>
 					<view class="label">
-						<input class="input" :value="form.height" placeholder="请输入身高" />
+						<input name="height" class="input" :value="form.height" placeholder="请输入身高(cm)" />
 					</view>
 				</view>
 				<view class="value other">
 					<view class="title">体重</view>
 					<view class="label">
-						<input class="input" :value="form.weight" placeholder="请输入体重" />
+						<input name="weight" class="input" :value="form.weight" placeholder="请输入体重(kg)" />
 					</view>
 				</view>
 				<view class="value other margin">
 					<view class="title">主要项目</view>
 					<view class="label">
-						<picker @change="typeChange" :value="index" :range="typeList" range-key="dictLabel">
+						<picker name="type" @change="typeChange" :value="index" :range="typeList" range-key="dictLabel">
 							<view class="picker">{{form.type||'请选择主要项目'}}</view>
 						</picker>
 					</view>
@@ -67,13 +68,17 @@
 				<view class="value other">
 					<view class="title">球龄</view>
 					<view class="label">
-						<input class="input" :value="form.ballYears" placeholder="请输入球龄" />
+						<picker name="ballYears" @change="ballYearsChange" :value="index" :range="ballYearsList"
+							range-key="dictLabel">
+							<view class="picker">{{form.ballYears||'请选择球龄'}}</view>
+						</picker>
 					</view>
 				</view>
 				<view class="value other">
 					<view class="title">队内位置</view>
 					<view class="label">
-						<picker @change="placeChange" :value="index" :range="placeList" range-key="dictLabel">
+						<picker name="place" @change="placeChange" :value="index" :range="placeList"
+							range-key="dictLabel">
 							<view class="picker">{{form.place||'请选择队内位置'}}</view>
 						</picker>
 					</view>
@@ -106,6 +111,7 @@
 	const sexList = ref([]);
 	const typeList = ref([]);
 	const placeList = ref([]);
+	const ballYearsList = ref([]);
 	onLoad(async () => {
 		await searchOther();
 		await searchConfig();
@@ -126,6 +132,9 @@
 		// 队内位置
 		res = await $api(`dict/data/list`, 'GET', { dictType: 'sys_user_place' });
 		if (res.code === 200 && res.total > 0) placeList.value = res.rows
+		// 球龄
+		res = await $api(`dict/data/list`, 'GET', { dictType: 'sys_user_year' });
+		if (res.code === 200 && res.total > 0) ballYearsList.value = res.rows
 	};
 	// config信息
 	const searchConfig = async () => {
@@ -137,7 +146,13 @@
 			openid: openid.value
 		});
 		if (res.code === 200) {
-			if (res.data) console.log(res.data);
+			if (res.data) {
+				form.value = res.data
+				form.value.sex = toData(form.value.sex, sexList.value)
+				form.value.type = toData(form.value.type, typeList.value)
+				form.value.place = toData(form.value.place, placeList.value)
+				form.value.ballYears = toData(form.value.ballYears, ballYearsList.value)
+			}
 			else {
 				uni.navigateTo({
 					url: `/pages/login/index`,
@@ -150,6 +165,10 @@
 			});
 		}
 	};
+	// 处理字典表数据
+	const toData = (value, list) => {
+		if (value) return value = list[value].dictLabel
+	};
 	// 城市选择
 	const toCity = () => {
 		if (form.value.city) {
@@ -177,6 +196,11 @@
 		const data = placeList.value[e.detail.value]
 		if (data) form.value.place = data.dictLabel
 	};
+	// 球龄选择
+	const ballYearsChange = (e) => {
+		const data = ballYearsList.value[e.detail.value]
+		if (data) form.value.ballYears = data.dictLabel
+	};
 	// 上传图片
 	const Preview = () => {
 		uni.chooseImage({
@@ -198,6 +222,31 @@
 			}
 		});
 	};
+	// 去除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) => {
+		const data = delEmptyQueryNodes(e.detail.value)
+		data.id = form.value.id
+		if (form.value.icon) data.icon = form.value.icon
+		if (form.value.city) data.city = form.value.city
+		const arr = await $api(`matchUser`, 'put', data);
+		if (arr.code === 200) {
+			search();
+		} else {
+			uni.showToast({
+				title: arr.msg,
+				icon: 'error'
+			});
+		}
+	};
 </script>
 <style lang="scss" scoped>
 	.content {

+ 2 - 0
unpackage/dist/dev/mp-weixin/app.js

@@ -19,6 +19,8 @@ if (!Math) {
   "./pagesHome/match/info.js";
   "./pagesHome/activity/index.js";
   "./pagesHome/activity/info.js";
+  "./pagesHome/person/index.js";
+  "./pagesHome/create/index.js";
   "./pagesMy/basic/index.js";
 }
 const _sfc_main = {

+ 3 - 1
unpackage/dist/dev/mp-weixin/app.json

@@ -19,7 +19,9 @@
         "match/index",
         "match/info",
         "activity/index",
-        "activity/info"
+        "activity/info",
+        "person/index",
+        "create/index"
       ]
     },
     {

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

@@ -71,7 +71,7 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
       });
       if (res.code === 200) {
         if (res.data)
-          console.log(res.data);
+          user.value = res.data;
         else
           popup.value.open();
       } else {

+ 1 - 0
unpackage/dist/dev/mp-weixin/pages/home/index.wxss

@@ -18,6 +18,7 @@
   width: 15vw;
   height: 15vw;
   border-radius: 20vw;
+  background: var(--mainColor);
 }
 .content .one .one_1 .name.data-v-4978fed5 {
   padding: 0 1vw 0 2vw;

+ 8 - 15
unpackage/dist/dev/mp-weixin/pages/login/index.js

@@ -4,7 +4,7 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
   __name: "index",
   setup(__props) {
     var _a;
-    (_a = common_vendor.getCurrentInstance()) == null ? void 0 : _a.appContext.config.globalProperties.$api;
+    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");
     });
@@ -17,19 +17,12 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
             success: async function(res) {
               let parmas = {
                 openid: openid.value,
-                icon: res.userInfo.avatarUrl,
                 nickname: res.userInfo.nickName + common_vendor.hooks().valueOf()
               };
-              const arr = await that.$api(`matchUser`, "POST", parmas);
+              const arr = await $api(`matchUser`, "POST", parmas);
               if (arr.code === 200) {
-                common_vendor.index.setStorage({
-                  key: "user",
-                  data: arr.data,
-                  success: function() {
-                    common_vendor.index.navigateBack({
-                      delta: 1
-                    });
-                  }
+                common_vendor.index.navigateBack({
+                  delta: 1
                 });
               } else {
                 common_vendor.index.showToast({
@@ -60,15 +53,15 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
         url: `/pagesHome/agree/index`
       });
     };
+    const changeAgree = () => {
+      agree.value = !agree.value;
+    };
     return (_ctx, _cache) => {
       return {
         a: common_vendor.o(($event) => otherLogin()),
         b: agree.value,
         c: common_vendor.o(($event) => toAgree()),
-        d: common_vendor.o(
-          //@ts-ignore
-          (...args) => _ctx.changeAgree && _ctx.changeAgree(...args)
-        )
+        d: common_vendor.o(changeAgree)
       };
     };
   }

+ 46 - 1
unpackage/dist/dev/mp-weixin/pagesHome/activity/info.js

@@ -1,11 +1,22 @@
 "use strict";
 const common_vendor = require("../../common/vendor.js");
+if (!Array) {
+  const _easycom_uni_segmented_control2 = common_vendor.resolveComponent("uni-segmented-control");
+  _easycom_uni_segmented_control2();
+}
+const _easycom_uni_segmented_control = () => "../../uni_modules/uni-segmented-control/components/uni-segmented-control/uni-segmented-control.js";
+if (!Math) {
+  _easycom_uni_segmented_control();
+}
 const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
   __name: "info",
   setup(__props) {
     var _a;
     (_a = common_vendor.getCurrentInstance()) == null ? void 0 : _a.appContext.config.globalProperties.$api;
     const config = common_vendor.ref({ logoUrl: "" });
+    const info = common_vendor.ref({});
+    const list = common_vendor.ref(["出勤报名", "数据统计"]);
+    const current = common_vendor.ref(0);
     const id = common_vendor.ref("");
     common_vendor.onLoad(async (options) => {
       id.value = options && options.id;
@@ -22,8 +33,42 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
       if (id.value)
         ;
     };
+    const onClickItem = (e) => {
+      if (current.value !== e.currentIndex)
+        current.value = e.currentIndex;
+    };
+    const getDayOfWeek = (dateString) => {
+      if (dateString) {
+        const date = new Date(dateString);
+        const dayOfWeek = date.getDay();
+        const weekdays = ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"];
+        return weekdays[dayOfWeek];
+      } else
+        return "暂无日期";
+    };
     return (_ctx, _cache) => {
-      return {};
+      return {
+        a: common_vendor.t(info.value.number || 0),
+        b: common_vendor.t(info.value.wheel || 0),
+        c: info.value.red_logo || config.value.logoUrl,
+        d: common_vendor.t(info.value.red_name || "暂无红方名称"),
+        e: common_vendor.t(info.value.red_score || 0),
+        f: common_vendor.t(info.value.blue_score || 0),
+        g: info.value.blue_logo || config.value.logoUrl,
+        h: common_vendor.t(info.value.blue_name || "暂无蓝方名称"),
+        i: common_vendor.t(getDayOfWeek(info.value.time)),
+        j: common_vendor.t(info.value.time || "暂无时间"),
+        k: common_vendor.t(info.value.address || "暂无地点"),
+        l: common_vendor.o(onClickItem),
+        m: common_vendor.p({
+          current: current.value,
+          values: list.value,
+          styleType: "text",
+          activeColor: "#dd524d"
+        }),
+        n: current.value === 0,
+        o: current.value === 1
+      };
     };
   }
 });

+ 3 - 1
unpackage/dist/dev/mp-weixin/pagesHome/activity/info.json

@@ -1,4 +1,6 @@
 {
   "navigationBarTitleText": "活动详情",
-  "usingComponents": {}
+  "usingComponents": {
+    "uni-segmented-control": "../../uni_modules/uni-segmented-control/components/uni-segmented-control/uni-segmented-control"
+  }
 }

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 1 - 1
unpackage/dist/dev/mp-weixin/pagesHome/activity/info.wxml


+ 74 - 0
unpackage/dist/dev/mp-weixin/pagesHome/activity/info.wxss

@@ -7,5 +7,79 @@
   height: 100vh;
 }
 .content .one.data-v-24c37ea1 {
+  background-color: var(--f12Color);
+  padding: 0 0 10vw 0;
+}
+.content .one .one_1.data-v-24c37ea1 {
   padding: 2vw;
+  text-align: center;
+  font-size: var(--font14Size);
+  color: var(--f99Color);
+}
+.content .one .one_2.data-v-24c37ea1 {
+  display: flex;
+  justify-content: space-around;
+  align-items: center;
+  color: var(--mainColor);
+}
+.content .one .one_2 .left.data-v-24c37ea1 {
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+}
+.content .one .one_2 .left .image.data-v-24c37ea1 {
+  width: 12vw;
+  height: 12vw;
+  border-radius: 12vw;
+}
+.content .one .one_2 .left .name.data-v-24c37ea1 {
+  margin: 2vw 0 0 0;
+}
+.content .one .one_2 .center.data-v-24c37ea1 {
+  font-size: 25px;
+}
+.content .one .one_2 .right.data-v-24c37ea1 {
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+}
+.content .one .one_2 .right .image.data-v-24c37ea1 {
+  width: 12vw;
+  height: 12vw;
+  border-radius: 12vw;
+}
+.content .one .one_2 .right .name.data-v-24c37ea1 {
+  margin: 2vw 0 0 0;
+}
+.content .one .one_3.data-v-24c37ea1 {
+  color: var(--mainColor);
+  text-align: center;
+  padding: 2vw;
+  font-size: var(--font16Size);
+}
+.content .one .one_3 text.data-v-24c37ea1 {
+  padding: 2px 5px;
+  background-color: rgba(105, 105, 105, 0.9);
+  border-radius: 2vw;
+}
+.content .one .one_4.data-v-24c37ea1 {
+  text-align: center;
+  padding: 2vw;
+}
+.content .one .one_4 text.data-v-24c37ea1 {
+  font-size: var(--font14Size);
+  padding: 2px 5px;
+  background-color: rgba(105, 105, 105, 0.9);
+  border-radius: 10vw;
+  color: var(--mainColor);
+}
+.content .position.data-v-24c37ea1 {
+  position: absolute;
+  top: 50vw;
+}
+.content .position .two.data-v-24c37ea1 {
+  width: 100vw;
+  border-top-left-radius: 25px;
+  border-top-right-radius: 25px;
+  background-color: var(--mainColor);
 }

+ 28 - 0
unpackage/dist/dev/mp-weixin/pagesHome/create/index.js

@@ -0,0 +1,28 @@
+"use strict";
+const common_vendor = require("../../common/vendor.js");
+const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
+  __name: "index",
+  setup(__props) {
+    var _a;
+    (_a = common_vendor.getCurrentInstance()) == null ? void 0 : _a.appContext.config.globalProperties.$api;
+    const config = common_vendor.ref({ logoUrl: "" });
+    const id = common_vendor.ref("");
+    common_vendor.onLoad(async (options) => {
+      id.value = options && options.id;
+      await searchConfig();
+      await search();
+    });
+    const searchConfig = async () => {
+      config.value = common_vendor.index.getStorageSync("config");
+    };
+    const search = async () => {
+      if (id.value)
+        ;
+    };
+    return (_ctx, _cache) => {
+      return {};
+    };
+  }
+});
+const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-fe92273c"], ["__file", "D:/project/足球比赛/match_applet/pagesHome/create/index.vue"]]);
+wx.createPage(MiniProgramPage);

+ 4 - 0
unpackage/dist/dev/mp-weixin/pagesHome/create/index.json

@@ -0,0 +1,4 @@
+{
+  "navigationBarTitleText": "创建",
+  "usingComponents": {}
+}

+ 1 - 0
unpackage/dist/dev/mp-weixin/pagesHome/create/index.wxml

@@ -0,0 +1 @@
+<view class="content data-v-fe92273c"><view class="one data-v-fe92273c"> 创建 </view></view>

+ 11 - 0
unpackage/dist/dev/mp-weixin/pagesHome/create/index.wxss

@@ -0,0 +1,11 @@
+/* 水平间距 */
+/* 水平间距 */
+.content.data-v-fe92273c {
+  display: flex;
+  flex-direction: column;
+  width: 100vw;
+  height: 100vh;
+}
+.content .one.data-v-fe92273c {
+  padding: 2vw;
+}

+ 4 - 4
unpackage/dist/dev/mp-weixin/pagesHome/match/index.js

@@ -74,6 +74,9 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
         }
       });
     };
+    const formSubmit = (e) => {
+      console.log(e.deatil.value);
+    };
     return (_ctx, _cache) => {
       return common_vendor.e({
         a: form.value.logo || "/static/qiudui.png",
@@ -93,10 +96,7 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
         m: _ctx.index,
         n: form.value.color,
         o: form.value.brief,
-        p: common_vendor.o(
-          //@ts-ignore
-          (...args) => _ctx.formSubmit && _ctx.formSubmit(...args)
-        )
+        p: common_vendor.o(formSubmit)
       });
     };
   }

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 1 - 1
unpackage/dist/dev/mp-weixin/pagesHome/match/index.wxml


+ 1 - 1
unpackage/dist/dev/mp-weixin/pagesHome/match/info.js

@@ -10,7 +10,7 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
     common_vendor.onLoad(async (options) => {
       id.value = options && options.id;
       common_vendor.index.setNavigationBarTitle({
-        title: options && options.name || "赛事详情"
+        title: options && options.name || "创建"
       });
       await searchConfig();
       await search();

+ 1 - 1
unpackage/dist/dev/mp-weixin/pagesHome/match/info.wxml

@@ -1 +1 @@
-<view class="content data-v-dc3bb826"><view class="one data-v-dc3bb826"> 赛事详情 </view></view>
+<view class="content data-v-dc3bb826"><view class="one data-v-dc3bb826"> 创建 </view></view>

+ 28 - 0
unpackage/dist/dev/mp-weixin/pagesHome/person/index.js

@@ -0,0 +1,28 @@
+"use strict";
+const common_vendor = require("../../common/vendor.js");
+const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
+  __name: "index",
+  setup(__props) {
+    var _a;
+    (_a = common_vendor.getCurrentInstance()) == null ? void 0 : _a.appContext.config.globalProperties.$api;
+    const config = common_vendor.ref({ logoUrl: "" });
+    const id = common_vendor.ref("");
+    common_vendor.onLoad(async (options) => {
+      id.value = options && options.id;
+      await searchConfig();
+      await search();
+    });
+    const searchConfig = async () => {
+      config.value = common_vendor.index.getStorageSync("config");
+    };
+    const search = async () => {
+      if (id.value)
+        ;
+    };
+    return (_ctx, _cache) => {
+      return {};
+    };
+  }
+});
+const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-4424ab31"], ["__file", "D:/project/足球比赛/match_applet/pagesHome/person/index.vue"]]);
+wx.createPage(MiniProgramPage);

+ 4 - 0
unpackage/dist/dev/mp-weixin/pagesHome/person/index.json

@@ -0,0 +1,4 @@
+{
+  "navigationBarTitleText": "Ta的球队名片",
+  "usingComponents": {}
+}

+ 1 - 0
unpackage/dist/dev/mp-weixin/pagesHome/person/index.wxml

@@ -0,0 +1 @@
+<view class="content data-v-4424ab31"><view class="one data-v-4424ab31"> ta的球队名片 </view></view>

+ 11 - 0
unpackage/dist/dev/mp-weixin/pagesHome/person/index.wxss

@@ -0,0 +1,11 @@
+/* 水平间距 */
+/* 水平间距 */
+.content.data-v-4424ab31 {
+  display: flex;
+  flex-direction: column;
+  width: 100vw;
+  height: 100vh;
+}
+.content .one.data-v-4424ab31 {
+  padding: 2vw;
+}

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

@@ -74,6 +74,9 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
         }
       });
     };
+    const formSubmit = (e) => {
+      console.log(e.deatil.value);
+    };
     return (_ctx, _cache) => {
       return common_vendor.e({
         a: form.value.logo || "/static/qiudui.png",
@@ -93,10 +96,7 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
         m: _ctx.index,
         n: form.value.color,
         o: form.value.brief,
-        p: common_vendor.o(
-          //@ts-ignore
-          (...args) => _ctx.formSubmit && _ctx.formSubmit(...args)
-        )
+        p: common_vendor.o(formSubmit)
       });
     };
   }

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 1 - 1
unpackage/dist/dev/mp-weixin/pagesHome/team/index.wxml


+ 3 - 0
unpackage/dist/dev/mp-weixin/pagesHome/team/info.js

@@ -56,6 +56,9 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
       });
     };
     const toSave = () => {
+      common_vendor.index.navigateTo({
+        url: `/pagesHome/create/index?id=${id.value}`
+      });
     };
     return (_ctx, _cache) => {
       return {

+ 5 - 3
unpackage/dist/dev/mp-weixin/pagesHome/team/person.js

@@ -47,7 +47,9 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
       }
     };
     const toInfo = async (item) => {
-      console.log(item);
+      common_vendor.index.navigateTo({
+        url: `/pagesHome/person/index?id=${item._id || item.id}`
+      });
     };
     const toSort = async (item) => {
       let list2;
@@ -84,8 +86,8 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
     const toClose = () => {
       popup.value.close();
     };
-    const toAdd = (data) => {
-      console.log(data);
+    const toAdd = (e) => {
+      console.log(e.deatil.value);
     };
     const change = (e) => {
       show.value = e.show;

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 1 - 1
unpackage/dist/dev/mp-weixin/pagesHome/team/person.wxml


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

@@ -15,6 +15,7 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
     const sexList = common_vendor.ref([]);
     const typeList = common_vendor.ref([]);
     const placeList = common_vendor.ref([]);
+    const ballYearsList = common_vendor.ref([]);
     common_vendor.onLoad(async () => {
       await searchOther();
       await searchConfig();
@@ -34,6 +35,9 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
       res = await $api(`dict/data/list`, "GET", { dictType: "sys_user_place" });
       if (res.code === 200 && res.total > 0)
         placeList.value = res.rows;
+      res = await $api(`dict/data/list`, "GET", { dictType: "sys_user_year" });
+      if (res.code === 200 && res.total > 0)
+        ballYearsList.value = res.rows;
     };
     const searchConfig = async () => {
       config.value = common_vendor.index.getStorageSync("config");
@@ -43,9 +47,13 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
         openid: openid.value
       });
       if (res.code === 200) {
-        if (res.data)
-          console.log(res.data);
-        else {
+        if (res.data) {
+          form.value = res.data;
+          form.value.sex = toData(form.value.sex, sexList.value);
+          form.value.type = toData(form.value.type, typeList.value);
+          form.value.place = toData(form.value.place, placeList.value);
+          form.value.ballYears = toData(form.value.ballYears, ballYearsList.value);
+        } else {
           common_vendor.index.navigateTo({
             url: `/pages/login/index`
           });
@@ -57,6 +65,10 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
         });
       }
     };
+    const toData = (value, list) => {
+      if (value)
+        return value = list[value].dictLabel;
+    };
     const toCity = () => {
       if (form.value.city) {
         common_vendor.index.navigateTo({
@@ -83,6 +95,11 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
       if (data)
         form.value.place = data.dictLabel;
     };
+    const ballYearsChange = (e) => {
+      const data = ballYearsList.value[e.detail.value];
+      if (data)
+        form.value.ballYears = data.dictLabel;
+    };
     const Preview = () => {
       common_vendor.index.chooseImage({
         count: 1,
@@ -107,6 +124,31 @@ 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) => {
+      const data = delEmptyQueryNodes(e.detail.value);
+      data.id = form.value.id;
+      if (form.value.icon)
+        data.icon = form.value.icon;
+      if (form.value.city)
+        data.city = form.value.city;
+      const arr = await $api(`matchUser`, "put", data);
+      if (arr.code === 200) {
+        search();
+      } else {
+        common_vendor.index.showToast({
+          title: arr.msg,
+          icon: "error"
+        });
+      }
+    };
     return (_ctx, _cache) => {
       return common_vendor.e({
         a: form.value.icon || config.value.logoUrl,
@@ -129,15 +171,15 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
         p: common_vendor.o(typeChange),
         q: _ctx.index,
         r: typeList.value,
-        s: form.value.ballYears,
-        t: common_vendor.t(form.value.place || "请选择队内位置"),
-        v: common_vendor.o(placeChange),
-        w: _ctx.index,
-        x: placeList.value,
-        y: common_vendor.o(
-          //@ts-ignore
-          (...args) => _ctx.formSubmit && _ctx.formSubmit(...args)
-        )
+        s: common_vendor.t(form.value.ballYears || "请选择球龄"),
+        t: common_vendor.o(ballYearsChange),
+        v: _ctx.index,
+        w: ballYearsList.value,
+        x: common_vendor.t(form.value.place || "请选择队内位置"),
+        y: common_vendor.o(placeChange),
+        z: _ctx.index,
+        A: placeList.value,
+        B: common_vendor.o(formSubmit)
       });
     };
   }

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 1 - 1
unpackage/dist/dev/mp-weixin/pagesMy/basic/index.wxml