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.5 KiB
Vue

9 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">
9 months ago
<g-panel-form-slot
:list="[
9 months ago
{
9 months ago
icon: '',
label: '原密码',
result: '',
path: '',
tip: 'old-pwd',
type: 'slot',
pColumn: 12,
flexSlot: '1',
9 months ago
},
9 months ago
]"
9 months ago
>
<slot>
<!-- #ifdef APP-PLUS || H5 || MP-TOUTIAO || MP-KUAISHOU -->
9 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;" />
9 months ago
<!-- #endif -->
<!-- #ifdef MP-WEIXIN -->
9 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" />
9 months ago
<!-- #endif -->
</slot>
</g-panel-form-slot>
</view>
9 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>
9 months ago
<view class="">
9 months ago
<g-panel-form-slot
:list="[
9 months ago
{
9 months ago
icon: '',
label: '新密码',
result: '',
path: '',
tip: 'slot-new-pwd',
value: newPwd,
type: 'slot',
placeholder: '请输入新密码',
pColumn: 12,
9 months ago
},
{
9 months ago
icon: '',
label: '确认密码',
result: '',
path: '',
tip: 'slot-confirm-pwd',
value: confirmPwd,
type: 'slot',
placeholder: '再次输入新密码',
pColumn: 12,
9 months ago
},
9 months ago
]"
9 months ago
@changeNewPwd="getNewPwd"
@changeConfirmPwd="getConfirmPwd"
>
</g-panel-form-slot>
9 months ago
</view>
9 months ago
<view class="g_pt_90 g_flex_row_center">
3 months ago
<rh-button primaryColor='#00b666' btnText="修改密码" type="primary" @clickBtn="submitForm" />
9 months ago
</view>
9 months ago
</view>
9 months ago
</template>
<script>
9 months ago
export default {
onReady() {
this.G.setNavStyle();
},
onShareAppMessage() {
return this.G.shareFun();
},
data() {
return {
oldPwd: "",
newPwd: "",
confirmPwd: "",
};
},
methods: {
getNewPwd(e) {
this.newPwd = e;
9 months ago
},
9 months ago
getConfirmPwd(e) {
this.confirmPwd = e;
9 months ago
},
9 months ago
submitForm() {
let that = this;
if (that.oldPwd == "") {
uni.showToast({
title: "请输入原密码",
icon: "none",
});
return false;
9 months ago
}
9 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,
{
9 months ago
tel: uni.getStorageSync("apply-tel"),
oldPassword: that.oldPwd,
9 months ago
password: that.newPwd,
},
() => {
9 months ago
uni.showToast({
9 months ago
title: "修改成功",
icon: "success",
});
setTimeout(() => {
that.G.Get(that.api.login_out, {}, () => {
9 months ago
that.G.clearLocalStorage();
let params = {
9 months ago
path: "",
level: "",
};
9 months ago
uni.reLaunch({
9 months ago
url: "/root/person/loginIndex?" + that.G.objToStr(params),
9 months ago
});
9 months ago
});
}, 1500);
}
);
},
goPage() {
uni.navigateTo({
url: "/root/person/pwdForget",
});
},
},
};
9 months ago
</script>
9 months ago
<style></style>