修改意见反馈以及修改密码发现的bug
parent
5cb2f6ad91
commit
b840a0adf1
|
@ -2,8 +2,8 @@
|
||||||
"name" : "lili商城",
|
"name" : "lili商城",
|
||||||
"appid" : "__UNI__EC9FD60",
|
"appid" : "__UNI__EC9FD60",
|
||||||
"description" : "",
|
"description" : "",
|
||||||
"versionName" : "4.2.5",
|
"versionName" : "4.2.6",
|
||||||
"versionCode" : 4000250,
|
"versionCode" : 4000260,
|
||||||
"transformPx" : false,
|
"transformPx" : false,
|
||||||
"app-plus" : {
|
"app-plus" : {
|
||||||
"compatible" : {
|
"compatible" : {
|
||||||
|
|
|
@ -16,9 +16,9 @@
|
||||||
<!-- 上传凭证 -->
|
<!-- 上传凭证 -->
|
||||||
<div class="feedBack-box">
|
<div class="feedBack-box">
|
||||||
<view class="opt-view">
|
<view class="opt-view">
|
||||||
<view class="img-title">上传凭证(最多5张)</view>
|
<view class="img-title">上传凭证(最多2张)</view>
|
||||||
<view class="images-view">
|
<view class="images-view">
|
||||||
<u-upload :header=" { accessToken: storage.getAccessToken() }" :action="action" width="150" @on-uploaded="onUploaded" :max-count="5" :show-progress="false"></u-upload>
|
<u-upload :header=" { accessToken: storage.getAccessToken() }" :action="action" width="150" @on-uploaded="onUploaded" :max-count="2" :show-progress="false"></u-upload>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,258 +1,277 @@
|
||||||
<template>
|
<template>
|
||||||
<view class="box">
|
<view class="box">
|
||||||
<view class="box-tips">
|
<view class="box-tips">
|
||||||
<h2 class='h2'>
|
<h2 class='h2'>
|
||||||
{{verificationTitle[validateFlage==false ? 0 : 1].title}}
|
{{verificationTitle[validateFlage==false ? 0 : 1].title}}
|
||||||
</h2>
|
</h2>
|
||||||
<view class="verification">{{verificationTitle[step].desc}}</view>
|
<view class="verification">{{verificationTitle[step].desc}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="form">
|
<view class="form">
|
||||||
<u-form :model="codeForm" ref="validateCodeForm">
|
<u-form :model="codeForm" ref="validateCodeForm">
|
||||||
<view v-if="!validateFlage">
|
<view v-if="!validateFlage">
|
||||||
<u-form-item label-width="120" label="手机号" prop="mobile">
|
<u-form-item label-width="120" label="手机号" prop="mobile">
|
||||||
<u-input maxlength="11" v-model="codeForm.mobile" placeholder="请输入您的手机号" />
|
<u-input maxlength="11" v-model="codeForm.mobile" placeholder="请输入您的手机号" />
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
|
|
||||||
<u-form-item class="sendCode" label-width="120" prop="code" label="验证码">
|
<u-form-item class="sendCode" label-width="120" prop="code" label="验证码">
|
||||||
<u-input v-model="codeForm.code" placeholder="请输入验证码" />
|
<u-input v-model="codeForm.code" placeholder="请输入验证码" />
|
||||||
<u-verification-code unique-key="page-edit" :seconds="seconds" @end="end" @start="start" ref="uCode" @change="codeChange"></u-verification-code>
|
<u-verification-code unique-key="page-edit" :seconds="seconds" @end="end" @start="start"
|
||||||
<view @tap="getCode" class="text-tips">{{ tips }}</view>
|
ref="uCode" @change="codeChange"></u-verification-code>
|
||||||
</u-form-item>
|
<view @tap="getCode" class="text-tips">{{ tips }}</view>
|
||||||
|
</u-form-item>
|
||||||
<view class="submit" @click="validatePhone">验证</view>
|
|
||||||
<myVerification keep-running @send="verification" class="verification" ref="verification" business="FIND_USER" />
|
<view class="submit" @click="validatePhone">验证</view>
|
||||||
</view>
|
<myVerification keep-running @send="verification" class="verification" ref="verification"
|
||||||
<view v-if="validateFlage">
|
business="FIND_USER" />
|
||||||
<u-form-item label-width="120" label="旧密码">
|
</view>
|
||||||
<u-input type="password" v-model="password" placeholder="请输入您的旧密码" />
|
<view v-if="validateFlage">
|
||||||
</u-form-item>
|
<u-form-item label-width="120" label="旧密码">
|
||||||
|
<u-input type="password" v-model="password" placeholder="请输入您的旧密码" />
|
||||||
<u-form-item label-width="120" label="新密码">
|
</u-form-item>
|
||||||
|
|
||||||
<u-input type="password" v-model="newPassword" placeholder="请输入您的新密码" />
|
<u-form-item label-width="120" label="新密码">
|
||||||
|
|
||||||
</u-form-item>
|
<u-input type="password" v-model="newPassword" placeholder="请输入您的新密码" />
|
||||||
|
|
||||||
<view class="submit" @click="updatePassword">修改密码</view>
|
</u-form-item>
|
||||||
</view>
|
|
||||||
</u-form>
|
<view class="submit" @click="updatePassword">修改密码</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</u-form>
|
||||||
</template>
|
</view>
|
||||||
|
</view>
|
||||||
<script>
|
</template>
|
||||||
import { sendMobile, resetByMobile, modifyPass } from "@/api/login";
|
|
||||||
|
<script>
|
||||||
import { md5 } from "@/utils/md5.js"; // md5
|
import {
|
||||||
import myVerification from "@/components/verification/verification.vue"; //验证
|
sendMobile,
|
||||||
import uuid from "@/utils/uuid.modified.js";
|
resetByMobile,
|
||||||
export default {
|
modifyPass
|
||||||
components: {
|
} from "@/api/login";
|
||||||
myVerification,
|
|
||||||
},
|
import {
|
||||||
data() {
|
md5
|
||||||
return {
|
} from "@/utils/md5.js"; // md5
|
||||||
uuid,
|
import myVerification from "@/components/verification/verification.vue"; //验证
|
||||||
validateFlage: false, //是否进行了手机号验证
|
import uuid from "@/utils/uuid.modified.js";
|
||||||
verificationTitle: [
|
export default {
|
||||||
{
|
components: {
|
||||||
title: "安全验证",
|
myVerification,
|
||||||
desc: "请输入当前手机号进行安全验证",
|
},
|
||||||
},
|
data() {
|
||||||
{
|
return {
|
||||||
title: "修改密码",
|
uuid,
|
||||||
desc: "请输入新密码",
|
validateFlage: false, //是否进行了手机号验证
|
||||||
},
|
verificationTitle: [{
|
||||||
],
|
title: "安全验证",
|
||||||
step: 0, //当前验证步骤
|
desc: "请输入当前手机号进行安全验证",
|
||||||
flage: false, //是否验证码验证
|
},
|
||||||
|
{
|
||||||
codeForm: {
|
title: "修改密码",
|
||||||
mobile: "", //手机号
|
desc: "请输入新密码",
|
||||||
code: "", //验证码
|
},
|
||||||
},
|
],
|
||||||
newPassword: "", //新密码
|
step: 0, //当前验证步骤
|
||||||
password: "", //密码
|
flage: false, //是否验证码验证
|
||||||
tips: "", //提示
|
|
||||||
seconds: 60, // 60s等待时间
|
codeForm: {
|
||||||
|
mobile: "", //手机号
|
||||||
// 验证码登录校验
|
code: "", //验证码
|
||||||
codeRules: {
|
},
|
||||||
mobile: [
|
newPassword: "", //新密码
|
||||||
{
|
password: "", //密码
|
||||||
validator: (rule, value, callback) => {
|
tips: "", //提示
|
||||||
return this.$u.test.mobile(value);
|
seconds: 69, // 60s等待时间
|
||||||
},
|
|
||||||
message: "手机号码不正确",
|
// 验证码登录校验
|
||||||
trigger: ["blur"],
|
codeRules: {
|
||||||
},
|
mobile: [{
|
||||||
],
|
validator: (rule, value, callback) => {
|
||||||
code: [
|
return this.$u.test.mobile(value);
|
||||||
{
|
},
|
||||||
min: 4,
|
message: "手机号码不正确",
|
||||||
max: 6,
|
trigger: ["blur"],
|
||||||
required: true,
|
}, ],
|
||||||
message: "请输入验证码",
|
code: [{
|
||||||
trigger: ["blur"],
|
min: 4,
|
||||||
},
|
max: 6,
|
||||||
],
|
required: true,
|
||||||
},
|
message: "请输入验证码",
|
||||||
};
|
trigger: ["blur"],
|
||||||
},
|
}, ],
|
||||||
onReady() {
|
},
|
||||||
// 必须要在onReady生命周期,因为onLoad生命周期组件可能尚未创建完毕
|
};
|
||||||
this.$refs.validateCodeForm.setRules(this.codeRules);
|
},
|
||||||
},
|
onReady() {
|
||||||
watch: {
|
// 必须要在onReady生命周期,因为onLoad生命周期组件可能尚未创建完毕
|
||||||
flage(val) {
|
this.$refs.validateCodeForm.setRules(this.codeRules);
|
||||||
if (val) {
|
},
|
||||||
if (this.$refs.uCode.canGetCode) {
|
watch: {
|
||||||
uni.showLoading({
|
flage(val) {
|
||||||
title: "正在获取验证码",
|
if (val) {
|
||||||
});
|
|
||||||
sendMobile(this.codeForm.mobile, "FIND_USER").then((res) => {
|
if (this.$refs.uCode.canGetCode) {
|
||||||
uni.hideLoading();
|
uni.showLoading({
|
||||||
// 这里此提示会被this.start()方法中的提示覆盖
|
title: "正在获取验证码",
|
||||||
if (res.data.code == 200) {
|
});
|
||||||
this.$refs.uCode.start();
|
sendMobile(this.codeForm.mobile, "FIND_USER").then((res) => {
|
||||||
} else {
|
uni.hideLoading();
|
||||||
uni.showToast({
|
// 这里此提示会被this.start()方法中的提示覆盖
|
||||||
title: res.data.message,
|
if (res.data.success) {
|
||||||
duration: 2000,
|
this.$refs.uCode.start();
|
||||||
icon: "none",
|
} else {
|
||||||
});
|
uni.showToast({
|
||||||
}
|
title: res.data.message,
|
||||||
});
|
duration: 2000,
|
||||||
} else {
|
icon: "none",
|
||||||
this.$u.toast("请倒计时结束后再发送");
|
});
|
||||||
}
|
this.flage = false;
|
||||||
}
|
this.$refs.verification.getCode();
|
||||||
},
|
}
|
||||||
},
|
})
|
||||||
|
} else {
|
||||||
methods: {
|
this.$u.toast("请倒计时结束后再发送");
|
||||||
// 修改密码
|
}
|
||||||
updatePassword() {
|
}
|
||||||
modifyPass({
|
},
|
||||||
newPassword: md5(this.newPassword),
|
},
|
||||||
password: md5(this.password),
|
|
||||||
}).then((res) => {
|
methods: {
|
||||||
if (res.data.success) {
|
// 修改密码
|
||||||
uni.showToast({
|
updatePassword() {
|
||||||
title: "修改成功!",
|
modifyPass({
|
||||||
duration: 2000,
|
newPassword: md5(this.newPassword),
|
||||||
icon: "none",
|
password: md5(this.password),
|
||||||
});
|
}).then((res) => {
|
||||||
setTimeout(() => {
|
if (res.data.success) {
|
||||||
uni.navigateBack({
|
uni.showToast({
|
||||||
delta: 1,
|
title: "修改成功!",
|
||||||
});
|
duration: 2000,
|
||||||
}, 1000);
|
icon: "none",
|
||||||
}
|
});
|
||||||
});
|
setTimeout(() => {
|
||||||
},
|
uni.navigateBack({
|
||||||
|
delta: 1,
|
||||||
// 验证码验证
|
});
|
||||||
verification(val) {
|
}, 1000);
|
||||||
this.flage = val == this.$store.state.verificationKey ? true : false;
|
}
|
||||||
},
|
});
|
||||||
|
},
|
||||||
// 验证手机号
|
|
||||||
validatePhone() {
|
// 验证码验证
|
||||||
this.$refs.validateCodeForm.validate((valid) => {
|
verification(val) {
|
||||||
if (valid) {
|
this.flage = val == this.$store.state.verificationKey ? true : false;
|
||||||
resetByMobile(this.codeForm).then((res) => {
|
},
|
||||||
if (res.data.success) {
|
|
||||||
this.validateFlage = !this.validateFlage;
|
// 验证手机号
|
||||||
// 登录成功
|
validatePhone() {
|
||||||
uni.showToast({
|
this.$refs.validateCodeForm.validate((valid) => {
|
||||||
title: "验证成功!",
|
if (valid) {
|
||||||
icon: "none",
|
resetByMobile(this.codeForm).then((res) => {
|
||||||
});
|
if (res.data.success) {
|
||||||
}
|
this.validateFlage = !this.validateFlage;
|
||||||
});
|
// 登录成功
|
||||||
}
|
uni.showToast({
|
||||||
});
|
title: "验证成功!",
|
||||||
},
|
icon: "none",
|
||||||
|
});
|
||||||
codeChange(text) {
|
}
|
||||||
this.tips = text;
|
});
|
||||||
},
|
}
|
||||||
end() {},
|
});
|
||||||
|
},
|
||||||
/**判断是否是当前用户的手机号 */
|
|
||||||
isUserPhone() {
|
codeChange(text) {
|
||||||
let flage = false;
|
this.tips = text;
|
||||||
let user = this.$options.filters.isLogin();
|
},
|
||||||
if (user.mobile != this.codeForm.mobile) {
|
end() {
|
||||||
uni.showToast({
|
|
||||||
title: "请输入当前绑定手机号",
|
this.flage = false;
|
||||||
icon: "none",
|
this.$refs.verification.getCode()
|
||||||
});
|
},
|
||||||
flage = false;
|
|
||||||
} else {
|
/**判断是否是当前用户的手机号 */
|
||||||
flage = true;
|
isUserPhone() {
|
||||||
}
|
let flage = false;
|
||||||
|
let user = this.$options.filters.isLogin();
|
||||||
return flage;
|
if (user.mobile != this.codeForm.mobile) {
|
||||||
},
|
uni.showToast({
|
||||||
/**获取验证码 */
|
title: "请输入当前绑定手机号",
|
||||||
getCode() {
|
icon: "none",
|
||||||
if (this.isUserPhone()) {
|
});
|
||||||
if (this.tips == "重新获取") {
|
flage = false;
|
||||||
this.flage = true;
|
} else {
|
||||||
}
|
flage = true;
|
||||||
if (!this.$u.test.mobile(this.codeForm.mobile)) {
|
}
|
||||||
uni.showToast({
|
|
||||||
title: "请输入正确手机号",
|
return flage;
|
||||||
icon: "none",
|
},
|
||||||
});
|
/**获取验证码 */
|
||||||
return false;
|
getCode() {
|
||||||
}
|
if (this.isUserPhone()) {
|
||||||
if (!this.flage) {
|
if (this.tips == "重新获取") {
|
||||||
this.$refs.verification.hide();
|
this.$refs.verification.error(); //发送
|
||||||
return false;
|
}
|
||||||
}
|
if (!this.$u.test.mobile(this.codeForm.mobile)) {
|
||||||
}
|
uni.showToast({
|
||||||
},
|
title: "请输入正确手机号",
|
||||||
start() {
|
icon: "none",
|
||||||
this.$u.toast("验证码已发送");
|
});
|
||||||
this.flage = false;
|
return false;
|
||||||
},
|
}
|
||||||
},
|
if (!this.flage) {
|
||||||
};
|
this.$refs.verification.error(); //发送
|
||||||
</script>
|
return false;
|
||||||
<style lang="scss" scoped>
|
}
|
||||||
@import url("@/pages/passport/login.scss");
|
}
|
||||||
/deep/ .u-form-item {
|
},
|
||||||
margin: 40rpx 0;
|
start() {
|
||||||
}
|
this.$u.toast("验证码已发送");
|
||||||
.sendCode {
|
this.flage = true;
|
||||||
/deep/ .u-form-item--right__content__slot {
|
|
||||||
display: flex;
|
this.$refs.verification.hide();
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
.h2{
|
};
|
||||||
font-size: 40rpx;
|
</script>
|
||||||
font-weight: bold;
|
<style lang="scss" scoped>
|
||||||
}
|
@import url("@/pages/passport/login.scss");
|
||||||
page {
|
|
||||||
background: #fff;
|
/deep/ .u-form-item {
|
||||||
}
|
margin: 40rpx 0;
|
||||||
.box {
|
}
|
||||||
padding: 80rpx 0;
|
|
||||||
border-radius: 20rpx;
|
.sendCode {
|
||||||
}
|
/deep/ .u-form-item--right__content__slot {
|
||||||
.submit {
|
display: flex;
|
||||||
background: $light-color;
|
}
|
||||||
}
|
}
|
||||||
.box-tips {
|
|
||||||
margin: 0 72rpx;
|
.h2 {
|
||||||
}
|
font-size: 40rpx;
|
||||||
.verification {
|
font-weight: bold;
|
||||||
font-size: 24rpx;
|
}
|
||||||
color: #999;
|
|
||||||
margin-top: 10rpx;
|
page {
|
||||||
}
|
background: #fff;
|
||||||
|
}
|
||||||
</style>
|
|
||||||
|
.box {
|
||||||
|
padding: 80rpx 0;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.submit {
|
||||||
|
background: $light-color;
|
||||||
|
}
|
||||||
|
|
||||||
|
.box-tips {
|
||||||
|
margin: 0 72rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.verification {
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #999;
|
||||||
|
margin-top: 10rpx;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
Loading…
Reference in New Issue