|
|
|
|
@ -1,39 +1,12 @@ |
|
|
|
|
<template> |
|
|
|
|
<div class="home"> |
|
|
|
|
<div class="act_shoose"> |
|
|
|
|
<div @click="doGuidance" class="act_btn active"> |
|
|
|
|
<img /> |
|
|
|
|
<div v-for="(item, index) in hospitalList" :key="'hospital' + index" @click="doGuidance(item.id)" |
|
|
|
|
:class="choosedIndex == index ? 'act_btn active' : 'act_btn'"> |
|
|
|
|
<img :src="item.imgUrl" v-if="item.imgUrl" /> |
|
|
|
|
<div class="hospital_info"> |
|
|
|
|
<div class="hospital_name">海慈医院</div> |
|
|
|
|
<div class="hospital_addr">青岛市市南区栖霞路18号</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<div @click="doGuidance" class="act_btn"> |
|
|
|
|
<img /> |
|
|
|
|
<div class="hospital_info"> |
|
|
|
|
<div class="hospital_name">即墨人民医院</div> |
|
|
|
|
<div class="hospital_addr">青岛市市南区栖霞路18号</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<div @click="doGuidance" class="act_btn"> |
|
|
|
|
<img /> |
|
|
|
|
<div class="hospital_info"> |
|
|
|
|
<div class="hospital_name">平度人民医院</div> |
|
|
|
|
<div class="hospital_addr">青岛市市南区栖霞路18号</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<div @click="doGuidance" class="act_btn"> |
|
|
|
|
<img /> |
|
|
|
|
<div class="hospital_info"> |
|
|
|
|
<div class="hospital_name">胶州医院</div> |
|
|
|
|
<div class="hospital_addr">青岛市市南区栖霞路18号</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<div @click="doGuidance" class="act_btn"> |
|
|
|
|
<img /> |
|
|
|
|
<div class="hospital_info"> |
|
|
|
|
<div class="hospital_name">莱西市立医院</div> |
|
|
|
|
<div class="hospital_addr">青岛市市南区栖霞路18号</div> |
|
|
|
|
<div class="hospital_name">{{ item.fullName }}</div> |
|
|
|
|
<div class="hospital_addr">{{ item.remark }}</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
@ -57,9 +30,9 @@ |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
|
<script> |
|
|
|
|
import { queryHosiptal } from "@/api/hospital"; |
|
|
|
|
import { queryHosiptal, checkBacklist } from "@/api/hospital"; |
|
|
|
|
import GuidanceVue from '@/components/Guidance.vue'; |
|
|
|
|
import { getUserInfo } from '@/utils/aisdapp'; |
|
|
|
|
// import { getUserInfo } from '@/utils/aisdapp'; |
|
|
|
|
import { isMobile } from '@/utils'; |
|
|
|
|
export default { |
|
|
|
|
name: "HomeView", |
|
|
|
|
@ -68,25 +41,31 @@ export default { |
|
|
|
|
}, |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
hospitalList: [], |
|
|
|
|
choosedIndex: -1, |
|
|
|
|
guideShow: false, |
|
|
|
|
userInfo: null, |
|
|
|
|
errMsg: '由于您未及时进行报道,已被拉黑请于10日后再次进行预约', |
|
|
|
|
isShowError:false,//自定义错误提示弹框 |
|
|
|
|
errMsg: '由于您未及时进行报到,已被拉黑请于10日后再次进行预约', |
|
|
|
|
isShowError: false,//自定义错误提示弹框 |
|
|
|
|
//用户登录参数 |
|
|
|
|
urlCreatesign: urldomaincreatesign, |
|
|
|
|
urlGateway: urldomaingateway, |
|
|
|
|
appmark: "sdzwapp", |
|
|
|
|
appword: "aKd20dbGdFvmuwrt", |
|
|
|
|
userType: '1',//用户类型 1个人 2法人 |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
mounted() { |
|
|
|
|
this.queryHosiptal(); |
|
|
|
|
if (isMobile()) { |
|
|
|
|
let userInfo = sessionStorage.getItem('userInfo') ? JSON.parse(sessionStorage.getItem('userInfo')) : null; |
|
|
|
|
console.log(userInfo); |
|
|
|
|
if (userInfo == null) { |
|
|
|
|
getUserInfo(); |
|
|
|
|
this.getUserInfo(); |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
else{ |
|
|
|
|
this.userInfo = userInfo; |
|
|
|
|
this.queryHosiptal(); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
this.queryHosiptal(); |
|
|
|
|
return false // alert('PC端') |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
@ -94,7 +73,7 @@ export default { |
|
|
|
|
//医院列表 |
|
|
|
|
queryHosiptal() { |
|
|
|
|
queryHosiptal().then(res => { |
|
|
|
|
|
|
|
|
|
this.hospitalList = res.data; |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
//跳转我的预约列表 |
|
|
|
|
@ -119,9 +98,162 @@ export default { |
|
|
|
|
this.guideShow = false; |
|
|
|
|
}, |
|
|
|
|
//阅读须知 |
|
|
|
|
doGuidance() { |
|
|
|
|
doGuidance(id) { |
|
|
|
|
// this.guideShow = true; |
|
|
|
|
this.$router.push({ name: 'guidance', query: { deptId: 1 } }) |
|
|
|
|
console.log(this.userInfo) |
|
|
|
|
if(this.userInfo){ |
|
|
|
|
checkBacklist(this.userInfo.papersnumber).then(res => { |
|
|
|
|
if(res.data){ |
|
|
|
|
this.errMsg = res.data; |
|
|
|
|
this.isShowError = true; |
|
|
|
|
}else{ |
|
|
|
|
this.$router.push({ name: 'guidance', query: { deptId: id } }) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
//登陆 |
|
|
|
|
getUserInfo() { |
|
|
|
|
lightAppJssdk.user.getTicket({ |
|
|
|
|
success: (data) => { |
|
|
|
|
//成功回调 |
|
|
|
|
console.log(JSON.stringify(data)) |
|
|
|
|
if (data == "未登录") { |
|
|
|
|
this.onLoginApp() //APP用户未登录,调用登录页面 |
|
|
|
|
} else { |
|
|
|
|
var jsonData = JSON.parse(data) |
|
|
|
|
if (jsonData.retcode == "000000") { |
|
|
|
|
var dataValueObj = JSON.parse(jsonData.data) |
|
|
|
|
var ticket = dataValueObj.ticket //解析出用户票据信息 |
|
|
|
|
this.userType = dataValueObj.usertype //解析保存用户类型(个人法人) |
|
|
|
|
this.getUserToken(ticket) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
fail: function (data) { |
|
|
|
|
//错误返回 |
|
|
|
|
console.log(JSON.stringify(data)) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
/** |
|
|
|
|
* 使用jssdk调用登录页面 |
|
|
|
|
*/ |
|
|
|
|
onLoginApp() { |
|
|
|
|
lightAppJssdk.user.loginapp({ |
|
|
|
|
success: (data) => { |
|
|
|
|
if (data == "未登录") { |
|
|
|
|
//取消登录或登录失败,关闭页面 |
|
|
|
|
this.oncloseWindow() |
|
|
|
|
} else { |
|
|
|
|
var dataObj = JSON.parse(data) |
|
|
|
|
if (dataObj.retcode == "000000") { |
|
|
|
|
//登录成功,返回用户的票据和用户类型 |
|
|
|
|
var dataValueObj = JSON.parse(dataObj.data) |
|
|
|
|
this.getUserToken(dataValueObj.ticket) //解析出用户票据信息 |
|
|
|
|
this.userType = jsonData.usertype //解析保存用户类型(个人法人) |
|
|
|
|
} else { |
|
|
|
|
//关闭页面 |
|
|
|
|
this.oncloseWindow() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
fail: function (data) { |
|
|
|
|
//关闭页面 |
|
|
|
|
oncloseWindow() |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
/** |
|
|
|
|
* 通过用户票据获取用户的令牌数据,票据使用一次后失效,token时效性较长 |
|
|
|
|
*/ |
|
|
|
|
getUserToken(ticket) { |
|
|
|
|
var params = '{"ticket":"' + ticket + '"}' |
|
|
|
|
const interfaceContent = { |
|
|
|
|
app_id: this.appmark, |
|
|
|
|
servicename: "ticketValidate", |
|
|
|
|
params: params |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
vaildInterfacefn("jisnzjk", "ticketvalidate", JSON.stringify(interfaceContent), "2", "https://" + this.urlCreatesign, "https://" + this.urlGateway).then((value) => { |
|
|
|
|
const data = JSON.parse(value) |
|
|
|
|
if (data.retcode == "000000") { |
|
|
|
|
const userToken = JSON.parse(data.data).token |
|
|
|
|
if (this.userType == "1") { |
|
|
|
|
//个人类型获取用户信息 |
|
|
|
|
this.getUserInfoByToken(userToken) |
|
|
|
|
} else { |
|
|
|
|
//法人类型获取用户信息 |
|
|
|
|
this.findCorUserByToken(userToken) |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
lightAppJssdk.notification.alert({ |
|
|
|
|
title: "提示", //可传空 |
|
|
|
|
message: data.msg, |
|
|
|
|
buttonName: "确认", |
|
|
|
|
success: function (data) { |
|
|
|
|
this.oncloseWindow() |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
/** |
|
|
|
|
* 根据令牌获取个人完整信息 |
|
|
|
|
*/ |
|
|
|
|
getUserInfoByToken(userToken) { |
|
|
|
|
const params = '{"token":"' + userToken + '"}' |
|
|
|
|
const interfaceContent = { |
|
|
|
|
app_id: this.appmark, |
|
|
|
|
servicename: "findOutsideUserByToken", |
|
|
|
|
params: params |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
vaildInterfacefn("jisnzjk", "findoutsideuserbytoken", JSON.stringify(interfaceContent), "2", "https://" + this.urlCreatesign, "https://" + this.urlGateway).then((value) => { |
|
|
|
|
const data = JSON.parse(value) |
|
|
|
|
if (data.retcode == "000000") { |
|
|
|
|
const userInfo = data.data |
|
|
|
|
sessionStorage.setItem('userInfo', userInfo); |
|
|
|
|
this.userInfo = userInfo; |
|
|
|
|
} else { |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} catch (error) { } |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 根据令牌获取完整法人信息 |
|
|
|
|
*/ |
|
|
|
|
findCorUserByToken(userToken) { |
|
|
|
|
try { |
|
|
|
|
const params = '{"token":"' + userToken + '"}' |
|
|
|
|
const interfaceContent = { |
|
|
|
|
app_id: this.appmark, |
|
|
|
|
servicename: "findCorUserByToken", |
|
|
|
|
params: params |
|
|
|
|
} |
|
|
|
|
vaildInterfacefn("jisnzjk", "findcoruserytoken", JSON.stringify(interfaceContent), "2", "https://" + this.urlCreatesign, "https://" + this.urlGateway).then((value) => { |
|
|
|
|
const data = JSON.parse(value) |
|
|
|
|
|
|
|
|
|
if (data.retcode == "000000") { |
|
|
|
|
const userInfo = data.data; |
|
|
|
|
sessionStorage.setItem('userInfo', userInfo); |
|
|
|
|
this.userInfo = userInfo; |
|
|
|
|
} else { |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} catch (err) { } |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 关闭容器 |
|
|
|
|
*/ |
|
|
|
|
oncloseWindow() { |
|
|
|
|
lightAppJssdk.navigation.close({ |
|
|
|
|
success: function (data) { }, |
|
|
|
|
fail: function (data) { } |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
@ -229,7 +361,7 @@ export default { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.tip_txt { |
|
|
|
|
width:3.6rem; |
|
|
|
|
width: 3.6rem; |
|
|
|
|
color: #666; |
|
|
|
|
font-size: 0.24rem; |
|
|
|
|
text-align: center; |
|
|
|
|
|