This commit is contained in:
周源 2022-05-09 11:49:59 +08:00
parent a25f8d4859
commit eee1a9d0eb
9 changed files with 232 additions and 25 deletions

View File

@ -428,6 +428,15 @@
}
}
,{
"path" : "pages/PersonalCenter/changePasw",
"style" :
{
"navigationBarTitleText": "修改密码",
"enablePullDownRefresh": false
}
}
],
"globalStyle": {
"navigationBarTextStyle": "black", // black/white

View File

@ -69,19 +69,19 @@
'pasw': [{
required: true,
message: '请填写密码',
trigger: ['blur']
trigger: ['blur','change']
}, {
min: 8,
max: 30,
message: '密码长度应大于等于8个字符小于30个字符!',
trigger: "blur"
min: 6,
max: 20,
message: '密码长度应大于等于6个字符小于20个字符!',
trigger: ['blur','change']
}, {
trigger: ['blur'],
trigger: ['blur','change'],
validator: (rule, value, callback) => {
var passwordreg =
/^(?!([a-zA-Z]+|[a-z\d]+|[a-z~`@#\$%\^&\*\(\)_\-\+=\{\[\}\]\|\\:;\"\'<,>\.\?\/\!]+|[A-Z\d]+|[A-Z~`@#\$%\^&\*\(\)_\-\+=\{\[\}\]\|\\:;\"\'<,>\.\?\/\!]+|[\d~`@#\$%\^&\*\(\)_\-\+=\{\[\}\]\|\\:;\"\'<,>\.\?\/\!]+)$)[a-zA-Z\d~`@#\$%\^&\*\(\)_\-\+=\{\[\}\]\|\\:;\"\'<,>\.\?\/\!]+$/;
/^(?![0-9]+$)(?![a-z]+$)(?![A-Z]+$)(?!([^(0-9a-zA-Z)])+$).{6,20}$/;
if (!passwordreg.test(value)) {
callback(new Error('密码必须由大写字母、小写字母、数字、特殊符号中的2种及以上类型组成!'))
callback(new Error('密码包含 数字,英文,字符中的两种以上'))
} else {
callback()
}

View File

@ -69,19 +69,19 @@
'pasw': [{
required: true,
message: '请填写密码',
trigger: ['blur']
trigger: ['blur','change']
}, {
min: 8,
max: 30,
message: '密码长度应大于等于8个字符小于30个字符!',
trigger: "blur"
min: 6,
max: 20,
message: '密码长度应大于等于6个字符小于20个字符!',
trigger: ['blur','change']
}, {
trigger: ['blur'],
trigger: ['blur','change'],
validator: (rule, value, callback) => {
var passwordreg =
/^(?!([a-zA-Z]+|[a-z\d]+|[a-z~`@#\$%\^&\*\(\)_\-\+=\{\[\}\]\|\\:;\"\'<,>\.\?\/\!]+|[A-Z\d]+|[A-Z~`@#\$%\^&\*\(\)_\-\+=\{\[\}\]\|\\:;\"\'<,>\.\?\/\!]+|[\d~`@#\$%\^&\*\(\)_\-\+=\{\[\}\]\|\\:;\"\'<,>\.\?\/\!]+)$)[a-zA-Z\d~`@#\$%\^&\*\(\)_\-\+=\{\[\}\]\|\\:;\"\'<,>\.\?\/\!]+$/;
/^(?![0-9]+$)(?![a-z]+$)(?![A-Z]+$)(?!([^(0-9a-zA-Z)])+$).{6,20}$/;
if (!passwordreg.test(value)) {
callback(new Error('密码必须由大写字母、小写字母、数字、特殊符号中的2种及以上类型组成!'))
callback(new Error('密码包含 数字,英文,字符中的两种以上'))
} else {
callback()
}
@ -153,6 +153,6 @@
<style lang="scss">
.data_itm {
margin: 80rpx 0px;
margin: 30rpx 0px;
}
</style>

View File

@ -72,7 +72,7 @@
<u-icon name="arrow-right"></u-icon>
</view>
</view> -->
<view class="person_itm_sign" @click="goChangeInfo('密码','')">
<view class="person_itm_sign" @click="goChangePasw">
<text class="person_itm_sign_tit">密码</text>
<view class="person_itm_sign_right">
<text> {{userInfoObj.pasw}}</text>
@ -284,7 +284,8 @@
this.http.request('/user/userInfo', {}, "GET").then((res) => {
console.log("res", res.data);
this.userInfoObj = res.data
this.imgUrl=baseurl+JSON.parse(this.userInfoObj.images)[0]
// this.imgUrl=baseurl+JSON.parse(this.userInfoObj.images)[0]
this.imgUrl= JSON.parse(this.userInfoObj.images)[0]
}).catch((error) => {
uni.showToast({
@ -292,6 +293,10 @@
})
})
},goChangePasw(){
uni.navigateTo({
url:'/pages/PersonalCenter/changePasw'
})
}
},
onReady() {

View File

@ -196,7 +196,8 @@
},
timeMode: 'date', // date tiem
postFileList2: [], //
baseurl: http.config.baseUrl.replace('/h5/api', ''),
// baseurl: http.config.baseUrl.replace('/h5/api', ''),
baseurl:'',
fileList4: [], //
fileList1: [], //
fileList2: [], //

View File

@ -0,0 +1,174 @@
<template>
<view style="margin: 0rpx 48rpx;">
<u--form :model="registInfo" ref="registForm">
<view class="" style="padding: 0rpx 28rpx ;">
<text style="font-size: 40rpx; font-weight: 700;">修改密码</text>
<u-form-item prop="oldpasw" ref="item1" class="data_itm">
<u--input type="password" placeholder="请输入旧密码" border="bottom" clearable
v-model="registInfo.oldpasw">
</u--input>
</u-form-item>
<u-form-item prop="pasw" ref="item1" class="data_itm">
<u--input type="password" placeholder="请输入新密码" border="bottom" clearable v-model="registInfo.pasw">
</u--input>
</u-form-item>
<u-form-item prop="repasw" ref="item1" class="data_itm">
<u--input type="password" placeholder="请再次输入密码" border="bottom" clearable
v-model="registInfo.repasw">
</u--input>
</u-form-item>
</view>
<u-button text="确认修改" size="large" throttleTime=1000 color="#99241B" style="margin-top: 80rpx;"
@click="submitNext"></u-button>
</u--form>
</view>
</template>
<script>
export default {
data() {
return {
tips: '',
registInfo: {
number: null,
checKcode: null,
pasw: null,
oldpasw: null,
repasw: null
},
rules: {
'checKcode': [{
required: true,
message: '请填写验证码',
trigger: ['blur']
}, {
min: 6,
max: 6,
message: '验证码长度应该等于6个字符!',
trigger: "blur"
}],
'number': [{
type: 'number',
required: true,
message: '请填写手机号',
trigger: ['blur']
}, {
validator: (rule, value, callback) => {
return uni.$u.test.mobile(value);
},
message: '请输入格式正确的手机号',
trigger: ['change', 'blur'],
}],
'pasw': [{
required: true,
message: '请填写密码',
trigger: ['blur', 'change']
}, {
min: 6,
max: 20,
message: '密码长度应大于等于6个字符小于20个字符!',
trigger: ['blur', 'change']
}, {
trigger: ['blur', 'change'],
validator: (rule, value, callback) => {
var passwordreg =
/^(?![0-9]+$)(?![a-z]+$)(?![A-Z]+$)(?!([^(0-9a-zA-Z)])+$).{6,20}$/;
if (!passwordreg.test(value)) {
callback(new Error('密码包含 数字,英文,字符中的两种以上'))
} else {
callback()
}
}
}],
'oldpasw': [{
required: true,
message: '请填写旧密码',
trigger: ['blur', 'change']
}, {
min: 6,
max: 20,
message: '密码长度应大于等于6个字符小于20个字符!',
trigger: ['blur', 'change']
}, {
trigger: ['blur', 'change'],
validator: (rule, value, callback) => {
var passwordreg =
/^(?![0-9]+$)(?![a-z]+$)(?![A-Z]+$)(?!([^(0-9a-zA-Z)])+$).{6,20}$/;
if (!passwordreg.test(value)) {
callback(new Error('密码包含 数字,英文,字符中的两种以上'))
} else {
callback()
}
}
}],
'repasw': [{
required: true,
message: '请填写密码',
trigger: ['blur', 'change']
}, {
validator: (rule, value, callback) => {
if (value !== this.registInfo.pasw) {
callback(new Error('两次输入密码不一致'))
} else {
callback()
}
},
trigger: ['change', 'blur'],
}],
}
};
},
methods: {
codeChange(text) {
this.tips = text;
},
getCode() {
uni.hideKeyboard()
if (!(/^1(3|4|5|6|7|8|9)\d{9}$/.test(this.registInfo.number))) { //
uni.showToast({
title: '请填写正确手机号码',
icon: "none"
});
return false;
}
if (this.$refs.uCode.canGetCode) {
//
uni.showLoading({
title: '正在获取验证码'
})
setTimeout(() => {
uni.hideLoading();
// this.start()
uni.$u.toast('验证码已发送');
//
this.$refs.uCode.start();
}, 2000);
} else {
uni.$u.toast('倒计时结束后再发送');
}
},
submitNext() {
this.$refs.registForm.validate().then(res => {
uni.$u.toast('Thanks your helping')
}).catch(errors => {
uni.$u.toast('您的资料还未补充完整')
})
}
},
onReady() {
this.$refs.registForm.setRules(this.rules);
},
}
</script>
<style lang="scss">
.data_itm {
margin: 30rpx 0px;
}
</style>

View File

@ -437,10 +437,26 @@
},
rules: {
'userInfo.pasw': [{
type: 'string',
required: true,
message: '密码不能为空',
message: '请填写密码',
trigger: ['blur','change']
}, {
min: 6,
max: 20,
message: '密码长度应大于等于6个字符小于20个字符!',
trigger: ['blur','change']
}, {
trigger: ['blur','change'],
validator: (rule, value, callback) => {
var passwordreg =
/^(?![0-9]+$)(?![a-z]+$)(?![A-Z]+$)(?!([^(0-9a-zA-Z)])+$).{6,20}$/;
if (!passwordreg.test(value)) {
callback(new Error('密码包含 数字,英文,字符中的两种以上'))
} else {
callback()
}
}
}],
'userInfo.serverInstrutor': [{
type: 'string',

View File

@ -109,6 +109,7 @@
if (res.code == 200) {
console.log(res.data)
this.actDetObj = res.data
// console.log("actObj");
// _this.load = false
}
}).catch(e => {

View File

@ -75,8 +75,8 @@
</view>
</view>
<view class="right">
<!-- <image :src="jianAct[i].picture" mode=""></image> -->
<image src="../../static/icon12.jpg" mode=""></image>
<image :src="jianAct[i].picture" mode=""></image>
<!-- <image src="../../static/icon12.jpg" mode=""></image> -->
</view>
</view>
</view>
@ -131,6 +131,7 @@
if (res.code == 200) {
console.log(res.data)
this.jianAct = res.data.records
// picture
_this.load = false
}