Merge commit '199d41fd833010478591628947044f3d9cd096ca' into develop
This commit is contained in:
commit
85e2fa240a
@ -100,6 +100,18 @@ export const EachData: FC<Props> = (props) => {
|
|||||||
if (isBetween === true) return `現在地:${Pos.from}→${Pos.to}間を走行中`;
|
if (isBetween === true) return `現在地:${Pos.from}→${Pos.to}間を走行中`;
|
||||||
else return Pos.Pos == "" ? "" : `現在地:${Pos.Pos}`;
|
else return Pos.Pos == "" ? "" : `現在地:${Pos.Pos}`;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const [platformNumber, setPlatformNumber] = useState<number>();
|
||||||
|
useEffect(() => {
|
||||||
|
fetch(
|
||||||
|
`https://n8n.haruk.in/webhook/JR-shikoku-PosID?PosNum=${currentTrainData?.PosNum}&Line=${currentTrainData?.Line}`
|
||||||
|
)
|
||||||
|
.then((res) => res.json())
|
||||||
|
.then((data) =>
|
||||||
|
setPlatformNumber(data?.type == "Station" ? data?.platform : undefined)
|
||||||
|
);
|
||||||
|
}, [currentTrainData, currentTrain]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<TouchableOpacity
|
<TouchableOpacity
|
||||||
@ -131,7 +143,7 @@ export const EachData: FC<Props> = (props) => {
|
|||||||
trainIDSwitch
|
trainIDSwitch
|
||||||
? currentTrainData?.PosNum
|
? currentTrainData?.PosNum
|
||||||
: trainPositionText(currentTrainData)
|
: trainPositionText(currentTrainData)
|
||||||
}`}
|
} ${platformNumber ? platformNumber + "番線" : ""}`}
|
||||||
onLongClick={() => {
|
onLongClick={() => {
|
||||||
Linking.openURL(
|
Linking.openURL(
|
||||||
"https://nexcloud.haruk.in/apps/forms/s/TEkBQW5WLcYjLyAzGxncQLtw"
|
"https://nexcloud.haruk.in/apps/forms/s/TEkBQW5WLcYjLyAzGxncQLtw"
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
export const checkDuplicateTrainData = (currentTrainArray) => {
|
import { trainDataType } from "./trainPositionTextArray";
|
||||||
|
|
||||||
|
export const checkDuplicateTrainData = (currentTrainArray: trainDataType[]) => {
|
||||||
const notNyujoData = currentTrainArray.filter((d) => d.delay !== "入線");
|
const notNyujoData = currentTrainArray.filter((d) => d.delay !== "入線");
|
||||||
if (currentTrainArray.length == 1) return currentTrainArray[0];
|
if (currentTrainArray.length == 1) return currentTrainArray[0];
|
||||||
if (notNyujoData.length == 0) return currentTrainArray[0];
|
if (notNyujoData.length == 0) return currentTrainArray[0];
|
@ -1,5 +1,7 @@
|
|||||||
|
import { trainDataType } from "./trainPositionTextArray";
|
||||||
|
|
||||||
type getTrainDelayStatus = (
|
type getTrainDelayStatus = (
|
||||||
current: { delay: number | "入線" | string; Pos: string },
|
current: trainDataType,
|
||||||
Station_JP: string
|
Station_JP: string
|
||||||
) => string | number;
|
) => string | number;
|
||||||
export const getTrainDelayStatus: getTrainDelayStatus = (
|
export const getTrainDelayStatus: getTrainDelayStatus = (
|
||||||
|
@ -14,6 +14,12 @@ type returnCurrentType = {
|
|||||||
export type trainDataType = {
|
export type trainDataType = {
|
||||||
Pos?: string;
|
Pos?: string;
|
||||||
Direction?: number;
|
Direction?: number;
|
||||||
|
Index?: number;
|
||||||
|
Line?: string;
|
||||||
|
PosNum?: number;
|
||||||
|
Type?: string;
|
||||||
|
delay?: string | number;
|
||||||
|
num?: string;
|
||||||
};
|
};
|
||||||
type trainData = (
|
type trainData = (
|
||||||
trainData: trainDataType
|
trainData: trainDataType
|
||||||
|
Loading…
Reference in New Issue
Block a user