Commit d6d99651 authored by linxin's avatar linxin

add

parent f24b9ea9
Pipeline #4462 canceled with stages
......@@ -137,7 +137,8 @@
<div slot="name">退出登录</div>
</item>
</list-item>
<button @click="approveBtn ? unBind() : changePageHead()">{{ description }}</button>
<button v-if="!popSetect" @click="approveBtn ? unBind() : changePageHead()">{{ description }}</button>
<button v-if="popSetect" @click="popSetectBox=true">{{ description }}</button>
</div>
</h-content>
<role-switch
......@@ -147,6 +148,13 @@
@roleConfirm="roleConfirm"
@roleCancle="roleCancle"
/>
<role-switch
v-show="popSetectBox"
ref="roleSwitch"
:roleList="type"
@roleConfirm="typeConfirm"
@roleCancle="typeCancle"
/>
</h-view>
</template>
<script>
......@@ -163,6 +171,7 @@ export default {
flag: true,
isAGENT: false,
popSetect: false, // true:待提交或者审核未通过
popSetectBox: false, // 弹出选择框
elecStatusDesceibe: '',
user_bp_status: '',
user_bp_class: '',
......@@ -191,6 +200,16 @@ export default {
bp_type_desc: '担保人',
},
],
type: [
{
bp_type: '0',
bp_type_desc: '修改信息',
},
{
bp_type: '1',
bp_type_desc: '重新选择用户类型',
},
],
}
},
watch: {
......@@ -302,15 +321,27 @@ export default {
this.roleSwitchFlag = false
console.log('选择后的角色为:' + role)
},
typeConfirm (e) { // 选择操作方式后
this.popSetectBox = false
if (e.bp_type === '0') {
this.changePageHead()
} else if (e.bp_type === '1') {
this.unBindSelext()
}
},
// 选择角色后取消
roleCancle () {
this.roleSwitchFlag = false
},
typeCancle () {
this.popSetectBox = false
},
// 监听用户状态
watchBpStatus () {
if (!this.bp_id && this.user_bp_status === 'NEW') {
this.description = '用户绑定'
this.approveBtn = false
this.popSetect = false
} else if (this.bp_id && this.user_bp_status === 'NEW') {
this.description = '待提交'
this.approveBtn = false
......@@ -318,6 +349,7 @@ export default {
} else if (this.bp_id && this.user_bp_status === 'APPROVED') {
this.description = '解除绑定'
this.approveBtn = true
this.popSetect = false
} else if (
(this.bp_id && this.user_bp_status === 'RETURN') ||
(this.bp_id && this.user_bp_status === 'REJECT')
......@@ -328,6 +360,7 @@ export default {
} else {
this.description = '审批中'
this.approveBtn = false
this.popSetect = false
}
},
// 我的发票
......@@ -492,6 +525,46 @@ export default {
},
})
},
unBindSelext () {
let vm = this
vm.popSetectBox = true
hlsPopup.showConfirm({
title: '提示',
content: '确定解除绑定?',
onConfirm: function (index) {
if (index === 1) {
let myPhone = window.localStorage.getItem('user_phone')
let myPassword = window.localStorage.getItem('password')
let url = process.env.basePath + 'bp_unbind'
let param = {
master: {
phone: myPhone,
password: myPassword,
},
}
vm.hlsPopup.showLoading('请稍候')
vm.hlsHttp
.post(url, param)
.then(function (res) {
vm.hlsPopup.hideLoading()
if (res.result === 'S') {
vm.hlsPopup.showLongCenter('解绑成功')
vm.userQuery()
vm.approveBtn = false
this.$router.push({
name: 'UserBind',
})
} else {
vm.hlsPopup.showLongCenter(res.message)
}
})
.catch(() => {
vm.hlsPopup.showLongCenter('传入参数异常')
})
}
},
})
},
unBind () {
let vm = this
hlsPopup.showConfirm({
......
......@@ -11,10 +11,12 @@
<img src="@/assets/myInfo/modalClose.png" @click="roleCancle">
</div>
<div class="content-wrap">
<div v-for="(item,index) in roleList" :key="index" :class="{'item-active':index === switchIndex}" class="role-item" @click="chooseRole(index)">
<div
v-for="(item,index) in roleList" :key="index" :class="{'item-active':index === switchIndex}" class="role-item"
@click="chooseRole(index)">
<span>{{ item.bp_type_desc }}</span>
</div>
<div :class="{'content-btn-active':switchIndex !== ''}" class="content-btn"><span @click="roleConfirm">确定</span></div>
<div :class="{'content-btn-active':switchIndex !== ''}" class="content-btn" @click="roleConfirm"><span>确定</span></div>
</div>
</div>
</div>
......@@ -37,15 +39,15 @@ export default {
updated: function () {
},
methods: {
chooseRole(index){
chooseRole (index) {
this.switchIndex = index
},
roleConfirm () {
if(this.switchIndex === ''){
if (this.switchIndex === '') {
}else {
} else {
this.showFlag = false
this.$emit('roleConfirm',this.roleList[this.switchIndex])
this.$emit('roleConfirm', this.roleList[this.switchIndex])
}
},
show () {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment