bug修改
This commit is contained in:
@@ -32,6 +32,15 @@ App({
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
})
|
||||
wx.removeStorage({
|
||||
key: 'userInfoTemp',
|
||||
})
|
||||
wx.removeStorage({
|
||||
key: 'userInfo',
|
||||
})
|
||||
wx.removeStorage({
|
||||
key: 'X-Access-Token',
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
@@ -209,7 +209,7 @@ Page({
|
||||
let pattern = /^(?=.*[a-zA-Z])(?=.*\d)(?=.*[~!@#$%^&*()_+`\-={}:";'<>?,.\/]).{8,}$/
|
||||
if(!pattern.test(e.detail.value.password)){
|
||||
wx.showToast({
|
||||
title: '新密码由8位及以上数字、大小写字母和特殊符号组成!',
|
||||
title: '密码由8位及以上数字、大小写字母和特殊符号组成!',
|
||||
icon: 'none'
|
||||
})
|
||||
this.data.flag = false
|
||||
@@ -225,18 +225,6 @@ Page({
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
} else {
|
||||
let pattern = /^(?=.*[a-zA-Z])(?=.*\d)(?=.*[~!@#$%^&*()_+`\-={}:";'<>?,.\/]).{8,}$/
|
||||
if(!pattern.test(e.detail.value.verifyPassword)){
|
||||
wx.showToast({
|
||||
title: '确认密码由8位及以上数字、大小写字母和特殊符号组成!',
|
||||
icon: 'none'
|
||||
})
|
||||
this.data.flag = false
|
||||
return
|
||||
} else {
|
||||
this.data.flag = true
|
||||
}
|
||||
}
|
||||
if(e.detail.value.password === e.detail.value.verifyPassword) {
|
||||
this.data.flag = true
|
||||
|
||||
@@ -0,0 +1,231 @@
|
||||
// pages/meeting/meeting.js
|
||||
import UserApi from '../../assets/js/http/userApi'
|
||||
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
userId: '',
|
||||
form: {
|
||||
name: '',
|
||||
companyName: '',
|
||||
post: '',
|
||||
gender: '1',
|
||||
phone: '',
|
||||
contactAddress: '',
|
||||
email: '',
|
||||
postalCode: '',
|
||||
remarks: ''
|
||||
},
|
||||
isDisabled: true,
|
||||
selects: [ // 自定义选择框参数
|
||||
{
|
||||
select: '状态',
|
||||
active: false,
|
||||
tabIndex: 1
|
||||
},
|
||||
{
|
||||
select: '会议类型',
|
||||
active: false,
|
||||
tabIndex: 2
|
||||
},
|
||||
{
|
||||
select: '时间',
|
||||
active: false,
|
||||
tabIndex: 3
|
||||
}
|
||||
],
|
||||
sexArr: [{
|
||||
value: '1',
|
||||
name: '男',
|
||||
checked: ''
|
||||
},
|
||||
{
|
||||
value: '2',
|
||||
name: '女',
|
||||
checked: ''
|
||||
}
|
||||
]
|
||||
},
|
||||
postInput(e) {
|
||||
this.setData({
|
||||
"form.post": e.detail.value
|
||||
})
|
||||
},
|
||||
contactAddressInput(e) {
|
||||
this.setData({
|
||||
"form.contactAddress": e.detail.value
|
||||
})
|
||||
},
|
||||
postalCodeInput(e) {
|
||||
this.setData({
|
||||
"form.postalCode": e.detail.value
|
||||
})
|
||||
},
|
||||
remarksInput(e) {
|
||||
this.setData({
|
||||
"form.remarks": e.detail.value
|
||||
})
|
||||
},
|
||||
// 编辑
|
||||
editForm() {
|
||||
this.setData({
|
||||
isDisabled: false
|
||||
})
|
||||
},
|
||||
// 提交
|
||||
formSubmit(e) {
|
||||
let flag = false
|
||||
// 通讯地址校验
|
||||
if (!e.detail.value.contactAddress) {
|
||||
wx.showToast({
|
||||
title: '请输入通讯地址',
|
||||
icon: 'none'
|
||||
})
|
||||
flag = false
|
||||
return
|
||||
} else {
|
||||
flag = true
|
||||
}
|
||||
// 邮箱校验
|
||||
|
||||
if(e.detail.value.email){
|
||||
let isEmail = /^\w[-\w.+]*@([A-Za-z0-9][-A-Za-z0-9]+\.)+[A-Za-z]{2,14}/.test(e.detail.value.email)
|
||||
if (!isEmail) {
|
||||
wx.showToast({
|
||||
title: '邮箱格式不正确',
|
||||
icon: 'none'
|
||||
})
|
||||
flag = false
|
||||
return
|
||||
} else {
|
||||
flag = true
|
||||
}
|
||||
}else{
|
||||
wx.showToast({
|
||||
title: '请输入邮箱',
|
||||
icon: 'none'
|
||||
})
|
||||
flag = false
|
||||
return
|
||||
}
|
||||
|
||||
// 邮政编码校验
|
||||
if (e.detail.value.postalCode) {
|
||||
let isPost = /^[0-9]\d{5}$/.test(e.detail.value.postalCode)
|
||||
if (!isPost) {
|
||||
wx.showToast({
|
||||
title: '邮政编码格式不正确',
|
||||
icon: 'none'
|
||||
})
|
||||
flag = false
|
||||
return
|
||||
} else {
|
||||
flag = true
|
||||
}
|
||||
}else{
|
||||
wx.showToast({
|
||||
title: '请输入邮政编码',
|
||||
icon: 'none'
|
||||
})
|
||||
flag = false
|
||||
return
|
||||
}
|
||||
let params = Object.assign(this.data.form, e.detail.value)
|
||||
params.id = this.data.userId
|
||||
if (flag) {
|
||||
UserApi.editMineInfo(params).then(res => {
|
||||
if (res.success) {
|
||||
wx.showToast({
|
||||
title: res.result,
|
||||
})
|
||||
// 编辑成功之后,显示查看页
|
||||
this.setData({
|
||||
isDisabled: true
|
||||
})
|
||||
}else{
|
||||
wx.showToast({
|
||||
title: res.message,
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
})
|
||||
}
|
||||
}).catch(err => {
|
||||
wx.showToast({
|
||||
title: '加载失败',
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
})
|
||||
})
|
||||
} else {
|
||||
wx.showToast({
|
||||
title: '检查表单是否填写正确',
|
||||
})
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function (options) {
|
||||
wx.showToast({
|
||||
title: '加载中...',
|
||||
icon: 'loading'
|
||||
})
|
||||
const that = this
|
||||
let userInfo = wx.getStorageSync('userInfo')
|
||||
that.setData({
|
||||
userId: userInfo.id
|
||||
})
|
||||
UserApi.mineInfo({
|
||||
id: this.data.userId
|
||||
}).then(res => {
|
||||
if(res.success){
|
||||
res.result.gender = res.result.gender.toString()
|
||||
this.setData({
|
||||
form: res.result
|
||||
})
|
||||
// 性别处理
|
||||
if (this.data.form.gender === '1') {
|
||||
this.data.sexArr[0].checked = "true"
|
||||
this.setData({
|
||||
sexArr: this.data.sexArr,
|
||||
})
|
||||
}
|
||||
if (this.data.form.gender === '2') {
|
||||
this.data.sexArr[1].checked = "true"
|
||||
this.setData({
|
||||
sexArr: this.data.sexArr,
|
||||
})
|
||||
}
|
||||
}else{
|
||||
wx.showToast({
|
||||
title: res.message,
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
})
|
||||
}
|
||||
}).catch(err => {
|
||||
wx.showToast({
|
||||
title: '加载失败',
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow: function () {
|
||||
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"navigationBarTitleText": "个人信息",
|
||||
"usingComponents": {}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
<!--pages/meeting/meeting.wxml-->
|
||||
<view>
|
||||
<view bindtap="editForm" class="edit-text" wx:if="{{isDisabled}}">编辑</view>
|
||||
<form bindsubmit="formSubmit" class="form-box">
|
||||
<view class="form-item">
|
||||
<view class="text-label">姓名</view>
|
||||
<view class="text-value">
|
||||
<input style="{{isDisabled ? '': 'background-color: #f5f5f5 !important;'}}" name="name" disabled value="{{form.name}}" placeholder="请输入姓名" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item">
|
||||
<view class="text-label">企业名称</view>
|
||||
<view class="text-value">
|
||||
<input style="{{isDisabled ? '': 'background-color: #f5f5f5 !important;'}}" name="companyName" disabled value="{{form.companyName}}" placeholder="请输入企业名称" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item">
|
||||
<view class="text-label">职务</view>
|
||||
<view class="text-value">
|
||||
<input name="post" maxlength="50" bindinput="postInput" disabled="{{isDisabled}}" value="{{form.post ? form.post : ''}}" placeholder="请输入职务" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item" wx:if="{{isDisabled}}">
|
||||
<view class="text-label">性别</view>
|
||||
<view class="text-value">
|
||||
<input name="gender" disabled="{{isDisabled}}" value="{{form.gender == 1 ? '男' : '女'}}" placeholder="请选择性别" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item" wx:if="{{!isDisabled}}">
|
||||
<view class="text-label">性别</view>
|
||||
<view class="text-value">
|
||||
<radio-group class="flex-center" name="gender">
|
||||
<label class="flex-center" wx:for="{{sexArr}}" wx:for-item="item" wx:key="value">
|
||||
<view class="">
|
||||
<radio value="{{item.value}}" checked="{{item.checked}}"/>
|
||||
</view>
|
||||
<view class="">{{item.name}}</view>
|
||||
</label>
|
||||
</radio-group>
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item">
|
||||
<view class="text-label">手机号</view>
|
||||
<view class="text-value">
|
||||
<input style="{{isDisabled ? '': 'background-color: #f5f5f5 !important;'}}" name="phone" maxlength="11" disabled value="{{form.phone}}" placeholder="请输入手机号" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item">
|
||||
<view class="text-label"><text style="color: red;">* </text>通讯地址</view>
|
||||
<view class="text-value">
|
||||
<input name="contactAddress" maxlength="50" bindinput="contactAddressInput" disabled="{{isDisabled}}" value="{{form.contactAddress}}" placeholder="请输入通讯地址" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item">
|
||||
<view class="text-label"><text style="color: red;">* </text>邮箱</view>
|
||||
<view class="text-value">
|
||||
<input name="email" disabled="{{isDisabled}}" maxlength="50" bindinput="emailInput" value="{{form.email}}"placeholder="请输入邮箱" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item">
|
||||
<view class="text-label"><text style="color: red;">* </text>邮政编码</view>
|
||||
<view class="text-value">
|
||||
<input name="postalCode" type="number" maxlength="6" bindinput="postalCodeInput" disabled="{{isDisabled}}" value="{{form.postalCode}}" placeholder="请输入邮政编码" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item">
|
||||
<view class="text-label">备注</view>
|
||||
<view class="text-value">
|
||||
<input name="remarks" disabled="{{isDisabled}}" maxlength="200" bindinput="remarksInput" value="{{form.remarks ? form.remarks : '' }}" placeholder="请输入备注" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="btn-area" wx:if="{{!isDisabled}}">
|
||||
<button type="primary" formType="submit">提交</button>
|
||||
</view>
|
||||
</form>
|
||||
</view>
|
||||
@@ -0,0 +1,62 @@
|
||||
/* pages/meeting/meeting.wxss */
|
||||
.text-label{
|
||||
width: 80px !important;
|
||||
}
|
||||
/* 列表start */
|
||||
.edit-text{
|
||||
display: flex;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
padding-right: 15pt;
|
||||
height: 40px;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
color: #07c160;
|
||||
}
|
||||
.list{
|
||||
padding: 15px;
|
||||
}
|
||||
.list-item{
|
||||
height: 90px;
|
||||
background-color: #fff;
|
||||
border-radius: 5px;
|
||||
padding: 10px 15px;
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
}
|
||||
.list-item:not(:first-child) {
|
||||
margin-top: 10px;
|
||||
}
|
||||
.list-item .title{
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
.list-item .title text:nth-child(1){
|
||||
font-size: 14px;
|
||||
color: #333;
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.list-item .title text:nth-child(2){
|
||||
font-size: 12px;
|
||||
color: #999;
|
||||
width: 70px;
|
||||
text-align: right;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.content-text{
|
||||
width: 100%;
|
||||
color: #999;
|
||||
font-size: 12px;
|
||||
}
|
||||
.content-text image{
|
||||
width: 11px;
|
||||
height: 11px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
@@ -149,8 +149,7 @@ Page({
|
||||
if(res.message == '请先用手机号登录'){
|
||||
wx.showToast({
|
||||
title: '首次登录请用验证码方式登录',
|
||||
icon: 'none',
|
||||
duration: 3000
|
||||
icon: 'none'
|
||||
})
|
||||
setTimeout(() => {
|
||||
wx.navigateBack()
|
||||
@@ -176,16 +175,16 @@ Page({
|
||||
}else{
|
||||
wx.showToast({
|
||||
title: res.message,
|
||||
icon: 'none',
|
||||
duration: 3000
|
||||
icon: 'none'
|
||||
})
|
||||
this.handleChangeCheckCode()
|
||||
setTimeout(() => {
|
||||
this.handleChangeCheckCode()
|
||||
}, 2000);
|
||||
}
|
||||
}).catch(err=>{
|
||||
wx.showToast({
|
||||
title: err.message,
|
||||
icon: 'none',
|
||||
duration: 3000
|
||||
icon: 'none'
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ Page({
|
||||
let pattern = /^(?=.*[a-zA-Z])(?=.*\d)(?=.*[~!@#$%^&*()_+`\-={}:";'<>?,.\/]).{8,}$/
|
||||
if(!pattern.test(e.detail.value.newPassword)){
|
||||
wx.showToast({
|
||||
title: '密码由8位及以上数字、大小写字母和特殊符号组成!',
|
||||
title: '密码由8位及以上数字、大小写字母和特殊符号组成!',
|
||||
icon: 'none'
|
||||
})
|
||||
this.data.flag = false
|
||||
@@ -137,18 +137,6 @@ Page({
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
} else {
|
||||
let pattern = /^(?=.*[a-zA-Z])(?=.*\d)(?=.*[~!@#$%^&*()_+`\-={}:";'<>?,.\/]).{8,}$/
|
||||
if(!pattern.test(e.detail.value.verifyPassword)){
|
||||
wx.showToast({
|
||||
title: '密码由8位及以上数字、大小写字母和特殊符号组成!',
|
||||
icon: 'none'
|
||||
})
|
||||
this.data.flag = false
|
||||
return
|
||||
} else {
|
||||
this.data.flag = true
|
||||
}
|
||||
}
|
||||
if(e.detail.value.newPassword === e.detail.value.verifyPassword) {
|
||||
this.data.flag = true
|
||||
|
||||
@@ -168,7 +168,7 @@ Page({
|
||||
let pattern = /^(?=.*[a-zA-Z])(?=.*\d)(?=.*[~!@#$%^&*()_+`\-={}:";'<>?,.\/]).{8,}$/
|
||||
if(!pattern.test(e.detail.value.oldpassword)){
|
||||
wx.showToast({
|
||||
title: '旧密码由8位及以上数字、大小写字母和特殊符号组成!',
|
||||
title: '密码由8位及以上数字、大小写字母和特殊符号组成!',
|
||||
icon: 'none'
|
||||
})
|
||||
this.data.flag = false
|
||||
@@ -188,7 +188,7 @@ Page({
|
||||
let pattern = /^(?=.*[a-zA-Z])(?=.*\d)(?=.*[~!@#$%^&*()_+`\-={}:";'<>?,.\/]).{8,}$/
|
||||
if(!pattern.test(e.detail.value.password)){
|
||||
wx.showToast({
|
||||
title: '新密码由8位及以上数字、大小写字母和特殊符号组成!',
|
||||
title: '密码由8位及以上数字、大小写字母和特殊符号组成!',
|
||||
icon: 'none'
|
||||
})
|
||||
this.data.flag = false
|
||||
@@ -208,7 +208,7 @@ Page({
|
||||
let pattern = /^(?=.*[a-zA-Z])(?=.*\d)(?=.*[~!@#$%^&*()_+`\-={}:";'<>?,.\/]).{8,}$/
|
||||
if(!pattern.test(e.detail.value.confirmpassword)){
|
||||
wx.showToast({
|
||||
title: '确认新密码由8位及以上数字、大小写字母和特殊符号组成!!',
|
||||
title: '密码由8位及以上数字、大小写字母和特殊符号组成!',
|
||||
icon: 'none'
|
||||
})
|
||||
this.data.flag = false
|
||||
|
||||
Reference in New Issue
Block a user