Commit 4b3204fd by 李君

优化

1 parent 05a8d440
...@@ -13,7 +13,16 @@ Page({ ...@@ -13,7 +13,16 @@ Page({
navTop: App.globalData.navTop, navTop: App.globalData.navTop,
newPwd:'', newPwd:'',
newPwd1:"", newPwd1:"",
oldPwd:'' oldPwd:'',
password:[{
required:true,
message: '请输入',
trigger:'onBlur',
validator: value => {
return /^(?=.*[0-9])((?=.*[A-Z])|(?=.*[a-z]))(?=.*[^a-zA-Z0-9]).{8,30}$/
.test(value)
},
}]
}, },
/** /**
...@@ -23,18 +32,18 @@ Page({ ...@@ -23,18 +32,18 @@ Page({
}, },
onGoBack: function() { onGoBack: function() {
wx.switchTab({ wx.navigateTo({
url: '/pages/me/index' url: '/pages/me/index'
}) })
}, },
inputBlur1(e){ inputBlur1(e){
this.data.oldPwd = e.detail.value this.data.oldPwd = e.detail
}, },
inputBlur2(e){ inputBlur2(e){
this.data.newPwd = e.detail.value this.data.newPwd = e.detail
}, },
inputBlur3(e){ inputBlur3(e){
this.data.newPwd1 = e.detail.value this.data.newPwd1 = e.detail
}, },
onSubmit(){ onSubmit(){
if(this.data.newPwd&&this.data.newPwd1&&this.data.oldPwd){ if(this.data.newPwd&&this.data.newPwd1&&this.data.oldPwd){
......
...@@ -15,24 +15,27 @@ ...@@ -15,24 +15,27 @@
type='password' type='password'
name="原密码" name="原密码"
label="原密码" label="原密码"
required
placeholder="原密码" placeholder="原密码"
bind:blur='inputBlur1' bind:change='inputBlur1'
/> />
<van-field <van-field
type='password' type='password'
value="{{newPwd}}" value="{{newPwd}}"
name="新密码" name="新密码"
required
label="新密码" label="新密码"
placeholder="新密码" placeholder="新密码"
bind:blur='inputBlur2' bind:change='inputBlur2'
/> />
<van-field <van-field
type='password' type='password'
value="{{newPwd1}}" value="{{newPwd1}}"
name="确认密码" name="确认密码"
required
label="确认密码" label="确认密码"
placeholder="确认密码" placeholder="确认密码"
bind:blur='inputBlur3' bind:change='inputBlur3'
/> />
</van-cell-group> </van-cell-group>
<view style="margin-top: 20rpx;"> <view style="margin-top: 20rpx;">
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
<view class="mcards ~acea-row" wx:if="{{cardData.length>2}}"> <view class="mcards ~acea-row" wx:if="{{cardData.length>2}}">
<view class="card" wx:for="{{cardData}}" wx:for-index="index" wx:for-item="item" wx:if="{{index>1}}" wx:key='index'> <view class="card" wx:for="{{cardData}}" wx:for-index="index" wx:for-item="item" wx:if="{{index>1}}" wx:key='index'>
<view class="mnum">{{index}}{{ item.value||'--' }}</view> <view class="mnum">{{ item.value||'--' }}</view>
<view class="mname">{{ item.name||'--' }}{{item.unit?'('+item.unit+')':''}}</view> <view class="mname">{{ item.name||'--' }}{{item.unit?'('+item.unit+')':''}}</view>
</view> </view>
<!-- <view class="card" wx:if="{{cardData.length>3}}"> <!-- <view class="card" wx:if="{{cardData.length>3}}">
......
...@@ -30,13 +30,13 @@ Page({ ...@@ -30,13 +30,13 @@ Page({
console.log(e) console.log(e)
}, },
inputBlur(e){ inputBlur(e){
this.data.userForm.realName = e.detail.value this.data.userForm.realName = e.detail
}, },
inputBlur2(e){ inputBlur2(e){
this.data.userForm.tel = e.detail.value this.data.userForm.tel = e.detail
}, },
inputBlur3(e){ inputBlur3(e){
this.data.userForm.email = e.detail.value this.data.userForm.email = e.detail
}, },
getUserInfo(){ getUserInfo(){
basicApi.singleUser(wx.getStorageSync('uid')).then(res => { basicApi.singleUser(wx.getStorageSync('uid')).then(res => {
...@@ -71,7 +71,7 @@ Page({ ...@@ -71,7 +71,7 @@ Page({
}) })
}, },
undatePwd(){ undatePwd(){
wx.reLaunch({ url: '/pages/editPwd/editPwd' }) wx.navigateTo({ url: '/pages/editPwd/editPwd' })
}, },
logout: () => { logout: () => {
wx.getStorageInfo({ wx.getStorageInfo({
......
...@@ -27,21 +27,21 @@ ...@@ -27,21 +27,21 @@
name="姓名" name="姓名"
label="姓名" label="姓名"
placeholder="姓名" placeholder="姓名"
bind:blur='inputBlur' bind:change='inputBlur'
/> />
<van-field <van-field
value="{{userForm.tel}}" value="{{userForm.tel}}"
name="电话号码" name="电话号码"
label="电话号码" label="电话号码"
placeholder="电话号码" placeholder="电话号码"
bind:blur='inputBlur2' bind:change='inputBlur2'
/> />
<van-field <van-field
value="{{userForm.email}}" value="{{userForm.email}}"
name="邮箱" name="邮箱"
label="邮箱" label="邮箱"
placeholder="邮箱" placeholder="邮箱"
bind:blur='inputBlur3' bind:change='inputBlur3'
/> />
<van-field <van-field
value="{{userForm.roles}}" value="{{userForm.roles}}"
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!