Commit 95428dd6 authored by 786817560's avatar 786817560

Merge branch 'develop' of https://hel.hand-china.com/xugong/hls-xcmg-vue-app into develop

parents 2708c33b e6ceaa42
......@@ -9,7 +9,7 @@ module.exports = merge(prodEnv, {
isMobilePlatform: false,
loginPath: '"http://180.104.121.66:8088/oauth/token?client_id=client2&client_secret=secret&grant_type=password&username=admin&password=" ',
basePath: '"http://180.104.121.66:8088/r/api/interface?sysName=XCMG_DEV&apiName="',
rootPath: '"http://180.104.121.66:8088/r/api/interface"',
rootPath: '"http://180.104.121.66:8088/r/api"',
ocrPath:'"http://180.104.121.66:8088/r/api"',
file_url: '"http://hlsapp.hand-china.com/file/"',
appId: '"com.hls.easy.car"',
......
......@@ -6,7 +6,7 @@ module.exports = {
isMobilePlatform: true,
loginPath: '"http://180.104.121.66:8088/oauth/token?client_id=client2&client_secret=secret&grant_type=password&username=admin&password=" ',
basePath: '"http://180.104.121.66:8088/r/api/interface?sysName=XCMG_DEV&apiName="',
rootPath: '"http://180.104.121.66:8088/r/api/interface"',
rootPath: '"http://180.104.121.66:8088/r/api"',
ocrPath:'"http://180.104.121.66:8088/r/api"',
file_url: '"http://hlsapp.hand-china.com/file/"',
appId: '"com.hls.easy.car"',
......
<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/1.jpg" @click="changePageHead" >
<span>{{ user_phone }}</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 () {
......@@ -32,6 +85,7 @@ export default {
user_bp_status: '',
user_bp_class: '',
bp_id: '',
user_phone: '',
}
},
beforeRouteEnter (to, from, next) {
......@@ -39,15 +93,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 +132,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 +177,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 +194,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 +213,29 @@ 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
vm.user_phone = res.info.user_phone
} else {
this.hlsPopup.showLongCenter(res.message)
}
})
},
......@@ -141,12 +244,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: 60px;
}
.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: 60px;
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> -->
......@@ -98,7 +98,7 @@ export default {
},
created () {
let vm = this
let url = process.env.loginPath + 'appadmin'
let url = process.env.loginPath + 'admin'
let param = {}
vm.$post(url, param).then(function (res) {
window.localStorage.setItem('access_token', res.access_token)
......
......@@ -95,7 +95,7 @@ export default {
},
created () {
let vm = this
let url = process.env.loginPath + 'appadmin'
let url = process.env.loginPath + 'admin'
let param = {}
vm.$post(url, param).then(function (res) {
window.localStorage.setItem('access_token', res.access_token)
......
......@@ -193,28 +193,22 @@
</item>
</list-item>
</div>
<div class="userInfo">资产信息</div>
<div class="card">
<span>房产证件</span>
<div v-if="cddItemList.length" class="userInfo">资产信息</div>
<div v-for="(list, index) in cddItemList" :key="index" class="card">
<span>{{ list.description }}</span>
<div class="img-content">
<div class="card-upload">
<img src="@/assets/userBind/camera.png" >
<!--待上传图片列表-->
<div v-for="(list, index) in upload_list" :key="index">
<img :src="list.picture" >
</div>
</div>
</div>
<div class="card">
<span>车辆证件</span>
<div class="img-content">
<div class="card-upload">
<img src="@/assets/userBind/camera.png" >
<!--从服务器上下载的图片-->
<div v-for="item in dowload_list" class="card-upload">
<div v-for="(pic, index) in item" :key="index">
<img :src="item.url" >
</div>
</div>
</div>
</div>
<div class="card">
<span>其他资产证件</span>
<div class="img-content">
<div class="card-upload">
<img src="@/assets/userBind/camera.png" >
<div class="card-upload" @click="imgUploadShow(list.check_id)">
<img src="@/assets/userBind/camera.png" class="upload-btn">
</div>
</div>
</div>
......@@ -307,7 +301,8 @@ export default {
from: false,
cityList: [],
provinceList: [],
upload_list: [],
upload_list: [], // 上传图片列表
dowload_list: [], // 下载图片列表
typeList: [],
backList: [],
bankList: [],
......@@ -355,6 +350,7 @@ export default {
idCardFront: '', // 身份证正面图片
idCardBack: '', // 身份证反面图片
bankImg: '', // 银行卡图片
cddItemList: [], // 资料清单列表
}
},
watch: {
......@@ -406,7 +402,7 @@ export default {
}
},
beforeRouteEnter (to, from, next) {
if (from.fullPath === '/tab/my-info') { // 绑定查询入口
if (from.fullPath === '/tab/my-info') { // 绑定查询入口
next(vm => {
vm.basicInfoQuery()
vm.from = true
......@@ -435,9 +431,28 @@ export default {
})
},
async verified () {
let bpId = await this.saveWord()
this.getBankInfo()
// let bpId = await this.saveWord()
// this.getBankInfo()
// 查询资料清单
this.loadItemList()
},
loadItemList () {
let vm = this
let url = process.env.basePath + 'prj_cdd_check_list'
let param = {
master: {
'document_id': 7928,
'document_table': 'HLS_BP_MASTER',
'tab_group': 'HLS_NP',
},
}
// vm.hlsPopup.showLoading('请稍候')
vm.hlsHttp.post(url, param).then(function (res) {
// vm.hlsPopup.hideLoading()
if (res.result === 'S') {
vm.cddItemList = [...res.lists]
}
})
},
async saveProtocol () {
let vm = this
......@@ -501,7 +516,119 @@ export default {
return bpId
}
},
/* uploadIdCardFront () {
// 图片上传入口
imgUploadShow(check_id){
let vm = this
hlsPopup.showActionSheet({
titleText: '请选择照片',
buttonArray: ['拍照', '从相册取'],
callback: index => {
if (index === 0) {
vm.imgUploadOpenCamera(check_id)
} else {
vm.imgUploadTakePicture(check_id)
}
},
})
},
imgUploadOpenCamera(check_id){
let vm = this
let obj = {
'pkvalue': 7928,
'source_type': 'HLS_BP_MASTER',
'check_id': check_id,
'picture': '',
'filePath': '',
'attachment_id': '',
'user_id':1
}
let cameraoptions = {
quality: 100,
}
obj.picture = 'http://img1.gtimg.com/auto/pics/hv1/148/233/2219/144350038.jpg'
obj.filePath = 'http://img1.gtimg.com/auto/pics/hv1/148/233/2219/144350038.jpg'
let list = []
list.push(obj)
vm.save_picture(list)
/*let success = function (imgdata) {
obj.picture = imgdata
obj.filePath = imgdata
let list = []
list.push(obj)
// vm.upload_list.push(obj)
// 拍完一张立马执行保存图片逻辑
}
let error = function () {
}
hlsUtil.openCamera(cameraoptions, success, error)*/
},
imgUploadTakePicture(){
let vm = this
let cameraoptions = {
quality: 100,
}
let success = function (imgUrl) {
for (let i = 0; i < imgUrl.length; i++) {
let obj = {
'pkvalue': 7928,
'source_type': 'HLS_BP_MASTER',
'check_id': check_id,
'picture': '',
'filePath': '',
'attachment_id': '',
'user_id':1
}
obj.picture = imgUrl[i]
obj.file_path = imgUrl[i]
// push到上传列表中 通知前台数据发生改变
vm.upload_list.push(obj)
}
}
let error = function () {
}
vm.hlsUtil.takePicture(cameraoptions, success, error)
},
// 图片保存
save_picture (list) {
debugger
let vm = this
if (list.length) {
// hlsPopup.showLoading('图片上传请稍候')
var alreadyUploadNum = 0
var attLength = 0
var recordUploadInterval = setInterval(function () {
if (alreadyUploadNum === attLength) {
clearInterval(recordUploadInterval)
hlsPopup.hideLoading()
hlsPopup.showLongCenter('图片上传成功')
}
}, 500)
for (var i = 0; i < list.length; i++) {
let uploadSuccess = function (res) {
if (res.result === 'S') {
alreadyUploadNum++
for (var j = 0; j < list.length; j++) {
if (list[j].filePath === res.response.filePath) {
list[j].attachment_id = res.response.attachment_id
vm.upload_list.push(list[j])
break
}
}
} else {
hlsPopup.hideLoading()
}
}
if (!list[i].attachment_id) {
attLength++
hlsUtil.fileUploadSvc(list[i], uploadSuccess)
}
}
} else {
hlsPopup.hideLoading()
}
},
/* uploadIdCardFront () {
let vm = this
let url = process.env.basePath + 'attachment_upload'
let param = {
......@@ -516,7 +643,7 @@ export default {
console.log(res.response.attachment_id)
}
})
},*/
}, */
ocrShow (ocrType, type) {
let vm = this
hlsPopup.showActionSheet({
......@@ -594,7 +721,7 @@ export default {
hlsUtil.baiduOcr(fileUrl, url, function (res) {
hlsPopup.hideLoading()
let result = res.result.result
vm.bank.bank_account_num = result.bank_card_number
vm.bank.bank_account_num = result.bank_card_number.replace(/\s*/g, '')
vm.bank.bank_full_name = result.bank_name
vm.bank.bank_card_type = result.bank_card_type
})
......@@ -943,7 +1070,7 @@ export default {
},
}
</script>
<style lang="less">
<style lang="less">
#base-info1 {
font-family: PingFangSC-Regular;
input::placeholder {
......@@ -1072,6 +1199,10 @@ export default {
margin-left: 12px;
// float: left;
img {
width: 88px;
height: 88px;
}
.upload-btn{
width: 24px;
height: 24px;
}
......
......@@ -370,22 +370,22 @@ export default {
* @param success
*/
fileUploadSvc: function (file, success) {
let path = file.filePath
debugger
let path = file.file_path
let name = path.substr(path.lastIndexOf('/') + 1)
let url = encodeURI(process.env.rootPath + '/app/fileUploadSvc?sysName=HLS_APP&apiName=attachment_upload')
let url = encodeURI(process.env.rootPath + '/app/fileUploadSvc?sysName=XCMG_DEV&apiName=attachment_upload')
let options = new FileUploadOptions() // eslint-disable-line
options.fileKey = 'file'
options.headers = {
'Authorization': 'Bearer ' + window.localStorage.access_token,
}
options.params = {
'source_type': file.table_name,
'pkvalue': file.table_pk_value,
'user_id': window.localStorage.user_id,
'source_type': file.source_type,
'pkvalue': file.pkvalue,
'user_id': file.user_id,
'check_id': file.check_id,
'access_token': window.localStorage.access_token,
'filePath': path,
'timestamp': file.timestamp,
'sequence': file.sequence,
}
options.fileName = name
options.mimeType = 'multipart/form-date'
......
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