オリジナルダイヤ表示反映に対応
This commit is contained in:
@@ -33,6 +33,24 @@ export const EachStopList = ({
|
|||||||
const StationNumbers =
|
const StationNumbers =
|
||||||
Stations &&
|
Stations &&
|
||||||
Stations.filter((d) => d.StationNumber).map((d) => d.StationNumber);
|
Stations.filter((d) => d.StationNumber).map((d) => d.StationNumber);
|
||||||
|
const [seString, seType] = (() => {
|
||||||
|
switch (se) {
|
||||||
|
case "発":
|
||||||
|
return ["出発", "normal"];
|
||||||
|
case "着":
|
||||||
|
return ["到着", "normal"];
|
||||||
|
case "発編":
|
||||||
|
return ["出発", "community"];
|
||||||
|
case "着編":
|
||||||
|
return ["到着", "community"];
|
||||||
|
case "通編":
|
||||||
|
return ["通過", "community"];
|
||||||
|
case "頃編":
|
||||||
|
return ["頃", "community"];
|
||||||
|
default:
|
||||||
|
return [se, "normal"];
|
||||||
|
}
|
||||||
|
})();
|
||||||
// Array [ "T01", "B01",]
|
// Array [ "T01", "B01",]
|
||||||
const lineIDs = [];
|
const lineIDs = [];
|
||||||
const EachIDs = [];
|
const EachIDs = [];
|
||||||
@@ -48,7 +66,7 @@ export const EachStopList = ({
|
|||||||
.set("hour", parseInt(time.split(":")[0]))
|
.set("hour", parseInt(time.split(":")[0]))
|
||||||
.set("minute", parseInt(time.split(":")[1]))
|
.set("minute", parseInt(time.split(":")[1]))
|
||||||
.add(isNaN(currentTrainData?.delay) ? 0 : currentTrainData.delay, "minute");
|
.add(isNaN(currentTrainData?.delay) ? 0 : currentTrainData.delay, "minute");
|
||||||
const timeString = se == "通過" ? "" : dates.format("HH:mm").split(":");
|
const timeString = se == "通過" ? "" : dates.format("HH:mm");
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<TouchableWithoutFeedback
|
<TouchableWithoutFeedback
|
||||||
@@ -58,7 +76,12 @@ export const EachStopList = ({
|
|||||||
}
|
}
|
||||||
key={station}
|
key={station}
|
||||||
>
|
>
|
||||||
<View style={{ flexDirection: "row", backgroundColor: "white" }}>
|
<View
|
||||||
|
style={{
|
||||||
|
flexDirection: "row",
|
||||||
|
backgroundColor: seType == "community" ? "#e3ffcdff" : "white",
|
||||||
|
}}
|
||||||
|
>
|
||||||
<View
|
<View
|
||||||
style={{
|
style={{
|
||||||
width: 35,
|
width: 35,
|
||||||
@@ -72,7 +95,7 @@ export const EachStopList = ({
|
|||||||
<View
|
<View
|
||||||
style={{
|
style={{
|
||||||
backgroundColor: `${lineColorList[lineID]}${
|
backgroundColor: `${lineColorList[lineID]}${
|
||||||
se == "通過" ? "80" : ""
|
se == "通過" || se == "通編" ? "80" : ""
|
||||||
}`,
|
}`,
|
||||||
flex: 1,
|
flex: 1,
|
||||||
}}
|
}}
|
||||||
@@ -105,7 +128,11 @@ export const EachStopList = ({
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Text
|
<Text
|
||||||
style={{ fontSize: 20, color: `#000${se == "通過" ? "5" : ""}` }}
|
style={{
|
||||||
|
fontSize: 20,
|
||||||
|
color: `#000${se == "通過" || se == "通編" ? "5" : ""}`,
|
||||||
|
fontStyle: seType == "community" ? "italic" : "normal",
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
{station}
|
{station}
|
||||||
</Text>
|
</Text>
|
||||||
@@ -122,12 +149,13 @@ export const EachStopList = ({
|
|||||||
<Text
|
<Text
|
||||||
style={{
|
style={{
|
||||||
fontSize: 15,
|
fontSize: 15,
|
||||||
color: "black",
|
color: `#000${se == "通過" || se == "通編" ? "5" : ""}`,
|
||||||
width: 60,
|
width: 60,
|
||||||
position: "absolute",
|
position: "absolute",
|
||||||
right: 120,
|
right: 120,
|
||||||
textAlign: "right",
|
textAlign: "right",
|
||||||
textDecorationLine: "line-through",
|
textDecorationLine: "line-through",
|
||||||
|
fontStyle: seType == "community" ? "italic" : "normal",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{time}
|
{time}
|
||||||
@@ -137,18 +165,17 @@ export const EachStopList = ({
|
|||||||
style={{
|
style={{
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
color: isNaN(currentTrainData?.delay)
|
color: isNaN(currentTrainData?.delay)
|
||||||
? "black"
|
? `#000${se == "通過" || se == "通編" ? "5" : ""}`
|
||||||
: currentTrainData?.delay == 0
|
: currentTrainData?.delay == 0
|
||||||
? "black"
|
? `#000${se == "通過" || se == "通編" ? "5" : ""}`
|
||||||
: "red",
|
: "red",
|
||||||
width: 60,
|
width: 60,
|
||||||
|
fontStyle: seType == "community" ? "italic" : "normal",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{se == "通過" ? "レ" : `${timeString[0]}:${timeString[1]}`}
|
{se == "通過" ? "レ" : timeString}
|
||||||
</Text>
|
|
||||||
<Text style={{ fontSize: 18, width: 50 }}>
|
|
||||||
{se?.replace("発", "出発").replace("着", "到着")}
|
|
||||||
</Text>
|
</Text>
|
||||||
|
<Text style={{ fontSize: 18, width: 50,color:`#000${se == "通過" || se == "通編" ? "5" : ""}` }}>{seString}</Text>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
</TouchableWithoutFeedback>
|
</TouchableWithoutFeedback>
|
||||||
|
|||||||
@@ -14,9 +14,11 @@ export const ShowSpecialTrain = ({
|
|||||||
};
|
};
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{isTrainDataNothing && trueTrainID && (
|
{isTrainDataNothing &&
|
||||||
|
trueTrainID?.map((ids) => {
|
||||||
|
return (
|
||||||
<TouchableOpacity
|
<TouchableOpacity
|
||||||
onPress={() => replaceSpecialTrainDetail(trueTrainID)}
|
onPress={() => replaceSpecialTrainDetail(ids)}
|
||||||
style={{
|
style={{
|
||||||
padding: 10,
|
padding: 10,
|
||||||
flexDirection: "row",
|
flexDirection: "row",
|
||||||
@@ -27,11 +29,14 @@ export const ShowSpecialTrain = ({
|
|||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Text style={{ fontSize: 18, fontWeight: "bold", color: "black" }}>
|
<Text
|
||||||
本来の列車情報を表示
|
style={{ fontSize: 18, fontWeight: "bold", color: "black" }}
|
||||||
|
>
|
||||||
|
本来の列車情報候補を表示:({ids})
|
||||||
</Text>
|
</Text>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
)}
|
);
|
||||||
|
})}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -197,15 +197,15 @@ export const EachTrainInfoCore = ({
|
|||||||
const scrollHandlers = actionSheetRef
|
const scrollHandlers = actionSheetRef
|
||||||
? useScrollHandlers("scrollview-1", actionSheetRef)
|
? useScrollHandlers("scrollview-1", actionSheetRef)
|
||||||
: null;
|
: null;
|
||||||
const [trueTrainID, setTrueTrainID] = useState();
|
const [trueTrainID, setTrueTrainID] = useState([]);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!data.trainNum) return;
|
if (!data.trainNum) return;
|
||||||
const TD = trainList[data.trainNum];
|
const TD = trainList[data.trainNum];
|
||||||
setHeadStation([]);
|
setHeadStation([]);
|
||||||
setTailStation([]);
|
setTailStation([]);
|
||||||
if (!TD) {
|
if (!TD) {
|
||||||
const specialTrainActualID = searchSpecialTrain(data.trainNum, trainList);
|
const specialTrainActualIDs = searchSpecialTrain(data.trainNum, trainList);
|
||||||
setTrueTrainID(specialTrainActualID || undefined);
|
setTrueTrainID(specialTrainActualIDs || []);
|
||||||
setTrainData([]);
|
setTrainData([]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -494,6 +494,7 @@ export const EachTrainInfoCore = ({
|
|||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
)}
|
)}
|
||||||
|
<Text>背景が緑色、時刻が斜体になっている時刻はコミュニティで追加されている独自データです。</Text>
|
||||||
{tailStation.length != 0 &&
|
{tailStation.length != 0 &&
|
||||||
tailStation.map(({ station, dia }, index) =>
|
tailStation.map(({ station, dia }, index) =>
|
||||||
showTailStation.findIndex((d) => d == index) == -1 ? (
|
showTailStation.findIndex((d) => d == index) == -1 ? (
|
||||||
|
|||||||
@@ -8,8 +8,9 @@ export const searchSpecialTrain = (trainNum: string, trainList: any[]) => {
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
if (search("D")) return searchBase + "D";
|
const returnBase = [];
|
||||||
if (search("M")) return searchBase + "M";
|
if (search("D")) returnBase.push(searchBase + "D");
|
||||||
|
if (search("M")) returnBase.push(searchBase + "M");
|
||||||
|
|
||||||
//増結いしづちの場合
|
//増結いしづちの場合
|
||||||
const baseStr = trainNum
|
const baseStr = trainNum
|
||||||
@@ -21,6 +22,7 @@ export const searchSpecialTrain = (trainNum: string, trainList: any[]) => {
|
|||||||
if (9000 < baseNum && baseNum < 9047) {
|
if (9000 < baseNum && baseNum < 9047) {
|
||||||
//いしづちの1001M-1046Mが9000番台になっている場合に発動
|
//いしづちの1001M-1046Mが9000番台になっている場合に発動
|
||||||
const TD = trainList[`${baseNum - 8000}M`];
|
const TD = trainList[`${baseNum - 8000}M`];
|
||||||
if (TD) return `${baseNum - 8000}M`;
|
if (TD) returnBase.push(`${baseNum - 8000}M`);
|
||||||
}
|
}
|
||||||
|
return returnBase;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user