import * as API from '@/apis/index.js' import Carmap from '@/components/Carmap.vue' export default { data() { return { mapopen:false, isReady:false, id:'', longitude: '', latitude: '', nearbyStationInfo:{ nearbyShiftDTOList:[] } } }, components: { Carmap }, onLoad(op){ this.longitude=op.longitude; this.latitude=op.latitude; this.id=op.id; }, methods: { mapdown(){ var obj={ longitude:this.longitude, latitude:this.latitude, } var obj2={ longitude:this.nearbyStationInfo.longitude, latitude:this.nearbyStationInfo.latitude, } this.$refs.amap.setPerson(obj); this.$refs.amap.setSite(obj2); }, gotoLine(item,downid){ uni.navigateTo({ url:'/pages/route/index?id='+item.routeId+"&upid="+item.startStationId+"&downid="+downid }) }, mapopenBtn(){ this.mapopen=!this.mapopen; if(this.mapopen){ this.$refs.amap.setMyStyle("width: 100%; height: 340px;") }else{ this.$refs.amap.setMyStyle("width: 100%; height: 140px;") } }, gotoLine(item,downid){ uni.navigateTo({ url:'/pages/route/index?id='+item.routeId+"&upid="+item.startStationId+"&downid="+downid }) }, getNearbyStationInfo() { var obj={ longitude:this.longitude, latitude:this.latitude, id:this.id, } this.$refs.common.showLoading(); API.nearbyStationInfo(obj).then((res) => { this.nearbyStationInfo=res.data; this.$refs.common.showLoading(false); }).catch(error => { this.$refs.common.showLoading(false,error); }) }, },onReady(){ this.getNearbyStationInfo(); this.isReady=true; this.$refs.amap.init(); },onShow(){ if(this.isReady){ this.getNearbyStationInfo(); } }, }