personInfo.vue 3.64 KB
<template>
	<view class="page-container">
	

		<!-- 信息展示区域 -->
		<view class="info-section">
			<view class="info-item">
				<view class="info-label">姓名</view>
				<view class="info-value">{{ perInfo?.perName || '' }}</view>
			</view>
			<!-- <view class="info-item">
				<view class="info-label">证件类型</view>
				<view class="info-value">{{ getCertType(perInfo?.idcType) }}</view>
			</view> -->
			<view class="info-item">
				<view class="info-label">身份证号</view>
				<view class="info-value">{{ perInfo?.perIdcCode || '--' }}</view>
			</view>
			<view class="info-item">
				<view class="info-label">生日</view>
				<view class="info-value">{{ perInfo?.birth || '--' }}</view>
			</view>
			<view class="info-item">
				<view class="info-label">会员卡号</view>
				<view class="info-value">{{ perInfo?.perCode || '--' }}</view>
			</view>
			<view class="info-item">
				<view class="info-label">会员有效期</view>
				<view class="info-value">{{ perInfo?.perValidDate || '--' }}</view>
			</view>
			<!-- <view class="info-item">
				<view class="info-label">性别</view>
				<view class="info-value">{{ getGender(perInfo?.gender) }}</view>
			</view>
			<view class="info-item">
				<view class="info-label">民族</view>
				<view class="info-value">{{ perInfo?.nation || '--' }}</view>
			</view>
			<view class="info-item">
				<view class="info-label">联系电话</view>
				<view class="info-value">{{ perInfo?.phone || '--' }}</view>
			</view>
			<view class="info-item">
				<view class="info-label">邮箱</view>
				<view class="info-value">{{ perInfo?.email || '--' }}</view>
			</view> -->
			<!-- <view class="info-item">
				<view class="info-label">地址</view>
				<view class="info-value">{{ perInfo?.address || '--' }}</view>
			</view> -->
		</view>
	</view>
</template>

<script setup>
	import { computed, onMounted } from 'vue';
	import { useUserStore } from '../store/modules/user';

	const userStore = useUserStore();
	const perInfo = computed(() => userStore.perInfo);

	// 返回上一页
	const goBack = () => {
		uni.navigateBack();
	};

	// 获取证件类型
	const getCertType = (type) => {
		switch (type) {
			case '1':
				return '身份证';
			case '2':
				return '护照';
			case '3':
				return '军官证';
			case '4':
				return '港澳通行证';
			case '5':
				return '台湾通行证';
			default:
				return '--';
		}
	};

	// 获取性别
	const getGender = (gender) => {
		switch (gender) {
			case '1':
				return '男';
			case '2':
				return '女';
			default:
				return '--';
		}
	};

	onMounted(() => {
		// 可以在这里添加额外的初始化逻辑
	});
</script>

<style lang="scss" scoped>
	.page-container {
		min-height: 100vh;
		background: #f5f5f5;
	}

	/* 导航栏 */
	.nav-bar {
		display: flex;
		align-items: center;
		justify-content: space-between;
		height: 88rpx;
		background: #ffffff;
		padding: 0 30rpx;
		box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.06);
		position: sticky;
		top: 0;
		z-index: 100;
	}

	.nav-left {
		width: 44rpx;
		height: 44rpx;
		display: flex;
		align-items: center;
		justify-content: center;
	}

	.nav-title {
		font-size: 32rpx;
		font-weight: 500;
		color: #333;
	}

	.nav-right {
		width: 44rpx;
	}

	/* 信息展示区域 */
	.info-section {
		margin: 20rpx;
		background: #ffffff;
	}

	.info-item {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 30rpx;
		border-bottom: 1rpx solid #f5f5f5;
	}

	.info-item:last-child {
		border-bottom: none;
	}

	.info-label {
		font-size: 28rpx;
		color: #666;
		width: 150rpx;
	}

	.info-value {
		font-size: 28rpx;
		color: #333;
		flex: 1;
		text-align: right;
		padding-left: 30rpx;
	}
</style>