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