Commit 4b3204fd by 李君

优化

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