番線表示機能開発開始
This commit is contained in:
parent
6fad8e23d2
commit
6653cbf65a
@ -92,6 +92,22 @@ export const EachData: FC<Props> = (props) => {
|
||||
.split("~")[currentTrainData?.Direction == 1 ? 1 : 0]
|
||||
}間を走行中`
|
||||
: `現在地:${currentTrainData?.Pos}`;
|
||||
|
||||
const [platformNumber, setPlatformNumber] = useState<number>();
|
||||
useEffect(()=>{
|
||||
fetch("https://n8n.haruk.in/webhook/JR-shikoku-PosID?num="+currentTrainData?.PosNum)
|
||||
.then(res=>res.json())
|
||||
.then(data=>{
|
||||
if(data?.type == "Station"){
|
||||
setPlatformNumber(data?.platform);
|
||||
}
|
||||
else{
|
||||
setPlatformNumber(undefined);
|
||||
}
|
||||
})
|
||||
},[currentTrainData,currentTrain])
|
||||
|
||||
|
||||
return (
|
||||
<>
|
||||
<TouchableOpacity
|
||||
@ -121,7 +137,7 @@ export const EachData: FC<Props> = (props) => {
|
||||
<Description
|
||||
info={`${
|
||||
trainIDSwitch ? currentTrainData?.PosNum : trainPositionText
|
||||
}`}
|
||||
} ${platformNumber? platformNumber+"番線":""}`}
|
||||
onLongClick={() => {
|
||||
Linking.openURL(
|
||||
"https://nexcloud.haruk.in/apps/forms/s/TEkBQW5WLcYjLyAzGxncQLtw"
|
||||
|
Loading…
Reference in New Issue
Block a user