Commit 8977b2d7 authored by linxin's avatar linxin

add个人中心

parent 3443f8c4
<template>
<section>
<h-header>
<div slot="left" class="h-header-btn" @click="$routeGo(-1)">
<i class="ion-ios-arrow-back"/>
<h-view id="my-info">
<div class="top">
<h-header class="header">
<div slot="left" class="h-header-btn" @click="$routeGo(-1)">
<img src="@/assets/myInfo/arrow-left.png" >
</div>
<div slot="center" class="top-word">个人中心</div>
</h-header>
<div class="card">
<div class="card-info">
<div class="card-top">
<img src="@/assets/myInfo/arrow-left.png" @click.native="changePageHead" >
<span>用户名</span>
</div>
<div class="card-bottom">
<div>
<img src="@/assets/myInfo/car.png" >
<p>发车申请</p>
</div>
<div>
<img src="@/assets/myInfo/pay.png" >
<p>首付还款</p>
</div>
<div>
<img src="@/assets/myInfo/refund.png" >
<p>租金还款</p>
</div>
</div>
</div>
</div>
<div slot="center">个人中心</div>
</h-header>
<h-content>
<list-item :item-height="45">
<item :show-arrow="true" @click.native="changePageHead">
<div slot="name">头像</div>
</div>
<h-content class="my-content">
<div class="userInfo">我的合同</div>
<div class="my-contract">
<div>
<img src="@/assets/myInfo/unSign.png" >
<p>待签约</p>
</div>
<div>
<img src="@/assets/myInfo/unConfirm.png" >
<p>待确认</p>
</div>
<div>
<img src="@/assets/myInfo/unFace.png" >
<p>待面签</p>
</div>
<div>
<img src="@/assets/myInfo/carConfirm.png" >
<p>发车确认</p>
</div>
</div>
<list-item :item-height="44" class="list">
<item>
<img slot="left-icon" src="@/assets/myInfo/myRefund.png" class="left-icon" >
<div slot="name">我的还款</div>
</item>
<item :show-arrow="true" @click.native="updateVersion">
<div slot="name">检查更新</div>
<item>
<img slot="left-icon" src="@/assets/myInfo/repay.png" class="left-icon" >
<div slot="name">业务退款</div>
</item>
<item :show-arrow="true" @click.native="logOut">
<div slot="name">退出登录</div>
<item>
<img slot="left-icon" src="@/assets/myInfo/collect.png" class="left-icon" >
<div slot="name">我的收藏</div>
</item>
<item>
<img slot="left-icon" src="@/assets/myInfo/help.png" class="left-icon" >
<div slot="name">帮助与反馈</div>
</item>
<item>
<img slot="left-icon" src="@/assets/myInfo/about.png" class="left-icon" >
<div slot="name">关于徐工</div>
</item>
<button v-if="flag" @click="changePageHead">用户绑定</button>
<button v-if="!flag" @click="unBind">解除绑定</button>
</list-item>
<button v-if="flag" @click="changePageHead">用户绑定</button>
<button v-if="!flag">解除绑定</button>
</h-content>
</section>
</h-view>
</template>
<script>
export default {
data () {
......@@ -39,15 +92,19 @@ export default {
vm.userQuery()
})
},
activated () {
},
activated () {},
methods: {
updateVersion () {
if (vum.Platform.isAndroid()) {
this.hote_update_version('发现新版本是否更新', 'http://hlsapp.hand-china.com/file/XCMG/www/android/www.zip')
this.hote_update_version(
'发现新版本是否更新',
'http://hlsapp.hand-china.com/file/XCMG/www/android/www.zip'
)
} else {
this.hote_update_version('发现新版本是否更新', 'http://hlsapp.hand-china.com/file/XCMG/www/ios/www.zip')
this.hote_update_version(
'发现新版本是否更新',
'http://hlsapp.hand-china.com/file/XCMG/www/ios/www.zip'
)
}
},
hote_update_version (content, url) {
......@@ -74,6 +131,42 @@ export default {
},
})
},
unBind () {
let vm = this
hlsPopup.showConfirm({
title: '提示',
content: '确定解除绑定?',
onConfirm: function (index) {
if (index === 1) {
// window.localStorage.clear()
// vm.$router.push('/login')
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') {
debugger
this.hlsPopup.showLongCenter('解绑成功')
this.flag = true
}
})
.catch(() => {
this.hlsPopup.showLongCenter('传入参数异常')
})
}
},
})
},
changePageHead () {
let vm = this
if (vm.bp_id) {
......@@ -83,14 +176,14 @@ export default {
vm.$router.push({
name: 'NaturePerson',
params: {
'bp_id': this.bp_id,
bp_id: this.bp_id,
},
})
} else {
this.$router.push({
name: 'Enterprise',
params: {
'bp_id': this.bp_id,
bp_id: this.bp_id,
},
})
}
......@@ -100,16 +193,16 @@ export default {
vm.$router.push({
name: 'NaturePerson',
params: {
'bp_id': this.bp_id,
'status': 'APPROVED',
bp_id: this.bp_id,
status: 'APPROVED',
},
})
} else {
this.$router.push({
name: 'Enterprise',
params: {
'bp_id': this.bp_id,
'status': 'APPROVED',
bp_id: this.bp_id,
status: 'APPROVED',
},
})
}
......@@ -119,20 +212,28 @@ export default {
}
} else {
vm.flag = true
this.hlsPopup.showLongCenter('请先进行用户绑定')
this.$router.push({
name: 'UserBind',
})
// this.hlsPopup.showLongCenter('请先进行用户绑定')
}
},
userQuery () {
let vm = this
let url = $config.basePath + 'user_query'
let param = {
'phone': window.localStorage.getItem('user_phone'),
phone: window.localStorage.getItem('user_phone'),
}
vm.$post(url, param).then(function (res) {
if (res.result === 'S') {
if (res.info.user_bp_status === 'APPROVED') {
vm.flag = false
}
vm.user_bp_status = res.info.user_bp_status
vm.user_bp_class = res.info.user_bp_class
vm.bp_id = res.info.user_bp_id
} else {
this.hlsPopup.showLongCenter(res.message)
}
})
},
......@@ -141,12 +242,147 @@ export default {
</script>
<style lang="less" scoped>
button{
margin-top:50px;
margin-left:100px;
width: 150px;
height: 50px;
color: #fff;
background-color: navy;
#my-info {
.top {
width: 100%;
height: 206px;
background: url("../../assets/myInfo/back.png") no-repeat;
background-size: 100% 206px;
.header {
background-color: rgba(0, 0, 0, 0);
.top-word {
font-family: PingFangSC-Semibold;
font-size: 17px;
letter-spacing: 0.61px;
color: #fff;
}
}
.card {
width: 343px;
height: 217px;
margin: 0 auto;
z-index: 10;
position: relative;
top: 0px;
left: 0px;
background-color: #fff;
box-shadow: 0 2px 17px -1px rgba(0, 0, 0, 0.1);
border-radius: 4px;
.card-info {
width: 295px;
margin: 0 auto;
.card-top {
height: 110px;
display: flex;
align-items: center;
border-bottom: 1px solid #d9dbdf;
img {
width: 59px;
height: 59px;
border-radius: 50%;
border: 1px solid #00469c;
}
span {
font-family: PingFangSC-Semibold;
font-size: 18px;
color: #383f45;
margin-left: 24px;
}
}
.card-bottom {
height: 100px;
width: 285px;
margin: 0 auto;
display: flex;
justify-content: space-between;
align-items: center;
text-align: center;
p {
font-family: PingFangSC-Regular;
font-size: 13px;
color: #3c3d48;
margin-top: 5px;
}
img {
width: 48px;
height: 48px;
}
}
}
}
}
.my-content {
.userInfo {
height: 45px;
line-height: 45px;
color: #00469c;
font-size: 15px;
margin-left: 16px;
position: relative;
margin-top: 88px;
}
.userInfo::before {
content: "";
display: block;
width: 4px;
height: 20px;
background-color: #00469c;
position: absolute;
left: -15px;
top: 12px;
}
.my-contract {
width: 295px;
margin: 0 auto;
display: flex;
justify-content: space-between;
align-items: center;
text-align: center;
img {
width: 38px;
height: 38px;
}
p {
font-family: PingFangSC-Regular;
font-size: 12px;
color: #383f45;
margin-top: 5px;
}
}
.list {
font-family: PingFangSC-Regular;
font-size: 14px;
color: #656464;
letter-spacing: 0;
line-height: 18px;
border-top: 1px solid rgba(0, 0, 0, 0.1);
margin-top: 20px;
}
}
button {
width: 359px;
height: 40px;
background: #00469c;
border-radius: 4px;
color: #fff;
margin-bottom: 100px;
margin-left:2%;
}
}
.content {
background-color: #fff;
}
</style>
<!-- <list-item :item-height="45">
<item :show-arrow="true" @click.native="changePageHead">
<div slot="name">头像</div>
</item>
<item :show-arrow="true" @click.native="updateVersion">
<div slot="name">检查更新</div>
</item>
<item :show-arrow="true" @click.native="logOut">
<div slot="name">退出登录</div>
</item>
</list-item>
<button v-if="flag" @click="changePageHead">用户绑定</button>
<button v-if="!flag" @click="unBind">解除绑定</button> -->
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