Commit 2cdfa1c1 authored by 胡's avatar

feat: 对接口

parent 0843a998
......@@ -46,9 +46,9 @@ export default {
data () {
return {
currentVersion: process.env.currentVersion,
multipleRole: '',
bp_id: '',
user_bp_type: '',
multipleRole: JSON.parse(window.localStorage.getItem('now_user_bp_bind_id')).bp_type,
bp_id: JSON.parse(window.localStorage.getItem('now_user_bp_bind_id')).bp_id,
user_bp_type: JSON.parse(window.localStorage.getItem('now_user_bp_bind_id')).bp_type ,
signCount: '0',
carNum: '0',
faceSign: '0',
......@@ -60,9 +60,9 @@ export default {
},
beforeRouteEnter (to, from, next) {
next(vm => {
vm.multipleRole = window.localStorage.getItem('multipleRole')
vm.bp_id = window.localStorage.getItem('bp_id')
vm.user_bp_type = window.localStorage.getItem('bp_type')
// vm.multipleRole = window.localStorage.getItem('multipleRole')
// vm.bp_id = window.localStorage.getItem('bp_id')
// vm.user_bp_type = window.localStorage.getItem('bp_type')
vm.numQuery()
})
next()
......@@ -72,7 +72,7 @@ export default {
let vm = this
let url = $config.basePath + 'number_display_query'
let param = {
user_phone: window.localStorage.getItem('user_phone'),
bp_id: this.bp_id,
}
vm.$post(url, param).then(function (res) {
if (res.result === 'S') {
......
......@@ -151,7 +151,7 @@ export default {
searchInput: '', // 搜索内容
pagenum: 1,
role: '',
multipleRole: window.localStorage.getItem('multipleRole'),
// multipleRole: window.localStorage.getItem('multipleRole'),
}
},
computed: {},
......@@ -171,68 +171,115 @@ export default {
// },
methods: {
userQuery () {
let vm = this
let url = $config.basePath + 'user_query'
let param = {
phone: window.localStorage.getItem('user_phone'),
}
vm.hlsPopup.showLoading('请稍候')
vm.$post(url, param).then(function (res) {
vm.hlsPopup.hideLoading()
if (res.result === 'S') {
if (res.info.user_bp_status === 'APPROVED') {
// let vm = this
// let url = $config.basePath + 'user_query'
// let param = {
// phone: window.localStorage.getItem('user_phone'),
// }
// vm.hlsPopup.showLoading('请稍候')
// vm.$post(url, param).then(function (res) {
// vm.hlsPopup.hideLoading()
// if (res.result === 'S') {
// if (res.info.user_bp_status === 'APPROVED') {
// vm.flag = false
// }
// window.localStorage.setItem('user_phone', res.info.user_phone)
// 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.bp_identity = res.info.bp_identity
// vm.app_user_id = res.info.app_user_id
// window.localStorage.removeItem('bp_id')
// window.localStorage.setItem('bp_id', res.info.user_bp_id)
// window.localStorage.setItem('user_bp_status', res.info.user_bp_status)
// window.localStorage.setItem('bp_name', res.info.user_bp_name)
// window.localStorage.setItem('bp_identity', res.info.bp_identity)
// window.localStorage.setItem('bp_class', res.info.user_bp_class)
// // 有角色信息就不设置缓存,可能在角色切换时做了处理,此处不设置角色
// if (localStorage.bp_type || localStorage.multipleRole) {
// vm.user_bp_type = localStorage.bp_type
// } else {
// window.localStorage.setItem('bp_type', res.info.user_bp_type)
// window.localStorage.setItem('multipleRole', res.info.user_bp_type)
// vm.user_bp_type = res.info.user_bp_type
// }
// // vm.bp_type_n = res.info.user_bp_type_n
// vm.user_bp_name = res.info.user_bp_name
// vm.user_phone = res.info.user_phone
// if (vm.user_bp_type === 'TENANT') {
// vm.role = '主承租人'
// } else if (vm.user_bp_type === 'GUTA') {
// vm.role = '担保人'
// } else if (vm.user_bp_type === 'FACTORY') {
// vm.role = '主机厂'
// } else if (vm.user_bp_type === 'AGENT') {
// vm.role = '经销商'
// } else if (vm.user_bp_type === 'OFFICE') {
// vm.role = '办事处'
// } else if (vm.user_bp_type === 'MANAGER') {
// vm.role = '业务经理'
// }
// if (vm.user_bp_type === 'AGENT') {
// vm.isAGENT = true
// } else {
// vm.isAGENT = false
// }
// if (vm.user_bp_type === 'GUTA' || vm.user_bp_type === 'TENANT' || vm.user_bp_type === 'AGENT') {
// vm.isMultiRole = true
// } else {
// vm.isMultiRole = false
// }
// } else {
// this.hlsPopup.showLongCenter(res.message)
// }
// })
let obj = JSON.parse(window.localStorage.getItem("now_user_bp_bind_id"));
let user_bp_status = obj.bp_status;
let user_bp_class = obj.bp_class;
let bp_id = obj.bp_id;
let bp_identity = obj.bp_identity;
let bp_type = obj.bp_type;
let bp_name = obj.bp_name;
let user_phone = JSON.parse(window.localStorage.getItem("user_phone"));
if (user_bp_status === 'APPROVED') {
vm.flag = false
}
window.localStorage.setItem('user_phone', res.info.user_phone)
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.bp_identity = res.info.bp_identity
vm.app_user_id = res.info.app_user_id
window.localStorage.removeItem('bp_id')
window.localStorage.setItem('bp_id', res.info.user_bp_id)
window.localStorage.setItem('user_bp_status', res.info.user_bp_status)
window.localStorage.setItem('bp_name', res.info.user_bp_name)
window.localStorage.setItem('bp_identity', res.info.bp_identity)
window.localStorage.setItem('bp_class', res.info.user_bp_class)
// 有角色信息就不设置缓存,可能在角色切换时做了处理,此处不设置角色
if (localStorage.bp_type || localStorage.multipleRole) {
vm.user_bp_type = localStorage.bp_type
} else {
window.localStorage.setItem('bp_type', res.info.user_bp_type)
window.localStorage.setItem('multipleRole', res.info.user_bp_type)
vm.user_bp_type = res.info.user_bp_type
}
// vm.bp_type_n = res.info.user_bp_type_n
vm.user_bp_name = res.info.user_bp_name
vm.user_phone = res.info.user_phone
if (vm.user_bp_type === 'TENANT') {
}
vm.user_bp_status = user_bp_status
vm.user_bp_class = user_bp_class
vm.bp_id = bp_id
vm.bp_identity = bp_identity
vm.user_bp_type = bp_type
vm.user_bp_name = bp_name
vm.user_phone = user_phone
if (bp_type === 'TENANT') {
vm.role = '主承租人'
} else if (vm.user_bp_type === 'GUTA') {
} else if (bp_type === 'GUTA') {
vm.role = '担保人'
} else if (vm.user_bp_type === 'FACTORY') {
} else if (bp_type === 'FACTORY') {
vm.role = '主机厂'
} else if (vm.user_bp_type === 'AGENT') {
} else if (bp_type === 'AGENT') {
vm.role = '经销商'
} else if (vm.user_bp_type === 'OFFICE') {
} else if (bp_type === 'OFFICE') {
vm.role = '办事处'
} else if (vm.user_bp_type === 'MANAGER') {
} else if (bp_type === 'MANAGER') {
vm.role = '业务经理'
}
if (vm.user_bp_type === 'AGENT') {
if (bp_type === 'AGENT') {
vm.isAGENT = true
} else {
vm.isAGENT = false
}
if (vm.user_bp_type === 'GUTA' || vm.user_bp_type === 'TENANT' || vm.user_bp_type === 'AGENT') {
if (bp_type === 'GUTA' || bp_type === 'TENANT' || bp_type === 'AGENT') {
vm.isMultiRole = true
} else {
vm.isMultiRole = false
}
} else {
this.hlsPopup.showLongCenter(res.message)
}
})
},
// 进入融资合同创建
goStart () {
......
......@@ -208,24 +208,28 @@ export default {
},
// 用户信息查询
userQuery () {
let vm = this
let url = $config.basePath + 'user_query'
let param = {
'phone': window.localStorage.getItem('user_phone'),
}
vm.hlsPopup.showLoading('数据加载中')
vm.$post(url, param).then(function (res) {
vm.hlsPopup.hideLoading()
if (res.result === 'S') {
window.localStorage.setItem('bp_type', res.info.user_bp_type)
window.localStorage.setItem('user_phone', res.info.user_phone)
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 {
hlsPopup.showLongCenter(res.message)
}
})
// let vm = this
// let url = $config.basePath + 'user_query'
// let param = {
// 'bp_id': window.localStorage.getItem('user_phone'),
// }
// vm.hlsPopup.showLoading('数据加载中')
// vm.$post(url, param).then(function (res) {
// vm.hlsPopup.hideLoading()
// if (res.result === 'S') {
// window.localStorage.setItem('bp_type', res.info.user_bp_type)
// // window.localStorage.setItem('user_phone', res.info.user_phone)
// 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 {
// hlsPopup.showLongCenter(res.message)
// }
// })
this.user_bp_status = JSON.parse(window.localStorage.getItem("now_user_bp_bind_id")).bp_status;
this.user_bp_class = JSON.parse(window.localStorage.getItem("now_user_bp_bind_id")).bp_class;
this.bp_id = JSON.parse(window.localStorage.getItem("now_user_bp_bind_id")).bp_id;
},
// 猜你喜欢
guessingQuery (e) {
......
......@@ -138,8 +138,8 @@ export default {
if (res.result === 'S' && res.info.login_flag === 'Y') {
vm.hlsPopup.hideLoading()
vm.updateVersion() // 版本更新
window.localStorage.setItem('user_phone', vm.username)
window.localStorage.setItem('password', md5passwprd)
window.localStorage.setItem('user_phone', vm.username)
window.localStorage.setItem('app_user_id', res.info.app_user_id)
// vm.$router.push('tab')
vm.$router.push('/choose-user');
......
This diff is collapsed.
This diff is collapsed.
......@@ -62,14 +62,14 @@ export default {
return {
upLoadObj: defaultImg, // 上传的图片
currentVersion: process.env.currentVersion,
app_user_id: window.localStorage.getItem('bp_id'),
user_bp_status: window.localStorage.getItem('user_bp_status'),
bp_id: window.localStorage.getItem('bp_id'),
user_bp_name: window.localStorage.getItem('bp_name'),
user_bp_class: window.localStorage.getItem('bp_class'),
app_user_id: window.localStorage.getItem('app_user_id'),
user_bp_status: JSON.parse(window.localStorage.getItem("now_user_bp_bind_id")).bp_status,
bp_id: JSON.parse(window.localStorage.getItem("now_user_bp_bind_id")).bp_id,
user_bp_name: JSON.parse(window.localStorage.getItem("now_user_bp_bind_id")).bp_name,
user_bp_class: JSON.parse(window.localStorage.getItem("now_user_bp_bind_id")).bp_class,
isMultiRole: window.localStorage.getItem('multipleRole'),
roleSwitchFlag: false,
user_bp_type: window.localStorage.getItem('bp_type'),
user_bp_type: JSON.parse(window.localStorage.getItem("now_user_bp_bind_id")).bp_type,
bp_type_n: '',
version: '',
version_url: '',
......@@ -228,51 +228,90 @@ export default {
})
},
userQuery () {
let vm = this
let url = $config.basePath + 'user_query'
let param = {
phone: window.localStorage.getItem('user_phone'),
}
// let vm = this
// let url = $config.basePath + 'user_query'
// let param = {
// phone: window.localStorage.getItem('user_phone'),
// }
// vm.hlsPopup.showLoading('请稍候')
vm.$post(url, param).then(function (res) {
if (res.result === 'S') {
if (res.info.user_bp_status === 'APPROVED') {
// vm.$post(url, param).then(function (res) {
// if (res.result === 'S') {
// if (res.info.user_bp_status === 'APPROVED') {
// vm.flag = false
// }
// window.localStorage.setItem('user_phone', res.info.user_phone)
// 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.bp_identity = res.info.bp_identity
// vm.app_user_id = res.info.app_user_id
// vm.user_bp_name = res.info.user_bp_name
// vm.user_bp_type = res.info.user_bp_type
// vm.user_phone = res.info.user_phone
// vm.bp_type_n = res.info.user_bp_type_n
// if (res.info.user_bp_type === 'TENANT') {
// window.localStorage.setItem('multipleRole', 'TENANT')
// } else if (res.info.user_bp_type === 'GUTA') {
// window.localStorage.setItem('multipleRole', 'GUTA')
// } else if (res.info.user_bp_type === 'AGENT') {
// window.localStorage.setItem('multipleRole', 'AGENT')
// }
// vm.watchBpStatus()
// vm.getHead()
// vm.getMultipleRole()
// if (vm.user_bp_type === 'AGENT') {
// vm.isAGENT = true
// } else {
// vm.isAGENT = false
// }
// if (vm.user_bp_type === 'GUTA' || vm.user_bp_type === 'TENANT' || vm.user_bp_type === 'AGENT') {
// vm.isMultiRole = true
// } else {
// vm.isMultiRole = false
// }
// } else {
// this.hlsPopup.showLongCenter(res.message)
// }
// })
let obj = JSON.parse(window.localStorage.getItem("now_user_bp_bind_id"));
let user_bp_status = obj.bp_status;
let user_bp_class = obj.bp_class;
let bp_id = obj.bp_id;
let bp_identity = obj.bp_identity;
let bp_type = obj.bp_type;
let bp_name = obj.bp_name;
let bp_type_n = obj.bp_type_n;
let user_phone = JSON.parse(window.localStorage.getItem("user_phone"));
let app_user_id = JSON.parse(window.localStorage.getItem("app_user_id"));
if (user_bp_status === 'APPROVED') {
vm.flag = false
}
window.localStorage.setItem('user_phone', res.info.user_phone)
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.bp_identity = res.info.bp_identity
vm.app_user_id = res.info.app_user_id
vm.user_bp_name = res.info.user_bp_name
vm.user_bp_type = res.info.user_bp_type
vm.user_phone = res.info.user_phone
vm.bp_type_n = res.info.user_bp_type_n
if (res.info.user_bp_type === 'TENANT') {
window.localStorage.setItem('multipleRole', 'TENANT')
} else if (res.info.user_bp_type === 'GUTA') {
window.localStorage.setItem('multipleRole', 'GUTA')
} else if (res.info.user_bp_type === 'AGENT') {
window.localStorage.setItem('multipleRole', 'AGENT')
}
}
vm.user_bp_status = user_bp_status
vm.user_bp_class = user_bp_class
vm.bp_id = bp_id
vm.bp_identity = bp_identity
vm.app_user_id = app_user_id
vm.user_bp_name = bp_name
vm.user_bp_type = bp_type
vm.user_phone = user_phone
vm.bp_type_n = bp_type_n
vm.watchBpStatus()
vm.getHead()
vm.getMultipleRole()
if (vm.user_bp_type === 'AGENT') {
if (bp_type === 'AGENT') {
vm.isAGENT = true
} else {
vm.isAGENT = false
}
if (vm.user_bp_type === 'GUTA' || vm.user_bp_type === 'TENANT' || vm.user_bp_type === 'AGENT') {
if (bp_type === 'GUTA' || bp_type === 'TENANT' || bp_type === 'AGENT') {
vm.isMultiRole = true
} else {
vm.isMultiRole = false
}
} else {
this.hlsPopup.showLongCenter(res.message)
}
})
},
// 查询头像
getHead () {
......
......@@ -183,7 +183,7 @@ export default new Router({
// 待办审核
{path: '/ToDoList', component: ToDoList, name: 'ToDoList', meta: {keepAlive: true}},
// 我绑定的用户
{path: '/myBindUser', component: myBindUser, name: 'myBindUser', meta: {keepAlive: true}},
{path: '/myBindUser', component: myBindUser, name: 'myBindUser', meta: {keepAlive: false}},
// 资讯动态
{path: '/NewsList', component: NewsList, name: 'NewsList', meta: {keepAlive: true}},
{path: '/NewsInfo', component: NewsInfo, name: 'NewsInfo', meta: {keepAlive: true}},
......
<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no,width=device-width,viewport-fit=cover"><meta name=format-detection content="telephone=no"><meta name=format-detection content="email=no"><meta name=apple-mobile-web-app-capable content=yes><meta name=apple-mobile-web-app-status-bar-style content=black><script type=text/javascript src=./static/vuePlatform.js></script><script type=text/javascript src=./static/prototype.js></script><script type=text/javascript src=./cordova.js></script><script type=text/javascript src="http://api.map.baidu.com/api?v=2.0&ak=Eoo0EtfjYCdAy7r8D19gZ0vMojdZpHqU"></script><title>徐工金服</title><link href=./static/css/app.5e0b58465e4ddacc7a432a8bf72c52d0.css rel=stylesheet></head><body><div id=app-box></div><script type=text/javascript src=./static/js/manifest.af73b2bfa72f20c880d9.js></script><script type=text/javascript src=./static/js/vendor.6ba205ec1e3c99a7aeda.js></script><script type=text/javascript src=./static/js/app.87004853603a69178a8b.js></script></body></html>
\ No newline at end of file
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