<template>
	<view class="page">
		<view class="list_info">
			<view class="name">输入原密码：</view>
			<view class="item">
				<input type="text" class="input" placeholder="请输入原密码" v-model="password0" maxlength="32" />
			</view>
			<view class="name">请输入新密码：</view>
			<view class="item">
				<input type="text" class="input" placeholder="请输入新密码" v-model="password1" maxlength="32" />
			</view>
			<view class="name">请确认新密码：</view>
			<view class="item">
				<input type="text" class="input" placeholder="请再次输入新密码" v-model="password2" maxlength="32" />
			</view>


			<view class="blankHeight"></view>
		</view>

		<view class="btn_submit">确定</view>


		<!-- 提示框 -->
		<DialogBox ref="DialogBox"></DialogBox>
	</view>
</template>

<script>
	export default {
		components: {},
		data() {
			return {
				title: '',
				sel: 1,
				mobile: '',
				password0: '',
				password1: '',
				password2: '',
				code: '',
				captchaTime: 0,

			}
		},
		onLoad() {
			setTimeout(function() {
				uni.setNavigationBarColor({
					frontColor: '#ffffff',
					backgroundColor: '#00000000',
					animation: {
						duration: 400,
						timingFunc: 'easeIn'
					}
				})
			}, 200);
		},
		onShow() {
			// this.loadData();
		},
		methods: {
			onBack() {},
			submitData() {
				if (this.mobile == "") {
					uni.showToast({
						title: "请输入手机号码",
						icon: 'none'
					});
					return;
				}
				if (this.password1 == "" || this.password1 != this.password2) {
					uni.showToast({
						title: "请输入密码并确保两次密码一致",
						icon: 'none'
					});
					return;
				}
				if (this.code == "") {
					uni.showToast({
						title: "请输入验证码",
						icon: 'none'
					});
					return;
				}
				uni.request({
					url: this.$apiHost + '/Member/editPass',
					data: {
						uuid: getApp().globalData.uuid,
						mobile1: this.mobile1,
						mobile2: this.mobile2,
						code: this.code,
					},
					header: {
						'content-type': 'application/json'
					},
					success: (res) => {
						console.log("----", res.data);
						uni.showToast({
							title: res.data.str,
							icon: 'none'
						});
						if (res.data.success == "yes") {

						}
					}
				});

			},
		}
	}
</script>

<style scoped lang="scss">
	@import 'normal.scss';
</style>