新增分享,找回密码,实名认证,签约
This commit is contained in:
131
pages/resetPassword/resetPassword.js
Normal file
131
pages/resetPassword/resetPassword.js
Normal file
@@ -0,0 +1,131 @@
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
codename : '获取验证码',
|
||||
smsDisabled : false, // 获取验证码 禁止点击
|
||||
seeState : false, // 小眼睛
|
||||
againState : false, // 小眼睛-再次输入密码
|
||||
passwordState : true, // 小眼睛-显示
|
||||
passwordAgain : true, // 小眼睛-显示-再次输入密码
|
||||
phone : "", // 手机号
|
||||
code : "", // 验证码
|
||||
},
|
||||
/**
|
||||
* 手机号码
|
||||
*/
|
||||
bindInput(e) {
|
||||
this.setData({
|
||||
phone: e.detail.value
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 短信验证码
|
||||
*/
|
||||
bindCode(e) {
|
||||
this.setData({
|
||||
code: e.detail.value
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取短信验证码
|
||||
*/
|
||||
getPhoneCode(e) {
|
||||
let mobile = this.data.phone
|
||||
var _this = this
|
||||
if (mobile == "") {
|
||||
wx.showToast({
|
||||
title : '手机号不能为空',
|
||||
icon : 'none',
|
||||
duration : 1000
|
||||
})
|
||||
return false;
|
||||
}else{
|
||||
wx.$api.auth.getSms({
|
||||
mobileNo: mobile
|
||||
}).then(res=>{
|
||||
console.log(res)
|
||||
_this.setData({
|
||||
smsDisabled : true
|
||||
})
|
||||
|
||||
wx.showToast({
|
||||
title : '发送成功',
|
||||
icon : 'success',
|
||||
duration: 2000
|
||||
})
|
||||
var num = 60;
|
||||
var timer = setInterval(function () {
|
||||
num--;
|
||||
if (num <= 0) {
|
||||
clearInterval(timer);
|
||||
_this.setData({
|
||||
codename : '重新发送',
|
||||
smsDisabled : false
|
||||
})
|
||||
|
||||
} else {
|
||||
_this.setData({
|
||||
codename : num + "s后重新获取",
|
||||
smsDisabled : true
|
||||
})
|
||||
}
|
||||
}, 1000)
|
||||
}).catch(err=>{})
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 查看密码
|
||||
*/
|
||||
seeClick() {
|
||||
this.setData({
|
||||
seeState : !this.data.seeState,
|
||||
passwordState: !this.data.passwordState
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 查看密码-再次
|
||||
*/
|
||||
seeAgain() {
|
||||
this.setData({
|
||||
againState : !this.data.againState,
|
||||
passwordAgain : !this.data.passwordAgain
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 重置密码
|
||||
*/
|
||||
registerForm(e) {
|
||||
wx.showLoading({
|
||||
title: '加载中...',
|
||||
mask : true
|
||||
})
|
||||
|
||||
let value = e.detail.value
|
||||
let data = {
|
||||
username : this.data.phone,
|
||||
code : value.code,
|
||||
password : value.password,
|
||||
password_confirmation : value.password_confirmation
|
||||
}
|
||||
wx.$api.auth.resetPassword(data).then(res => {
|
||||
wx.hideLoading()
|
||||
wx.showModal({
|
||||
content : res.data,
|
||||
showCancel : false,
|
||||
confirmText : '确定',
|
||||
confirmColor: '#da2b54',
|
||||
success : () => {
|
||||
wx.navigateBack()
|
||||
}
|
||||
})
|
||||
}).catch(() =>{ })
|
||||
}
|
||||
})
|
||||
5
pages/resetPassword/resetPassword.json
Normal file
5
pages/resetPassword/resetPassword.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"navigationBarTitleText": "找回密码",
|
||||
"navigationBarBackgroundColor": "#f7f6fa"
|
||||
}
|
||||
35
pages/resetPassword/resetPassword.wxml
Normal file
35
pages/resetPassword/resetPassword.wxml
Normal file
@@ -0,0 +1,35 @@
|
||||
<image class="loginImg" src="/static/imgs/loginImg.png" mode="widthFix"></image>
|
||||
<view class="loginTitle">
|
||||
<image class="loginImg" src="/static/imgs/loginTitle.png" mode="widthFix"></image>
|
||||
</view>
|
||||
<form bindsubmit="registerForm" class="site-form">
|
||||
<!-- 输入手机号相关 -->
|
||||
<view class="inputs">
|
||||
<input type="number" placeholder="请输入手机号" maxlength="11" bindinput="bindInput" />
|
||||
</view>
|
||||
<view class="inputs">
|
||||
<input type="number" placeholder="请输入验证码" maxlength="4" name="code" class="inputs-sms" />
|
||||
<button class="sms-btn" type="default" size="mini" disabled="{{phone == '' || smsDisabled}}" bindtap="getPhoneCode">{{codename}}</button>
|
||||
</view>
|
||||
<view class="inputs">
|
||||
<input type="text" placeholder="密码须包含大小写,最少8位" name="password" password="{{passwordState}}" />
|
||||
<image class="inputs-see" bindtap="seeClick" src="{{seeState ? '/static/icons/see_active.png' : '/static/icons/see.png'}}" mode="aspectFill"></image>
|
||||
</view>
|
||||
<view class="inputs">
|
||||
<input type="text" placeholder="密码须包含大小写,最少8位" name="password_confirmation" password="{{passwordAgain}}" />
|
||||
<image class="inputs-see" bindtap="seeAgain" src="{{againState ? '/static/icons/see_active.png' : '/static/icons/see.png'}}" mode="aspectFill"></image>
|
||||
</view>
|
||||
<button class="btn" type="default" form-type="submit">立即重置</button>
|
||||
</form>
|
||||
|
||||
<view class="refertoEject {{successHide ? 'active' : ''}}" catchtouchmove='true'></view>
|
||||
<view class="refertoCont {{successHide ? 'active' : ''}}" catchtouchmove='true'>
|
||||
<view class="refertoWrite">
|
||||
<image class="refertoCont-img" src="https://cdn.douhuofalv.com/images/2023/08/04/b099539e6c5d6d89b69516002412a4d9.png" mode="widthFix"></image>
|
||||
<view class="refertoCont-name">
|
||||
<view class="refertoCont-title">注册成功</view>
|
||||
<view class="refertoCont-text">恭喜您已完成注册,点击按钮返回</view>
|
||||
<navigator class="refertoCont-go" hover-class="none" open-type="navigateBack" delta="2">确定</navigator>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
158
pages/resetPassword/resetPassword.wxss
Normal file
158
pages/resetPassword/resetPassword.wxss
Normal file
@@ -0,0 +1,158 @@
|
||||
page {
|
||||
background-color: #f7f6fa;
|
||||
}
|
||||
|
||||
.loginImg {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.loginTitle {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
padding: 0 50rpx;
|
||||
box-sizing: border-box;
|
||||
margin-top: -50rpx;
|
||||
}
|
||||
|
||||
.site-form {
|
||||
display: block;
|
||||
padding: 50rpx 50rpx 20rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.inputs {
|
||||
background: #edebf1;
|
||||
border: none;
|
||||
position: relative;
|
||||
margin-bottom: 40rpx;
|
||||
height: 100rpx;
|
||||
line-height: 100rpx;
|
||||
border-radius: 80rpx;
|
||||
padding: 0 50rpx;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.inputs input {
|
||||
width: 100%;
|
||||
height: 100rpx;
|
||||
line-height: 100rpx;
|
||||
border: none;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
.inputs-see {
|
||||
position: absolute;
|
||||
right: 50rpx;
|
||||
top: 32rpx;
|
||||
width: 38rpx;
|
||||
height: 38rpx;
|
||||
z-index: 9;
|
||||
}
|
||||
|
||||
.sms-btn[size='mini'] {
|
||||
font-weight: normal;
|
||||
height: 100rpx;
|
||||
line-height: 100rpx;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 30rpx;
|
||||
margin: 0;
|
||||
border-radius: 0;
|
||||
border-left: solid 1rpx #f2f2f2;
|
||||
color: #da2b54 !important;
|
||||
font-size: 32rpx;
|
||||
background-color: transparent !important;
|
||||
z-index: 9;
|
||||
}
|
||||
|
||||
.btn {
|
||||
background: #da2b54 !important;
|
||||
width: 100% !important;
|
||||
color: white !important;
|
||||
border-radius: 100rpx;
|
||||
font-size: 32rpx;
|
||||
line-height: 100rpx;
|
||||
height: 100rpx;
|
||||
font-weight: bold;
|
||||
font-weight: normal;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.btn::after {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.btn[disabled] {
|
||||
background: #da2b54 !important;
|
||||
}
|
||||
|
||||
/* 注册成功弹出 */
|
||||
/* 弹出 */
|
||||
.refertoEject {
|
||||
position: fixed;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
left: 0;
|
||||
top: 0;
|
||||
background-color: rgba(0, 0, 0, .7);
|
||||
z-index: 1000;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.refertoEject.active {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.refertoCont {
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-box-pack: center;
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
z-index: 10000;
|
||||
padding: 0 15%;
|
||||
box-sizing: border-box;
|
||||
text-align: center;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.refertoCont.active {
|
||||
display: -webkit-box;
|
||||
}
|
||||
|
||||
.refertoWrite {
|
||||
background-color: white;
|
||||
border-radius: 20rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.refertoCont-img {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.refertoCont-name {
|
||||
padding: 30rpx 0 40rpx;
|
||||
}
|
||||
|
||||
.refertoCont-title {
|
||||
color: #da2b54;
|
||||
font-size: 40rpx;
|
||||
}
|
||||
|
||||
.refertoCont-text {
|
||||
padding: 20rpx 0 40rpx;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.refertoCont-go {
|
||||
background-color: #da2b54;
|
||||
display: inline-block;
|
||||
color: #ffffff;
|
||||
line-height: 88rpx;
|
||||
width: 80%;
|
||||
border-radius: 80rpx;
|
||||
}
|
||||
Reference in New Issue
Block a user