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

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

上级 bfca45d6
......@@ -38,3 +38,11 @@ export const getDetailByYunOrderNo = (yunOrderNo) => {
withCredentials: true,
});
};
export const getHospitalList = (params) => {
return request({
method: 'GET',
params,
url: '/tis/insurance/hospitalList',
withCredentials: true,
});
};
......@@ -70,6 +70,7 @@ export default {
locationAreaCode:{
async handler(nv, ov) {
console.log('locationAreaCode', nv, ov);
if (nv) {
this.provinceList = await this.getProvinceList();
this.cityList = await this.getCityList(nv[0]);
this.countyList = await this.getCountyList(nv[1]);
......@@ -77,7 +78,12 @@ export default {
const cityIndex = this.cityList.findIndex(ele => ele.id === nv[1]);
const countyIndex = this.countyList.findIndex(ele => ele.id === nv[2]);
this.columns = [{ values: this.provinceList, defaultIndex:provinceIndex}, { values: this.cityList, defaultIndex:cityIndex}, { values: this.countyList, defaultIndex:countyIndex }];
console.log('locationAreaCode', this.$refs.picker);
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
......@@ -85,7 +91,7 @@ export default {
},
created() {
this.initData();
},
methods: {
// 初始化 省市县信息
......@@ -94,6 +100,8 @@ export default {
this.cityList = await this.getCityList(this.provinceList[0].id);
this.countyList = await this.getCountyList(this.cityList[0].id);
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() {
......
......@@ -23,7 +23,7 @@ const routerConfig = [
{
path: '/insuranceQuestionResult',
name: 'insuranceQuestionResult',
component: () => import('@/views/insurance-question-result/index.vue'),
component: () => import('@/views/insurance-question-result/insuranceQuestionResult.vue'),
},
{
path: '/insuranceQuestionBack',
......
......@@ -62,6 +62,7 @@
<van-field
label="检测地点"
required
disabled
class="appoint-form-title"
/>
<van-field
......@@ -179,7 +180,7 @@
</template>
<script>
import {getDetectionName, getOrderInfo, appointment} from '@/api/appoint';
import {getDetectionName, getOrderInfo, appointment, getHospitalList} from '@/api/appoint';
import SelectHospital from '@/components/selectHospital/index.vue';
import SelectTime from '@/components/selectTime/index.vue';
import PickArea from '@/components/pickArea/index.vue';
......@@ -227,10 +228,13 @@ export default {
showSelectTime:false,
isSelf: false,
spEquityCode: '',
locationAreaCode: [330, 330400000000, 330424000000],
position: {
latitude: '',
longitude:''
},
locationAreaCode: [],
hospitalId: '12746',
projectEquityNo: 'CX202302091000154321',
projectEquityNo: '',
yunOrderNo:''
};
},
......@@ -241,10 +245,11 @@ export default {
},
mounted() {
setTimeout(() => {
this.locationAreaCode = [330, 330400000000, 330424000000];
this.locationAreaCode = [120, 120100000000, 120102000000];
}, 3000);
const { yunOrderNo } = this.$route.query;
const { yunOrderNo, projectEquityNo } = this.$route.query;
this.yunOrderNo = yunOrderNo;
this.projectEquityNo = projectEquityNo;
console.log('yunOrderNo', yunOrderNo);
this.getDetectionName(yunOrderNo);
this.getOrderInfo(yunOrderNo);
......@@ -252,8 +257,10 @@ export default {
},
methods: {
choose() {},
submit() {},
submit() { },
// 高德地图导航只有在线上环境才能使用
initMap() {
var that = this;
AMapLoader.load({
key:'d22c1f112c97cb93b8d343b18420b98d', // 申请好的Web端开发者Key,首次调用 load 时必填
version:'2.0', // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
......@@ -274,11 +281,25 @@ export default {
});
geolocation.getCurrentPosition((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
getDetectionName(yunOrderNo) {
getDetectionName(yunOrderNo).then(res => {
......
......@@ -44,6 +44,7 @@
<div
v-if="!needDetect"
class="custom-style"
@click="toAppoint"
>
{{ statusMap(detailInfo.status) || '免费预约检测' }}
......@@ -55,6 +56,7 @@
</template>
<script>
import {getButtonStatus, getJumpPageStatus} from '@/api/question';
export default {
data() {
return {
......@@ -62,11 +64,30 @@ export default {
result: {},
detailInfo: {},
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() {
console.log(11223);
const { query } = this.$route;
this.query = query;
this.getJumpPageStatus();
},
methods: {
statusMap(status) {
......@@ -80,6 +101,32 @@ export default {
};
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>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册