Newer
Older
xinJiangMiniProgranm / packageA / accountInfo / accountInfo.vue
liyaguang on 28 Jun 2023 5 KB 个人信息/举报电话
<!-- 账号信息 -->
<template>
	<view class="account-info">
		<image src="http://111.198.10.15:11604/png/back_ts.png" style="position:absolute;top: -4rpx;left: 0;z-index: -999; width:100%;height: 300rpx;"></image>
		<view class="main" v-if="">
			<view class="title">个人信息</view>
			<view class="info" v-for="item in list" :key="item.id">
				<view class="title-icon">
					<image :src="item.icon" style="width: 48rpx;height: 48rpx;margin-right: 12rpx;"  mode=""></image>
					<text class="name">{{item.name}}</text>
				</view>
				<view style="margin-left: 40rpx;">{{item.value}}</view>
			</view>
		</view>
		
		<!-- <view class="button" @click="changePage('accountBound')">{{isShowInfo ? '绑定' : '重新绑定'}}</view> -->
		<view class="button-bottom">
			<!-- <view class="button button-left" @click="changePage('register')">用户注册</view> -->
			<view class="button" @click="changePage('changePassword')">修改密码</view>
		</view>
	</view>
</template>

<script>
import { hidePhone } from '../../common/utils.js'
	export default {
		data() {
			return {
				list: [
					{
						id: 'username',
						name: '用户名:',
						value: '',
						icon: 'http://111.198.10.15:11604/png/back_ts.png'
					},
					{
						id: 'name',
						name: '姓名:',
						value: '',
						icon: '../../static/mine/name.png'
					},
					// {
					// 	id: 'sex',
					// 	name: '性别:',
					// 	value: '',
					// 	icon: '../../static/mine/sex.png'
					// },
					{
						id: 'phone',
						name: '手机号:',
						value: '',
						icon: '../../static/mine/phone.png'
					},
					{
						id: 'email',
						name: '电子邮箱:',
						value: '',
						icon: '../../static/mine/email.png'
					},
					// {
					// 	id: 'region',
					// 	name: '地区:',
					// 	value: '',
					// 	icon: '../../static/mine/region.png'
					// },
					// {
					// 	id: 'address',
					// 	name: '详细地址:',
					// 	value: '',
					// 	icon: '../../static/mine/address.png'
					// },
				],
				isShowInfo: true,
			}
		},
		mounted() {
			this.getData();
		},
		methods: {
			getData() {
				const userinfo = wx.getStorageSync('userInfoxj')
				console.log(userinfo, 'userinfo')
				this.$set(this.list, 0, {
					id: 'username',
					name: '用户名:',
					value: userinfo.account,
					icon: '../../static/mine/username.png'
				});
				this.$set(this.list, 1, {
					id: 'name',
					name: '姓名:',
					value: userinfo.name,
					icon: '../../static/mine/name.png'
				},);
				// this.$set(this.list, 2, {
				// 	id: 'sex',
				// 	name: '性别:',
				// 	value: userinfo.sex,
				// 	icon: '../../static/mine/sex.png'
				// },);
				this.$set(this.list, 2, {
					id: 'phone',
					name: '手机号:',
					value: hidePhone(userinfo.phone),
					icon: '../../static/mine/phone.png'
				},);
				this.$set(this.list, 3, {
					id: 'email',
					name: '电子邮箱:',
					value: userinfo.email,
					icon: '../../static/mine/email.png'
				},);
				// this.$set(this.list, 5, {
				// 	id: 'region',
				// 	name: '地区:',
				// 	value: `${userinfo.province}/${userinfo.city}/${userinfo.county}`,
				// 	icon: '../../static/mine/region.png'
				// });
				// this.$set(this.list, 6, {
				// 	id: 'address',
				// 	name: '详细地址:',
				// 	value: userinfo.address,
				// 	icon: '../../static/mine/address.png'
				// },);
				this.isShowInfo = this.list.every(item => {
					return item.value === '';
				});

			},
			changePage(val) {
				let url = `/packageA/${val}/${val}`
				wx.navigateTo({
					url: url
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.account-info {
		padding: 40rpx 20rpx;
		padding-top: 186rpx;
		width: 100%;
		height: 100%;
		box-sizing: border-box;
		.main {
			padding: 20rpx;
			box-sizing: border-box;
			background-color: #fff;
			border-radius: 16rpx;
			.title {
				width: 100%;
				text-align: center;
				font-size: 36rpx;
				font-weight: 600;
				margin-bottom: 50rpx;
			}
			.info {
				display: flex;
				justify-content: space-between;
				align-items: center;
				margin: 32rpx 0;
				.title-icon {
					display: flex;
					align-items: center;
					font-size: 30rpx;
					font-weight: 600;
					white-space: nowrap;
				}
			}
		}
		.button {
			width: 100%;
			display: flex;
			justify-content: center;
			align-items: center;
			padding: 20rpx;
			color: #fff;
			font-weight: 600;
			letter-spacing: 4rpx;
			background-color: #408bf6;
			border: 2rpx solid #408bf6;
			border-radius: 10rpx;
			margin: 64rpx 0 32rpx 0;
			white-space: nowrap;
			box-sizing: border-box;
			// &:active {
			// 	background-color: #fff;
			// 	color: #408bf6;
			// }
		}
		.button-bottom {
			display: flex;
			flex-direction: row;
			justify-content: space-between;
			align-items: center;
			.button-left {
				width: fit-content;
				padding: 20rpx 40rpx;
				margin-top: 0;
				color: #0043ac;
				background-color: #fff;
				border: 2rpx solid #0043ac;
			}
			.button-right {
				width: fit-content;
				padding: 20rpx 40rpx;
				margin-top: 0;
				color: #0043ac;
				background-color: #fff;
				border: 2rpx solid #0043ac;
			}
		}
	}
</style>
<style lang="scss">
	.account-info {
		.u-button--primary {
			font-weight: 600;
			letter-spacing: 4rpx;
			background-color: #408bf6 !important;
			border-color: #408bf6 !important;
			margin: 64rpx 0 32rpx 0;
		}
		.u-button--normal {
			padding: 0 32rpx !important;
		}
		.u-button {
			width: fit-content !important;
		}
	}
</style>
<style>
	page {
		background-color: #f0f0f0;
	}
</style>