提交 88008fe8 编写于 作者: 张敬贤's avatar 张敬贤

根据geolocation信息获取距离最近的机构详情

上级 bfca45d6
...@@ -38,3 +38,11 @@ export const getDetailByYunOrderNo = (yunOrderNo) => { ...@@ -38,3 +38,11 @@ export const getDetailByYunOrderNo = (yunOrderNo) => {
withCredentials: true, withCredentials: true,
}); });
}; };
export const getHospitalList = (params) => {
return request({
method: 'GET',
params,
url: '/tis/insurance/hospitalList',
withCredentials: true,
});
};
...@@ -70,14 +70,20 @@ export default { ...@@ -70,14 +70,20 @@ export default {
locationAreaCode:{ locationAreaCode:{
async handler(nv, ov) { async handler(nv, ov) {
console.log('locationAreaCode', nv, ov); console.log('locationAreaCode', nv, ov);
this.provinceList = await this.getProvinceList(); if (nv) {
this.cityList = await this.getCityList(nv[0]); this.provinceList = await this.getProvinceList();
this.countyList = await this.getCountyList(nv[1]); this.cityList = await this.getCityList(nv[0]);
const provinceIndex = this.provinceList.findIndex(ele => ele.id === nv[0]); this.countyList = await this.getCountyList(nv[1]);
const cityIndex = this.cityList.findIndex(ele => ele.id === nv[1]); const provinceIndex = this.provinceList.findIndex(ele => ele.id === nv[0]);
const countyIndex = this.countyList.findIndex(ele => ele.id === nv[2]); const cityIndex = this.cityList.findIndex(ele => ele.id === nv[1]);
this.columns = [{ values: this.provinceList, defaultIndex:provinceIndex}, { values: this.cityList, defaultIndex:cityIndex}, { values: this.countyList, defaultIndex:countyIndex }]; const countyIndex = this.countyList.findIndex(ele => ele.id === nv[2]);
console.log('locationAreaCode', this.$refs.picker); this.columns = [{ values: this.provinceList, defaultIndex:provinceIndex}, { values: this.cityList, defaultIndex:cityIndex}, { values: this.countyList, defaultIndex:countyIndex }];
console.log('locationAreaCode', this.provinceList, provinceIndex);
const data = [this.provinceList[provinceIndex], this.cityList[cityIndex], this.countyList[countyIndex]];
this.$emit('confirm', data);
}else{
this.initData();
}
}, },
immediate:true immediate:true
...@@ -85,7 +91,7 @@ export default { ...@@ -85,7 +91,7 @@ export default {
}, },
created() { created() {
this.initData();
}, },
methods: { methods: {
// 初始化 省市县信息 // 初始化 省市县信息
...@@ -94,6 +100,8 @@ export default { ...@@ -94,6 +100,8 @@ export default {
this.cityList = await this.getCityList(this.provinceList[0].id); this.cityList = await this.getCityList(this.provinceList[0].id);
this.countyList = await this.getCountyList(this.cityList[0].id); this.countyList = await this.getCountyList(this.cityList[0].id);
this.columns = [{ values: this.provinceList }, { values: this.cityList }, { values: this.countyList }]; this.columns = [{ values: this.provinceList }, { values: this.cityList }, { values: this.countyList }];
const data = [this.provinceList[0], this.cityList[0], this.countyList[0]];
this.$emit('confirm', data);
}, },
// 获取省列表 // 获取省列表
getProvinceList() { getProvinceList() {
......
...@@ -23,7 +23,7 @@ const routerConfig = [ ...@@ -23,7 +23,7 @@ const routerConfig = [
{ {
path: '/insuranceQuestionResult', path: '/insuranceQuestionResult',
name: 'insuranceQuestionResult', name: 'insuranceQuestionResult',
component: () => import('@/views/insurance-question-result/index.vue'), component: () => import('@/views/insurance-question-result/insuranceQuestionResult.vue'),
}, },
{ {
path: '/insuranceQuestionBack', path: '/insuranceQuestionBack',
......
...@@ -62,6 +62,7 @@ ...@@ -62,6 +62,7 @@
<van-field <van-field
label="检测地点" label="检测地点"
required required
disabled
class="appoint-form-title" class="appoint-form-title"
/> />
<van-field <van-field
...@@ -179,7 +180,7 @@ ...@@ -179,7 +180,7 @@
</template> </template>
<script> <script>
import {getDetectionName, getOrderInfo, appointment} from '@/api/appoint'; import {getDetectionName, getOrderInfo, appointment, getHospitalList} from '@/api/appoint';
import SelectHospital from '@/components/selectHospital/index.vue'; import SelectHospital from '@/components/selectHospital/index.vue';
import SelectTime from '@/components/selectTime/index.vue'; import SelectTime from '@/components/selectTime/index.vue';
import PickArea from '@/components/pickArea/index.vue'; import PickArea from '@/components/pickArea/index.vue';
...@@ -227,10 +228,13 @@ export default { ...@@ -227,10 +228,13 @@ export default {
showSelectTime:false, showSelectTime:false,
isSelf: false, isSelf: false,
spEquityCode: '', spEquityCode: '',
position: {
locationAreaCode: [330, 330400000000, 330424000000], latitude: '',
longitude:''
},
locationAreaCode: [],
hospitalId: '12746', hospitalId: '12746',
projectEquityNo: 'CX202302091000154321', projectEquityNo: '',
yunOrderNo:'' yunOrderNo:''
}; };
}, },
...@@ -241,10 +245,11 @@ export default { ...@@ -241,10 +245,11 @@ export default {
}, },
mounted() { mounted() {
setTimeout(() => { setTimeout(() => {
this.locationAreaCode = [330, 330400000000, 330424000000]; this.locationAreaCode = [120, 120100000000, 120102000000];
}, 3000); }, 3000);
const { yunOrderNo } = this.$route.query; const { yunOrderNo, projectEquityNo } = this.$route.query;
this.yunOrderNo = yunOrderNo; this.yunOrderNo = yunOrderNo;
this.projectEquityNo = projectEquityNo;
console.log('yunOrderNo', yunOrderNo); console.log('yunOrderNo', yunOrderNo);
this.getDetectionName(yunOrderNo); this.getDetectionName(yunOrderNo);
this.getOrderInfo(yunOrderNo); this.getOrderInfo(yunOrderNo);
...@@ -252,8 +257,10 @@ export default { ...@@ -252,8 +257,10 @@ export default {
}, },
methods: { methods: {
choose() {}, choose() {},
submit() {}, submit() { },
// 高德地图导航只有在线上环境才能使用
initMap() { initMap() {
var that = this;
AMapLoader.load({ AMapLoader.load({
key:'d22c1f112c97cb93b8d343b18420b98d', // 申请好的Web端开发者Key,首次调用 load 时必填 key:'d22c1f112c97cb93b8d343b18420b98d', // 申请好的Web端开发者Key,首次调用 load 时必填
version:'2.0', // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15 version:'2.0', // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
...@@ -274,11 +281,25 @@ export default { ...@@ -274,11 +281,25 @@ export default {
}); });
geolocation.getCurrentPosition((status, result) => { geolocation.getCurrentPosition((status, result) => {
console.log('geolocation,', status, result); console.log('geolocation,', status, result);
that.position.latitude = result.position.lat;
that.position.longitude = result.position.lng;
const data = {
projectEquityNo: that.projectEquityNo,
latitude: that.position.latitude,
longitude:that.position.longitude,
};
that.getHospitalList(data);
}); });
}); });
}); });
}, },
// 根据坐标获取最近的机构id
getHospitalList(data) {
getHospitalList(data).then(res => {
console.log(res);
});
},
// 目前是配置一个检测信息,可能会拓展,所以返回的是一个list // 目前是配置一个检测信息,可能会拓展,所以返回的是一个list
getDetectionName(yunOrderNo) { getDetectionName(yunOrderNo) {
getDetectionName(yunOrderNo).then(res => { getDetectionName(yunOrderNo).then(res => {
......
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
<div <div
v-if="!needDetect" v-if="!needDetect"
class="custom-style" class="custom-style"
@click="toAppoint" @click="toAppoint"
> >
{{ statusMap(detailInfo.status) || '免费预约检测' }} {{ statusMap(detailInfo.status) || '免费预约检测' }}
...@@ -55,6 +56,7 @@ ...@@ -55,6 +56,7 @@
</template> </template>
<script> <script>
import {getButtonStatus, getJumpPageStatus} from '@/api/question';
export default { export default {
data() { data() {
return { return {
...@@ -62,11 +64,30 @@ export default { ...@@ -62,11 +64,30 @@ export default {
result: {}, result: {},
detailInfo: {}, detailInfo: {},
isLoading: true, isLoading: true,
projectEquityNo: 'CX202302091000154321',
orderNo: '12746',
yunOrderNo:'',
// 无问卷-0001 有问卷未填写-0101 已填写问卷未出结果-0102 已出结果无需领用-0401 已出结果未预约-0201 已预约未采样-0301 已预约已采样-0302
routerMap: {
'0001': null,
'0101': null,
'0102': null,
'0401': null,
'0201': '/appoint',
'0301': null,
'0302': null,
},
status:null,
query: {},
buttonStatus:false
}; };
}, },
mounted() { mounted() {
console.log(11223); console.log(11223);
const { query } = this.$route;
this.query = query;
this.getJumpPageStatus();
}, },
methods: { methods: {
statusMap(status) { statusMap(status) {
...@@ -80,6 +101,32 @@ export default { ...@@ -80,6 +101,32 @@ export default {
}; };
return m[status]; return m[status];
}, },
getJumpPageStatus() {
getJumpPageStatus(this.orderNo, this.projectEquityNo).then(res => {
// console.log('res', getJumpPageStatus);
if (res.code == '000000') {
this.yunOrderNo = res.data.yunOrderNo;
this.query.yunOrderNo = res.data.yunOrderNo;
this.status = res.data.status;
this.getButtonStatus(res.data.yunOrderNo);
}
});
},
toAppoint() {
if (this.buttonStatus) {
const {projectEquityNo, orderNo, yunOrderNo} = this;
this.$router.push({
path: this.routerMap[this.status],
query: {projectEquityNo, orderNo, yunOrderNo},
});
}
},
getButtonStatus(yunOrderNo) {
getButtonStatus(yunOrderNo).then(res => {
console.log(res);
this.buttonStatus = res.data.buttonStatus;
});
}
}, },
}; };
</script> </script>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册