diff --git a/components/ActionSheetComponents/EachTrainInfoCore.js b/components/ActionSheetComponents/EachTrainInfoCore.js index f5ab02c..baae4cf 100644 --- a/components/ActionSheetComponents/EachTrainInfoCore.js +++ b/components/ActionSheetComponents/EachTrainInfoCore.js @@ -180,6 +180,7 @@ export const EachTrainInfoCore = ({ if (!points) return () => {}; if (points.length == 0) return () => {}; const position = points.findIndex((d) => d == true); + let isThrew = false; if (position == -1) return () => {}; if (trainDataWidhThrough[position].split(",")[1] == "通過") { LayoutAnimation.configureNext({ @@ -187,14 +188,18 @@ export const EachTrainInfoCore = ({ update: { type: "easeInEaseOut", springDamping: 0.6 }, }); setShowThrew(true); + isThrew = true; + } + if (position < 5) { + } // 5駅以内の場合はスクロールしない + else { + const count = position * 44 - 50; + // 0.5秒待機してからスクロール + setTimeout( + () => ScrollViewRef.current?.scrollTo({ y: count, animated: true }), + 400 + ); } - if(position < 5) return() => {}; // 5駅以内の場合はスクロールしない - const count = position * 44-50; - // 0.5秒待機してからスクロール - setTimeout( - () => ScrollViewRef.current?.scrollTo({ y: count, animated: true }), - 400 - ); setIsJumped(true); }, [points]); const trainName = useMemo(() => { diff --git a/components/発車時刻表/EachData.tsx b/components/発車時刻表/EachData.tsx index 22dd788..275358e 100644 --- a/components/発車時刻表/EachData.tsx +++ b/components/発車時刻表/EachData.tsx @@ -102,14 +102,18 @@ export const EachData: FC = (props) => { }; const [platformNumber, setPlatformNumber] = useState(); + const [platformDescription, setPlatformDescription] = useState(); 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) - ); + .then((data) => { + setPlatformNumber(data?.type == "Station" ? data?.platform : undefined); + setPlatformDescription( + data?.type == "Station" ? data?.description : undefined + ); + }); }, [currentTrainData, currentTrain]); return ( @@ -141,9 +145,11 @@ export const EachData: FC = (props) => { { Linking.openURL( "https://nexcloud.haruk.in/apps/forms/s/TEkBQW5WLcYjLyAzGxncQLtw" diff --git a/lib/webViewInjectjavascript.ts b/lib/webViewInjectjavascript.ts index b9dd1d0..ed18176 100644 --- a/lib/webViewInjectjavascript.ts +++ b/lib/webViewInjectjavascript.ts @@ -770,6 +770,7 @@ export const injectJavascriptData: InjectJavascriptData = ( case "5210M": case "5108M": case "110M": + case "112M": case "118M": case "5218M": case "5120M": @@ -817,7 +818,6 @@ export const injectJavascriptData: InjectJavascriptData = ( setStationIcon(element.querySelector("img"),'https://storage.haruk.in/s7200.png'); break; // 上り7000系 - case "112M": case "114M": case "122M": case "4138M": @@ -847,6 +847,10 @@ export const injectJavascriptData: InjectJavascriptData = ( : ``; const normal_train_name = ` + if(列車名データ.match("サンポート")){ + const textBase = 列車名データ.split(":")[1]; + 行き先情報.innerText = textBase+行き先情報.innerText; + } if(new RegExp(/^4[1-9]\\d\\d[DM]$/).test(列番データ) || new RegExp(/^5[1-7]\\d\\d[DM]$/).test(列番データ) || 列番データ ==="3621D"){ 行き先情報.innerText = "ワンマン\\n"+行き先情報.innerText; flag=true; @@ -954,6 +958,7 @@ const setStrings = () =>{ } var 行き先情報 = element.getElementsByTagName("p")[0]; var 列番データ = element.getAttribute('offclick').split('"')[1]; + var 列車名データ = element.getAttribute('offclick').split('"')[3]; var flag=false; var TrainType = undefined; setTrainMenuDialog(element)