Bläddra i källkod

完善路线地图显示。

zhengqiang 4 år sedan
förälder
incheckning
e81ed3aba6
3 ändrade filer med 23 tillägg och 5 borttagningar
  1. 2 2
      .env.development
  2. 18 0
      src/views/bus/routeInfo-list.vue
  3. 3 3
      src/views/bus/shiftInfo-map.vue

+ 2 - 2
.env.development

@@ -1,8 +1,8 @@
 OUT_PUT_DIR=dist/smart-bus-portal
 
-VUE_APP_BACKEND_URL=http://127.0.0.1:8086/smart-bus-server
+#VUE_APP_BACKEND_URL=http://127.0.0.1:8086/smart-bus-server
 #VUE_APP_BACKEND_URL=https://ykt-test.xiaoxinda.com/smart-bus-server
-#VUE_APP_BACKEND_URL=http://121.37.187.149/smart-bus-server
+VUE_APP_BACKEND_URL=http://121.37.187.149/smart-bus-server
 
 #手机企业版
 VUE_APP_COMPANY_HEALTH_WECHAT_QY_URL=http://wisdomhousewechat.sudaonline.net/prevention/motemwall.html 

+ 18 - 0
src/views/bus/routeInfo-list.vue

@@ -179,6 +179,7 @@
           :key="station.id"
           :position="station.position"
           :title="station.title"
+          :icon="station.icon"
         ></el-amap-marker>
         <!--路线-->
         <el-amap-polyline
@@ -263,6 +264,9 @@ import routeInfoApi from "@/api/bus/routeInfo";
 import SelectTree from "@/components/SelectTree";
 import companyInfoApi from "@/api/bus/companyInfo";
 
+import stationIcon from "@/assets/icons/station.svg";
+import greenIcon from "@/assets/icons/green.svg";
+import redIcon from "@/assets/icons/red.svg";
 
 
 import { getToken } from "@/utils/auth"; // get token from cookie
@@ -625,10 +629,24 @@ export default {
                 id: item.id,
                 title: item.name,
                 position: item.location.split(","),
+                icon: stationIcon
               };
 
               this.stationList.push(station);
 
+              if(item.stationSubInfoList!=null){
+                  item.stationSubInfoList.forEach(subItem=>{
+                      var startToEnd = subItem.startStationId == this.stationList[0].id;
+
+                      this.stationList.push({
+                          id: subItem.id,
+                          title: item.name + "入口" + (startToEnd ? "(起)" : "(终)"),
+                          position: [subItem.longitude,subItem.latitude],
+                          icon: startToEnd ? greenIcon : redIcon
+                      });
+                  });
+              }
+
               if (initMapPath) {
                 this.mapPath.push(station.position);
               }

+ 3 - 3
src/views/bus/shiftInfo-map.vue

@@ -108,9 +108,9 @@ export default {
 
                 console.log(this.centerPoint);
 
-                // setTimeout(()=>{
-                //     this.loadVehicle(vehicleId);
-                // },60000);
+                setTimeout(()=>{
+                    this.loadVehicle(vehicleId);
+                },60000);
             });
         },
         loadRouteMap(routeId) {