<template>
	<view :style="{ minHeight: sys.windowHeight + 'px' }"
		:class="[$tm.vx.state().tmVuetify.black ? 'black' : ' ']">
		<tm-menubars title="" :shadow="0" :showback="true"></tm-menubars>
		<view class="tou C1b1b1b">
			<view>忘记密码？</view>
			<view class="text-size-s mt-20">请输入您的注册手机号码，我们将发送短信验证码到您的手机</view>
		</view>
		<view class="zhuti">
			<tm-form>
				<view class="tel text-size-m mt-50">请输入注册手机号码</view>
				<tm-input name="title" v-model="reqData.mobile"></tm-input>
				<view class="mima">
					<tm-input placeholder="请输入短信验证码" name="title" v-model="reqData.sms_code"></tm-input>
					<tm-button class="wangji" @click="sendyzm" size="m">{{yzmvar.text}}</tm-button>
				</view>
				<view class="px-24">
					<tm-button @click="xia()" theme="primary" :round="24" class="mt100" block>下一步</tm-button>
				</view>
			</tm-form>
		</view>
		<!-- 弹出层消息 -->
		<tm-message ref="toast"></tm-message>
	</view>
</template>	
<script>
import{myRequest} from '@/api/request.js'
export default {
	data() {
		return {
			kan:1, //1没看2看
			kan1:3, //1没看2看
			reqData:{
				mobile:'',
				sms_code:''
			},
			yzmvar:{
				text:'发送验证码'
			}
		};
	},
	onLoad() {
		
	},
	created() {
		this.sys = uni.getSystemInfoSync();
	},
	methods: {
		xia(){
			var that=this;
			if(that.reqData.mobile==""){
				that.$refs.toast.show({model:'warn',label:'请输入手机号'})
				return
			}else if(that.reqData.sms_code==""){
				that.$refs.toast.show({model:'warn',label:'请输入验证码'})
				return
			}
			uni.navigateTo({
				url: "/pages/zhtijiao/index?mobile="+that.reqData.mobile+'&sms_code='+that.reqData.sms_code,
			})
		},
		sendyzm(){
			var that=this;
			if(that.reqData.mobile==""){
				that.$refs.toast.show({model:'warn',label:'请输入手机号'})
				return
			}
			that.yzmvar.text="已发送";
			setTimeout(function(){
				that.yzmvar.text="发送验证码";
			},15000)
			// myRequest({
			// 	url: "/api/login/sendCode",
			// 	method:'get',
			// 	data:{mobile:that.reqData.mobile}
			// }).then(res => {
			// 	console.log(res.data)
			// 	if (res.data.code == 200) {
			// 		that.$refs.toast.show({model:'success',label:res.data.msg})
			// 		that.yzmvar.text="已发送";
			// 		setTimeout(function(){
			// 			that.yzmvar.text="发送验证码";
			// 		},15000)
			// 	}else{
			// 		that.$refs.toast.show({model:'error',label:res.data.msg})
			// 	}
			// })
		},
	},
}
</script>

<style lang="scss">
	/deep/ .tm-menubars .body{
		background-color: #1b1b1b !important;
	}
	/deep/ .grey-darken-5{
		background-color: #0d0d0d!important;
		padding: 0px !important;
	}
	.tou{
		font-size: 28px;
		padding: 15px 30px 40px 30px;
	}
	.zhuti{
		padding: 15px 30px 40px 30px;
	}
	.mima{
		position: relative;
	}
	.wangji{
		position: absolute;
		right: 0px;
		top: 3px;
	}
	/deep/ .wangji .primary{
		background-color: #303440 !important;
	}
	.tel{
		margin-left: 5px;
	}
</style>
