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.
apply-assistant-v3/root/person/pwdLogin.vue

155 lines
3.4 KiB
Vue

6 months ago
<template>
<view class="p-root-person-pwdLogin g_w_all g_h_all g_bg_f_5 g_kuaishou">
<view class="g_pt_16">
5 months ago
<g-panel-form-slot
:list="[
6 months ago
{
5 months ago
icon: '',
label: '原密码',
result: '',
path: '',
tip: 'old-pwd',
type: 'slot',
pColumn: 12,
flexSlot: '1',
6 months ago
},
5 months ago
]"
6 months ago
>
<slot>
<!-- #ifdef APP-PLUS || H5 || MP-TOUTIAO || MP-KUAISHOU -->
5 months ago
<u-input type="text" :clearable="false" :password-icon="false" placeholder="请输入原密码" input-align="right" class="g_text_r" placeholder-style="color:#999999;font-size:32rpx;line-height:1" v-model="oldPwd" style="width: calc(100vw - (106px);flex: none;" />
6 months ago
<!-- #endif -->
<!-- #ifdef MP-WEIXIN -->
5 months ago
<u-input type="text" :clearable="false" :password-icon="false" placeholder="请输入原密码" input-align="right" class="g_text_r g_w_all" placeholder-style="color:#999999;font-size:32rpx;line-height:1" v-model="oldPwd" />
6 months ago
<!-- #endif -->
</slot>
</g-panel-form-slot>
</view>
5 months ago
<view class="g_flex_row_end g_pr_20 g_mt_8 g_fs_14 g_mb_24" style="color: #576b95" ref="" @click="goPage"> </view>
6 months ago
<view class="">
5 months ago
<g-panel-form-slot
:list="[
6 months ago
{
5 months ago
icon: '',
label: '新密码',
result: '',
path: '',
tip: 'slot-new-pwd',
value: newPwd,
type: 'slot',
placeholder: '请输入新密码',
pColumn: 12,
6 months ago
},
{
5 months ago
icon: '',
label: '确认密码',
result: '',
path: '',
tip: 'slot-confirm-pwd',
value: confirmPwd,
type: 'slot',
placeholder: '再次输入新密码',
pColumn: 12,
6 months ago
},
5 months ago
]"
6 months ago
@changeNewPwd="getNewPwd"
@changeConfirmPwd="getConfirmPwd"
>
</g-panel-form-slot>
5 months ago
</view>
6 months ago
<view class="g_pt_90 g_flex_row_center">
5 months ago
<g-button btnText="修改密码" type="primary" @clickBtn="submitForm" />
6 months ago
</view>
5 months ago
</view>
6 months ago
</template>
<script>
5 months ago
export default {
onReady() {
this.G.setNavStyle();
},
onShareAppMessage() {
return this.G.shareFun();
},
data() {
return {
oldPwd: "",
newPwd: "",
confirmPwd: "",
};
},
methods: {
getNewPwd(e) {
this.newPwd = e;
6 months ago
},
5 months ago
getConfirmPwd(e) {
this.confirmPwd = e;
6 months ago
},
5 months ago
submitForm() {
let that = this;
if (that.oldPwd == "") {
uni.showToast({
title: "请输入原密码",
icon: "none",
});
return false;
6 months ago
}
5 months ago
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.Post(
that.api.user_changeLoginPwd,
{
6 months ago
tel: uni.getStorageSync("apply-tel"),
oldPassword: that.oldPwd,
5 months ago
password: that.newPwd,
},
() => {
6 months ago
uni.showToast({
5 months ago
title: "修改成功",
icon: "success",
});
setTimeout(() => {
that.G.Get(that.api.login_out, {}, () => {
6 months ago
that.G.clearLocalStorage();
let params = {
5 months ago
path: "",
level: "",
};
6 months ago
uni.reLaunch({
5 months ago
url: "/root/person/loginIndex?" + that.G.objToStr(params),
6 months ago
});
5 months ago
});
}, 1500);
}
);
},
goPage() {
uni.navigateTo({
url: "/root/person/pwdForget",
});
},
},
};
6 months ago
</script>
5 months ago
<style></style>