番線表示機能開発開始
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]
|
.split("~")[currentTrainData?.Direction == 1 ? 1 : 0]
|
||||||
}間を走行中`
|
}間を走行中`
|
||||||
: `現在地:${currentTrainData?.Pos}`;
|
: `現在地:${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 (
|
return (
|
||||||
<>
|
<>
|
||||||
<TouchableOpacity
|
<TouchableOpacity
|
||||||
@ -121,7 +137,7 @@ export const EachData: FC<Props> = (props) => {
|
|||||||
<Description
|
<Description
|
||||||
info={`${
|
info={`${
|
||||||
trainIDSwitch ? currentTrainData?.PosNum : trainPositionText
|
trainIDSwitch ? currentTrainData?.PosNum : trainPositionText
|
||||||
}`}
|
} ${platformNumber? platformNumber+"番線":""}`}
|
||||||
onLongClick={() => {
|
onLongClick={() => {
|
||||||
Linking.openURL(
|
Linking.openURL(
|
||||||
"https://nexcloud.haruk.in/apps/forms/s/TEkBQW5WLcYjLyAzGxncQLtw"
|
"https://nexcloud.haruk.in/apps/forms/s/TEkBQW5WLcYjLyAzGxncQLtw"
|
||||||
|
Loading…
Reference in New Issue
Block a user