import * as API from '@/apis/my.js' import Carmap from '@/components/Carmap.vue' export default { data() { return { id:"", mapopen:false, obj:{ driverInfo:{}, shiftInfo:{}, routeInfo:{}, vehicleInfo:{}, }, } }, methods: { 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;") } }, mapdown(){ this.$refs.amap.setUp(this.obj.ticketUpDownLonLat[0]); this.$refs.amap.setDown(this.obj.ticketUpDownLonLat[1]); this.$refs.amap.setCenter(this.obj.ticketUpDownLonLat[1]); }, makePhoneCall(tel){ uni.makePhoneCall({ phoneNumber: tel //仅为示例 }); }, showname(name){ if(!name){ return ""; } return name.substring(0,1)+'师傅'; }, passengerRecordDetail() { this.$refs.common.showLoading(); API.passengerRecordDetail(this.id).then((res) => { this.isLoading=true; this.obj=res.data; var point=[]; res.data.routeInfo.mapPath.split("|").forEach((item) => { var sz = item.split(","); point.push({ longitude: sz[0], latitude: sz[1], }) }) this.$refs.amap.initMap(point, [],this.obj.routeStationLonLat); this.$refs.common.showLoading(false); }).catch(error => { this.$refs.common.showLoading(false,error); }) } }, components: { Carmap }, onLoad(op) { this.id=op.id; }, onReady() { this.passengerRecordDetail(); }, }