liwei19941102 2 лет назад
Родитель
Сommit
ae910327b3
1 измененных файлов с 11 добавлено и 4 удалено
  1. 11 4
      src/components/Public/timeLine.vue

+ 11 - 4
src/components/Public/timeLine.vue

@@ -4,7 +4,8 @@
       <div v-for="(obj, index1) in list" style="width: 13vw;">
         <div style="display: flex;flex-direction: row;width: 13vw">
           <div style="height: 40px;">
-            <img v-if="index1 == carIndex" style="width: 30px;margin-left: 1vw;" src="@/assets/images/icon/小货车.png" />
+            <!-- {{ index1 }} -->
+            <img v-if="index1 == carIndex" style="width: 30px;margin-left: 2vw;" src="@/assets/images/icon/小货车.png" />
           </div>
           <div style="height: 40px;">
             <img v-if="index1 == Number(carIndex)+0.5" style="width: 30px;margin-left: 5vw;"
@@ -20,7 +21,7 @@
     </div>
     <div style="display: flex;flex-direction: row;padding-left: 3%;">
       <div v-for="(item, index) in list" style="width: 13vw;">
-        <div>
+        <div style="width: 13vw;">
           <div style="display: flex;flex-direction: row;">
             <div class="activitieyContent" v-if="index == 0" style="background: #06D903;">
               起
@@ -129,6 +130,7 @@ const formatDate = (value) => {
 }
 
 const getCurrentStation = () => {
+  console.log(props.stationInfo)
   var stationObj = props.stationInfo;
   var list = props.list
   if (stationObj.passStations == 'null') {
@@ -136,10 +138,15 @@ const getCurrentStation = () => {
     // return index == 0
   } else {
     var passStationsArry = stationObj.passStations.split(",");
-    if (stationObj.currentStation == "null") {
+    if (stationObj.currentStation == "null" || stationObj.currentStation == "") {
       for (var index in list) {
         if (passStationsArry[passStationsArry.length - 1] == list[index].stationName) {
-          carIndex.value = index + 0.5
+          if(index == list.length - 1){
+            carIndex.value = index
+          }else{
+            carIndex.value = Number(index) + 0.5
+          }
+          console.log(carIndex.value)
         }
       }
     } else {