<view class="load-head">
<image src="../../images/return.png" />
注册
</view>
<view class="login">
<form bindsubmit="formSubmit">
<view class="field clearfix">
<label for="name"><image src="../../images/phone.png" /></label>
<input id="name" name="mobile" class="login-input" type="text" placeholder="请输入手机号" />
</view>
<view class="field clearfix">
<label for="password"><image src="../../images/code.png" /></label>
<input id="password" class="login-input" type="password" placeholder="请输入验证码" />
<button class="get-code" hover-class="code-hover">获取验证码</button>
</view>
<view class="field clearfix">
<label for="password"><image src="../../images/password.png" /></label>
<input id="password" name="password" class="login-input" type="password" placeholder="请设置6-20位登录密码" />
</view>
<view class="field clearfix">
<label for="repassword"><image src="../../images/password.png" /></label>
<input id="repassword" name="repassword" class="login-input" type="password" placeholder="请输入确认密码" />
</view>
<button class="btn_login" formType="submit">注册</button>
</form>
<view class="reg_forget clearfix">
<navigator url="../login/index" class="btn_reg">登录</navigator>
<navigator url="../forget/index" class="btn_forget">忘记密码</navigator>
</view >
</view>
Page({
data: {
},
formSubmit: function(e) {
if(e.detail.value.mobile.length==0||e.detail.value.password.length==0){
wx.showToast({
title: '手机号码或密码不得为空!',
icon: 'loading',
duration: 1500
})
setTimeout(function(){
wx.hideToast()
},2000)
}else if(e.detail.value.mobile.length != 11){
wx.showToast({
title: '请输入11位手机号码!',
icon: 'loading',
duration: 1500
})
setTimeout(function(){
wx.hideToast()
},2000)
}else if(e.detail.value.password.length <6 ||e.detail.value.password.length>20){
wx.showToast({
title: '请输入6-20密码!',
icon: 'loading',
duration: 1500
})
setTimeout(function(){
wx.hideToast()
},2000)
}else if(e.detail.value.password != e.detail.value.repassword){
wx.showToast({
title: '两次密码输入不一致!',
icon: 'loading',
duration: 1500
})
setTimeout(function(){
wx.hideToast()
},2000)
}else{
wx.request({
url: 'https://shop.yunapply.com/home/Login/register',
header: {
"Content-Type": "application/x-www-form-urlencoded"
},
method: "POST",
data:{mobile:e.detail.value.mobile,password:e.detail.value.password},
success: function(res) {
if(res.data.status == 0){
wx.showToast({
title: res.data.info,
icon: 'loading',
duration: 1500
})
}else{
wx.showToast({
title: res.data.info,//这里打印出登录成功
icon: 'success',
duration: 1000
})
}
}
})
}
},
})
if(e.detail.value.mobile.length==0||e.detail.value.password.length==0){
wx.showToast({
title: '手机号码或密码不得为空!',
icon: 'loading',
duration: 1500
})
wx.request({
url: 'https://shop.com/home/Login/register',
header: {
"Content-Type": "application/x-www-form-urlencoded"
},
method: "POST",
data:{mobile:e.detail.value.mobile,password:e.detail.value.password},
success: function(res) {
if(res.data.status == 0){
wx.showToast({
title: res.data.info,
icon: 'loading',
duration: 1500
})
}else{
wx.showToast({
title: res.data.info,//这里打印出登录成功
icon: 'success',
duration: 1000
})
}
},
fail:function(){
wx.showToast({
title: '服务器网络错误!',
icon: 'loading',
duration: 1500
})
}
})
header: {
"Content-Type": "application/x-www-form-urlencoded"
},
success: function(res) {
if(res.data.status == 0){
wx.showToast({
title: res.data.info,
icon: 'loading',
duration: 1500
})
}else{
wx.showToast({
title: res.data.info,
icon: 'success',
duration: 1000
})
}
}
if(res.data.status == 0){
wx.showToast({
title: res.data.info,
icon: 'loading',
duration: 1500
})
}else{
wx.showToast({
title: res.data.info,//这里打印出登录成功
icon: 'success',
duration: 1000
})
}
/**
* 用户注册
*/
public function register()
{
if (IS_POST) {
$User = D("User");
if (!$User->create($_POST, 4)) {
$this->error($User->getError(),'',true);
} else {
if ($User->register()){
$this->success('注册成功!','',true);
}else{
$this->error('注册失败!','',true);
}
}
}
}
public function register()
{
$mobile = I('post.mobile');
$password = I('post.password');
$res = D('User')->add(array(
'mobile'=> $mobile,
'password'=>md5($password),
'modifytime'=>date("Y-m-d H:i:s")
));
return $res;
}
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有