Commit 7cca7da9 authored by 18224442217's avatar 18224442217

no message

parent 493f8d57
......@@ -130,20 +130,19 @@
x.flightList.forEach((y,index)=>{
if(y.flightSubType!=3&&x.flightList.length>2){
x.frequency+=1
}if(y.flightSubType==3){
}
if(y.flightSubType==3){
x.frequencyA+=1
}
let date = y.flightDate.split('-')
y.time = `${date[1]}-${date[2]}`
y.week = getDateWeek(y.flightDate)
if(index==0){
console.log(x.frequency-1,'-----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 ':''}`
x.NewFlightList.push(y)
}
if(x.flightList.length-1==index){
console.log(x.frequencyA-1,'-----frequencyA')
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 ':''}`
x.NewFlightList.push(y)
......
......@@ -279,6 +279,7 @@
list.forEach(x=>{
x.Price = 0
x.frequency = 0
x.frequencyA = 0
})
}
arr(this.dataList)
......@@ -297,6 +298,7 @@
})
}else if(y.FlightList.length>2){
y.frequency = 0
y.frequencyA = 0
let FlightDates = y.FlightList.map(z=>{ return z.FlightDate})
let NewFlightDates = []
let Days = []
......@@ -304,12 +306,13 @@
NewFlightDates = FlightDates.slice(0,FlightDates.length-1)
Days = new Set(NewFlightDates)
}
y.FlightList.forEach(z=>{
if(z.FlightType!=3){
y.FlightList.forEach((z,i)=>{
if(z.FlightType!=3&&y.FlightList.length>2&&i){
y.frequency+=1
}if(z.FlightType==3){
y.frequencyA+=1
}
})
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 ':''}`,
frequency: y.frequency-1,
......@@ -320,6 +323,7 @@
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 ':''}`,
Days: 1,
frequency: y.frequencyA,
...y.FlightList[y.FlightList.length-1]
}
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