Commit 7cca7da9 authored by 18224442217's avatar 18224442217

no message

parent 493f8d57
...@@ -130,20 +130,19 @@ ...@@ -130,20 +130,19 @@
x.flightList.forEach((y,index)=>{ x.flightList.forEach((y,index)=>{
if(y.flightSubType!=3&&x.flightList.length>2){ if(y.flightSubType!=3&&x.flightList.length>2){
x.frequency+=1 x.frequency+=1
}if(y.flightSubType==3){ }
if(y.flightSubType==3){
x.frequencyA+=1 x.frequencyA+=1
} }
let date = y.flightDate.split('-') let date = y.flightDate.split('-')
y.time = `${date[1]}-${date[2]}` y.time = `${date[1]}-${date[2]}`
y.week = getDateWeek(y.flightDate) y.week = getDateWeek(y.flightDate)
if(index==0){ if(index==0){
console.log(x.frequency-1,'-----frequency')
y.frequency = x.frequency y.frequency = x.frequency
y.duration = `${x.departureTime.days>0?x.departureTime.days+'d ':''}${x.departureTime.hours>0?x.departureTime.hours+'h ':''}${x.departureTime.minutes>0?x.departureTime.minutes+'m ':''}` y.duration = `${x.departureTime.days>0?x.departureTime.days+'d ':''}${x.departureTime.hours>0?x.departureTime.hours+'h ':''}${x.departureTime.minutes>0?x.departureTime.minutes+'m ':''}`
x.NewFlightList.push(y) x.NewFlightList.push(y)
} }
if(x.flightList.length-1==index){ if(x.flightList.length-1==index){
console.log(x.frequencyA-1,'-----frequencyA')
y.frequency = x.frequencyA-1 y.frequency = x.frequencyA-1
y.duration = `${x.arrivalTime.days>0?x.arrivalTime.days+'d ':''}${x.arrivalTime.hours>0?x.arrivalTime.hours+'h ':''}${x.arrivalTime.minutes>0?x.arrivalTime.minutes+'m ':''}` y.duration = `${x.arrivalTime.days>0?x.arrivalTime.days+'d ':''}${x.arrivalTime.hours>0?x.arrivalTime.hours+'h ':''}${x.arrivalTime.minutes>0?x.arrivalTime.minutes+'m ':''}`
x.NewFlightList.push(y) x.NewFlightList.push(y)
......
...@@ -279,6 +279,7 @@ ...@@ -279,6 +279,7 @@
list.forEach(x=>{ list.forEach(x=>{
x.Price = 0 x.Price = 0
x.frequency = 0 x.frequency = 0
x.frequencyA = 0
}) })
} }
arr(this.dataList) arr(this.dataList)
...@@ -297,6 +298,7 @@ ...@@ -297,6 +298,7 @@
}) })
}else if(y.FlightList.length>2){ }else if(y.FlightList.length>2){
y.frequency = 0 y.frequency = 0
y.frequencyA = 0
let FlightDates = y.FlightList.map(z=>{ return z.FlightDate}) let FlightDates = y.FlightList.map(z=>{ return z.FlightDate})
let NewFlightDates = [] let NewFlightDates = []
let Days = [] let Days = []
...@@ -304,12 +306,13 @@ ...@@ -304,12 +306,13 @@
NewFlightDates = FlightDates.slice(0,FlightDates.length-1) NewFlightDates = FlightDates.slice(0,FlightDates.length-1)
Days = new Set(NewFlightDates) Days = new Set(NewFlightDates)
} }
y.FlightList.forEach(z=>{ y.FlightList.forEach((z,i)=>{
if(z.FlightType!=3){ if(z.FlightType!=3&&y.FlightList.length>2&&i){
y.frequency+=1 y.frequency+=1
}if(z.FlightType==3){
y.frequencyA+=1
} }
}) })
let obj = { let obj = {
duration:`${y.DepartureTime.Days>0?y.DepartureTime.Days+'d ':''}${y.DepartureTime.Hours>0?y.DepartureTime.Hours+'h ':''}${y.DepartureTime.Minutes>0?y.DepartureTime.Minutes+'m ':''}`, duration:`${y.DepartureTime.Days>0?y.DepartureTime.Days+'d ':''}${y.DepartureTime.Hours>0?y.DepartureTime.Hours+'h ':''}${y.DepartureTime.Minutes>0?y.DepartureTime.Minutes+'m ':''}`,
frequency: y.frequency-1, frequency: y.frequency-1,
...@@ -320,6 +323,7 @@ ...@@ -320,6 +323,7 @@
let obj2 = { let obj2 = {
duration:`${y.ArrivalTime.Days>0?y.ArrivalTime.Days+'d ':''}${y.ArrivalTime.Hours>0?y.ArrivalTime.Hours+'h ':''}${y.ArrivalTime.Minutes>0?y.ArrivalTime.Minutes+'m ':''}`, duration:`${y.ArrivalTime.Days>0?y.ArrivalTime.Days+'d ':''}${y.ArrivalTime.Hours>0?y.ArrivalTime.Hours+'h ':''}${y.ArrivalTime.Minutes>0?y.ArrivalTime.Minutes+'m ':''}`,
Days: 1, Days: 1,
frequency: y.frequencyA,
...y.FlightList[y.FlightList.length-1] ...y.FlightList[y.FlightList.length-1]
} }
y.NewFlightList.push(obj) y.NewFlightList.push(obj)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment