通過情報を追加

This commit is contained in:
harukin-expo-dev-env
2025-08-23 17:37:44 +00:00
parent ebf72e35bc
commit 8cc1fcf3de
4 changed files with 27 additions and 12 deletions

View File

@@ -79,7 +79,7 @@ export const EachStopList = ({
<View
style={{
flexDirection: "row",
backgroundColor: seType == "community" ? "#c2ff94c4" : "#ffffffc2",
backgroundColor: "#ffffffc2",
}}
>
<View
@@ -130,7 +130,7 @@ export const EachStopList = ({
<Text
style={{
fontSize: 20,
color: `#000${se == "通過" || se == "通編" ? "5" : ""}`,
color: `#${seType == "community" ? "44f" : "000"}${se == "通過" || se == "通編" ? "5" : ""}`,
fontStyle: seType == "community" ? "italic" : "normal",
}}
>
@@ -149,7 +149,7 @@ export const EachStopList = ({
<Text
style={{
fontSize: 15,
color: `#000${se == "通過" || se == "通編" ? "5" : ""}`,
color: `#${seType == "community" ? "44f" : "000"}${se == "通過" || se == "通編" ? "5" : ""}`,
width: 60,
position: "absolute",
right: 120,
@@ -165,9 +165,9 @@ export const EachStopList = ({
style={{
fontSize: 20,
color: isNaN(currentTrainData?.delay)
? `#000${se == "通過" || se == "通編" ? "5" : ""}`
? `#${seType == "community" ? "44f" : "000"}${se == "通過" || se == "通編" ? "5" : ""}`
: currentTrainData?.delay == 0
? `#000${se == "通過" || se == "通編" ? "5" : ""}`
? `#${seType == "community" ? "44f" : "000"}${se == "通過" || se == "通編" ? "5" : ""}`
: "red",
width: 60,
fontStyle: seType == "community" ? "italic" : "normal",
@@ -175,7 +175,7 @@ export const EachStopList = ({
>
{se == "通過" ? "レ" : timeString}
</Text>
<Text style={{ fontSize: 18, width: 50,color:`#000${se == "通過" || se == "通編" ? "5" : ""}` }}>{seString}</Text>
<Text style={{ fontSize: 18, width: 50,color:`#${seType == "community" ? "44f" : "000"}${se == "通過" || se == "通編" ? "5" : ""}` }}>{seString}</Text>
</View>
</View>
</TouchableWithoutFeedback>

View File

@@ -392,7 +392,7 @@ export const EachTrainInfoCore = ({
containerProps={{
style: {
maxHeight: isLandscape ? height - 94 : (height / 100) * 70,
backgroundColor:getTrainType(customTrainDataDetector(data.trainNum, allCustomTrainData).type).data === "notService" ? "#868686ff" :"white"
backgroundColor:getTrainType(customTrainDataDetector(data.trainNum, allCustomTrainData).type).data === "notService" ? "#777777ff" :"white"
},
}}
shortHeader={
@@ -423,7 +423,7 @@ export const EachTrainInfoCore = ({
/>
}
>
{getTrainType(customTrainDataDetector(data.trainNum, allCustomTrainData).type).data === "notService" &&<Text>この列車には乗車できません</Text>}
{getTrainType(customTrainDataDetector(data.trainNum, allCustomTrainData).type).data === "notService" &&<Text style={{backgroundColor:"#ffffffc2",fontWeight:"bold"}}>この列車には乗車できません</Text>}
{headStation.length != 0 &&
headStation.map((i, index) =>
showHeadStation.findIndex((d) => d == index) == -1 ? (
@@ -496,7 +496,7 @@ export const EachTrainInfoCore = ({
/>
)
)}
<Text style={{backgroundColor:"#ffffffc2"}}>背景が緑色時刻が斜体になっている時刻はコミュニティで追加されている独自データです</Text>
<Text style={{backgroundColor:"#ffffffc2"}}>時刻が斜体,青色になっている時刻はコミュニティで追加されている独自データです</Text>
{tailStation.length != 0 &&
tailStation.map(({ station, dia }, index) =>
showTailStation.findIndex((d) => d == index) == -1 ? (

View File

@@ -24,6 +24,7 @@ type Props = {
train: string;
lastStation: string;
time: string;
isThrough?: boolean;
};
trainIDSwitch: boolean;
trainDescriptionSwitch: boolean;
@@ -206,7 +207,7 @@ export const EachData: FC<Props> = (props) => {
{!!isDepartureNow && (
<Description
info={
d.lastStation == "当駅止"
d.isThrough ? "通過列車にご注意ください" : d.lastStation == "当駅止"
? "この列車は当駅止です。間もなく到着します。"
: "列車の出発時刻です。"
}

View File

@@ -110,15 +110,29 @@ export default function LED_vision(props) {
.map((trainNum) => {
let trainData = {};
stationDiagram[trainNum].split("#").forEach((data) => {
if(trainNum == 74){
console.log(data);
}
if (data.match("着")) {
trainData.lastStation = data.split(",着,")[0];
}
if (data.match("着編")) {
trainData.lastStation = data.split(",着編,")[0];
}
if (data.split(",")[0] === station.Station_JP) {
if (data.match(",発,")) {
trainData.time = data.split(",発,")[1];
}else if (data.match(",発編,")) {
trainData.time = data.split(",発編,")[1];
} else if (data.match(",通編,")) {
trainData.time = data.split(",通編,")[1];
trainData.isThrough = true;
} else if (data.match(",着,")) {
trainData.time = data.split(",着,")[1];
trainData.lastStation = "当駅止";
}else if (data.match(",着編,")) {
trainData.time = data.split(",着編,")[1];
trainData.lastStation = "当駅止";
}
}
});
@@ -126,6 +140,7 @@ export default function LED_vision(props) {
train: trainNum,
time: trainData.time,
lastStation: trainData.lastStation,
isThrough: trainData.isThrough,
};
})
.filter((d) => d.time);
@@ -148,7 +163,6 @@ export default function LED_vision(props) {
const timeFiltering = (d) => {
const baseTime = 2;
if (currentTrain.filter((t) => t.num == d.train).length == 0) {
const date = dayjs();
const trainTime = date