<template>
	<view class="page">
		
		<view class="items">
			<view class="item">
				<view class="text" @tap="changePassword()">
					旧密码
				</view>
				<view class="input">
					<input type="password" placeholder="请输入旧密码" v-model="list.oldpassword">
				</view>
			</view>
			<view class="item">
				<view class="text" @tap="changePassword()">
					新密码
				</view>
				<view class="input">
					<input type="password" placeholder="请输入新密码"  v-model="list.newpassword">
				</view>
			</view>
			<view class="item">
				<view class="text" @tap="changePassword()">
					确认密码
				</view>
				<view class="input">
					<input type="password" placeholder="请确认密码" v-model="list.truepassword">
				</view>
			</view>
		</view>
		<view class="button">
			<button>确定</button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list:{
					newpassword:"",
					oldpassword:"",
					truepassword:""
				}
			}
		},
		onLoad() {
			
		},
		methods: {
			
			tuichu(){
				if(this.list.truepassword!=this.list.newpassword){
					return this.$alert.showError("两次输入不一致")
				}
				let bady={
					oldPassword: this.list.oldpassword,
					newPassword: this.list.newpassword
				}
				this.$request.patch('/api/Accounts/ChangePassword',bady,(data,res)=>{
					
				})
			}
		}
	}
</script>

<style lang="scss">
	.page {
		
		
		.top{
			background: linear-gradient(180deg, #317AFF 0%, #ACD1FF 100%);
			height: 300rpx;
			padding: 20rpx 40rpx;
			.box{
				display: flex;
				.portrait{
					width: 150rpx;
					height: 150rpx;
					border-radius: 150rpx;
					border: 6rpx solid #fff;
					img{
						width: 100%;
						height: 100%;
						border-radius: 150rpx;
					}
				}
				.information{
					color: #fff;
					margin: 30rpx 20rpx;
					font-size: 36rpx;
					.name{
						margin-bottom: 20rpx;
					}
				}
			}
		}
		.items{
			width: 100%;
			// margin-top: -40rpx;
			
			.item{
				margin-top: 20rpx;
				display: flex;
				background-color: #fff;
				// width: 90%;
				margin: 0 auto;
				height: 80rpx;
				line-height: 80rpx;
				// border-radius: 10rpx;
				padding-left: 20rpx;
				border-bottom: 2rpx solid #E4E7EC;
				.text{
					width: 180rpx;
				}
				.input{
					margin-left: 20rpx;
					flex: 1;
					height: 100%;
					input{
						margin-top: 20rpx;
					}
				}
			}
			
		}
		.button{
			margin-top: 80rpx;
			button {
				width: 100%;
				// height: 140rpx;
				// background: linear-gradient(180deg, #317AFF 0%, #0052E6 100%);
				color: #fff;
				border-radius: 120rpx;
				background: #4963F4;
				box-shadow: 2px 6px 8px 1px rgba(73, 99, 244, 0.8);
			}
		}
	}

	
</style>
