1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- 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();
- }
-
-
- },
- }
|