Ver código fonte

家庭成员静态页面完成

htc 2 semanas atrás
pai
commit
336205945a
4 arquivos alterados com 385 adições e 1 exclusões
  1. 12 0
      pages.json
  2. 1 1
      pages/my.vue
  3. 188 0
      pagesMy/familyMember.vue
  4. 184 0
      pagesMy/familyMemberVindicate.vue

+ 12 - 0
pages.json

@@ -99,6 +99,18 @@
 						"navigationStyle": "custom"
 					}
 				},
+				{
+					"path": "familyMember",
+					"style": {
+						"navigationStyle": "custom"
+					}
+				},
+				{
+					"path": "familyMemberVindicate",
+					"style": {
+						"navigationStyle": "custom"
+					}
+				},
 				{
 					"path": "exclusiveScroll",
 					"style": {

+ 1 - 1
pages/my.vue

@@ -81,7 +81,7 @@
 					<image src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/09/18/53fb5a7a-e7fb-4e5d-b902-f434cfc6d786.png"></image>
 					<text>申领社会实践记录</text>
 				</div>
-				<div class="box-other-pre adffcac">
+				<div class="box-other-pre adffcac" @tap="handleTurnPage('/pagesMy/familyMember')">
 					<image src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/09/18/06acc5f2-45e8-43ea-96a3-c17e79a190bc.png"></image>
 					<text>家庭成员</text>
 				</div>

+ 188 - 0
pagesMy/familyMember.vue

@@ -0,0 +1,188 @@
+<template>
+	<view class="common_page adffc" :style="{'height':h+'px', 'padding-top':mt+'px'}">
+		<cus-header title="家庭成员" bgColor="#FFFFFF"></cus-header>
+		<div class="add">
+			<div class="btn adfacjc" @tap="handleAdd">
+				<image src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/10/09/af9133fd-e15e-454d-9152-e4629fd0ce28.png"></image>
+				<text>新增家庭成员</text>
+			</div>
+		</div>
+		<template v-if="list.length">
+			<div class="list">
+				<up-list @scrolltolower="scrolltolower" style="height: 100%;">
+					<up-list-item v-for="(item, index) in list" :key="index">
+						<div class="box adfacjb">
+							<div class="box-left adfac" @tap="handleEdit(item,index)">
+								<div class="box-left-edit">
+									<image src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/10/09/7799f9f2-1dca-4af3-980b-7f6def10e22f.png"></image>
+								</div>
+								<div class="box-left-info">
+									<div class="box-left-info-top adfac">
+										<div class="name">{{'张琳琳'}}</div>
+										<image class="sex" v-if="item.sex==2" src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/09/12/b6d1fcb3-55ba-4104-b8cd-756b963a4da8.png"></image>
+										<image class="sex" v-else-if="item.sex==1" src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/09/12/a1899fd0-c468-48d9-b554-2f17b75a4157.png"></image>
+										<div class="age" :class="{'women':item.sex==2,'man':item.sex==1}">{{46}}岁</div>
+									</div>
+									<div class="box-left-info-bottom">
+										身份证 {{'340123**********09'}}
+									</div>
+								</div>
+							</div>
+							<div class="box-right" @tap="handleDelete(item,index)">
+								<image src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/09/23/ebdf1327-3eeb-4797-8840-cb1ec4840d9a.png"></image>
+							</div>
+						</div>
+					</up-list-item>
+				</up-list>
+			</div>
+		</template>
+		<template v-else>
+			<div class="empty">暂无家庭成员,请添加</div>
+		</template>
+	</view>
+</template>
+
+<script setup name="">
+	import CusHeader from '@/components/CusHeader/index.vue'
+	import { ref } from 'vue'
+	
+	const list = ref([{sex:1},{sex:2},{sex:2}])
+	
+	const handleAdd = () => {
+		uni.navigateTo({
+			url:'/pagesMy/familyMemberVindicate'
+		})
+	}
+	
+	const handleEdit = (item,index) => {
+		uni.navigateTo({
+			url:'/pagesMy/familyMemberVindicate?member='+encodeURIComponent(JSON.stringify(item))
+		})
+	}
+	const handleDelete = (item,index) => {
+		uni.showModal({
+			title:'温馨提示',
+			content:`是否确认删除家庭成员【${item.name||'张琳琳'}】?`,
+			success: (res) => {
+				if(res.confirm){
+					
+				}
+			}
+		})
+	}
+</script>
+
+<style scoped lang="scss">
+	.common_page{
+		padding-bottom: 60rpx;
+		.add{
+			margin-top: 20rpx;
+			background: #FFFFFF;
+			border-radius: 20rpx 20rpx 0 0;
+			padding: 30rpx 24rpx 20rpx;
+			.btn{
+				width: 100%;
+				background: rgba(112,207,82,0.08);
+				border-radius: 24rpx;
+				border: 1rpx dotted #70CF52;
+				padding: 21rpx 0;
+				image{
+					width: 36rpx;
+					height: 36rpx;
+				}
+				text{
+					font-family: PingFang-SC, PingFang-SC;
+					font-weight: bold;
+					font-size: 28rpx;
+					color: #70CF52;
+					line-height: 40rpx;
+					margin-left: 18rpx;
+					letter-spacing: 2rpx;
+				}
+			}
+		}
+		
+		.list{
+			flex: 1;
+			overflow: auto;
+			background: #FFFFFF;
+			border-radius: 0 0 20rpx 20rpx;
+			padding: 0 24rpx;
+			.box{
+				padding: 37rpx 0;
+				box-shadow: inset 0rpx -1rpx 0rpx 0rpx #F2F2F2;
+				&-left{
+					width: calc(100% - 76rpx);
+					&-edit{
+						width: 36rpx;
+						height: 36rpx;
+						image{
+							width: 100%;
+							height: 100%;
+						}
+					}
+					&-info{
+						width: calc(100% - 36rpx);
+						padding-left: 20rpx;
+						box-sizing: border-box;
+						&-top{
+							.name{
+								font-family: PingFang-SC, PingFang-SC;
+								font-weight: bold;
+								font-size: 32rpx;
+								color: #151B29;
+								line-height: 32rpx;
+							}
+							.sex{
+								width: 44rpx;
+								height: 32rpx;
+								margin-left: 16rpx;
+							}
+							.age{
+								border-radius: 13rpx;
+								font-family: PingFangSC, PingFang SC;
+								font-weight: 400;
+								font-size: 20rpx;
+								line-height: 24rpx;
+								padding: 4rpx 10rpx;
+								margin-left: 13rpx;
+								&.women{
+									background: rgba(244,101,122,0.14);
+									color: #F4657A;
+								}
+								&.man{
+									background: rgba(5,169,254,0.12);
+									color: #05A9FE;
+								}
+							}
+						}
+						&-bottom{
+							font-family: PingFangSC, PingFang SC;
+							font-weight: 400;
+							font-size: 24rpx;
+							color: #989998;
+							line-height: 24rpx;
+							margin-top: 23rpx;
+						}
+					}
+				}
+				
+				&-right{
+					width: 36rpx;
+					height: 36rpx;
+					image{
+						width: 100%;
+						height: 100%;
+					}
+				}
+			}
+		}
+		
+		.empty{
+			margin-top: 300rpx;
+			text-align: center;
+			font-size: 32rpx;
+			color: #666666;
+		}
+	}
+</style>

+ 184 - 0
pagesMy/familyMemberVindicate.vue

@@ -0,0 +1,184 @@
+<template>
+	<view class="common_page" :style="{'min-height':h+'px', 'padding-top':mt+'px'}">
+		<cus-header :title="title" bgColor="#FFFFFF"></cus-header>
+		<div class="form">
+			<div class="title">家庭人员信息</div>
+			<div class="pre adfac" style="margin-top: 40rpx;">
+				<div class="pre-title"><span>*</span>人员类型</div>
+				<div class="pre-content adfac">
+					<div class="pre-content-box adfac" @tap="changeMember(1,'type')">
+						<image v-if="memberInfo.type==1" src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/10/09/9efae012-a9fd-4a0d-9e14-7ec90001e712.png"></image>
+						<image v-else src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/10/09/5ae64305-d1e0-4ffe-8dc0-f9d3704ac370.png"></image>
+						<text>成人</text>
+					</div>
+					<div class="pre-content-box adfac" @tap="changeMember(2,'type')">
+						<image v-if="memberInfo.type==2" src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/10/09/9efae012-a9fd-4a0d-9e14-7ec90001e712.png"></image>
+						<image v-else src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/10/09/5ae64305-d1e0-4ffe-8dc0-f9d3704ac370.png"></image>
+						<text>学生</text>
+					</div>
+				</div>
+			</div>
+			<div class="pre adfac">
+				<div class="pre-title"><span>*</span>姓名</div>
+				<div class="pre-content">
+					<up-input v-model="memberInfo.name" border="none" style="font-size: 30rpx;color: #252525;" placeholder="请输入姓名"></up-input>
+				</div>
+			</div>
+			<div class="pre adfac">
+				<div class="pre-title"><span>*</span>身份证</div>
+				<div class="pre-content">
+					<up-input v-model="memberInfo.idcard" border="none" style="font-size: 30rpx;color: #252525;" placeholder="请输入身份证"></up-input>
+				</div>
+			</div>
+			<div class="pre adfac">
+				<div class="pre-title"><span style="color: #FFFFFF;">*</span>义工号</div>
+				<div class="pre-content">
+					<up-input v-model="memberInfo.workNo" border="none" style="font-size: 30rpx;color: #252525;" placeholder="请输入义工号"></up-input>
+				</div>
+			</div>
+			<div class="pre adfac">
+				<div class="pre-title"><span>*</span>性别</div>
+				<div class="pre-content adfac">
+					<div class="pre-content-box adfac" @tap="changeMember(1,'sex')">
+						<image v-if="memberInfo.sex==1" src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/10/09/9efae012-a9fd-4a0d-9e14-7ec90001e712.png"></image>
+						<image v-else src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/10/09/5ae64305-d1e0-4ffe-8dc0-f9d3704ac370.png"></image>
+						<text>男</text>
+					</div>
+					<div class="pre-content-box adfac" @tap="changeMember(2,'sex')">
+						<image v-if="memberInfo.sex==2" src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/10/09/9efae012-a9fd-4a0d-9e14-7ec90001e712.png"></image>
+						<image v-else src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/10/09/5ae64305-d1e0-4ffe-8dc0-f9d3704ac370.png"></image>
+						<text>女</text>
+					</div>
+				</div>
+			</div>
+			<div class="pre adfac" v-if="memberInfo.type==2">
+				<div class="pre-title"><span>*</span>就读学校</div>
+				<div class="pre-content">
+					<up-input v-model="memberInfo.school" border="none" style="font-size: 30rpx;color: #252525;" placeholder="请输入就读学校"></up-input>
+				</div>
+			</div>
+		</div>
+		<div class="btn" @tap="handleSave">保存</div>
+	</view>
+</template>
+
+<script setup name="">
+	import CusHeader from '@/components/CusHeader/index.vue'
+	import { onLoad } from '@dcloudio/uni-app';
+	import { ref, getCurrentInstance } from 'vue'
+	const { proxy } = getCurrentInstance()
+	
+	const title = ref('添加家庭成员')
+	const memberInfo = ref({
+		type:1,
+		name:'',
+		idcard:'',
+		workNo:'',
+		sex:1,
+		school:''
+	})
+	
+	const changeMember = (value,key) => {
+		memberInfo.value[key] = value;
+	}
+	
+	const handleSave = () => {
+		if(!memberInfo.value.type) return proxy.$showToast('请选择人员类型')
+		if(!memberInfo.value.name) return proxy.$showToast('请输入姓名')
+		if(!proxy.$reg.idCard(memberInfo.value.idcard)) return proxy.$showToast('请输入正确的身份证号')
+		if(!memberInfo.value.sex) return proxy.$showToast('请选择性别')
+		if(!memberInfo.value.school&&memberInfo.value.type==2) return proxy.$showToast('请输入就读学校')
+		console.log(memberInfo.value);
+	}
+	
+	onLoad((options)=>{
+		if (options.member) {
+			try {
+				const memberObject = JSON.parse(decodeURIComponent(options.member));
+				console.log('成功解析的 member 对象:', memberObject);
+				if(memberObject) title.value = '编辑家庭成员';
+			} catch (e) {
+				console.error('解析 member 参数失败:', e);
+			}
+		} else {
+			console.warn('未在URL中找到 member 参数');
+		}
+	})
+</script>
+
+<style scoped lang="scss">
+	.common_page{
+		padding-bottom: 184rpx;
+		
+		.form{
+			background: #FFFFFF;
+			border-radius: 24rpx;
+			margin-top: 20rpx;
+			padding: 36rpx 24rpx 0;
+			
+			.title{
+				font-family: PingFang-SC, PingFang-SC;
+				font-weight: bold;
+				font-size: 36rpx;
+				color: #151B29;
+				line-height: 48rpx;
+			}
+		
+			.pre{
+				padding: 25rpx 0;
+				box-shadow: inset 0rpx -1rpx 0rpx 0rpx #F2F2F2;
+				&-title{
+					width: 209rpx;
+					font-family: PingFangSC, PingFang SC;
+					font-weight: 400;
+					font-size: 28rpx;
+					color: #676775;
+					line-height: 40rpx;
+					label{
+						font-family: PingFangSC, PingFang SC;
+						font-weight: 400;
+						font-size: 30rpx;
+						color: #F4657A;
+						line-height: 42rpx;
+						margin-right: 4rpx;
+					}
+				}
+				&-content{
+					width: calc(100% - 209rpx);
+					&-box{
+						width: 184rpx;
+						image{
+							width: 28rpx;
+							height: 28rpx;
+						}
+						text{
+							font-family: PingFangSC, PingFang SC;
+							font-weight: 400;
+							font-size: 30rpx;
+							color: #252525;
+							line-height: 42rpx;
+							margin-left: 16rpx;
+						}
+					}
+				}
+			}
+		}
+		
+		.btn{
+			width: calc(100% - 80rpx);
+			height: 90rpx;
+			background: #B7F358;
+			border-radius: 45rpx;
+			font-family: PingFang-SC, PingFang-SC;
+			font-weight: bold;
+			font-size: 32rpx;
+			color: #151B29;
+			line-height: 90rpx;
+			text-align: center;
+			letter-spacing: 2rpx;
+			position: fixed;
+			left: 40rpx;
+			bottom: 64rpx;
+		}
+	}
+</style>