h5手机页面注册处理(短信验证)
2024-09-02 11:59:19
//获取验证码
var wait = 60;
function time(o) {
if(wait == 0) {
o.removeAttribute("disabled");
o.value = "获取验证码";
wait = 60;
} else {
o.setAttribute("disabled", true);
o.value = "重新发送(" + wait + ")";
o.style.backgroundColor = '';
wait--;
setTimeout(function() {
time(o)
},
1000)
}
}
$("#btn").click(function() {
var phone1 = $("#phone1").val();
if(phone1.length == 11) {
time(this);
var json = {
phone:phone1
}
var param = {
form:JSON.stringify(json)
}
$.ajax({
url: "https://ttcf.cheleu.com/api/h5sms.do",
type: 'post',
dataType: "json",
data:param,
success: function(data) {
mui.toast("验证码已发送,请注意查收。");
}
});
}else {
mui.toast("请输入正确的手机号");
}
})
//点击确定按钮、
$(".determine").click(function(){
var phone1 = $("#phone1").val();
var code = $("#code").val();
if(phone1 == ''){
mui.toast("请输入正确的手机号!");
}else if(code=='' || code.length !=4 || code == undefined){
mui.toast("请输入正确的验证码!");
return
}
var json = {
phone:phone1,
code:code,
type:4,
spare1:teil,
}
var param = {
form:JSON.stringify(json)
}
$.ajax({
url: "https://ttcf.cheleu.com/api/user/shareRegister.do",
type: 'post',
dataType: "json",
data:param,
success: function(data) {
if(data.result==0){
window.location.href="AppDownload.html"
}else {
mui.toast("请输入正确的验证码!");
return
}
},
});
})
最新文章
- VIew-CoordinatorLayout 笔记
- 用VBox虚拟机安装Android 屏幕90度翻转竖屏设置
- linux查找进程,查找僵死进程,查找僵死进程并自动杀掉
- C#如何自定义DataGridViewColumn来显示TreeView
- 斐波那契数列PHP非递归数组实现
- 数据库mysql的基本命令
- 关于Liferay所有的能够进行自定义和扩展的东西的总结
- Android Handler与多线程
- 微信开放框架-UCToo
- CDockablePane 关闭的问题
- SQL索引--基础理论
- thinkphp系列:类的自动加载是如何设计的
- YAML详解
- AES加密的S盒和逆S盒的推导代码备份(C实现)
- 设置python环境变量
- jquery 获得下拉框的值《转》
- 验证 Googlebot (检查是否为真的Google机器人)
- 20145104张家明 《Java程序设计》第10周学习总结
- Apache JMeter2.13 实战
- nagios-4.0.8 安装部署
热门文章
- 自然语言处理NLP学习笔记三:使用Django做一个NLP的Web站点
- Cisco 三层交换机划分VLan与普通路由器连接配置
- Interceptors - 拦截器
- AI 资源帖
- GIT命令总结,so easy
- (已解决)Could not open '/var/lib/nova/mnt/*/volume-*': Permission denied
- spring笔记3路径跳转
- Hadoop三种架构介绍及搭建
- Thinkphp6框架学习:($this->;error()undefined)Call to undefined method app\index\controller\Admin::error()
- 从入门到自闭之python三大器--装饰器进阶