提交 57ddc920 编写于 作者: 张敬贤's avatar 张敬贤

Merge branch 'feature/zjx' into 'develop'

Feature/zjx

See merge request !97
......@@ -3,7 +3,7 @@ import request from 'mn-template/plugins/http';
// 根据订单号获取检测名称
// /tis/insurance/detectionName?yunOrderNo=11
export const getDetectionName = (yunOrderNo) => {
export const getDetectionName = async (yunOrderNo) => {
return request({
method: 'get',
url: `/tis/insurance/detectionName?yunOrderNo=${yunOrderNo}`,
......@@ -13,14 +13,14 @@ export const getDetectionName = (yunOrderNo) => {
// /tis/insurance/order/info?yunOrderNo=1
// 查询订单信息
export const getOrderInfo = (yunOrderNo) => {
export const getOrderInfo = async (yunOrderNo) => {
return request({
method: 'get',
url: `/tis/insurance/order/info?yunOrderNo=${yunOrderNo}`,
withCredentials: true,
});
};
export const appointment = (data) => {
export const appointment = async (data) => {
return request({
method: 'post',
data,
......@@ -31,17 +31,20 @@ export const appointment = (data) => {
// /insurance/getDetailByYunOrderNo
// 查看预约详情
export const getDetailByYunOrderNo = (yunOrderNo) => {
export const getDetailByYunOrderNo = async (yunOrderNo) => {
return request({
method: 'get',
url: `/tis/insurance/getDetailByYunOrderNo?yunOrderNo=${yunOrderNo}`,
withCredentials: true,
});
};
export const getHospitalList = (data) => {
export const getHospitalList = async(data) => {
return request({
method: 'post',
data,
headers: {
noLoading:true,
},
url: '/tis/insurance/hospitalList',
withCredentials: true,
});
......
......@@ -19,6 +19,7 @@ const loading = {
instance.show = true;
},
hide: () => {
setTimeout(() => {
instance.show = false;
}, 300);
......
......@@ -4,7 +4,10 @@
:close-on-click-overlay="false"
style="background-color: transparent"
>
<div class="loadingWrap">
<div
id="globalLoading"
class="loadingWrap"
>
<van-loading
v-if="show"
type="spinner"
......
//
import request from 'mn-template/plugins/http';
// *
// * 获取省列表
// *
......@@ -7,6 +8,9 @@ export const getProvinceList = async params => {
return request({
method: 'get',
params: params,
headers: {
noLoading:true,
},
withCredentials: true,
url: 'tis/insurance/provinces'
});
......@@ -19,6 +23,9 @@ export const getCityList = async params => {
method: 'get',
params: params,
withCredentials: true,
headers: {
noLoading:true,
},
url: 'tis/insurance/cities'
});
};
......@@ -29,6 +36,9 @@ export const getCountyList = async params => {
return request({
method: 'get',
params: params,
headers: {
noLoading:true,
},
withCredentials: true,
url: '/tis/insurance/counties'
});
......@@ -40,6 +50,9 @@ export const getTownList = async params => {
return request({
method: 'get',
params: params,
headers: {
noLoading:true,
},
withCredentials: true,
url: '/basic-data/position/towns'
});
......
......@@ -38,7 +38,8 @@
</template>
<script>
import {getProvinceList, getCityList, getCountyList} from './api';
import { getProvinceList, getCityList, getCountyList } from './api';
import store from 'storejs';
export default {
props: {
show: {
......@@ -64,6 +65,7 @@ export default {
cityList: [],
countyList:[],
loading: true,
result:{}
};
},
watch: {
......@@ -80,7 +82,9 @@ export default {
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);
if (this.result) {
this.$emit('confirm', data);
}
}
},
......@@ -95,7 +99,7 @@ export default {
},
created() {
this.result = store.get('geolocation');
},
methods: {
// 初始化 省市县信息
......@@ -107,7 +111,9 @@ export default {
this.columns = [{ values: this.provinceList }, { values: this.cityList }, { values: this.countyList }];
const data = [this.provinceList[0], this.cityList[0], this.countyList[0]];
console.log('initData', data);
this.$emit('confirm', data);
if (this.result) {
this.$emit('confirm', data);
}
},
// 获取省列表
getProvinceList() {
......
......@@ -4,6 +4,9 @@ export const getHospitalList = (data) => {
return request({
method: 'post',
data,
headers: {
noLoading:true,
},
url: '/tis/insurance/hospitalList',
withCredentials: true,
});
......
import $http from 'mn-template/plugins/http';
import { vueApp } from '@pica-cli/vue-cli-plugin-pica-cli-plugin/auto';
// 设置axios默认属性
$http.setDefaults({
headers: {}
});
// 设置http配置信息 loading、error、clear、encrypt、mockUserInfo
$http.setOptions({
loading () {
console.log('我重写了默认的loading');
loading(opt) {
const noLoading = opt.headers.noLoading || false;
console.log('我重写了默认的loading1', opt);
const globalLoading = document.getElementById('globalLoading');
if (!globalLoading && !noLoading) {
vueApp.$loading.show();
}
}
});
......@@ -16,6 +23,6 @@ $http.addBeforeHook(config => console.log('我是新增的前置钩子', config)
// 新增后置钩子
$http.addAfterHook(response => {
vueApp.$loading.hide();
console.log('我是新增的后置钩子', response);
}, 0);
......@@ -199,12 +199,13 @@
</template>
<script>
import store from 'storejs';
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';
import { getJumpPageStatus } from '@/api/question';
import storejs from 'storejs';
import AMapLoader from '@amap/amap-jsapi-loader';
export default {
components: {
SelectHospital,
......@@ -323,7 +324,6 @@ export default {
this.$toast('活动已经结束');
}
}
this.$loading.hide();
console.log('getJumpPageStatus', res);
});
},
......@@ -334,18 +334,54 @@ export default {
// },
// 高德地图导航只有在线上环境才能使用
initMap() {
const result = store.get('geolocation');
const that = this;
AMapLoader.load({
key:'009dd02e4fe0a1b5f895cd7b86b9e216', // 申请好的Web端开发者Key,首次调用 load 时必填
plugins:[''], // 需要使用的的插件列表,如比例尺'AMap.Scale'等
}).then((AMap) => {
AMap.plugin('AMap.Geolocation', function() {
var geolocation = new AMap.Geolocation({
// 是否使用高精度定位,默认:true
enableHighAccuracy: true,
// 设置定位超时时间,默认:无穷大
timeout: 10000,
// 定位按钮的停靠位置的偏移量,默认:Pixel(10, 20)
buttonOffset: new AMap.Pixel(10, 20),
// 定位成功后调整地图视野范围使定位位置及精度范围视野内可见,默认:false
zoomToAccuracy: true,
// 定位按钮的排放位置, RB表示右下
buttonPosition: 'RB'
});
geolocation.getCurrentPosition((status, result) => {
console.log('geolocationgeolocation,', status, result);
if (result.position) {
const position = { ...result.position, addr: result.formattedAddress };
storejs.set('geolocation', position);
} else {
storejs.remove('geolocation');
}
that.initHospitalList();
});
});
});
},
initHospitalList() {
const result = storejs.get('geolocation');
console.log('initHospitalList', result);
// 没有位置信息,不请求机构信息
if (result) {
console.log('geolocation', result);
this.position.latitude = result.lat || '';
this.position.longitude = result.lng || '';
const data = {
projectEquityNo: this.projectEquityNo,
latitude: this.position.latitude,
longitude:this.position.longitude,
};
this.getHospitalList(data);
}
const data = {
projectEquityNo: this.projectEquityNo,
latitude: this.position.latitude,
longitude:this.position.longitude,
};
this.getHospitalList(data);
},
// 根据坐标获取最近的机构id
......@@ -425,7 +461,6 @@ export default {
cancelSearch() {},
selectAddress() {},
appointment() {
this.$loading.show();
this.$refs.dectionForm.validate().then(result => {
console.log('this.dectionForm', result);
const data = {
......@@ -439,7 +474,6 @@ export default {
yunOrderNo:this.yunOrderNo,
};
appointment(data).then(res => {
this.$loading.hide();
if (res.code === '000000') {
this.$router.push({
path: '/appoint-details',
......@@ -452,7 +486,6 @@ export default {
});
}).catch(err => {
this.$loading.hide();
console.log(err);
});
},
......
......@@ -93,7 +93,10 @@
class="tips"
>
<div class="tip-org">
<van-icon name="warning-o" size="16px"/> 温馨提示
<van-icon
name="warning-o"
size="16px"
/> 温馨提示
</div>
<div class="tip-grey">
(1)请在预约日期前往预约医院完成采样。无需空腹,采样前三天可适当清淡饮食;
......@@ -140,6 +143,8 @@
import {getDetailByYunOrderNo} from '@/api/appoint';
import store from 'storejs';
import { formatDate } from '@/utils/common';
import storejs from 'storejs';
import AMapLoader from '@amap/amap-jsapi-loader';
export default {
data() {
return {
......@@ -205,6 +210,38 @@ export default {
this.$loading.hide();
});
},
initMap() {
AMapLoader.load({
key:'009dd02e4fe0a1b5f895cd7b86b9e216', // 申请好的Web端开发者Key,首次调用 load 时必填
plugins:[''], // 需要使用的的插件列表,如比例尺'AMap.Scale'等
}).then((AMap) => {
AMap.plugin('AMap.Geolocation', function() {
var geolocation = new AMap.Geolocation({
// 是否使用高精度定位,默认:true
enableHighAccuracy: true,
// 设置定位超时时间,默认:无穷大
timeout: 10000,
// 定位按钮的停靠位置的偏移量,默认:Pixel(10, 20)
buttonOffset: new AMap.Pixel(10, 20),
// 定位成功后调整地图视野范围使定位位置及精度范围视野内可见,默认:false
zoomToAccuracy: true,
// 定位按钮的排放位置, RB表示右下
buttonPosition: 'RB'
});
geolocation.getCurrentPosition((status, result) => {
console.log('geolocationgeolocation,', status, result);
if (result.position) {
const position = { ...result.position, addr: result.formattedAddress };
storejs.set('geolocation', position);
} else {
storejs.remove('geolocation');
}
});
});
});
},
reAppoint() {
this.$router.push({
......@@ -301,6 +338,7 @@ export default {
this.$rocNative.WXInstance.openLocation(addressInfo);
return;
}
this.initMap();
this.showSsheet = true;
},
......
......@@ -5,8 +5,7 @@
<script>
import { getJumpPageStatus, createOrder } from '@/api/question';
import { getDetectionName } from '@/api/appoint';
import storejs from 'storejs';
import AMapLoader from '@amap/amap-jsapi-loader';
export default {
data() {
return {
......@@ -94,37 +93,7 @@ export default {
// longitude: 50.2,
// };
this.getJumpPageStatus(data);
var that = this;
AMapLoader.load({
key:'009dd02e4fe0a1b5f895cd7b86b9e216', // 申请好的Web端开发者Key,首次调用 load 时必填
plugins:[''], // 需要使用的的插件列表,如比例尺'AMap.Scale'等
}).then((AMap) => {
AMap.plugin('AMap.Geolocation', function() {
var geolocation = new AMap.Geolocation({
// 是否使用高精度定位,默认:true
enableHighAccuracy: true,
// 设置定位超时时间,默认:无穷大
timeout: 10000,
// 定位按钮的停靠位置的偏移量,默认:Pixel(10, 20)
buttonOffset: new AMap.Pixel(10, 20),
// 定位成功后调整地图视野范围使定位位置及精度范围视野内可见,默认:false
zoomToAccuracy: true,
// 定位按钮的排放位置, RB表示右下
buttonPosition: 'RB'
});
geolocation.getCurrentPosition((status, result) => {
console.log('geolocationgeolocation,', status, result);
if (result.position) {
const position = { ...result.position, addr: result.formattedAddress };
storejs.set('geolocation', position);
}
that.getJumpPageStatus(data);
});
});
});
// var that = this;
},
// 目前是配置一个检测信息,可能会拓展,所以返回的是一个list
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册