提交 e3bf0328 编写于 作者: M m0_74163447

优化找回密码和修改密码界面

上级 fc1fde6e
......@@ -2,18 +2,6 @@
export default {
onLaunch: function() {
console.log('App Launch')
uni.getPushClientId({
success: (res) => {
let push_clientid = res.cid
console.log('客户端推送标识:',push_clientid)
},
fail(err) {
console.log(err)
}
})
uni.onPushMessage((res) => {
console.log("收到推送消息:",res) //监听推送消息
})
},
onShow: function() {
......
<template>
<view class="bg">
<image class="returnBack" src="/static/discover/back.png" @click="goBack(1,'/pages/login/login')"></image>
<view class="content">
<image class="logo" src="/static/login/find.png"></image>
<view class="text-area">
<uni-forms :modelValue="formData" label-position="left" :labelWidth='90' :rules="confirmRules"
<uni-forms :modelValue="formData" :rules="confirmRules"
ref="form" validate-trigger="bind" err-show-type="undertext">
<uni-forms-item name="phone" required label="手机号">
<uni-easyinput type="text" :inputBorder="true" v-model="formData.phone"
......@@ -14,23 +14,23 @@
<uni-easyinput type="number" :inputBorder="true" v-model="formData.captcha"
placeholder="请输入六位验证码"></uni-easyinput>
</uni-forms-item>
<!-- <button class="captchaButton" @click="sendCaptcha()">发送验证码</button> -->
<button size="mini" class="captchaButton" :disabled="btnDis" @tap="sendCaptcha">{{btnText}}</button>
</view>
<uni-forms-item name="newPassword" required label="新密码">
<uni-easyinput type="password" :inputBorder="true" v-model="formData.newPassword"
placeholder="请输入密码"></uni-easyinput>
</uni-forms-item>
<uni-forms-item name="confirmPassword" required label="确认密码">
<uni-forms-item name="confirmPassword" required label="确认">
<uni-easyinput type="password" :inputBorder="true" v-model="formData.confirmPassword"
placeholder="请确认新密码"></uni-easyinput>
</uni-forms-item>
<uni-forms-item>
<button class="confirmButton" @click="confirm('form')">确认</button>
<button class="confirmButton" @click="confirm('form')">确认</button>
</uni-forms-item>
</uni-forms>
</view>
</view>
<uni-popup ref="popupDialog" type="center">
<view class="mcaptcha">
<view style="padding: 30px 20px;text-align: center;">
......@@ -55,7 +55,7 @@
data() {
return {
btnDis: false,// 发送验证码按钮不禁用
btnText: "发送验证码",// 提示
btnText: "发送",// 提示
loading: false,
graphicVerifyCode: "",
formData: {
......@@ -267,33 +267,50 @@
<style>
.bg {
width: 100%;
height: 100%;
position: absolute;
background-color: #edeef0;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.content {
background-color: #edeef0;
.logo {
height: 450rpx;
width: 250rpx;
margin-top: 30rpx;
margin-left: auto;
margin-right: auto;
margin-bottom: 50rpx;
}
.text-area {
display: flex;
align-items: center;
flex-direction: column;
justify-content: center;
position: absolute;
width: 100%;
height: 100%;
width: 75%;
}
.returnBack {
height: 55rpx;
width: 55rpx;
margin-top: 60rpx;
margin-left: 20rpx;
margin-top: 50rpx;
margin-left: 25rpx;
margin-right: auto;
}
.confirmButton {
background-color: #f1992d;
color: #fff;
border: 0;
border-radius: 20px;
margin-top: 8px;
margin-bottom: 15px;
}
.confirmButton::after {
......
......@@ -7,7 +7,7 @@
</view>
<view class="content">
<view class="text-area">
<uni-forms :modelValue="formData" label-position="left" :labelWidth='90' :rules="confirmRules"
<uni-forms :modelValue="formData" :rules="confirmRules"
ref="form" validate-trigger="bind" err-show-type="undertext">
<uni-forms-item name="phone" required label="手机号">
<uni-easyinput type="text" :inputBorder="true" v-model="formData.phone"
......@@ -25,12 +25,12 @@
<uni-easyinput type="password" :inputBorder="true" v-model="formData.newPassword"
placeholder="请输入密码"></uni-easyinput>
</uni-forms-item>
<uni-forms-item name="confirmPassword" required label="确认密码">
<uni-forms-item name="confirmPassword" required label="确认">
<uni-easyinput type="password" :inputBorder="true" v-model="formData.confirmPassword"
placeholder="请确认新密码"></uni-easyinput>
</uni-forms-item>
<uni-forms-item>
<button class="confirmButton" @click="confirm('form')">确认</button>
<button class="confirmButton" @click="confirm()">确认</button>
</uni-forms-item>
</uni-forms>
</view>
......@@ -48,7 +48,7 @@
<uni-popup ref="alertDialog" type="dialog">
<uni-popup-dialog cancelText="取消" confirmText="确定" title="提示" content="确定修改你的密码吗?"
@confirm="dialogConfirm"></uni-popup-dialog>
@confirm="dialogConfirm('form')"></uni-popup-dialog>
</uni-popup>
</view>
</template>
......@@ -64,7 +64,7 @@
data() {
return {
btnDis: false,// 发送验证码按钮不禁用
btnText: "发送验证码",// 提示
btnText: "发送",// 提示
loading: false,
graphicVerifyCode: "",
formData: {
......@@ -171,11 +171,11 @@
this.btnText = `${timer}s`;
}, 1000)
},
confirm(validateForm) {
confirm() {
this.$refs.alertDialog.open();
},
dialogConfirm() {
dialogConfirm(validateForm) {
this.$refs[validateForm].validate(valid => {
if (!valid) {
......@@ -205,6 +205,9 @@
title: '修改成功',
duration: 2000
});
uni.navigateBack({
delta: 1, //返回层数,2则上上页
})
} else if (this.code == 400) {
uni.showToast({
title: '验证码错误或超时',
......@@ -301,6 +304,13 @@
height: 100%;
}
.text-area {
margin-top: 40rpx;
display: flex;
justify-content: center;
width: 75%;
}
.top {
width: 100%;
height: 50px;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册