mirror of
http://112.124.100.131/GFRS/ebiz-h5.git
synced 2025-12-22 02:26:43 +08:00
Merge branch 'feature/【20210304】注销账户增加提示' into dev
This commit is contained in:
@@ -61,7 +61,7 @@ export default [
|
|||||||
name: 'LogoutAgent',
|
name: 'LogoutAgent',
|
||||||
component: LogoutAgent,
|
component: LogoutAgent,
|
||||||
meta: {
|
meta: {
|
||||||
title: '注销账户',
|
title: '停用账户',
|
||||||
index: 1
|
index: 1
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,57 +1,20 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="insured-info-container">
|
<div class="insured-info-container">
|
||||||
<van-cell-group>
|
<van-field v-model="pwd" clearable required type="password" label="登陆密码" name="密码" placeholder="请输入登陆密码" />
|
||||||
<van-field
|
|
||||||
v-if="clickMobileDisabled"
|
|
||||||
:value="logoutDTO.mobile | dataMaskingMobile"
|
|
||||||
clearable
|
|
||||||
required
|
|
||||||
label="电话号码"
|
|
||||||
name="联系电话"
|
|
||||||
placeholder="请输入"
|
|
||||||
v-validate="'required|mobile'"
|
|
||||||
:disabled="true"
|
|
||||||
/>
|
|
||||||
<van-field
|
|
||||||
v-if="clickMobileDisabled"
|
|
||||||
v-model="logoutDTO.smsCode"
|
|
||||||
required
|
|
||||||
center
|
|
||||||
label="验证码"
|
|
||||||
clearable
|
|
||||||
placeholder="请输入短信验证码"
|
|
||||||
@input="validateNext"
|
|
||||||
>
|
|
||||||
<van-button type="danger" slot="button" size="small" @click="getCode" :disabled="codeDisabled" v-no-more-click="1000">
|
|
||||||
{{ codeDisabled ? `${countDown}s后重新获取` : '获取验证码' }}
|
|
||||||
</van-button>
|
|
||||||
</van-field>
|
|
||||||
<van-field v-model="logoutDTO.pwd" clearable required type="password" label="密码" name="密码" placeholder="请输入密码" @input="validateNext" />
|
|
||||||
<van-field
|
|
||||||
v-model="logoutDTO.confirmPwd"
|
|
||||||
clearable
|
|
||||||
required
|
|
||||||
type="password"
|
|
||||||
label="确认密码"
|
|
||||||
name="确认密码"
|
|
||||||
placeholder="请输入密码"
|
|
||||||
@input="validateNext"
|
|
||||||
/>
|
|
||||||
</van-cell-group>
|
|
||||||
|
|
||||||
<p style="color: #ff0000; font-size: 14px;" class="bg-white p10">温馨提示: 此账号为公司员工内部账号,一旦注销将无法再次登陆该账号。</p>
|
<p style="color: #ff0000; font-size: 14px;" class="bg-white p10 pb0 mb0">温馨提示:</p>
|
||||||
|
<p style="color: #ff0000; font-size: 14px;" class="bg-white pl10">停用账号将无法再次登陆使用,请您谨慎操作。</p>
|
||||||
|
|
||||||
<van-button type="danger" size="large" class="logout_button mt30" :disabled="checkNextDisabled" @click="logoutAgent">注销账户 </van-button>
|
<van-button type="danger" size="large" class="logout_button mt10" :disabled="!Boolean(pwd)" @click="logoutAgent">停用账户 </van-button>
|
||||||
|
|
||||||
<van-dialog v-model="show" title="提示" @confirm="logoutAgentInfo" show-cancel-button>
|
<van-dialog v-model="show" title="提示" @confirm="logoutAgentInfo" show-cancel-button>
|
||||||
是否注销用户
|
<p style="text-align: center" class="p10">是否停用账户?</p>
|
||||||
</van-dialog>
|
</van-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { Field, CellGroup, Popup, Picker, Checkbox, Area, Dialog } from 'vant'
|
import { Field, CellGroup, Popup, Picker, Checkbox, Area, Dialog } from 'vant'
|
||||||
import { getAgentInfo, logoutAgent } from '@/api/ebiz/my/my.js'
|
import { logoutAgent } from '@/api/ebiz/my/my.js'
|
||||||
import { getAuthCode } from '@/api/ebiz/sale/sale'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'logoutAgent',
|
name: 'logoutAgent',
|
||||||
@@ -66,40 +29,12 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
logoutDTO: {
|
pwd: '',
|
||||||
smsId: null,
|
show: false
|
||||||
smsCode: null,
|
|
||||||
mobile: null,
|
|
||||||
pwd: null,
|
|
||||||
confirmPwd: null
|
|
||||||
},
|
|
||||||
show: false,
|
|
||||||
timeId: null, // 计时器ID
|
|
||||||
countDown: 60, // 倒计时
|
|
||||||
codeDisabled: true, // 获取验证码按钮是否禁用
|
|
||||||
branchType: null,
|
|
||||||
checkNextDisabled: true, // 禁用修改
|
|
||||||
clickMobileDisabled: false // 手机号是否存在
|
|
||||||
}
|
|
||||||
},
|
|
||||||
async mounted() {
|
|
||||||
this.codeDisabled = false
|
|
||||||
// 获取代理人信息
|
|
||||||
const res = await getAgentInfo({ '89': '890' })
|
|
||||||
if (res.result == 0) {
|
|
||||||
if (/^[0-9][0-9]*$/.test(res.branchType)) {
|
|
||||||
// 内勤 手机号格式正确
|
|
||||||
this.logoutDTO.mobile = res.phoneNo
|
|
||||||
this.codeDisabled = false
|
|
||||||
this.clickMobileDisabled = true
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return this.$toast(res.resultMessage)
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
if (this.$CacheUtils.getLocItem('businessNo') && this.$CacheUtils.getLocItem('claimsClear')) {
|
if (this.$CacheUtils.getLocItem('businessNo') && this.$CacheUtils.getLocItem('claimsClear')) {
|
||||||
this.init()
|
|
||||||
this.$CacheUtils.getLocItem('claimsClear', '')
|
this.$CacheUtils.getLocItem('claimsClear', '')
|
||||||
} else {
|
} else {
|
||||||
this.$CacheUtils.setLocItem('businessNo', '')
|
this.$CacheUtils.setLocItem('businessNo', '')
|
||||||
@@ -107,95 +42,17 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
init() {},
|
|
||||||
//获取验证码
|
|
||||||
getCode() {
|
|
||||||
if (!this.logoutDTO.mobile || this.logoutDTO.mobile == '') {
|
|
||||||
return this.$toast('代理人信息异常请联系管理员')
|
|
||||||
}
|
|
||||||
this.codeDisabled = true
|
|
||||||
let data = {
|
|
||||||
operateType: 'appntInfoEntry',
|
|
||||||
type: 'H5',
|
|
||||||
operateCode: this.logoutDTO.mobile,
|
|
||||||
system: 'agentApp',
|
|
||||||
operateCodeType: '0'
|
|
||||||
}
|
|
||||||
//获取验证码
|
|
||||||
getAuthCode(data).then(res => {
|
|
||||||
if (res.result == 0) {
|
|
||||||
this.logoutDTO.smsId = res.sessionId
|
|
||||||
this.logoutDTO.smsCode = null
|
|
||||||
//倒计时
|
|
||||||
this.timeId = setInterval(() => {
|
|
||||||
this.countDown--
|
|
||||||
if (this.countDown <= 0) {
|
|
||||||
window.clearInterval(this.timeId)
|
|
||||||
this.codeDisabled = false
|
|
||||||
this.countDown = 60
|
|
||||||
}
|
|
||||||
}, 1000)
|
|
||||||
} else {
|
|
||||||
this.$toast(res.resultMessage)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
//操作下一步按钮状态
|
|
||||||
validateNext() {
|
|
||||||
if (this.clickMobileDisabled) {
|
|
||||||
if (!this.logoutDTO.smsCode || this.logoutDTO.smsCode == '') {
|
|
||||||
this.checkNextDisabled = true
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 2、判断密码是否一致
|
|
||||||
if (!this.logoutDTO.pwd || this.logoutDTO.pwd == '') {
|
|
||||||
this.checkNextDisabled = true
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (!this.logoutDTO.confirmPwd || this.logoutDTO.confirmPwd == '') {
|
|
||||||
this.checkNextDisabled = true
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (this.logoutDTO.pwd.length < 6 || this.logoutDTO.confirmPwd.length < 6) {
|
|
||||||
this.checkNextDisabled = true
|
|
||||||
return
|
|
||||||
}
|
|
||||||
this.checkNextDisabled = false
|
|
||||||
return
|
|
||||||
},
|
|
||||||
// 注销
|
// 注销
|
||||||
logoutAgent() {
|
logoutAgent() {
|
||||||
// 1、判断计时器
|
if (!this.pwd || this.pwd.trim() === '') {
|
||||||
if (this.clickMobileDisabled) {
|
this.pwd = ''
|
||||||
if (!this.codeDisabled) {
|
|
||||||
return this.$toast('请先获取验证码')
|
|
||||||
}
|
|
||||||
//
|
|
||||||
if (!this.logoutDTO.smsCode || this.logoutDTO.smsCode == '') {
|
|
||||||
return this.$toast('请输入短信验证码')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 2、判断密码是否一致
|
|
||||||
if (!this.logoutDTO.pwd || this.logoutDTO.pwd == '') {
|
|
||||||
return this.$toast('请输入密码')
|
return this.$toast('请输入密码')
|
||||||
}
|
}
|
||||||
if (!this.logoutDTO.confirmPwd || this.logoutDTO.confirmPwd == '') {
|
this.show = true
|
||||||
return this.$toast('请输入确认密码')
|
|
||||||
}
|
|
||||||
if (!(this.logoutDTO.pwd == this.logoutDTO.confirmPwd)) {
|
|
||||||
return this.$toast('两次输入密码不一致')
|
|
||||||
}
|
|
||||||
|
|
||||||
this.logoutAgentInfo()
|
|
||||||
},
|
},
|
||||||
logoutAgentInfo() {
|
logoutAgentInfo() {
|
||||||
let req = {
|
let req = {
|
||||||
smsId: this.logoutDTO.smsId,
|
password: this.$MD5(this.pwd)
|
||||||
smsCode: this.logoutDTO.smsCode,
|
|
||||||
mobile: this.logoutDTO.mobile,
|
|
||||||
password: this.$MD5(this.logoutDTO.pwd),
|
|
||||||
confirmPwd: this.$MD5(this.logoutDTO.confirmPwd)
|
|
||||||
}
|
}
|
||||||
// 调用注销接口
|
// 调用注销接口
|
||||||
logoutAgent(req).then(res => {
|
logoutAgent(req).then(res => {
|
||||||
@@ -217,6 +74,8 @@ export default {
|
|||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.insured-info-container {
|
.insured-info-container {
|
||||||
|
height: 100vh;
|
||||||
|
background-color: #fff;
|
||||||
/deep/ .van-checkbox {
|
/deep/ .van-checkbox {
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user