You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
162 lines
3.0 KiB
Vue
162 lines
3.0 KiB
Vue
<template>
|
|
<view class="p-root-person-pwdForget g_w_all g_h_all g_bg_f_5 g_kuaishou">
|
|
<view class="g_pt_16 g_mb_24">
|
|
<g-panel-form-slot
|
|
:list="[
|
|
{
|
|
icon: '',
|
|
label: '手机号',
|
|
result: tel,
|
|
path: '',
|
|
tip: 'mobile',
|
|
type: 'slot',
|
|
},
|
|
{
|
|
icon: '',
|
|
label: '验证码',
|
|
result: '',
|
|
path: '',
|
|
tip: 'slot-code',
|
|
value: code,
|
|
tel: tel,
|
|
type: 'slot',
|
|
placeholder: '输入验证码',
|
|
pColumn: 12,
|
|
},
|
|
]"
|
|
@changeCode="getCode"
|
|
>
|
|
</g-panel-form-slot>
|
|
</view>
|
|
<view class="">
|
|
<g-panel-form-slot
|
|
:list="[
|
|
{
|
|
icon: '',
|
|
label: '新密码',
|
|
result: '',
|
|
path: '',
|
|
tip: 'slot-new-pwd',
|
|
value: newPwd,
|
|
type: 'slot',
|
|
placeholder: '请输入新密码',
|
|
pColumn: 12,
|
|
},
|
|
{
|
|
icon: '',
|
|
label: '确认密码',
|
|
result: '',
|
|
path: '',
|
|
tip: 'slot-confirm-pwd',
|
|
value: confirmPwd,
|
|
type: 'slot',
|
|
placeholder: '再次输入新密码',
|
|
pColumn: 12,
|
|
},
|
|
]"
|
|
@changeNewPwd="getNewPwd"
|
|
@changeConfirmPwd="getConfirmPwd"
|
|
>
|
|
</g-panel-form-slot>
|
|
</view>
|
|
<view class="g_pt_90 g_flex_row_center">
|
|
<g-button btnText="修改密码" type="primary" @clickBtn="submitForm" />
|
|
</view>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
onReady() {
|
|
this.G.setNavStyle();
|
|
},
|
|
onShareAppMessage() {
|
|
return this.G.shareFun();
|
|
},
|
|
data() {
|
|
return {
|
|
tel: uni.getStorageSync("apply-tel"),
|
|
code: "",
|
|
newPwd: "",
|
|
confirmPwd: "",
|
|
};
|
|
},
|
|
methods: {
|
|
getCode(e) {
|
|
this.code = e;
|
|
console.log(e);
|
|
},
|
|
getNewPwd(e) {
|
|
this.newPwd = e;
|
|
},
|
|
getConfirmPwd(e) {
|
|
this.confirmPwd = e;
|
|
},
|
|
submitForm() {
|
|
let that = this;
|
|
if (that.code == "") {
|
|
uni.showToast({
|
|
title: "请输入验证码",
|
|
icon: "none",
|
|
});
|
|
return false;
|
|
}
|
|
if (that.newPwd == "") {
|
|
uni.showToast({
|
|
title: "请输入新密码",
|
|
icon: "none",
|
|
});
|
|
return false;
|
|
}
|
|
if (that.confirmPwd == "") {
|
|
uni.showToast({
|
|
title: "请再次输入新密码",
|
|
icon: "none",
|
|
});
|
|
return false;
|
|
}
|
|
if (that.confirmPwd != that.newPwd) {
|
|
uni.showToast({
|
|
title: "前后密码不一致",
|
|
icon: "none",
|
|
});
|
|
return false;
|
|
}
|
|
that.G.Get(
|
|
that.api.user_changeForgetPwd,
|
|
{
|
|
tel: uni.getStorageSync("apply-tel"),
|
|
code: that.code,
|
|
password: that.newPwd,
|
|
},
|
|
() => {
|
|
uni.showToast({
|
|
title: "修改成功",
|
|
icon: "success",
|
|
});
|
|
setTimeout(() => {
|
|
that.G.Get(that.api.login_out, {}, () => {
|
|
that.G.clearLocalStorage();
|
|
let params = {
|
|
path: "",
|
|
level: "",
|
|
};
|
|
uni.reLaunch({
|
|
url: "/root/person/loginIndex?" + that.G.objToStr(params),
|
|
});
|
|
});
|
|
}, 1500);
|
|
}
|
|
);
|
|
},
|
|
goPage() {
|
|
uni.navigateTo({
|
|
url: "/root/person/pwdForget",
|
|
});
|
|
},
|
|
},
|
|
};
|
|
</script>
|
|
|
|
<style></style>
|