Files
pte/h5/js/page/reg.js
2024-09-27 01:31:25 +08:00

59 lines
1.8 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

class Reg {
constructor() {
this.showPassword();
this.phone = document.querySelector(".userphone");
this.pass = document.querySelector(".showpas input");
this.UserReg()
}
showPassword() {
var showPassword = document.querySelector(".showPassword");
showPassword.onclick = () => {
if (showPassword.classList.contains("icon-eye1")) {
showPassword.classList.remove("icon-eye1")
showPassword.classList.add("icon-eye")
this.pass.type = "text"
} else {
this.pass.type = "password"
showPassword.classList.remove("icon-eye")
showPassword.classList.add("icon-eye1")
}
}
}
UserReg() {
document.querySelector(".reg_input button").onclick = async () => {
if (!/^[1][3,4,5,7,8,9][0-9]{9}$/.test(this.phone.value)) {
Tips.toast("手机号格式不正确",2000)
return;
}
if (this.pass.value.length == 0) {
Tips.toast("密码不能为空",2000)
return;
}
let res = await homeService.search({
userphone: this.phone.value,
userpwd: this.pass.value,
superior: utils.GetQueryString("objectId") == null
? ''
: utils.GetQueryString("objectId")
});
Tips.dialog({
title: '温馨提示',
message: '注册成功点击确定跳转至App下载页面请安装App',
cancelText: '取消',
confirmText: '确定',
confirm: ()=> {
location.href = "../share/index.html";
}
})
}
}
}
new Reg()