mirror of
https://gitee.com/elegant_wings/dbd-meeting-wx-small.git
synced 2025-06-21 13:09:38 +08:00
描述:登录页面修改
This commit is contained in:
parent
946d891fc6
commit
0f7b1982c6
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,4 +1,6 @@
|
|||||||
|
|
||||||
|
.idea
|
||||||
|
|
||||||
node_modules/
|
node_modules/
|
||||||
|
|
||||||
miniprogram/miniprogram_npm
|
miniprogram/miniprogram_npm
|
||||||
|
@ -4,245 +4,14 @@ Page({
|
|||||||
* 页面的初始数据
|
* 页面的初始数据
|
||||||
*/
|
*/
|
||||||
data: {
|
data: {
|
||||||
type: 'log',
|
IMG_NAME: app.IMG_NAME,
|
||||||
getCodeTime: 40, //发送短信的间隔时间
|
|
||||||
verifyCodeTime: '获取验证码',
|
|
||||||
passwordfocus: false,
|
|
||||||
mobilefocus: false,
|
|
||||||
codefocus: false,
|
|
||||||
typeName: 'password',
|
|
||||||
passFlag: 1
|
|
||||||
},
|
|
||||||
|
|
||||||
onShow() {
|
|
||||||
// wx.hideHomeButton()
|
|
||||||
},
|
|
||||||
|
|
||||||
tapType: function (e) {
|
|
||||||
var type = e.currentTarget.dataset.type;
|
|
||||||
this.setData({
|
|
||||||
type
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
foget: function () {
|
|
||||||
wx.navigateTo({
|
|
||||||
url: '/pages/my/retrievePassword/retrievePassword',
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
navlogs () {
|
|
||||||
wx.navigateTo({
|
|
||||||
url: '/pages/logs/logs',
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
codelog: function () {
|
|
||||||
this.setData({
|
|
||||||
codelog: 1
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
getphone: function (e) {
|
|
||||||
this.setData({
|
|
||||||
mobile: e.detail.value
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
passWordInput: function (e) {
|
|
||||||
var type = e.currentTarget.dataset.type
|
|
||||||
if (this.data.typeName = 'text') {
|
|
||||||
this.setData({
|
|
||||||
typeName: 'password'
|
|
||||||
})
|
|
||||||
} else if (this.data.typeName = 'password') {
|
|
||||||
this.setData({
|
|
||||||
typeName: 'text'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
showPass() { // 显示密码而非*号
|
|
||||||
console.log(this.data.storePass)
|
|
||||||
if (this.data.passFlag == 1) { // 第一次点击
|
|
||||||
this.setData({
|
|
||||||
passFlag: 2,
|
|
||||||
typeName: 'text'
|
|
||||||
});
|
|
||||||
} else { // 第二次点击
|
|
||||||
this.setData({
|
|
||||||
passFlag: 1,
|
|
||||||
typeName: 'password'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
bSubmit: function (e) {
|
|
||||||
var that = this,
|
|
||||||
mobile = e.detail.value.mobile,
|
|
||||||
password = e.detail.value.password
|
|
||||||
if (!mobile) {
|
|
||||||
wx.showToast({
|
|
||||||
title: '请先填写手机号',
|
|
||||||
duration: 3000,
|
|
||||||
icon: 'none'
|
|
||||||
});
|
|
||||||
that.setData({
|
|
||||||
mobilefocus: true
|
|
||||||
})
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (!password) {
|
|
||||||
that.setData({
|
|
||||||
passwordfocus: true
|
|
||||||
});
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
app.AjaxRequest('POST', {
|
|
||||||
'content-type': 'application/json'
|
|
||||||
}, '/auth/login', {
|
|
||||||
username: mobile,
|
|
||||||
password: password
|
|
||||||
}, function (res) {
|
|
||||||
wx.showToast({
|
|
||||||
title: res.message,
|
|
||||||
duration: 3000,
|
|
||||||
icon: 'none'
|
|
||||||
});
|
|
||||||
if (res.code == 0) {
|
|
||||||
wx.cloud.init()
|
|
||||||
wx.cloud.callFunction({
|
|
||||||
name: "pay",
|
|
||||||
success(res) {
|
|
||||||
wx.setStorageSync('OPENID', res.result.OPENID)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
wx.setStorageSync('parkId', res.parkId)
|
|
||||||
wx.setStorageSync('token', res.token)
|
|
||||||
wx.setStorageSync('userId', res.userId)
|
|
||||||
wx.reLaunch({
|
|
||||||
url: '/pages/index/index',
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
bindGetUserInfo(e) {
|
|
||||||
var userInfo = e.detail.userInfo
|
|
||||||
wx.cloud.init()
|
|
||||||
wx.cloud.callFunction({
|
|
||||||
// 云函数名称
|
|
||||||
name: 'pay',
|
|
||||||
}).then(res => {
|
|
||||||
console.log(e.detail.userInfo)
|
|
||||||
app.AjaxRequest('POST', {
|
|
||||||
'content-type': 'application/json'
|
|
||||||
}, '/wx/login', {
|
|
||||||
avatar: userInfo.avatarUrl,
|
|
||||||
username: userInfo.nickName,
|
|
||||||
gender: userInfo.gender === 1 ? '0' : '1',
|
|
||||||
openid: res.result.OPENID
|
|
||||||
}, function (res) {
|
|
||||||
if (res.code == 0) {
|
|
||||||
wx.setStorageSync('userId', res.userId)
|
|
||||||
wx.setStorageSync('token', res.token)
|
|
||||||
wx.reLaunch({
|
|
||||||
url: '/pages/index/index',
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 执行发送验证码
|
|
||||||
*/
|
|
||||||
verifyCodeEvent: function (e) {
|
|
||||||
var that = this;
|
|
||||||
//验证手机号
|
|
||||||
if (that.data.buttonDisable == true) return false;
|
|
||||||
var mobile = that.data.mobile;
|
|
||||||
var regMobile = /^[1]([3-9])[0-9]{9}$/;
|
|
||||||
if (!regMobile.test(mobile)) {
|
|
||||||
wx.showToast({
|
|
||||||
title: '手机号错误',
|
|
||||||
duration: 3000,
|
|
||||||
icon: 'none'
|
|
||||||
});
|
|
||||||
that.setData({
|
|
||||||
mobilefocus: true
|
|
||||||
});
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
that.Countdown()
|
|
||||||
//验证手机号 END
|
|
||||||
wx.showLoading();
|
|
||||||
wx.request({
|
|
||||||
header: {
|
|
||||||
'content-type': 'application/x-www-form-urlencoded'
|
|
||||||
},
|
|
||||||
method: 'GET',
|
|
||||||
url: app.DOMAIN_NAME + '/sms/send',
|
|
||||||
data: {
|
|
||||||
username: mobile,
|
|
||||||
type: 'MEMBER_REGISTER'
|
|
||||||
},
|
|
||||||
success: res => {
|
|
||||||
var mes = res.data.message,
|
|
||||||
code = mes.slice(21, 25)
|
|
||||||
that.setData({
|
|
||||||
code
|
|
||||||
})
|
|
||||||
wx.hideLoading()
|
|
||||||
that.Countdown();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 发送短信倒计时,防止恶意刷短信
|
|
||||||
*/
|
|
||||||
Countdown: function () {
|
|
||||||
var that = this;
|
|
||||||
that.setData({
|
|
||||||
buttonDisable: true
|
|
||||||
});
|
|
||||||
var getCodeTime = wx.getStorageSync('getCodeTime');
|
|
||||||
var intervalId = setInterval(function () {
|
|
||||||
getCodeTime--;
|
|
||||||
wx.setStorageSync('getCodeTime', getCodeTime);
|
|
||||||
that.setData({
|
|
||||||
verifyCodeTime: '重新获取' + '(' + getCodeTime + 's' + ')'
|
|
||||||
});
|
|
||||||
//倒计时完成
|
|
||||||
if (getCodeTime == 0) {
|
|
||||||
wx.setStorageSync('getCodeTime', that.data.getCodeTime);
|
|
||||||
clearInterval(intervalId);
|
|
||||||
that.setData({
|
|
||||||
verifyCodeTime: '获取验证码',
|
|
||||||
buttonDisable: false
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}, 1000);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生命周期函数--监听页面加载
|
* 生命周期函数--监听页面加载
|
||||||
*/
|
*/
|
||||||
onLoad: function (e) {
|
onLoad: function (e) {
|
||||||
var that = this;
|
|
||||||
//限制发送验证码的时间,防止恶意刷短信
|
|
||||||
var getCodeTime = wx.getStorageSync('getCodeTime');
|
|
||||||
if (getCodeTime <= that.data.getCodeTime - 1 && getCodeTime > 0) {
|
|
||||||
that.Countdown(that);
|
|
||||||
} else {
|
|
||||||
wx.setStorageSync('getCodeTime', that.data.getCodeTime)
|
|
||||||
that.setData({
|
|
||||||
buttonDisable: false
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,24 +1,10 @@
|
|||||||
<view class='page'>
|
<view class='container' style="background: url('{{IMG_NAME + '/profile/opt/static/login/bg.png'}}') no-repeat;">
|
||||||
<!-- <view>
|
<image class="titleImg" src="{{IMG_NAME + '/profile/opt/static/login/bg.png'}}" mode="aspectFill"></image>
|
||||||
<image mode="widthFix" style="width:30%" src="/images/login.webp"></image>
|
|
||||||
</view> -->
|
|
||||||
|
|
||||||
<view class="login-header">
|
<view class="bottomView">
|
||||||
<view class="login-title">请登录</view>
|
<image class="loginBtnImg" src="{{IMG_NAME + '/profile/opt/static/login/loginBtn.png'}}" mode="aspectFill"></image>
|
||||||
<view class="login-info">Please Login Your Account</view>
|
<button class="loginBtn" open-type="getUserInfo" bindgetuserinfo="authorLogin"></button>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="logBox">
|
|
||||||
<form bindsubmit='bSubmit' bindreset="formReset">
|
|
||||||
<!--
|
|
||||||
<view class="{{RemberPass}}" style="width:30%;text-align:left;margin-left:80rpx;float:left;font-size:13px;margin-bottom: 20%;">
|
|
||||||
<switch type="checkbox" checked="{{switchChecked}}" bindswitcheck="switchChecked" bindchange="bindswitchchange" style="transform:scale(0.8)"/>记住密码
|
|
||||||
</view>
|
|
||||||
-->
|
|
||||||
<button open-type="getUserInfo" bindgetuserinfo="authorLogin" style="text-align: center;margin-bottom: 10%;background: white;">
|
|
||||||
<image bindtap="wxlog" src="/images/icon/new.png" mode="widthFix" style="width:84rpx;height:84rpx;"></image>
|
|
||||||
<view style="font-size: 14px;">微信登陆</view>
|
|
||||||
</button>
|
|
||||||
</form>
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
@ -1,150 +1,45 @@
|
|||||||
.page{
|
|
||||||
width:100%;
|
|
||||||
height: 100%;
|
|
||||||
/*padding: 50rpx 50rpx; */
|
|
||||||
box-sizing: border-box;
|
|
||||||
color: black;
|
|
||||||
font-size: 60rpx;
|
|
||||||
}
|
|
||||||
.floR{
|
|
||||||
font-size: 14pt;
|
|
||||||
/* font-weight: 600; */
|
|
||||||
}page {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
background: #fff;
|
|
||||||
font-size: 32rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.container{
|
.container{
|
||||||
padding: 0 60rpx;
|
width: 100vw;
|
||||||
|
height: 100vh;
|
||||||
|
background-position: center top;
|
||||||
}
|
}
|
||||||
|
|
||||||
.wechatapp {
|
.titleImg{
|
||||||
padding: 80rpx 0 48rpx;
|
border: 1px solid red;
|
||||||
border-bottom: 1rpx solid #e3e3e3;
|
display: block;
|
||||||
margin-bottom: 72rpx;
|
margin: 100rpx auto;
|
||||||
text-align: center;
|
width: 649rpx;
|
||||||
|
height: 256rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.wechatapp .header {
|
.bottomView{
|
||||||
width: 190rpx;
|
border: 1px solid red;
|
||||||
height: 190rpx;
|
|
||||||
border: 2px solid #fff;
|
|
||||||
margin: 0rpx auto 0;
|
|
||||||
border-radius: 50%;
|
|
||||||
overflow: hidden;
|
|
||||||
box-shadow: 1px 0px 5px rgba(50, 50, 50, 0.3);
|
|
||||||
}
|
|
||||||
|
|
||||||
.auth-title {
|
|
||||||
color: #585858;
|
|
||||||
font-size: 40rpx;
|
|
||||||
margin-bottom: 40rpx;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.auth-subtitle {
|
|
||||||
color: #888;
|
|
||||||
margin-bottom: 88rpx;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.login-btn {
|
|
||||||
border: none;
|
|
||||||
background: #04be01;
|
|
||||||
color: #fff;
|
|
||||||
font-size: 11pt;
|
|
||||||
border-radius: 999rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.login-btn::after {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.login-btn.button-hover {
|
|
||||||
box-shadow: inset 0 5rpx 30rpx rgba(0, 0, 0, 0.15);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
.bshaw {
|
|
||||||
padding: 10rpx 40rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
input {
|
|
||||||
width: 88%;
|
|
||||||
margin-top: 4rpx;
|
|
||||||
text-align: left;
|
|
||||||
padding-right: 30rpx;
|
|
||||||
box-sizing: border-box;
|
|
||||||
float: right;
|
|
||||||
color: #696969;
|
|
||||||
}
|
|
||||||
|
|
||||||
.inputbox {
|
|
||||||
font-size: 30rpx;
|
|
||||||
margin: 0 auto;
|
|
||||||
margin-bottom: 8%;
|
|
||||||
display: flex;
|
|
||||||
padding: 3% 0;
|
|
||||||
width: 90%;
|
|
||||||
border-radius: 50rpx;
|
|
||||||
background-color: #F7F7F7;
|
|
||||||
}
|
|
||||||
|
|
||||||
.topBox{
|
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 84%;
|
left: 50%;
|
||||||
top: 250rpx;
|
bottom: 120rpx;
|
||||||
left: 8%;
|
margin-left: -310rpx;
|
||||||
|
width: 620rpx;
|
||||||
|
height: 150rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.logBox{
|
.loginBtnImg{
|
||||||
margin-top: 10%;
|
background: gray;
|
||||||
}
|
width: 100%;
|
||||||
|
|
||||||
.code {
|
|
||||||
text-align: center;
|
|
||||||
width: 240rpx;
|
|
||||||
border-radius: 0 45rpx 45rpx 0;
|
|
||||||
font-size: 24rpx;
|
|
||||||
color: #3147FA;
|
|
||||||
z-index: 999;
|
|
||||||
padding-top: 10rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.nexts{
|
|
||||||
width: 390rpx;
|
|
||||||
height: 100%;
|
height: 100%;
|
||||||
color: #fff;
|
position: absolute;
|
||||||
padding: 20rpx 0;
|
z-index: 1;
|
||||||
border-radius: 30rpx;
|
left: 0;
|
||||||
text-align: center;
|
top: 0;
|
||||||
display: inline-block;
|
|
||||||
margin: 0 auto;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.login-header{
|
.loginBtn{
|
||||||
height: 200rpx;
|
background:blue;
|
||||||
padding: 40rpx 30rpx;
|
width: 100%;
|
||||||
display: flex;
|
height: 100%;
|
||||||
flex-direction: column;
|
position: absolute;
|
||||||
background-color: #73ccd8;
|
z-index: 2;
|
||||||
color: white;
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
opacity: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.login-title{
|
|
||||||
font-size: 52rpx;
|
|
||||||
font-weight: 700;
|
|
||||||
padding: 20rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.login-info{
|
|
||||||
font-size: 28rpx;
|
|
||||||
padding: 20rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.pailie{
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user