Merge commit '0c002c443deab8e12299d8d5696e70b02313b53b' into develop
This commit is contained in:
commit
08d105588f
BIN
assets/fonts/DelaGothicOne-Regular.ttf
Normal file
BIN
assets/fonts/DelaGothicOne-Regular.ttf
Normal file
Binary file not shown.
BIN
assets/fonts/西日本方向幕ロゴ.otf
Normal file
BIN
assets/fonts/西日本方向幕ロゴ.otf
Normal file
Binary file not shown.
@ -46,7 +46,10 @@ export const EachStopList = ({
|
|||||||
.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").split(":");
|
||||||
|
const onClickStateText = (string) => {
|
||||||
|
if (string != "通過") return;
|
||||||
|
alert("この駅は通過駅です");
|
||||||
|
};
|
||||||
return (
|
return (
|
||||||
<TouchableWithoutFeedback
|
<TouchableWithoutFeedback
|
||||||
onPress={() =>
|
onPress={() =>
|
||||||
@ -140,6 +143,7 @@ export const EachStopList = ({
|
|||||||
: "red",
|
: "red",
|
||||||
width: 60,
|
width: 60,
|
||||||
}}
|
}}
|
||||||
|
onPress={() => onClickStateText(se)}
|
||||||
>
|
>
|
||||||
{se == "通過" ? "レ" : `${timeString[0]}:${timeString[1]}`}
|
{se == "通過" ? "レ" : `${timeString[0]}:${timeString[1]}`}
|
||||||
</Text>
|
</Text>
|
||||||
|
@ -10,6 +10,7 @@ import {
|
|||||||
LayoutAnimation,
|
LayoutAnimation,
|
||||||
} from "react-native";
|
} from "react-native";
|
||||||
import { SheetManager } from "react-native-actions-sheet";
|
import { SheetManager } from "react-native-actions-sheet";
|
||||||
|
import { useFonts } from "expo-font";
|
||||||
import { AS } from "../../storageControl";
|
import { AS } from "../../storageControl";
|
||||||
import trainList from "../../assets/originData/trainList";
|
import trainList from "../../assets/originData/trainList";
|
||||||
import { lineListPair } from "../../lib/getStationList";
|
import { lineListPair } from "../../lib/getStationList";
|
||||||
@ -44,6 +45,10 @@ export const EachTrainInfoCore = ({
|
|||||||
from,
|
from,
|
||||||
navigate,
|
navigate,
|
||||||
}) => {
|
}) => {
|
||||||
|
const [fontLoaded, error] = useFonts({
|
||||||
|
"JR-Nishi": require("../../assets/fonts/西日本方向幕ロゴ.otf"),
|
||||||
|
"Zou": require("../../assets/fonts/DelaGothicOne-Regular.ttf"),
|
||||||
|
});
|
||||||
// const [actionSheetHorizonalScroll, setActionSheetHorizonalScroll] = useState(false);
|
// const [actionSheetHorizonalScroll, setActionSheetHorizonalScroll] = useState(false);
|
||||||
const { currentTrain } = useCurrentTrain();
|
const { currentTrain } = useCurrentTrain();
|
||||||
const { originalStationList, stationList } = useStationList();
|
const { originalStationList, stationList } = useStationList();
|
||||||
@ -405,6 +410,7 @@ export const EachTrainInfoCore = ({
|
|||||||
tailStation={tailStation}
|
tailStation={tailStation}
|
||||||
navigate={navigate}
|
navigate={navigate}
|
||||||
from={from}
|
from={from}
|
||||||
|
fontLoaded={fontLoaded}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<DynamicHeaderScrollView
|
<DynamicHeaderScrollView
|
||||||
@ -494,6 +500,7 @@ export const EachTrainInfoCore = ({
|
|||||||
currentTrainData,
|
currentTrainData,
|
||||||
openStationACFromEachTrainInfo,
|
openStationACFromEachTrainInfo,
|
||||||
showThrew,
|
showThrew,
|
||||||
|
fontLoaded,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
|
@ -6,6 +6,7 @@ import { getType } from "../../../lib/eachTrainInfoCoreLib/getType";
|
|||||||
import { migrateTrainName } from "../../../lib/eachTrainInfoCoreLib/migrateTrainName";
|
import { migrateTrainName } from "../../../lib/eachTrainInfoCoreLib/migrateTrainName";
|
||||||
import { TrainIconStatus } from "./trainIconStatus";
|
import { TrainIconStatus } from "./trainIconStatus";
|
||||||
import { TrainViewIcon } from "./trainViewIcon";
|
import { TrainViewIcon } from "./trainViewIcon";
|
||||||
|
import { OneManText } from "./HeaderTextParts/OneManText";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
data: { trainNum: string; limited: string };
|
data: { trainNum: string; limited: string };
|
||||||
@ -16,10 +17,11 @@ type Props = {
|
|||||||
tailStation: { id: string }[];
|
tailStation: { id: string }[];
|
||||||
navigate: any;
|
navigate: any;
|
||||||
from: string;
|
from: string;
|
||||||
|
fontLoaded: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
const textConfig: TextStyle = {
|
const textConfig: TextStyle = {
|
||||||
fontSize: 20,
|
fontSize: 18,
|
||||||
fontWeight: "bold",
|
fontWeight: "bold",
|
||||||
color: "white",
|
color: "white",
|
||||||
};
|
};
|
||||||
@ -33,37 +35,129 @@ export const HeaderText: FC<Props> = ({
|
|||||||
tailStation,
|
tailStation,
|
||||||
navigate,
|
navigate,
|
||||||
from,
|
from,
|
||||||
|
fontLoaded,
|
||||||
}) => {
|
}) => {
|
||||||
const trainName = useMemo(() => {
|
const { limited, trainNum } = data;
|
||||||
if (!data.limited) return "";
|
|
||||||
const limitedArray = data.limited.split(":");
|
|
||||||
const type = getType(limitedArray[0]);
|
|
||||||
|
|
||||||
|
// 貨物の判定
|
||||||
|
const freightDetect = (num:string)=>{
|
||||||
|
switch(num){
|
||||||
|
case "71":
|
||||||
|
return "貨物 東京(タ)→高松(タ)";
|
||||||
|
case "73":
|
||||||
|
case "75":
|
||||||
|
return "貨物 大阪(タ)→高松(タ)";
|
||||||
|
case "3079":
|
||||||
|
return "貨物 高松(タ)→伊予三島";
|
||||||
|
case "3071":
|
||||||
|
case "3077":
|
||||||
|
return "貨物 高松(タ)→新居浜";
|
||||||
|
case "3073":
|
||||||
|
return "貨物 高松(タ)→松山貨物";
|
||||||
|
case "70":
|
||||||
|
return "貨物 高松(タ)→東京(タ)";
|
||||||
|
case "74":
|
||||||
|
case "76":
|
||||||
|
return "貨物 高松(タ)→大阪(タ)";
|
||||||
|
case "3078":
|
||||||
|
return "貨物 伊予三島→高松(タ)";
|
||||||
|
case "3070":
|
||||||
|
return "貨物 新居浜→高松(タ)";
|
||||||
|
case "3076":
|
||||||
|
return "貨物 新居浜→高松(タ)";
|
||||||
|
case "3072":
|
||||||
|
return "貨物 松山貨物→高松(タ)";
|
||||||
|
case "9070":
|
||||||
|
return "貨物 臨時";
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 列車名、種別、フォントの取得
|
||||||
|
const [typeName, trainName, fontAvailable] = useMemo(() => {
|
||||||
|
if (!limited) return "";
|
||||||
|
const limitedArray = limited.split(":");
|
||||||
|
const [type, fontAvailable] = (() => {
|
||||||
|
const d = getType(limitedArray[0]);
|
||||||
|
switch (true) {
|
||||||
|
case !!d:
|
||||||
|
return [d, true];
|
||||||
|
case !!trainNum.includes("T"):
|
||||||
|
return ["単機回送", false];
|
||||||
|
case !!trainNum.includes("R"):
|
||||||
|
case !!trainNum.includes("E"):
|
||||||
|
case !!trainNum.includes("L"):
|
||||||
|
case !!trainNum.includes("A"):
|
||||||
|
case !!trainNum.includes("B"):
|
||||||
|
return ["回送", false];
|
||||||
|
case !!trainNum.includes("H"):
|
||||||
|
return ["試運転", false];
|
||||||
|
case !!trainNum.match("D"):
|
||||||
|
case !!trainNum.match("M"):
|
||||||
|
return ["普通", true];
|
||||||
|
case !!freightDetect(trainNum):
|
||||||
|
return [freightDetect(trainNum), false];
|
||||||
|
default:
|
||||||
|
return ["", false];
|
||||||
|
}
|
||||||
|
})();
|
||||||
switch (true) {
|
switch (true) {
|
||||||
case !!limitedArray[1]:
|
case !!limitedArray[1]:
|
||||||
// 特急の場合は、列車名を取得
|
// 特急の場合は、列車名を取得
|
||||||
return type + migrateTrainName(limitedArray[1]);
|
return [type, migrateTrainName(limitedArray[1]), fontAvailable];
|
||||||
case trainData.length == 0:
|
case trainData.length == 0:
|
||||||
// 特急以外の場合は、列車番号を取得
|
// 特急以外の場合は、列車番号を取得
|
||||||
return type;
|
|
||||||
|
return [type, "", fontAvailable];
|
||||||
default:
|
default:
|
||||||
// 行先がある場合は、行先を取得
|
// 行先がある場合は、行先を取得
|
||||||
return (
|
return [
|
||||||
type +
|
type,
|
||||||
migrateTrainName(
|
migrateTrainName(
|
||||||
trainData[trainData.length - 1].split(",")[0] + "行き"
|
trainData[trainData.length - 1].split(",")[0] + "行き"
|
||||||
)
|
),
|
||||||
);
|
fontAvailable,
|
||||||
|
];
|
||||||
}
|
}
|
||||||
}, [data.limited, trainData]);
|
}, [limited, trainData]);
|
||||||
|
|
||||||
|
// 1人運転の判定
|
||||||
|
const isOneMan = useMemo(() => {
|
||||||
|
const OneManRegex = new RegExp(/^4[1-9]\d\d[DM]$/);
|
||||||
|
const OneManRegex2 = new RegExp(/^5[1-7]\d\d[DM]$/);
|
||||||
|
return !!(
|
||||||
|
OneManRegex.test(trainNum) ||
|
||||||
|
OneManRegex2.test(trainNum) ||
|
||||||
|
trainNum === "3621D"
|
||||||
|
);
|
||||||
|
}, [trainNum]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={{ padding: 10, flexDirection: "row", alignItems: "center" }}>
|
<View style={{ padding: 10, flexDirection: "row", alignItems: "center" }}>
|
||||||
<TrainIconStatus {...{ data, navigate, from }} />
|
<TrainIconStatus {...{ data, navigate, from }} />
|
||||||
|
<View
|
||||||
|
style={{ borderRadius: 5, flexDirection: "row", alignItems: "center" }}
|
||||||
|
>
|
||||||
|
<Text
|
||||||
|
style={{
|
||||||
|
fontSize: 20,
|
||||||
|
color: "white",
|
||||||
|
fontFamily: fontAvailable ? "JR-Nishi" : undefined,
|
||||||
|
fontWeight: !fontAvailable ?"bold":undefined,
|
||||||
|
marginRight: 5,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{typeName}
|
||||||
|
</Text>
|
||||||
|
{isOneMan && <OneManText />}
|
||||||
<Text style={textConfig}>{trainName}</Text>
|
<Text style={textConfig}>{trainName}</Text>
|
||||||
|
</View>
|
||||||
|
|
||||||
<View style={{ flex: 1 }} />
|
<View style={{ flex: 1 }} />
|
||||||
<Text style={textConfig}>
|
<Text style={textConfig}>
|
||||||
{showHeadStation.map((d) => `${headStation[d].id} + `)}
|
{showHeadStation.map((d) => `${headStation[d].id} + `)}
|
||||||
{data.trainNum}
|
{trainNum}
|
||||||
{showTailStation.map((d) => ` + ${tailStation[d].id}`)}
|
{showTailStation.map((d) => ` + ${tailStation[d].id}`)}
|
||||||
</Text>
|
</Text>
|
||||||
|
|
||||||
|
@ -0,0 +1,16 @@
|
|||||||
|
import React, { FC } from "react";
|
||||||
|
import { Text, View } from "react-native";
|
||||||
|
export const OneManText: FC = () => {
|
||||||
|
const styles = {
|
||||||
|
fontSize: 12,
|
||||||
|
margin: -2,
|
||||||
|
color: "white",
|
||||||
|
fontFamily: "Zou",
|
||||||
|
};
|
||||||
|
return (
|
||||||
|
<View style={{ flexDirection: "column", marginRight: 7 }}>
|
||||||
|
<Text style={{ ...styles, marginRight: 5 }}>ワン</Text>
|
||||||
|
<Text style={{ ...styles, marginLeft: 5 }}>マン</Text>
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
};
|
@ -5,6 +5,7 @@ import dayjs from "dayjs";
|
|||||||
import { useInterval } from "../../../lib/useInterval";
|
import { useInterval } from "../../../lib/useInterval";
|
||||||
import { Icon } from "@expo/vector-icons/build/createIconSet";
|
import { Icon } from "@expo/vector-icons/build/createIconSet";
|
||||||
import { SheetManager } from "react-native-actions-sheet";
|
import { SheetManager } from "react-native-actions-sheet";
|
||||||
|
import { customTrainDataDetector } from "../../custom-train-data";
|
||||||
|
|
||||||
type GlyphNames = ComponentProps<typeof Ionicons>["name"];
|
type GlyphNames = ComponentProps<typeof Ionicons>["name"];
|
||||||
|
|
||||||
@ -20,8 +21,14 @@ type apt = {
|
|||||||
export const TrainIconStatus: FC<Props> = ({ data, navigate, from }) => {
|
export const TrainIconStatus: FC<Props> = ({ data, navigate, from }) => {
|
||||||
const [trainIcon, setTrainIcon] = useState(null);
|
const [trainIcon, setTrainIcon] = useState(null);
|
||||||
const [anpanmanStatus, setAnpanmanStatus] = useState<apt>();
|
const [anpanmanStatus, setAnpanmanStatus] = useState<apt>();
|
||||||
|
const [address, setAddress] = useState("");
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!data.trainNum) return;
|
if (!data.trainNum) return;
|
||||||
|
const { trainIcon, infoUrl } = customTrainDataDetector(data.trainNum);
|
||||||
|
if (trainIcon) setTrainIcon(trainIcon);
|
||||||
|
|
||||||
|
if (infoUrl) setAddress(infoUrl);
|
||||||
|
|
||||||
switch (data.trainNum) {
|
switch (data.trainNum) {
|
||||||
case "32D":
|
case "32D":
|
||||||
case "36D":
|
case "36D":
|
||||||
@ -33,11 +40,6 @@ export const TrainIconStatus: FC<Props> = ({ data, navigate, from }) => {
|
|||||||
case "45D":
|
case "45D":
|
||||||
case "49D":
|
case "49D":
|
||||||
case "57D":
|
case "57D":
|
||||||
setTrainIcon(
|
|
||||||
`https://n8n.haruk.in/webhook/dosan-anpanman-pictures.png?trainNum=${
|
|
||||||
data.trainNum
|
|
||||||
}&day=${dayjs().format("yyyy-MM-DD")}`
|
|
||||||
);
|
|
||||||
fetch(
|
fetch(
|
||||||
`https://n8n.haruk.in/webhook/dosan-anpanman?trainNum=${
|
`https://n8n.haruk.in/webhook/dosan-anpanman?trainNum=${
|
||||||
data.trainNum
|
data.trainNum
|
||||||
@ -72,7 +74,7 @@ export const TrainIconStatus: FC<Props> = ({ data, navigate, from }) => {
|
|||||||
<TouchableOpacity
|
<TouchableOpacity
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
navigate("howto", {
|
navigate("howto", {
|
||||||
info: "https://www.jr-eki.com/aptrain/naani/dosan/jikoku.html",
|
info: address,
|
||||||
goTo: from == "LED" ? "menu" : from,
|
goTo: from == "LED" ? "menu" : from,
|
||||||
});
|
});
|
||||||
SheetManager.hide("EachTrainInfo");
|
SheetManager.hide("EachTrainInfo");
|
||||||
@ -81,11 +83,15 @@ export const TrainIconStatus: FC<Props> = ({ data, navigate, from }) => {
|
|||||||
{move ? (
|
{move ? (
|
||||||
<Image
|
<Image
|
||||||
source={{ uri: trainIcon }}
|
source={{ uri: trainIcon }}
|
||||||
style={{ height: 30, width: 30, margin: 5 }}
|
style={{ height: 34, width: 30, marginRight: 5 }}
|
||||||
resizeMethod="resize"
|
resizeMethod="scale"
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<Ionicons {...anpanmanStatus} size={30} style={{ margin: 5 }} />
|
<Ionicons
|
||||||
|
{...anpanmanStatus}
|
||||||
|
size={30}
|
||||||
|
style={{ marginRight: 5 }}
|
||||||
|
/>
|
||||||
)}
|
)}
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
)}
|
)}
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import dayjs from "dayjs";
|
||||||
export const customTrainDataDetector = (TrainNumber: string) => {
|
export const customTrainDataDetector = (TrainNumber: string) => {
|
||||||
switch (TrainNumber) {
|
switch (TrainNumber) {
|
||||||
//しおかぜメイン
|
//しおかぜメイン
|
||||||
@ -22,7 +23,9 @@ export const customTrainDataDetector = (TrainNumber: string) => {
|
|||||||
return {
|
return {
|
||||||
type: "LTDEXP",
|
type: "LTDEXP",
|
||||||
trainName: "しおかぜ",
|
trainName: "しおかぜ",
|
||||||
trainIcon: "http://www.trainfrontview.net/b/s8000nr.png",
|
trainIcon: "https://storage.haruk.in/s8000nr.png",
|
||||||
|
infoUrl:
|
||||||
|
"http://jr-shikoku.co.jp/01_trainbus/vehicle-info/shiokaze.html",
|
||||||
trainNumDistance: 0,
|
trainNumDistance: 0,
|
||||||
info: "いしづちと併結 / 8000系で運転",
|
info: "いしづちと併結 / 8000系で運転",
|
||||||
};
|
};
|
||||||
@ -30,19 +33,22 @@ export const customTrainDataDetector = (TrainNumber: string) => {
|
|||||||
return {
|
return {
|
||||||
type: "LTDEXP",
|
type: "LTDEXP",
|
||||||
trainName: "しおかぜ",
|
trainName: "しおかぜ",
|
||||||
trainIcon: "http://www.trainfrontview.net/b/s8000nr.png",
|
trainIcon: "https://storage.haruk.in/s8000nr.png",
|
||||||
|
infoUrl:
|
||||||
|
"http://jr-shikoku.co.jp/01_trainbus/vehicle-info/shiokaze.html",
|
||||||
trainNumDistance: 0,
|
trainNumDistance: 0,
|
||||||
info: "8000系で運転",
|
info: "8000系で運転",
|
||||||
};
|
};
|
||||||
//8000 アンパン
|
//8000 アンパン
|
||||||
|
case "10M":
|
||||||
case "22M":
|
case "22M":
|
||||||
case "9M":
|
case "9M":
|
||||||
case "10M":
|
|
||||||
case "21M":
|
case "21M":
|
||||||
return {
|
return {
|
||||||
type: "LTDEXP",
|
type: "LTDEXP",
|
||||||
trainName: "しおかぜ",
|
trainName: "しおかぜ",
|
||||||
trainIcon: "http://www.trainfrontview.net/f/s8000ap.png",
|
trainIcon: "https://storage.haruk.in/s8000ap.png",
|
||||||
|
infoUrl: "https://www.jr-eki.com/aptrain/naani/yosan/train.html",
|
||||||
trainNumDistance: 0,
|
trainNumDistance: 0,
|
||||||
info: "いしづちと併結 / アンパンマン列車で運転",
|
info: "いしづちと併結 / アンパンマン列車で運転",
|
||||||
};
|
};
|
||||||
@ -58,7 +64,9 @@ export const customTrainDataDetector = (TrainNumber: string) => {
|
|||||||
return {
|
return {
|
||||||
type: "LTDEXP",
|
type: "LTDEXP",
|
||||||
trainName: "しおかぜ",
|
trainName: "しおかぜ",
|
||||||
trainIcon: "http://www.trainfrontview.net/b/s8600.png",
|
trainIcon: "https://storage.haruk.in/s8600.png",
|
||||||
|
infoUrl:
|
||||||
|
"http://jr-shikoku.co.jp/01_trainbus/vehicle-info/shiokaze.html",
|
||||||
trainNumDistance: 0,
|
trainNumDistance: 0,
|
||||||
info: "いしづちと併結 / 8600系で運転",
|
info: "いしづちと併結 / 8600系で運転",
|
||||||
};
|
};
|
||||||
@ -86,7 +94,9 @@ export const customTrainDataDetector = (TrainNumber: string) => {
|
|||||||
return {
|
return {
|
||||||
type: "LTDEXP",
|
type: "LTDEXP",
|
||||||
trainName: "いしづち",
|
trainName: "いしづち",
|
||||||
trainIcon: "http://www.trainfrontview.net/b/s8000no.png",
|
trainIcon: "https://storage.haruk.in/s8000no.png",
|
||||||
|
infoUrl:
|
||||||
|
"http://jr-shikoku.co.jp/01_trainbus/vehicle-info/ishizuchi.html",
|
||||||
trainNumDistance: 1000,
|
trainNumDistance: 1000,
|
||||||
info: "しおかぜと併結 / 8000系で運転",
|
info: "しおかぜと併結 / 8000系で運転",
|
||||||
};
|
};
|
||||||
@ -99,7 +109,8 @@ export const customTrainDataDetector = (TrainNumber: string) => {
|
|||||||
return {
|
return {
|
||||||
type: "LTDEXP",
|
type: "LTDEXP",
|
||||||
trainName: "いしづち",
|
trainName: "いしづち",
|
||||||
trainIcon: "http://www.trainfrontview.net/f/s8000ap.png",
|
trainIcon: "https://storage.haruk.in/s8000ap.png",
|
||||||
|
infoUrl: "https://www.jr-eki.com/aptrain/naani/yosan/train.html",
|
||||||
trainNumDistance: 1000,
|
trainNumDistance: 1000,
|
||||||
info: "しおかぜと併結 / アンパンマン列車で運転",
|
info: "しおかぜと併結 / アンパンマン列車で運転",
|
||||||
};
|
};
|
||||||
@ -116,7 +127,9 @@ export const customTrainDataDetector = (TrainNumber: string) => {
|
|||||||
return {
|
return {
|
||||||
type: "LTDEXP",
|
type: "LTDEXP",
|
||||||
trainName: "いしづち",
|
trainName: "いしづち",
|
||||||
trainIcon: "http://www.trainfrontview.net/b/s8600_isz.png",
|
trainIcon: "https://storage.haruk.in/s8600_isz.png",
|
||||||
|
infoUrl:
|
||||||
|
"http://jr-shikoku.co.jp/01_trainbus/vehicle-info/ishizuchi.html",
|
||||||
trainNumDistance: 1000,
|
trainNumDistance: 1000,
|
||||||
info: "しおかぜと併結 / 8600系で運転",
|
info: "しおかぜと併結 / 8600系で運転",
|
||||||
};
|
};
|
||||||
@ -127,7 +140,9 @@ export const customTrainDataDetector = (TrainNumber: string) => {
|
|||||||
return {
|
return {
|
||||||
type: "LTDEXP",
|
type: "LTDEXP",
|
||||||
trainName: "モーニングEXP高松",
|
trainName: "モーニングEXP高松",
|
||||||
trainIcon: "http://www.trainfrontview.net/b/s8000no.png",
|
trainIcon: "https://storage.haruk.in/s8000nr.png",
|
||||||
|
infoUrl:
|
||||||
|
"http://jr-shikoku.co.jp/01_trainbus/vehicle-info/morning.html",
|
||||||
trainNumDistance: null,
|
trainNumDistance: null,
|
||||||
info: "8000系で運転",
|
info: "8000系で運転",
|
||||||
};
|
};
|
||||||
@ -136,7 +151,9 @@ export const customTrainDataDetector = (TrainNumber: string) => {
|
|||||||
return {
|
return {
|
||||||
type: "LTDEXP",
|
type: "LTDEXP",
|
||||||
trainName: "モーニングEXP松山",
|
trainName: "モーニングEXP松山",
|
||||||
trainIcon: "http://www.trainfrontview.net/b/s8600_isz.png",
|
trainIcon: "https://storage.haruk.in/s8600_isz.png",
|
||||||
|
infoUrl:
|
||||||
|
"http://jr-shikoku.co.jp/01_trainbus/vehicle-info/morning.html",
|
||||||
trainNumDistance: null,
|
trainNumDistance: null,
|
||||||
info: "8600系で運転",
|
info: "8600系で運転",
|
||||||
};
|
};
|
||||||
@ -147,7 +164,8 @@ export const customTrainDataDetector = (TrainNumber: string) => {
|
|||||||
return {
|
return {
|
||||||
type: "LTDEXP",
|
type: "LTDEXP",
|
||||||
trainName: "いしづち",
|
trainName: "いしづち",
|
||||||
trainIcon: "http://www.trainfrontview.net/f/s8000ap.png",
|
trainIcon: "https://storage.haruk.in/s8000ap.png",
|
||||||
|
infoUrl: "https://www.jr-eki.com/aptrain/naani/yosan/train.html",
|
||||||
trainNumDistance: 940,
|
trainNumDistance: 940,
|
||||||
info: "アンパンマン列車で運転",
|
info: "アンパンマン列車で運転",
|
||||||
};
|
};
|
||||||
@ -158,7 +176,9 @@ export const customTrainDataDetector = (TrainNumber: string) => {
|
|||||||
return {
|
return {
|
||||||
type: "LTDEXP",
|
type: "LTDEXP",
|
||||||
trainName: "いしづち",
|
trainName: "いしづち",
|
||||||
trainIcon: "http://www.trainfrontview.net/b/s8600_isz.png",
|
trainIcon: "https://storage.haruk.in/s8600_isz.png",
|
||||||
|
infoUrl:
|
||||||
|
"http://jr-shikoku.co.jp/01_trainbus/vehicle-info/ishizuchi.html",
|
||||||
trainNumDistance: 940,
|
trainNumDistance: 940,
|
||||||
info: "8600系で運転",
|
info: "8600系で運転",
|
||||||
};
|
};
|
||||||
@ -171,7 +191,8 @@ export const customTrainDataDetector = (TrainNumber: string) => {
|
|||||||
return {
|
return {
|
||||||
type: "LTDEXP",
|
type: "LTDEXP",
|
||||||
trainName: "南風",
|
trainName: "南風",
|
||||||
trainIcon: "http://www.trainfrontview.net/b/s2700.png",
|
trainIcon: "https://storage.haruk.in/s2700.png",
|
||||||
|
infoUrl: "http://jr-shikoku.co.jp/01_trainbus/vehicle-info/nanpu.html",
|
||||||
trainNumDistance: 30,
|
trainNumDistance: 30,
|
||||||
info: "しまんとと併結 / 2700系で運転",
|
info: "しまんとと併結 / 2700系で運転",
|
||||||
};
|
};
|
||||||
@ -180,7 +201,8 @@ export const customTrainDataDetector = (TrainNumber: string) => {
|
|||||||
return {
|
return {
|
||||||
type: "LTDEXP",
|
type: "LTDEXP",
|
||||||
trainName: "南風",
|
trainName: "南風",
|
||||||
trainIcon: "http://www.trainfrontview.net/b/s2700.png",
|
trainIcon: "https://storage.haruk.in/s2700.png",
|
||||||
|
infoUrl: "http://jr-shikoku.co.jp/01_trainbus/vehicle-info/nanpu.html",
|
||||||
trainNumDistance: 30,
|
trainNumDistance: 30,
|
||||||
info: "うずしおと併結 / 2700系で運転",
|
info: "うずしおと併結 / 2700系で運転",
|
||||||
};
|
};
|
||||||
@ -199,7 +221,8 @@ export const customTrainDataDetector = (TrainNumber: string) => {
|
|||||||
return {
|
return {
|
||||||
type: "LTDEXP",
|
type: "LTDEXP",
|
||||||
trainName: "南風",
|
trainName: "南風",
|
||||||
trainIcon: "http://www.trainfrontview.net/b/s2700.png",
|
trainIcon: "https://storage.haruk.in/s2700.png",
|
||||||
|
infoUrl: "http://jr-shikoku.co.jp/01_trainbus/vehicle-info/nanpu.html",
|
||||||
trainNumDistance: 30,
|
trainNumDistance: 30,
|
||||||
info: "2700系で運転",
|
info: "2700系で運転",
|
||||||
};
|
};
|
||||||
@ -210,22 +233,30 @@ export const customTrainDataDetector = (TrainNumber: string) => {
|
|||||||
return {
|
return {
|
||||||
type: "LTDEXP",
|
type: "LTDEXP",
|
||||||
trainName: "南風",
|
trainName: "南風",
|
||||||
trainIcon: "http://www.trainfrontview.net/f/s2700apr.png",
|
trainIcon: `https://n8n.haruk.in/webhook/dosan-anpanman-pictures.png?trainNum=${TrainNumber}&day=${dayjs().format(
|
||||||
|
"yyyy-MM-DD"
|
||||||
|
)}`,
|
||||||
|
infoUrl: "https://www.jr-eki.com/aptrain/naani/dosan/train.html",
|
||||||
trainNumDistance: 30,
|
trainNumDistance: 30,
|
||||||
info: "うずしおと連結 / アンパンマン列車で運転",
|
info: "うずしおと連結 / アンパンマン列車で運転",
|
||||||
};
|
};
|
||||||
case "32D":
|
case "32D":
|
||||||
|
case "36D":
|
||||||
case "44D":
|
case "44D":
|
||||||
case "48D":
|
case "48D":
|
||||||
case "56D":
|
case "56D":
|
||||||
case "33D":
|
case "33D":
|
||||||
|
case "37D":
|
||||||
case "45D":
|
case "45D":
|
||||||
case "49D":
|
case "49D":
|
||||||
case "57D":
|
case "57D":
|
||||||
return {
|
return {
|
||||||
type: "LTDEXP",
|
type: "LTDEXP",
|
||||||
trainName: "南風",
|
trainName: "南風",
|
||||||
trainIcon: "http://www.trainfrontview.net/f/s2700apr.png",
|
trainIcon: `https://n8n.haruk.in/webhook/dosan-anpanman-pictures.png?trainNum=${TrainNumber}&day=${dayjs().format(
|
||||||
|
"yyyy-MM-DD"
|
||||||
|
)}`,
|
||||||
|
infoUrl: "https://www.jr-eki.com/aptrain/naani/dosan/train.html",
|
||||||
trainNumDistance: 30,
|
trainNumDistance: 30,
|
||||||
info: "アンパンマン列車で運転",
|
info: "アンパンマン列車で運転",
|
||||||
};
|
};
|
||||||
@ -239,7 +270,9 @@ export const customTrainDataDetector = (TrainNumber: string) => {
|
|||||||
return {
|
return {
|
||||||
type: "LTDEXP",
|
type: "LTDEXP",
|
||||||
trainName: "うずしお",
|
trainName: "うずしお",
|
||||||
trainIcon: "http://www.trainfrontview.net/b/s2700_uzu.png",
|
trainIcon: "https://storage.haruk.in/s2700_uzu.png",
|
||||||
|
infoUrl:
|
||||||
|
"http://jr-shikoku.co.jp/01_trainbus/vehicle-info/uzushio.html",
|
||||||
trainNumDistance: 5000,
|
trainNumDistance: 5000,
|
||||||
info: "南風と併結 / 高松-宇多津間進行方向逆転 / 2700系で運転",
|
info: "南風と併結 / 高松-宇多津間進行方向逆転 / 2700系で運転",
|
||||||
};
|
};
|
||||||
@ -255,7 +288,9 @@ export const customTrainDataDetector = (TrainNumber: string) => {
|
|||||||
return {
|
return {
|
||||||
type: "LTDEXP",
|
type: "LTDEXP",
|
||||||
trainName: "うずしお",
|
trainName: "うずしお",
|
||||||
trainIcon: "http://www.trainfrontview.net/b/s2700_uzu.png",
|
trainIcon: "https://storage.haruk.in/s2700_uzu.png",
|
||||||
|
infoUrl:
|
||||||
|
"http://jr-shikoku.co.jp/01_trainbus/vehicle-info/uzushio.html",
|
||||||
trainNumDistance: 3000,
|
trainNumDistance: 3000,
|
||||||
info: "2700系で運転",
|
info: "2700系で運転",
|
||||||
};
|
};
|
||||||
@ -273,7 +308,9 @@ export const customTrainDataDetector = (TrainNumber: string) => {
|
|||||||
return {
|
return {
|
||||||
type: "LTDEXP",
|
type: "LTDEXP",
|
||||||
trainName: "うずしお",
|
trainName: "うずしお",
|
||||||
trainIcon: "http://www.trainfrontview.net/b/s2700_uzu.png",
|
trainIcon: "https://storage.haruk.in/s2700_uzu.png",
|
||||||
|
infoUrl:
|
||||||
|
"http://jr-shikoku.co.jp/01_trainbus/vehicle-info/uzushio.html",
|
||||||
trainNumDistance: 3000,
|
trainNumDistance: 3000,
|
||||||
info: "2700系で運転",
|
info: "2700系で運転",
|
||||||
};
|
};
|
||||||
@ -292,7 +329,9 @@ export const customTrainDataDetector = (TrainNumber: string) => {
|
|||||||
return {
|
return {
|
||||||
type: "LTDEXP",
|
type: "LTDEXP",
|
||||||
trainName: "うずしお",
|
trainName: "うずしお",
|
||||||
trainIcon: "http://www.trainfrontview.net/b/s2600.png",
|
trainIcon: "https://storage.haruk.in/s2600.png",
|
||||||
|
infoUrl:
|
||||||
|
"http://jr-shikoku.co.jp/01_trainbus/vehicle-info/uzushio.html",
|
||||||
trainNumDistance: 3000,
|
trainNumDistance: 3000,
|
||||||
info: "2600系で運転",
|
info: "2600系で運転",
|
||||||
};
|
};
|
||||||
@ -303,7 +342,9 @@ export const customTrainDataDetector = (TrainNumber: string) => {
|
|||||||
return {
|
return {
|
||||||
type: "LTDEXP",
|
type: "LTDEXP",
|
||||||
trainName: "うずしお",
|
trainName: "うずしお",
|
||||||
trainIcon: "http://www.trainfrontview.net/b/s185tu_uzu.png",
|
trainIcon: "https://storage.haruk.in/s185tu_uzu.png",
|
||||||
|
infoUrl:
|
||||||
|
"http://jr-shikoku.co.jp/01_trainbus/vehicle-info/uzushio.html",
|
||||||
trainNumDistance: 3000,
|
trainNumDistance: 3000,
|
||||||
info: "キハ185系で運転",
|
info: "キハ185系で運転",
|
||||||
};
|
};
|
||||||
@ -380,7 +421,8 @@ export const customTrainDataDetector = (TrainNumber: string) => {
|
|||||||
return {
|
return {
|
||||||
type: "Rapid",
|
type: "Rapid",
|
||||||
trainName: "マリンライナー",
|
trainName: "マリンライナー",
|
||||||
trainIcon: "http://www.trainfrontview.net/b/s5001.png",
|
trainIcon: "https://storage.haruk.in/s5001.png",
|
||||||
|
infoUrl: "http://jr-shikoku.co.jp/01_trainbus/vehicle-info/marine.html",
|
||||||
trainNumDistance: 3100,
|
trainNumDistance: 3100,
|
||||||
info: "",
|
info: "",
|
||||||
};
|
};
|
||||||
@ -392,7 +434,8 @@ export const customTrainDataDetector = (TrainNumber: string) => {
|
|||||||
return {
|
return {
|
||||||
type: "Rapid",
|
type: "Rapid",
|
||||||
trainName: "マリンライナー",
|
trainName: "マリンライナー",
|
||||||
trainIcon: "http://www.trainfrontview.net/b/s5001k.png",
|
trainIcon: "https://storage.haruk.in/s5001k.png",
|
||||||
|
infoUrl: "http://jr-shikoku.co.jp/01_trainbus/vehicle-info/marine.html",
|
||||||
trainNumDistance: 3100,
|
trainNumDistance: 3100,
|
||||||
info: "",
|
info: "",
|
||||||
};
|
};
|
||||||
@ -403,7 +446,9 @@ export const customTrainDataDetector = (TrainNumber: string) => {
|
|||||||
return {
|
return {
|
||||||
type: "NightLTDEXP",
|
type: "NightLTDEXP",
|
||||||
trainName: "サンライズ瀬戸",
|
trainName: "サンライズ瀬戸",
|
||||||
trainIcon: "http://www.trainfrontview.net/b/w285.png",
|
trainIcon: "https://storage.haruk.in/w285.png",
|
||||||
|
infoUrl:
|
||||||
|
"https://www.jr-odekake.net/train/sunriseseto_izumo/index.html",
|
||||||
trainNumDistance: null,
|
trainNumDistance: null,
|
||||||
info: "",
|
info: "",
|
||||||
};
|
};
|
||||||
@ -412,7 +457,9 @@ export const customTrainDataDetector = (TrainNumber: string) => {
|
|||||||
return {
|
return {
|
||||||
type: "NightLTDEXP",
|
type: "NightLTDEXP",
|
||||||
trainName: "サンライズ瀬戸",
|
trainName: "サンライズ瀬戸",
|
||||||
trainIcon: "http://www.trainfrontview.net/b/w285.png",
|
trainIcon: "https://storage.haruk.in/w285.png",
|
||||||
|
infoUrl:
|
||||||
|
"https://www.jr-odekake.net/train/sunriseseto_izumo/index.html",
|
||||||
trainNumDistance: null,
|
trainNumDistance: null,
|
||||||
info: "琴平延長運転日",
|
info: "琴平延長運転日",
|
||||||
};
|
};
|
||||||
@ -446,7 +493,8 @@ export const customTrainDataDetector = (TrainNumber: string) => {
|
|||||||
return {
|
return {
|
||||||
type: "LTDEXP",
|
type: "LTDEXP",
|
||||||
trainName: "宇和海",
|
trainName: "宇和海",
|
||||||
trainIcon: "http://www.trainfrontview.net/b/s2000_uwa.png",
|
trainIcon: "https://storage.haruk.in/s2000_uwa.png",
|
||||||
|
infoUrl: "http://jr-shikoku.co.jp/01_trainbus/vehicle-info/uwakai.html",
|
||||||
trainNumDistance: 1050,
|
trainNumDistance: 1050,
|
||||||
info: "2000系で運転",
|
info: "2000系で運転",
|
||||||
};
|
};
|
||||||
@ -462,7 +510,8 @@ export const customTrainDataDetector = (TrainNumber: string) => {
|
|||||||
return {
|
return {
|
||||||
type: "LTDEXP",
|
type: "LTDEXP",
|
||||||
trainName: "宇和海",
|
trainName: "宇和海",
|
||||||
trainIcon: "http://www.trainfrontview.net/f/s2002a.png",
|
trainIcon: "https://storage.haruk.in/s2002a.png",
|
||||||
|
infoUrl: "https://www.jr-eki.com/aptrain/naani/yosan/train.html",
|
||||||
trainNumDistance: 1050,
|
trainNumDistance: 1050,
|
||||||
info: "アンパン列車で運転",
|
info: "アンパン列車で運転",
|
||||||
};
|
};
|
||||||
@ -474,7 +523,9 @@ export const customTrainDataDetector = (TrainNumber: string) => {
|
|||||||
return {
|
return {
|
||||||
type: "LTDEXP",
|
type: "LTDEXP",
|
||||||
trainName: "しまんと",
|
trainName: "しまんと",
|
||||||
trainIcon: "http://www.trainfrontview.net/b/s2700_smn.png",
|
trainIcon: "https://storage.haruk.in/s2700_smn.png",
|
||||||
|
infoUrl:
|
||||||
|
"http://jr-shikoku.co.jp/01_trainbus/vehicle-info/shimanto.html",
|
||||||
trainNumDistance: 2000,
|
trainNumDistance: 2000,
|
||||||
info: "2700系で運転",
|
info: "2700系で運転",
|
||||||
};
|
};
|
||||||
@ -485,7 +536,9 @@ export const customTrainDataDetector = (TrainNumber: string) => {
|
|||||||
return {
|
return {
|
||||||
type: "LTDEXP",
|
type: "LTDEXP",
|
||||||
trainName: "しまんと",
|
trainName: "しまんと",
|
||||||
trainIcon: "http://www.trainfrontview.net/b/s2700_smn.png",
|
trainIcon: "https://storage.haruk.in/s2000_smn.png",
|
||||||
|
infoUrl:
|
||||||
|
"http://jr-shikoku.co.jp/01_trainbus/vehicle-info/shimanto.html",
|
||||||
trainNumDistance: 2000,
|
trainNumDistance: 2000,
|
||||||
info: "南風と併結 / 2700系で運転",
|
info: "南風と併結 / 2700系で運転",
|
||||||
};
|
};
|
||||||
@ -502,7 +555,9 @@ export const customTrainDataDetector = (TrainNumber: string) => {
|
|||||||
return {
|
return {
|
||||||
type: "LTDEXP",
|
type: "LTDEXP",
|
||||||
trainName: "あしずり",
|
trainName: "あしずり",
|
||||||
trainIcon: "http://www.trainfrontview.net/b/s2000_asi.png",
|
trainIcon: "https://storage.haruk.in/s2000_asi.png",
|
||||||
|
infoUrl:
|
||||||
|
"http://jr-shikoku.co.jp/01_trainbus/vehicle-info/ashizuri.html",
|
||||||
trainNumDistance: 2070,
|
trainNumDistance: 2070,
|
||||||
info: "2000系で運転",
|
info: "2000系で運転",
|
||||||
};
|
};
|
||||||
@ -518,7 +573,9 @@ export const customTrainDataDetector = (TrainNumber: string) => {
|
|||||||
return {
|
return {
|
||||||
type: "LTDEXP",
|
type: "LTDEXP",
|
||||||
trainName: "あしずり",
|
trainName: "あしずり",
|
||||||
trainIcon: "http://www.trainfrontview.net/b/s2700_asi.png",
|
trainIcon: "https://storage.haruk.in/s2700_asi.png",
|
||||||
|
infoUrl:
|
||||||
|
"http://jr-shikoku.co.jp/01_trainbus/vehicle-info/ashizuri.html",
|
||||||
trainNumDistance: 2070,
|
trainNumDistance: 2070,
|
||||||
info: "2700系で運転",
|
info: "2700系で運転",
|
||||||
};
|
};
|
||||||
@ -538,7 +595,9 @@ export const customTrainDataDetector = (TrainNumber: string) => {
|
|||||||
return {
|
return {
|
||||||
type: "LTDEXP",
|
type: "LTDEXP",
|
||||||
trainName: "剣山",
|
trainName: "剣山",
|
||||||
trainIcon: "http://www.trainfrontview.net/b/s185tu.png",
|
trainIcon: "https://storage.haruk.in/s185tu.png",
|
||||||
|
infoUrl:
|
||||||
|
"http://jr-shikoku.co.jp/01_trainbus/vehicle-info/tsurugisan.html",
|
||||||
trainNumDistance: 4000,
|
trainNumDistance: 4000,
|
||||||
info: "キハ185系で運転",
|
info: "キハ185系で運転",
|
||||||
};
|
};
|
||||||
@ -549,7 +608,8 @@ export const customTrainDataDetector = (TrainNumber: string) => {
|
|||||||
return {
|
return {
|
||||||
type: "LTDEXP",
|
type: "LTDEXP",
|
||||||
trainName: "むろと",
|
trainName: "むろと",
|
||||||
trainIcon: "http://www.trainfrontview.net/b/s185_mrt.png",
|
trainIcon: "https://storage.haruk.in/s185_mrt.png",
|
||||||
|
infoUrl: "http://jr-shikoku.co.jp/01_trainbus/vehicle-info/muroto.html",
|
||||||
trainNumDistance: 5050,
|
trainNumDistance: 5050,
|
||||||
info: "キハ185系で運転",
|
info: "キハ185系で運転",
|
||||||
};
|
};
|
||||||
@ -560,7 +620,9 @@ export const customTrainDataDetector = (TrainNumber: string) => {
|
|||||||
return {
|
return {
|
||||||
type: "LTDEXP",
|
type: "LTDEXP",
|
||||||
trainName: "よしのがわトロッコ",
|
trainName: "よしのがわトロッコ",
|
||||||
trainIcon: "http://www.trainfrontview.net/f/s185to_ai.png",
|
trainIcon: "https://storage.haruk.in/s185to_ai.png",
|
||||||
|
infoUrl:
|
||||||
|
"http://jr-shikoku.co.jp/01_trainbus/event_train/yoshino_torokko.html",
|
||||||
trainNumDistance: null,
|
trainNumDistance: null,
|
||||||
info: "",
|
info: "",
|
||||||
};
|
};
|
||||||
@ -574,7 +636,9 @@ export const customTrainDataDetector = (TrainNumber: string) => {
|
|||||||
return {
|
return {
|
||||||
type: "LTDEXP",
|
type: "LTDEXP",
|
||||||
trainName: "アンパンマントロッコ",
|
trainName: "アンパンマントロッコ",
|
||||||
trainIcon: "http://www.trainfrontview.net/f/s32to4.png",
|
trainIcon: "https://storage.haruk.in/s32to4.png",
|
||||||
|
infoUrl:
|
||||||
|
"https://www.jr-eki.com/aptrain/naani/torokko_seto/jikoku.html",
|
||||||
trainNumDistance: null,
|
trainNumDistance: null,
|
||||||
info: "",
|
info: "",
|
||||||
};
|
};
|
||||||
@ -582,12 +646,21 @@ export const customTrainDataDetector = (TrainNumber: string) => {
|
|||||||
//伊予灘ものがたり
|
//伊予灘ものがたり
|
||||||
case "8091D":
|
case "8091D":
|
||||||
case "8093D":
|
case "8093D":
|
||||||
|
return {
|
||||||
|
type: "LTDEXP",
|
||||||
|
trainName: "伊予灘ものがたり",
|
||||||
|
trainIcon: "https://storage.haruk.in/s185iyor.png",
|
||||||
|
infoUrl: "https://iyonadamonogatari.com/",
|
||||||
|
trainNumDistance: null,
|
||||||
|
info: "",
|
||||||
|
};
|
||||||
case "8092D":
|
case "8092D":
|
||||||
case "8094D":
|
case "8094D":
|
||||||
return {
|
return {
|
||||||
type: "LTDEXP",
|
type: "LTDEXP",
|
||||||
trainName: "伊予灘ものがたり",
|
trainName: "伊予灘ものがたり",
|
||||||
trainIcon: "http://www.trainfrontview.net/b/s185iyoy.png",
|
trainIcon: "https://storage.haruk.in/s185iyoy.png",
|
||||||
|
infoUrl: "https://iyonadamonogatari.com/",
|
||||||
trainNumDistance: null,
|
trainNumDistance: null,
|
||||||
info: "",
|
info: "",
|
||||||
};
|
};
|
||||||
@ -598,7 +671,8 @@ export const customTrainDataDetector = (TrainNumber: string) => {
|
|||||||
return {
|
return {
|
||||||
type: "LTDEXP",
|
type: "LTDEXP",
|
||||||
trainName: "四国まんなか千年ものがたり",
|
trainName: "四国まんなか千年ものがたり",
|
||||||
trainIcon: "http://www.trainfrontview.net/b/s185mm1.png",
|
trainIcon: "https://storage.haruk.in/s185mm1.png",
|
||||||
|
infoUrl: "https://www.jr-shikoku.co.jp/sennenmonogatari/",
|
||||||
trainNumDistance: null,
|
trainNumDistance: null,
|
||||||
info: "",
|
info: "",
|
||||||
};
|
};
|
||||||
@ -611,16 +685,32 @@ export const customTrainDataDetector = (TrainNumber: string) => {
|
|||||||
return {
|
return {
|
||||||
type: "LTDEXP",
|
type: "LTDEXP",
|
||||||
trainName: "時代の夜明けのものがたり",
|
trainName: "時代の夜明けのものがたり",
|
||||||
trainIcon: "http://www.trainfrontview.net/b/s185ym1.png",
|
trainIcon: "https://storage.haruk.in/s185ym1.png",
|
||||||
|
infoUrl: "https://www.jr-shikoku.co.jp/yoakenomonogatari/index.html",
|
||||||
trainNumDistance: null,
|
trainNumDistance: null,
|
||||||
info: "",
|
info: "",
|
||||||
};
|
};
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
if (
|
||||||
|
new RegExp(/^4[1-9]\d\d[DM]$/).test(TrainNumber) ||
|
||||||
|
new RegExp(/^5[1-7]\d\d[DM]$/).test(TrainNumber) ||
|
||||||
|
TrainNumber === "3621D"
|
||||||
|
)
|
||||||
|
return {
|
||||||
|
type: "OneMan",
|
||||||
|
trainName: "",
|
||||||
|
trainIcon: null,
|
||||||
|
infoUrl: null,
|
||||||
|
trainNumDistance: null,
|
||||||
|
info: null,
|
||||||
|
};
|
||||||
|
else
|
||||||
return {
|
return {
|
||||||
type: "Normal",
|
type: "Normal",
|
||||||
trainName: "",
|
trainName: "",
|
||||||
trainIcon: null,
|
trainIcon: null,
|
||||||
|
infoUrl: null,
|
||||||
trainNumDistance: null,
|
trainNumDistance: null,
|
||||||
info: null,
|
info: null,
|
||||||
};
|
};
|
||||||
|
@ -73,7 +73,9 @@ export const EachData: FC<Props> = (props) => {
|
|||||||
|
|
||||||
const getTrainDataFromCurrentTrain = (trainNum: string) => {
|
const getTrainDataFromCurrentTrain = (trainNum: string) => {
|
||||||
const customTrainData = customTrainDataDetector(d.train);
|
const customTrainData = customTrainDataDetector(d.train);
|
||||||
if (customTrainData.type != "Normal") return customTrainData;
|
switch (customTrainData.type) {
|
||||||
|
case "Normal":
|
||||||
|
case "OneMan":
|
||||||
const currentTrainData = currentTrain.filter((a) => a.num == trainNum);
|
const currentTrainData = currentTrain.filter((a) => a.num == trainNum);
|
||||||
if (currentTrainData.length == 0) return customTrainData;
|
if (currentTrainData.length == 0) return customTrainData;
|
||||||
else if (currentTrainData[0].Type.includes("rapid:")) {
|
else if (currentTrainData[0].Type.includes("rapid:")) {
|
||||||
@ -88,8 +90,10 @@ export const EachData: FC<Props> = (props) => {
|
|||||||
return returnData;
|
return returnData;
|
||||||
}
|
}
|
||||||
return customTrainData;
|
return customTrainData;
|
||||||
|
default:
|
||||||
|
return customTrainData;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const [train, setTrain] = useState(getTrainDataFromCurrentTrain(d.train));
|
const [train, setTrain] = useState(getTrainDataFromCurrentTrain(d.train));
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setTrain(getTrainDataFromCurrentTrain(d.train));
|
setTrain(getTrainDataFromCurrentTrain(d.train));
|
||||||
|
6
howto.js
6
howto.js
@ -2,11 +2,17 @@ import React from "react";
|
|||||||
import { View } from "react-native";
|
import { View } from "react-native";
|
||||||
import { WebView } from "react-native-webview";
|
import { WebView } from "react-native-webview";
|
||||||
import { BigButton } from "./components/atom/BigButton";
|
import { BigButton } from "./components/atom/BigButton";
|
||||||
|
import { useNavigation } from "@react-navigation/native";
|
||||||
export default ({ navigation: { navigate }, route }) => {
|
export default ({ navigation: { navigate }, route }) => {
|
||||||
const { info, goTo, useShow } = route.params;
|
const { info, goTo, useShow } = route.params;
|
||||||
|
const { goBack } = useNavigation();
|
||||||
const onExit = () => {
|
const onExit = () => {
|
||||||
|
if(goTo != "NearTrainDiagramView") {
|
||||||
navigate(goTo || "Apps");
|
navigate(goTo || "Apps");
|
||||||
useShow && useShow();
|
useShow && useShow();
|
||||||
|
} else {
|
||||||
|
goBack();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
return (
|
return (
|
||||||
<View style={styles}>
|
<View style={styles}>
|
||||||
|
@ -12,6 +12,7 @@ type trainTypeString =
|
|||||||
| "寝台特急"
|
| "寝台特急"
|
||||||
| "臨時"
|
| "臨時"
|
||||||
| "普通列車"
|
| "普通列車"
|
||||||
|
| "普通列車(ワンマン)"
|
||||||
| "その他";
|
| "その他";
|
||||||
type trainTypeDataString = "rapid" | "express" | "normal";
|
type trainTypeDataString = "rapid" | "express" | "normal";
|
||||||
type getTrainType = (d: nameString) => {
|
type getTrainType = (d: nameString) => {
|
||||||
@ -29,6 +30,8 @@ export const getTrainType: getTrainType = (nameString) => {
|
|||||||
return { color: "red", name: "寝台特急", data: "express" };
|
return { color: "red", name: "寝台特急", data: "express" };
|
||||||
case "SPCL":
|
case "SPCL":
|
||||||
return { color: "blue", name: "臨時", data: "normal" };
|
return { color: "blue", name: "臨時", data: "normal" };
|
||||||
|
case "OneMan":
|
||||||
|
return { color: "white", name: "普通列車(ワンマン)", data: "normal" };
|
||||||
case "Normal":
|
case "Normal":
|
||||||
return { color: "white", name: "普通列車", data: "normal" };
|
return { color: "white", name: "普通列車", data: "normal" };
|
||||||
default:
|
default:
|
||||||
|
Loading…
Reference in New Issue
Block a user