From 6fbe47f527cbd181cc8a7633d06397c99664e610 Mon Sep 17 00:00:00 2001 From: harukin-expo-dev-env Date: Thu, 21 Aug 2025 16:26:44 +0000 Subject: [PATCH 01/17] =?UTF-8?q?=E9=95=B7=E6=8A=BC=E3=81=97=E3=81=99?= =?UTF-8?q?=E3=82=8B=E4=BD=8D=E7=BD=AE=E3=82=92=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EachTrainInfo/TrainDataView.tsx | 14 ++++++---- .../EachTrainInfoCore/HeaderText.tsx | 28 +++++++++++-------- 2 files changed, 25 insertions(+), 17 deletions(-) diff --git a/components/ActionSheetComponents/EachTrainInfo/TrainDataView.tsx b/components/ActionSheetComponents/EachTrainInfo/TrainDataView.tsx index 7d605de..739ed3f 100644 --- a/components/ActionSheetComponents/EachTrainInfo/TrainDataView.tsx +++ b/components/ActionSheetComponents/EachTrainInfo/TrainDataView.tsx @@ -78,11 +78,15 @@ export const TrainDataView = ({ const [trainNumber, setTrainNumber] = useState(currentTrainData?.num); useEffect(() => { - const { - TrainNumberOverride, - } = customTrainDataDetector(currentTrainData?.num, allCustomTrainData); - if (!TrainNumberOverride) return; - setTrainNumber(TrainNumberOverride); + const { TrainNumberOverride } = customTrainDataDetector( + currentTrainData?.num, + allCustomTrainData + ); + if (TrainNumberOverride) { + setTrainNumber(TrainNumberOverride); + }else{ + setTrainNumber(currentTrainData?.num); + } }, [currentTrainData?.num, allCustomTrainData]); // 投稿システム関係 // Dialog表示関係 diff --git a/components/ActionSheetComponents/EachTrainInfoCore/HeaderText.tsx b/components/ActionSheetComponents/EachTrainInfoCore/HeaderText.tsx index 7b3a0db..1edccd8 100644 --- a/components/ActionSheetComponents/EachTrainInfoCore/HeaderText.tsx +++ b/components/ActionSheetComponents/EachTrainInfoCore/HeaderText.tsx @@ -134,12 +134,6 @@ export const HeaderText: FC = ({ { - if (!updatePermission) return; - const uri = `https://jr-shikoku-data-post-system.pages.dev?trainNum=${trainNum}&token=${expoPushToken}`; - navigate("generalWebView", { uri, useExitButton: false }); - SheetManager.hide("EachTrainInfo"); - }} onPress={() => { if (!trainInfoUrl) return; const uri = trainInfoUrl.includes("pdf") @@ -148,7 +142,7 @@ export const HeaderText: FC = ({ navigate("generalWebView", { uri, useExitButton: true }); SheetManager.hide("EachTrainInfo"); }} - disabled={!(!!updatePermission || !!trainInfoUrl)} + disabled={!trainInfoUrl} > = ({ )} - - {showHeadStation.map((d) => `${headStation[d].id} + `)} - {trainNum} - {showTailStation.map((d) => ` + ${tailStation[d].id}`)} - + { + if (!updatePermission) return; + const uri = `https://jr-shikoku-data-post-system.pages.dev?trainNum=${trainNum}&token=${expoPushToken}`; + navigate("generalWebView", { uri, useExitButton: false }); + SheetManager.hide("EachTrainInfo"); + }} + disabled={!updatePermission} + > + + {showHeadStation.map((d) => `${headStation[d].id} + `)} + {trainNum} + {showTailStation.map((d) => ` + ${tailStation[d].id}`)} + + From ed6dc3809e771b5ce49d92de7e70499ca2ed4844 Mon Sep 17 00:00:00 2001 From: harukin-expo-dev-env Date: Thu, 21 Aug 2025 17:06:43 +0000 Subject: [PATCH 02/17] =?UTF-8?q?Party=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/getStringConfig.ts | 3 +++ lib/getTrainType.ts | 5 ++++- lib/webViewInjectjavascript.ts | 7 +++++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/lib/getStringConfig.ts b/lib/getStringConfig.ts index 5295f04..327c533 100644 --- a/lib/getStringConfig.ts +++ b/lib/getStringConfig.ts @@ -9,6 +9,7 @@ type typeID = | "SPCL_Normal" | "SPCL_Rapid" | "SPCL_EXP" + | "Party" | "Freight" | "Forwarding" | "FreightForwarding" @@ -36,6 +37,8 @@ export const getStringConfig: types = (type, id) => { return ["臨時快速", true, false]; case "SPCL_EXP": return ["臨時特急", true, false]; + case "Party": + return ["団体臨時", true, false]; case "Freight": return ["貨物", false, false]; case "Forwarding": diff --git a/lib/getTrainType.ts b/lib/getTrainType.ts index a0a76b6..6c2d3e6 100644 --- a/lib/getTrainType.ts +++ b/lib/getTrainType.ts @@ -5,7 +5,7 @@ type nameString = | "SPCL" | "Normal" | string; -type colorString = "aqua" | "red" | "#297bff" | "white" | "pink"; +type colorString = "aqua" | "red" | "#297bff" | "#ff7300ff" | "white" | "pink"; type trainTypeString = | "快速" | "特急" @@ -15,6 +15,7 @@ type trainTypeString = | "普通列車(ワンマン)" | "臨時快速" | "臨時特急" + | "団体臨時" | "その他"; type trainTypeDataString = "rapid" | "express" | "normal"; type getTrainType = (d: nameString) => { @@ -42,6 +43,8 @@ export const getTrainType: getTrainType = (nameString) => { return { color: "#297bff", name: "臨時快速", data: "normal" }; case "SPCL_EXP": return { color: "#297bff", name: "臨時特急", data: "normal" }; + case "Party": + return { color: "#ff7300ff", name: "団体臨時", data: "normal" }; default: return { color: "white", name: "その他", data: "normal" }; } diff --git a/lib/webViewInjectjavascript.ts b/lib/webViewInjectjavascript.ts index c629bb1..6c4c188 100644 --- a/lib/webViewInjectjavascript.ts +++ b/lib/webViewInjectjavascript.ts @@ -921,6 +921,10 @@ export const injectJavascriptData: InjectJavascriptData = ( trainTypeColor = "#a52e2eff"; isWanman = false; return "臨時特急"; + case "Party": + trainTypeColor = "#ff7300ff"; + isWanman = false; + return "団体臨時"; case "Freight": trainTypeColor = "#00869ecc"; isWanman = false; @@ -1050,6 +1054,9 @@ const setNewTrainItem = (element,hasProblem,type)=>{ case "SPCL_EXP": element.style.borderColor = "#a52e2eff"; break; + case "Party": + element.style.borderColor = "#ff7300ff"; + break; case "Freight": element.style.borderColor = "#00869ecc"; break; From 7814037d2a9eedacab8c6558e599e46f0eeccf96 Mon Sep 17 00:00:00 2001 From: harukin-expo-dev-env Date: Thu, 21 Aug 2025 18:59:22 +0000 Subject: [PATCH 03/17] =?UTF-8?q?party=E3=81=AEbackgoundColor=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/webViewInjectjavascript.ts | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/lib/webViewInjectjavascript.ts b/lib/webViewInjectjavascript.ts index 6c4c188..44f10eb 100644 --- a/lib/webViewInjectjavascript.ts +++ b/lib/webViewInjectjavascript.ts @@ -1007,7 +1007,7 @@ export const injectJavascriptData: InjectJavascriptData = ( const gradient = getColors.length > 1 ? "linear-gradient(130deg, " + getColors[0] + " 0%, "+ getColors[0]+"50%, "+ getColors[1]+"50%, " + getColors[1] + " 100%)" : getColors[0]; - 行き先情報.insertAdjacentHTML('beforebegin', "
"+( isEdit ? "
" : isSeason ? "
" : "")+"

" + (TrainNumberOverride ? TrainNumberOverride : TrainNumber) + "

" + (isWanman ? "ワンマン " : "") + "

" + viaData + "

" + trainName + "

" + (ToData ? ToData + "行" : ToData) + "

" + trainType + "

" + (hasProblem ? "‼️停止中‼️" : "") + "

"); + 行き先情報.insertAdjacentHTML('beforebegin', "
" + ( isEdit ? "
" : isSeason ? "
" : "") + "

" + (TrainNumberOverride ? TrainNumberOverride : TrainNumber) + "

" + (isWanman ? "ワンマン " : "") + "

" + viaData + "

" + trainName + "

" + (ToData ? ToData + "行" : ToData) + "

" + trainType + "

" + (hasProblem ? "‼️停止中‼️" : "") + "

"); `: ` 行き先情報.insertAdjacentHTML('beforebegin', "

" + returnText1 + "

"); 行き先情報.insertAdjacentHTML('beforebegin', "

" + (ToData ? ToData + "行 " : ToData) + "

" + (TrainNumberOverride ? TrainNumberOverride : TrainNumber) + "

"); @@ -1023,6 +1023,20 @@ export const injectJavascriptData: InjectJavascriptData = ( const setNewTrainItem = (element,hasProblem,type)=>{ var 列番データ = element.getAttribute('offclick').split('"')[1]; const JRFTemp = getJRF(列番データ); + switch(true){ + case 列番データ.indexOf("H") != -1: + case 列番データ.indexOf("R") != -1: + case 列番データ.indexOf("E") != -1: + case 列番データ.indexOf("A") != -1: + case 列番データ.indexOf("B") != -1: + case 列番データ.indexOf("T") != -1: + case !!JRFTemp: + element.style.backgroundColor = '#c7c7c7cc'; + break; + default: + element.style.backgroundColor = '#ffffffcc'; + break; + } if(trainDataList.find(e => e.id === 列番データ) !== undefined){ const data = trainDataList.find(e => e.id === 列番データ); switch (data.type) { @@ -1056,6 +1070,7 @@ const setNewTrainItem = (element,hasProblem,type)=>{ break; case "Party": element.style.borderColor = "#ff7300ff"; + element.style.backgroundColor = '#ffd0a9ff'; break; case "Freight": element.style.borderColor = "#00869ecc"; @@ -1084,19 +1099,6 @@ const setNewTrainItem = (element,hasProblem,type)=>{ element.style.borderWidth = '2px'; element.style.borderStyle = 'solid'; element.style.borderRadius = '10%'; - switch(true){ - case 列番データ.indexOf("H") != -1: - case 列番データ.indexOf("R") != -1: - case 列番データ.indexOf("E") != -1: - case 列番データ.indexOf("A") != -1: - case 列番データ.indexOf("B") != -1: - case !!JRFTemp: - element.style.backgroundColor = 'rgba(199, 199, 199, 0.8)'; - break; - default: - element.style.backgroundColor = 'rgba(255, 255, 255, 0.8)'; - break; - } if(hasProblem){ element.style.boxShadow = '0 0 10px rgba(255, 0, 0, 0.9)'; }else{ From 46cff473e670b95bb836e8ac70a4b46c8bfc2587 Mon Sep 17 00:00:00 2001 From: harukin-expo-dev-env Date: Fri, 22 Aug 2025 11:36:31 +0000 Subject: [PATCH 04/17] =?UTF-8?q?JRF=E3=81=AE=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/webViewInjectjavascript.ts | 228 ++++++++++++--------------------- 1 file changed, 85 insertions(+), 143 deletions(-) diff --git a/lib/webViewInjectjavascript.ts b/lib/webViewInjectjavascript.ts index 44f10eb..c38f321 100644 --- a/lib/webViewInjectjavascript.ts +++ b/lib/webViewInjectjavascript.ts @@ -634,39 +634,6 @@ export const injectJavascriptData: InjectJavascriptData = ( `; const normal_train_name = ` - const getJRF = num =>{ - 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 undefined; - } - } const nameReplace = (列車名データ,列番データ,行き先情報,hasProblem,isLeft) =>{ let isWanman = false; let trainName = ""; @@ -724,15 +691,6 @@ export const injectJavascriptData: InjectJavascriptData = ( trainName = "臨時列車"; } - - let JRF = true; - const JRFTemp = getJRF(列番データ); - - if(JRFTemp){ - trainName = JRFTemp; - JRF = false; - } - const getThrew = num =>{ switch(num){ @@ -833,30 +791,6 @@ export const injectJavascriptData: InjectJavascriptData = ( viaData = "ごめん・なはり線[快速]"; ToData = "(後免にて解結)\\n土佐山田/奈半利"; break; - case "9395D": - viaData = "[臨時]普通"; - ToData = "三本松"; - break; - case "9174M": - viaData = "[臨時]マリンライナー94号"; - ToData = "岡山"; - break; - case "9662D": - viaData = "[臨時]れんげ号"; - ToData = "八幡浜"; - break; - case "9665D": - viaData = "[臨時]れんげ号"; - ToData = "宇和島"; - break; - case "9664D": - viaData = "[臨時]わらぐろ号"; - ToData = "八幡浜"; - break; - case "9663D": - viaData = "[臨時]わらぐろ号"; - ToData = "卯之町"; - break; default: if(new RegExp(/^58[1-3][1,3,5,7,9][DM]$/).test(列番データ)){ viaData = "ごめん・なはり線[快速]"; @@ -882,65 +816,77 @@ export const injectJavascriptData: InjectJavascriptData = ( if(trainDataList.find(e => e.id === 列番データ) !== undefined){ const data = trainDataList.find(e => e.id === 列番データ); //{id,trainName,viaData,ToData,TrainNumber,TrainNumberOverride,type,infoUrl,trainNumDistance,info,infogram,isEdit} - trainType = (()=>{ - switch(data.type){ - case "Normal": - trainTypeColor = "black"; - isWanman = false; - return "普通"; - case "OneMan": - trainTypeColor = "black"; - isWanman = true; - return "普通"; - case "Rapid": - trainTypeColor = "rgba(0, 140, 255, 1)"; - isWanman = false; - return "快速"; - case "OneManRapid": - trainTypeColor = "rgba(0, 140, 255, 1)"; - isWanman = true; - return "快速"; - case "LTDEXP": - trainTypeColor = "red"; - isWanman = false; - return "特急"; - case "NightLTDEXP": - trainTypeColor = "#d300b0ff"; - isWanman = false; - return "寝台特急"; - case "SPCL": - case "SPCL_Normal": - trainTypeColor = "#008d07ff"; - isWanman = false; - return "臨時"; - case "SPCL_Rapid": - trainTypeColor = "rgba(0, 81, 255, 1)"; - isWanman = false; - return "臨時快速"; - case "SPCL_EXP": - trainTypeColor = "#a52e2eff"; - isWanman = false; - return "臨時特急"; - case "Party": - trainTypeColor = "#ff7300ff"; - isWanman = false; - return "団体臨時"; - case "Freight": - trainTypeColor = "#00869ecc"; - isWanman = false; - return "貨物"; - case "Forwarding": - trainTypeColor = "#727272cc"; - isWanman = false; - return "回送"; - case "FreightForwarding": - trainTypeColor = "#727272cc"; - isWanman = false; - return "単機回送"; - default: - return ""; - } - })(); + + switch(data.type){ + case "Normal": + trainTypeColor = "black"; + isWanman = false; + trainType = "普通"; + break; + case "OneMan": + trainTypeColor = "black"; + isWanman = true; + trainType = "普通"; + break; + case "Rapid": + trainTypeColor = "rgba(0, 140, 255, 1)"; + isWanman = false; + trainType = "快速"; + break; + case "OneManRapid": + trainTypeColor = "rgba(0, 140, 255, 1)"; + isWanman = true; + trainType = "快速"; + break; + case "LTDEXP": + trainTypeColor = "red"; + isWanman = false; + trainType = "特急"; + break; + case "NightLTDEXP": + trainTypeColor = "#d300b0ff"; + isWanman = false; + trainType = "寝台特急"; + break; + case "SPCL": + case "SPCL_Normal": + trainTypeColor = "#008d07ff"; + isWanman = false; + trainType = "臨時"; + break; + case "SPCL_Rapid": + trainTypeColor = "rgba(0, 81, 255, 1)"; + isWanman = false; + trainType = "臨時快速"; + break; + case "SPCL_EXP": + trainTypeColor = "#a52e2eff"; + isWanman = false; + trainType = "臨時特急"; + break; + case "Party": + trainTypeColor = "#ff7300ff"; + isWanman = false; + trainType = "団体臨時"; + break; + case "Freight": + trainTypeColor = "#00869ecc"; + isWanman = false; + trainType = "貨物"; + break; + case "Forwarding": + trainTypeColor = "#727272cc"; + isWanman = false; + trainType = "回送"; + break; + case "FreightForwarding": + trainTypeColor = "#727272cc"; + isWanman = false; + trainType = "単機回送"; + break; + default: + break; + } isEdit = data.isEdit; isSeason = data.isSeason; if(data.trainName != ""){ @@ -1022,51 +968,45 @@ export const injectJavascriptData: InjectJavascriptData = ( const setNewTrainItem = (element,hasProblem,type)=>{ var 列番データ = element.getAttribute('offclick').split('"')[1]; - const JRFTemp = getJRF(列番データ); - switch(true){ - case 列番データ.indexOf("H") != -1: - case 列番データ.indexOf("R") != -1: - case 列番データ.indexOf("E") != -1: - case 列番データ.indexOf("A") != -1: - case 列番データ.indexOf("B") != -1: - case 列番データ.indexOf("T") != -1: - case !!JRFTemp: - element.style.backgroundColor = '#c7c7c7cc'; - break; - default: - element.style.backgroundColor = '#ffffffcc'; - break; - } if(trainDataList.find(e => e.id === 列番データ) !== undefined){ const data = trainDataList.find(e => e.id === 列番データ); switch (data.type) { case "Normal": element.style.borderColor = "black"; + element.style.backgroundColor = '#ffffffcc'; break; case "OneMan": element.style.borderColor = "black"; + element.style.backgroundColor = '#ffffffcc'; break; case "Rapid": element.style.borderColor = "rgba(0, 140, 255, 1)"; + element.style.backgroundColor = '#ffffffcc'; break; case "OneManRapid": element.style.borderColor = "rgba(0, 140, 255, 1)"; + element.style.backgroundColor = '#ffffffcc'; break; case "LTDEXP": element.style.borderColor = "red"; + element.style.backgroundColor = '#ffffffcc'; break; case "NightLTDEXP": element.style.borderColor = "#d300b0ff"; + element.style.backgroundColor = '#ffffffcc'; break; case "SPCL": case "SPCL_Normal": element.style.borderColor = "#008d07ff"; + element.style.backgroundColor = '#ffffffcc'; break; case "SPCL_Rapid": - element.style.borderColor = "rgba(0, 81, 255, 1)"; + element.style.borderColor = "#0051ffff"; + element.style.backgroundColor = '#ffffffcc'; break; case "SPCL_EXP": element.style.borderColor = "#a52e2eff"; + element.style.backgroundColor = '#ffffffcc'; break; case "Party": element.style.borderColor = "#ff7300ff"; @@ -1074,15 +1014,19 @@ const setNewTrainItem = (element,hasProblem,type)=>{ break; case "Freight": element.style.borderColor = "#00869ecc"; + element.style.backgroundColor = '#c7c7c7cc'; break; case "Forwarding": element.style.borderColor = "#727272cc"; + element.style.backgroundColor = '#c7c7c7cc'; break; case "FreightForwarding": element.style.borderColor = "#727272cc"; + element.style.backgroundColor = '#c7c7c7cc'; break; default: element.style.borderColor = 'black'; + element.style.backgroundColor = '#ffffffcc'; break; } }else{ @@ -1090,8 +1034,6 @@ const setNewTrainItem = (element,hasProblem,type)=>{ element.style.borderColor = '#ff0000ff'; }else if(element.getAttribute('offclick').includes("rapid")){ element.style.borderColor = '#008cffff'; - }else if(JRFTemp){ - element.style.borderColor = '#00869ecc'; }else{ element.style.borderColor = 'black'; } From 98d3b750de1bee0b16c181fa3504282059b0c1ef Mon Sep 17 00:00:00 2001 From: harukin-expo-dev-env Date: Sat, 23 Aug 2025 09:00:12 +0000 Subject: [PATCH 05/17] =?UTF-8?q?=E4=B8=8D=E8=A6=81=E3=81=AA=E8=A6=81?= =?UTF-8?q?=E7=B4=A0=E3=82=92=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EachTrainInfo/EachStopList.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/components/ActionSheetComponents/EachTrainInfo/EachStopList.js b/components/ActionSheetComponents/EachTrainInfo/EachStopList.js index 3fa4f41..cde3b8a 100644 --- a/components/ActionSheetComponents/EachTrainInfo/EachStopList.js +++ b/components/ActionSheetComponents/EachTrainInfo/EachStopList.js @@ -12,7 +12,10 @@ export const EachStopList = ({ openStationACFromEachTrainInfo, showThrew, }) => { - if (!showThrew && i.split(",")[1] == "通過") return null; + if(!showThrew){ + if(i.split(",")[1] == "通過") return null; + if(i.split(",")[1] == "通編") return null; + } const [station, se, time] = i.split(","); // 阿波池田,発,6:21 const Stations = stationList .map((a) => a.filter((d) => d.StationName == station)) @@ -46,10 +49,7 @@ export const EachStopList = ({ .set("minute", parseInt(time.split(":")[1])) .add(isNaN(currentTrainData?.delay) ? 0 : currentTrainData.delay, "minute"); const timeString = se == "通過" ? "" : dates.format("HH:mm").split(":"); - const onClickStateText = (string) => { - if (string != "通過") return; - alert("この駅は通過駅です"); - }; + return ( @@ -143,7 +143,6 @@ export const EachStopList = ({ : "red", width: 60, }} - onPress={() => onClickStateText(se)} > {se == "通過" ? "レ" : `${timeString[0]}:${timeString[1]}`}
From b07521e4ef6bf126f2a7debd0432489ef5655ba8 Mon Sep 17 00:00:00 2001 From: harukin-expo-dev-env Date: Sat, 23 Aug 2025 14:26:24 +0000 Subject: [PATCH 06/17] =?UTF-8?q?=E3=82=AA=E3=83=AA=E3=82=B8=E3=83=8A?= =?UTF-8?q?=E3=83=AB=E3=83=80=E3=82=A4=E3=83=A4=E8=A1=A8=E7=A4=BA=E5=8F=8D?= =?UTF-8?q?=E6=98=A0=E3=81=AB=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EachTrainInfo/EachStopList.js | 55 ++++++++++++++----- .../EachTrainInfo/ShowSpecialTrain.js | 41 ++++++++------ .../EachTrainInfoCore.js | 7 ++- .../searchSpecialTrain.ts | 8 ++- 4 files changed, 73 insertions(+), 38 deletions(-) diff --git a/components/ActionSheetComponents/EachTrainInfo/EachStopList.js b/components/ActionSheetComponents/EachTrainInfo/EachStopList.js index cde3b8a..5ebbb70 100644 --- a/components/ActionSheetComponents/EachTrainInfo/EachStopList.js +++ b/components/ActionSheetComponents/EachTrainInfo/EachStopList.js @@ -12,9 +12,9 @@ export const EachStopList = ({ openStationACFromEachTrainInfo, showThrew, }) => { - if(!showThrew){ - if(i.split(",")[1] == "通過") return null; - if(i.split(",")[1] == "通編") return null; + if (!showThrew) { + if (i.split(",")[1] == "通過") return null; + if (i.split(",")[1] == "通編") return null; } const [station, se, time] = i.split(","); // 阿波池田,発,6:21 const Stations = stationList @@ -33,6 +33,24 @@ export const EachStopList = ({ const StationNumbers = Stations && Stations.filter((d) => d.StationNumber).map((d) => d.StationNumber); + const [seString, seType] = (() => { + switch (se) { + case "発": + return ["出発", "normal"]; + case "着": + return ["到着", "normal"]; + case "発編": + return ["出発", "community"]; + case "着編": + return ["到着", "community"]; + case "通編": + return ["通過", "community"]; + case "頃編": + return ["頃", "community"]; + default: + return [se, "normal"]; + } + })(); // Array [ "T01", "B01",] const lineIDs = []; const EachIDs = []; @@ -48,7 +66,7 @@ export const EachStopList = ({ .set("hour", parseInt(time.split(":")[0])) .set("minute", parseInt(time.split(":")[1])) .add(isNaN(currentTrainData?.delay) ? 0 : currentTrainData.delay, "minute"); - const timeString = se == "通過" ? "" : dates.format("HH:mm").split(":"); + const timeString = se == "通過" ? "" : dates.format("HH:mm"); return ( - + {station} @@ -122,12 +149,13 @@ export const EachStopList = ({ {time} @@ -137,18 +165,17 @@ export const EachStopList = ({ style={{ fontSize: 20, color: isNaN(currentTrainData?.delay) - ? "black" + ? `#000${se == "通過" || se == "通編" ? "5" : ""}` : currentTrainData?.delay == 0 - ? "black" + ? `#000${se == "通過" || se == "通編" ? "5" : ""}` : "red", width: 60, + fontStyle: seType == "community" ? "italic" : "normal", }} > - {se == "通過" ? "レ" : `${timeString[0]}:${timeString[1]}`} - - - {se?.replace("発", "出発").replace("着", "到着")} + {se == "通過" ? "レ" : timeString} + {seString} diff --git a/components/ActionSheetComponents/EachTrainInfo/ShowSpecialTrain.js b/components/ActionSheetComponents/EachTrainInfo/ShowSpecialTrain.js index ea8e121..38dc720 100644 --- a/components/ActionSheetComponents/EachTrainInfo/ShowSpecialTrain.js +++ b/components/ActionSheetComponents/EachTrainInfo/ShowSpecialTrain.js @@ -14,24 +14,29 @@ export const ShowSpecialTrain = ({ }; return ( <> - {isTrainDataNothing && trueTrainID && ( - replaceSpecialTrainDetail(trueTrainID)} - style={{ - padding: 10, - flexDirection: "row", - borderColor: "blue", - borderWidth: 1, - margin: 10, - borderRadius: 5, - alignItems: "center", - }} - > - - 本来の列車情報を表示 - - - )} + {isTrainDataNothing && + trueTrainID?.map((ids) => { + return ( + replaceSpecialTrainDetail(ids)} + style={{ + padding: 10, + flexDirection: "row", + borderColor: "blue", + borderWidth: 1, + margin: 10, + borderRadius: 5, + alignItems: "center", + }} + > + + 本来の列車情報候補を表示:({ids}) + + + ); + })} ); }; diff --git a/components/ActionSheetComponents/EachTrainInfoCore.js b/components/ActionSheetComponents/EachTrainInfoCore.js index 92a6521..60daa28 100644 --- a/components/ActionSheetComponents/EachTrainInfoCore.js +++ b/components/ActionSheetComponents/EachTrainInfoCore.js @@ -197,15 +197,15 @@ export const EachTrainInfoCore = ({ const scrollHandlers = actionSheetRef ? useScrollHandlers("scrollview-1", actionSheetRef) : null; - const [trueTrainID, setTrueTrainID] = useState(); + const [trueTrainID, setTrueTrainID] = useState([]); useEffect(() => { if (!data.trainNum) return; const TD = trainList[data.trainNum]; setHeadStation([]); setTailStation([]); if (!TD) { - const specialTrainActualID = searchSpecialTrain(data.trainNum, trainList); - setTrueTrainID(specialTrainActualID || undefined); + const specialTrainActualIDs = searchSpecialTrain(data.trainNum, trainList); + setTrueTrainID(specialTrainActualIDs || []); setTrainData([]); return; } @@ -494,6 +494,7 @@ export const EachTrainInfoCore = ({ /> ) )} + 背景が緑色、時刻が斜体になっている時刻はコミュニティで追加されている独自データです。 {tailStation.length != 0 && tailStation.map(({ station, dia }, index) => showTailStation.findIndex((d) => d == index) == -1 ? ( diff --git a/lib/eachTrainInfoCoreLib/searchSpecialTrain.ts b/lib/eachTrainInfoCoreLib/searchSpecialTrain.ts index 535f68d..ee444b1 100644 --- a/lib/eachTrainInfoCoreLib/searchSpecialTrain.ts +++ b/lib/eachTrainInfoCoreLib/searchSpecialTrain.ts @@ -8,8 +8,9 @@ export const searchSpecialTrain = (trainNum: string, trainList: any[]) => { } return false; }; - if (search("D")) return searchBase + "D"; - if (search("M")) return searchBase + "M"; + const returnBase = []; + if (search("D")) returnBase.push(searchBase + "D"); + if (search("M")) returnBase.push(searchBase + "M"); //増結いしづちの場合 const baseStr = trainNum @@ -21,6 +22,7 @@ export const searchSpecialTrain = (trainNum: string, trainList: any[]) => { if (9000 < baseNum && baseNum < 9047) { //いしづちの1001M-1046Mが9000番台になっている場合に発動 const TD = trainList[`${baseNum - 8000}M`]; - if (TD) return `${baseNum - 8000}M`; + if (TD) returnBase.push(`${baseNum - 8000}M`); } + return returnBase; }; From 37e21be4c0b3cef3543dfd26d7bb4a12cc96f93c Mon Sep 17 00:00:00 2001 From: harukin-expo-dev-env Date: Sat, 23 Aug 2025 14:48:58 +0000 Subject: [PATCH 07/17] =?UTF-8?q?=E3=82=BF=E3=82=A4=E3=83=88=E3=83=AB?= =?UTF-8?q?=E8=A6=81=E7=B4=A0=E3=82=AF=E3=83=AA=E3=83=83=E3=82=AF=E5=8F=AF?= =?UTF-8?q?=E8=83=BD=E3=81=AA=E6=99=82=E3=81=AE=E3=83=87=E3=82=B6=E3=82=A4?= =?UTF-8?q?=E3=83=B3=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EachTrainInfoCore/HeaderText.tsx | 23 +++++++++++++++++-- .../EachTrainInfoCore/trainIconStatus.tsx | 4 ++-- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/components/ActionSheetComponents/EachTrainInfoCore/HeaderText.tsx b/components/ActionSheetComponents/EachTrainInfoCore/HeaderText.tsx index 1edccd8..8fea967 100644 --- a/components/ActionSheetComponents/EachTrainInfoCore/HeaderText.tsx +++ b/components/ActionSheetComponents/EachTrainInfoCore/HeaderText.tsx @@ -11,7 +11,7 @@ import { useTrainMenu } from "@/stateBox/useTrainMenu"; import { useAllTrainDiagram } from "@/stateBox/useAllTrainDiagram"; import { useNotification } from "@/stateBox/useNotifications"; import { getStringConfig } from "@/lib/getStringConfig"; -import { FontAwesome } from "@expo/vector-icons"; +import { FontAwesome, MaterialCommunityIcons } from "@expo/vector-icons"; import { getPDFViewURL } from "@/lib/getPdfViewURL"; type Props = { @@ -133,7 +133,19 @@ export const HeaderText: FC = ({ > { if (!trainInfoUrl) return; const uri = trainInfoUrl.includes("pdf") @@ -158,6 +170,13 @@ export const HeaderText: FC = ({ {isOneMan && } {trainName} + {trainInfoUrl && ( + + )} {isEdit && ( = ({ data, navigate, from }) => { {move ? ( ) : ( Date: Sat, 23 Aug 2025 16:34:29 +0000 Subject: [PATCH 08/17] =?UTF-8?q?=E3=81=A8=E3=82=8A=E3=81=82=E3=81=88?= =?UTF-8?q?=E3=81=9A=E5=AE=9F=E8=A3=85=E3=80=81=E6=98=8E=E6=97=A5=E5=8B=95?= =?UTF-8?q?=E4=BD=9C=E3=83=81=E3=82=A7=E3=83=83=E3=82=AF=E3=81=97=E3=81=A6?= =?UTF-8?q?=E6=8C=99=E5=8B=95=E7=A2=BA=E8=AA=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EachTrainInfo/EachStopList.js | 2 +- .../EachTrainInfo/ScrollStickyContent.js | 4 ++-- .../ActionSheetComponents/EachTrainInfoCore.js | 5 ++++- components/DynamicHeaderScrollView.js | 2 +- lib/getTrainType.ts | 13 +++++++++++-- 5 files changed, 19 insertions(+), 7 deletions(-) diff --git a/components/ActionSheetComponents/EachTrainInfo/EachStopList.js b/components/ActionSheetComponents/EachTrainInfo/EachStopList.js index 5ebbb70..fc01483 100644 --- a/components/ActionSheetComponents/EachTrainInfo/EachStopList.js +++ b/components/ActionSheetComponents/EachTrainInfo/EachStopList.js @@ -79,7 +79,7 @@ export const EachStopList = ({ { @@ -16,7 +16,7 @@ export const ScrollStickyContent = (props) => { padding: 8, flexDirection: "row", borderBottomWidth: 1, - borderBottomColor: "#f0f0f0", + borderBottomColor: "#ffffffc2", flex: 1, }} > diff --git a/components/ActionSheetComponents/EachTrainInfoCore.js b/components/ActionSheetComponents/EachTrainInfoCore.js index 60daa28..9806359 100644 --- a/components/ActionSheetComponents/EachTrainInfoCore.js +++ b/components/ActionSheetComponents/EachTrainInfoCore.js @@ -392,6 +392,7 @@ export const EachTrainInfoCore = ({ containerProps={{ style: { maxHeight: isLandscape ? height - 94 : (height / 100) * 70, + backgroundColor:getTrainType(customTrainDataDetector(data.trainNum, allCustomTrainData).type).data === "notService" ? "#868686ff" :"white" }, }} shortHeader={ @@ -422,6 +423,7 @@ export const EachTrainInfoCore = ({ /> } > + {getTrainType(customTrainDataDetector(data.trainNum, allCustomTrainData).type).data === "notService" &&この列車には乗車できません。} {headStation.length != 0 && headStation.map((i, index) => showHeadStation.findIndex((d) => d == index) == -1 ? ( @@ -494,7 +496,7 @@ export const EachTrainInfoCore = ({ /> ) )} - 背景が緑色、時刻が斜体になっている時刻はコミュニティで追加されている独自データです。 + 背景が緑色、時刻が斜体になっている時刻はコミュニティで追加されている独自データです。 {tailStation.length != 0 && tailStation.map(({ station, dia }, index) => showTailStation.findIndex((d) => d == index) == -1 ? ( @@ -535,6 +537,7 @@ export const EachTrainInfoCore = ({ flexDirection: "row", borderBottomWidth: 1, borderBottomColor: "#f0f0f0", + backgroundColor:"#ffffffc2", flex: 1, }} > diff --git a/components/DynamicHeaderScrollView.js b/components/DynamicHeaderScrollView.js index 0e31d16..8d163bf 100644 --- a/components/DynamicHeaderScrollView.js +++ b/components/DynamicHeaderScrollView.js @@ -159,7 +159,7 @@ export const DynamicHeaderScrollView = (props) => { ref={scrollHandlers.ref} onLayout={scrollHandlers.onLayout} scrollEventThrottle={scrollHandlers.scrollEventThrottle} - style={{ backgroundColor: "white", zIndex: 0 }} + style={{ zIndex: 0 }} stickyHeaderIndices={[1]} onScroll={onScroll} > diff --git a/lib/getTrainType.ts b/lib/getTrainType.ts index 6c2d3e6..7966b8a 100644 --- a/lib/getTrainType.ts +++ b/lib/getTrainType.ts @@ -5,7 +5,7 @@ type nameString = | "SPCL" | "Normal" | string; -type colorString = "aqua" | "red" | "#297bff" | "#ff7300ff" | "white" | "pink"; +type colorString = "aqua" | "red" | "#297bff" | "#ff7300ff" | "#00869ecc" | "#727272cc" | "white" | "pink"; type trainTypeString = | "快速" | "特急" @@ -16,8 +16,11 @@ type trainTypeString = | "臨時快速" | "臨時特急" | "団体臨時" + | "貨物" + | "回送" + | "単機回送" | "その他"; -type trainTypeDataString = "rapid" | "express" | "normal"; +type trainTypeDataString = "rapid" | "express" | "normal" | "notService"; type getTrainType = (d: nameString) => { color: colorString; name: trainTypeString; @@ -45,6 +48,12 @@ export const getTrainType: getTrainType = (nameString) => { return { color: "#297bff", name: "臨時特急", data: "normal" }; case "Party": return { color: "#ff7300ff", name: "団体臨時", data: "normal" }; + case "Freight": + return { color: "#00869ecc", name: "貨物", data: "notService" }; + case "Forwarding": + return { color: "#727272cc", name: "回送", data: "notService" }; + case "FreightForwarding": + return { color: "#727272cc", name: "単機回送", data: "notService" }; default: return { color: "white", name: "その他", data: "normal" }; } From 8cc1fcf3de465f7518f818c900abdd5eb81f6faf Mon Sep 17 00:00:00 2001 From: harukin-expo-dev-env Date: Sat, 23 Aug 2025 17:37:44 +0000 Subject: [PATCH 09/17] =?UTF-8?q?=E9=80=9A=E9=81=8E=E6=83=85=E5=A0=B1?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EachTrainInfo/EachStopList.js | 12 ++++++------ .../ActionSheetComponents/EachTrainInfoCore.js | 6 +++--- components/発車時刻表/EachData.tsx | 3 ++- components/発車時刻表/LED_vidion.js | 18 ++++++++++++++++-- 4 files changed, 27 insertions(+), 12 deletions(-) diff --git a/components/ActionSheetComponents/EachTrainInfo/EachStopList.js b/components/ActionSheetComponents/EachTrainInfo/EachStopList.js index fc01483..d6cdb41 100644 --- a/components/ActionSheetComponents/EachTrainInfo/EachStopList.js +++ b/components/ActionSheetComponents/EachTrainInfo/EachStopList.js @@ -79,7 +79,7 @@ export const EachStopList = ({ @@ -149,7 +149,7 @@ export const EachStopList = ({ {se == "通過" ? "レ" : timeString} - {seString} + {seString} diff --git a/components/ActionSheetComponents/EachTrainInfoCore.js b/components/ActionSheetComponents/EachTrainInfoCore.js index 9806359..f3e1a1a 100644 --- a/components/ActionSheetComponents/EachTrainInfoCore.js +++ b/components/ActionSheetComponents/EachTrainInfoCore.js @@ -392,7 +392,7 @@ export const EachTrainInfoCore = ({ containerProps={{ style: { maxHeight: isLandscape ? height - 94 : (height / 100) * 70, - backgroundColor:getTrainType(customTrainDataDetector(data.trainNum, allCustomTrainData).type).data === "notService" ? "#868686ff" :"white" + backgroundColor:getTrainType(customTrainDataDetector(data.trainNum, allCustomTrainData).type).data === "notService" ? "#777777ff" :"white" }, }} shortHeader={ @@ -423,7 +423,7 @@ export const EachTrainInfoCore = ({ /> } > - {getTrainType(customTrainDataDetector(data.trainNum, allCustomTrainData).type).data === "notService" &&この列車には乗車できません。} + {getTrainType(customTrainDataDetector(data.trainNum, allCustomTrainData).type).data === "notService" &&この列車には乗車できません。} {headStation.length != 0 && headStation.map((i, index) => showHeadStation.findIndex((d) => d == index) == -1 ? ( @@ -496,7 +496,7 @@ export const EachTrainInfoCore = ({ /> ) )} - 背景が緑色、時刻が斜体になっている時刻はコミュニティで追加されている独自データです。 + 時刻が斜体,青色になっている時刻はコミュニティで追加されている独自データです。 {tailStation.length != 0 && tailStation.map(({ station, dia }, index) => showTailStation.findIndex((d) => d == index) == -1 ? ( diff --git a/components/発車時刻表/EachData.tsx b/components/発車時刻表/EachData.tsx index f06c6d1..56e4a35 100644 --- a/components/発車時刻表/EachData.tsx +++ b/components/発車時刻表/EachData.tsx @@ -24,6 +24,7 @@ type Props = { train: string; lastStation: string; time: string; + isThrough?: boolean; }; trainIDSwitch: boolean; trainDescriptionSwitch: boolean; @@ -206,7 +207,7 @@ export const EachData: FC = (props) => { {!!isDepartureNow && ( { let trainData = {}; stationDiagram[trainNum].split("#").forEach((data) => { + if(trainNum == 74){ + console.log(data); + } if (data.match("着")) { trainData.lastStation = data.split(",着,")[0]; } + if (data.match("着編")) { + trainData.lastStation = data.split(",着編,")[0]; + } if (data.split(",")[0] === station.Station_JP) { if (data.match(",発,")) { trainData.time = data.split(",発,")[1]; - } else if (data.match(",着,")) { + }else if (data.match(",発編,")) { + trainData.time = data.split(",発編,")[1]; + } else if (data.match(",通編,")) { + trainData.time = data.split(",通編,")[1]; + trainData.isThrough = true; + } else if (data.match(",着,")) { trainData.time = data.split(",着,")[1]; trainData.lastStation = "当駅止"; + }else if (data.match(",着編,")) { + trainData.time = data.split(",着編,")[1]; + trainData.lastStation = "当駅止"; } } }); @@ -126,6 +140,7 @@ export default function LED_vision(props) { train: trainNum, time: trainData.time, lastStation: trainData.lastStation, + isThrough: trainData.isThrough, }; }) .filter((d) => d.time); @@ -148,7 +163,6 @@ export default function LED_vision(props) { const timeFiltering = (d) => { const baseTime = 2; - if (currentTrain.filter((t) => t.num == d.train).length == 0) { const date = dayjs(); const trainTime = date From c2226eb49e582b0153229518e140c5ab1590d35d Mon Sep 17 00:00:00 2001 From: harukin-expo-dev-env Date: Sat, 23 Aug 2025 20:07:05 +0000 Subject: [PATCH 10/17] =?UTF-8?q?type=E3=81=AE=E6=95=B4=E5=82=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../{EachStopList.js => EachStopList.tsx} | 168 +++++++++++------- .../SpecialTrainInfo.tsx | 8 +- components/Menu/SpecialTrainInfoBox.tsx | 35 ++-- 3 files changed, 122 insertions(+), 89 deletions(-) rename components/ActionSheetComponents/EachTrainInfo/{EachStopList.js => EachStopList.tsx} (53%) diff --git a/components/ActionSheetComponents/EachTrainInfo/EachStopList.js b/components/ActionSheetComponents/EachTrainInfo/EachStopList.tsx similarity index 53% rename from components/ActionSheetComponents/EachTrainInfo/EachStopList.js rename to components/ActionSheetComponents/EachTrainInfo/EachStopList.tsx index d6cdb41..259c64a 100644 --- a/components/ActionSheetComponents/EachTrainInfo/EachStopList.js +++ b/components/ActionSheetComponents/EachTrainInfo/EachStopList.tsx @@ -1,9 +1,30 @@ -import React from "react"; +import React, { FC } from "react"; import { View, Text, TouchableWithoutFeedback } from "react-native"; import dayjs from "dayjs"; import lineColorList from "../../../assets/originData/lineColorList"; -export const EachStopList = ({ +type seTypes = "発編" | "着編" | "通編" | "頃編" | "発" | "着" | string; + +type currentTrainDataType = { + Index: number; + num: string; + delay: "入線" | number; + Pos: string; + PosNum: number; + Direction: number; + Type: string; + Line: string; +}; +type props = { + i: string; + index: number; + stationList: { StationName: string; StationNumber: string }[][]; + points: boolean; + currentTrainData?: currentTrainDataType; + openStationACFromEachTrainInfo?: (station: string) => void; + showThrew: boolean; +}; +export const EachStopList: FC = ({ i, index, stationList, @@ -12,11 +33,11 @@ export const EachStopList = ({ openStationACFromEachTrainInfo, showThrew, }) => { + const [station, se, time] = i.split(",") as [string, seTypes, string]; // 阿波池田,発,6:21 if (!showThrew) { - if (i.split(",")[1] == "通過") return null; - if (i.split(",")[1] == "通編") return null; + if (se == "通過") return null; + if (se == "通編") return null; } - const [station, se, time] = i.split(","); // 阿波池田,発,6:21 const Stations = stationList .map((a) => a.filter((d) => d.StationName == station)) .reduce((newArray, e) => newArray.concat(e), []); @@ -52,22 +73,12 @@ export const EachStopList = ({ } })(); // Array [ "T01", "B01",] - const lineIDs = []; - const EachIDs = []; - StationNumbers.forEach((d) => { - const textArray = d.split(""); - lineIDs.push(textArray.filter((s) => "A" < s && s < "Z").join("")); - EachIDs.push(textArray.filter((s) => "0" <= s && s <= "9").join("")); - }); // Array [ "T", "B",] // Array [ "01", "01",] - const dates = dayjs() - .set("hour", parseInt(time.split(":")[0])) - .set("minute", parseInt(time.split(":")[1])) - .add(isNaN(currentTrainData?.delay) ? 0 : currentTrainData.delay, "minute"); - const timeString = se == "通過" ? "" : dates.format("HH:mm"); - + const textColor = `#${seType == "community" ? "44f" : "000"}${ + se == "通過" || se == "通編" ? "5" : "" + }`; return ( @@ -76,12 +87,7 @@ export const EachStopList = ({ } key={station} > - + - {lineIDs.map((lineID, index) => ( - - - - {lineIDs[index]} - {"\n"} - {EachIDs[index]} - - - + {StationNumbers.map((stn, index) => ( + ))} @@ -138,18 +121,18 @@ export const EachStopList = ({ - {points ? ( + {points && ( 🚊 - ) : null} + )} - {!isNaN(currentTrainData?.delay) && currentTrainData?.delay != 0 && ( + {currentTrainData.delay != "入線" && currentTrainData?.delay != 0 && ( )} - - {se == "通過" ? "レ" : timeString} + + + {seString} - {seString} ); }; + +const StationNumbersBox: FC<{ stn: string; se: seTypes }> = (props) => { + const { stn, se } = props; + const lineColor = lineColorList[stn.charAt(0)]; + const hasThrew = se == "通過" || se == "通編" ? "80" : ""; + const backgroundColor = `${lineColor}${hasThrew}`; + return ( + + + + {stn.charAt(0)} + {"\n"} + {stn.slice(1)} + + + + ); +}; + +type StationTimeBoxType = { + delay: "入線" | number; + textColor: string; + seType: seTypes; + se: string; + time: string; +}; + +const StationTimeBox: FC = (props) => { + const { delay, textColor, seType, se, time } = props; + const dates = dayjs() + .set("hour", parseInt(time.split(":")[0])) + .set("minute", parseInt(time.split(":")[1])) + .add(delay == "入線" ? 0 : delay, "minute"); + const timeString = se == "通過" ? "" : dates.format("HH:mm"); + return ( + + {se == "通過" ? "レ" : timeString} + + ); +}; diff --git a/components/ActionSheetComponents/SpecialTrainInfo.tsx b/components/ActionSheetComponents/SpecialTrainInfo.tsx index 590f0d9..3114ff2 100644 --- a/components/ActionSheetComponents/SpecialTrainInfo.tsx +++ b/components/ActionSheetComponents/SpecialTrainInfo.tsx @@ -1,10 +1,14 @@ -import React, { useRef } from "react"; +import React, { FC, useRef } from "react"; import { View, Platform } from "react-native"; import ActionSheet from "react-native-actions-sheet"; import { useSafeAreaInsets } from "react-native-safe-area-context"; import { SpecialTrainInfoBox } from "../Menu/SpecialTrainInfoBox"; -export const SpecialTrainInfo = ({ payload }) => { + +type props = { + payload: { navigate: (screen: string, params?: object) => void }; +}; +export const SpecialTrainInfo: FC = ({ payload }) => { const { navigate } = payload; const actionSheetRef = useRef(null); const insets = useSafeAreaInsets(); diff --git a/components/Menu/SpecialTrainInfoBox.tsx b/components/Menu/SpecialTrainInfoBox.tsx index c24bb95..3b5548e 100644 --- a/components/Menu/SpecialTrainInfoBox.tsx +++ b/components/Menu/SpecialTrainInfoBox.tsx @@ -1,4 +1,4 @@ -import { FC, useEffect, useLayoutEffect, useState } from "react"; +import { FC, useLayoutEffect, useState } from "react"; import { View, Text, TouchableOpacity } from "react-native"; import { getPDFViewURL } from "@/lib/getPdfViewURL"; import { ScrollView, SheetManager } from "react-native-actions-sheet"; @@ -6,20 +6,27 @@ import { ScrollView, SheetManager } from "react-native-actions-sheet"; type props = { navigate: (screen: string, params?: object) => void; }; +type specialDataType = { address: string; text: string; description: string }; + export const SpecialTrainInfoBox: FC = ({ navigate }) => { - const [specialData, setSpecialData] = useState([]); + const [specialData, setSpecialData] = useState([]); useLayoutEffect(() => { fetch("https://n8n.haruk.in/webhook/sptrainfo") .then((res) => res.json()) .then((data) => setSpecialData(data.data)) .catch((err) => console.log(err)); }, []); + + const onPressItem: (d: specialDataType) => void = (d) => { + navigate("howto", { + info: getPDFViewURL("https://www.jr-shikoku.co.jp" + d.address), + goTo: "menu", + }); + SheetManager.hide("SpecialTrainInfo"); + }; + return ( - + = ({ navigate }) => { 臨時列車情報 - + {specialData.map((d) => ( { - navigate("howto", { - info: getPDFViewURL("https://www.jr-shikoku.co.jp" + d.address), - goTo: "menu", - }); - SheetManager.hide("SpecialTrainInfo"); - }} + onPress={() => onPressItem(d)} onLongPress={() => alert(d.description)} key={d.address} style={{ From 8792d3a770f04e14a0254e6e3fccb1a7392040ba Mon Sep 17 00:00:00 2001 From: harukin-expo-dev-env Date: Sun, 24 Aug 2025 03:32:41 +0000 Subject: [PATCH 11/17] =?UTF-8?q?=E6=99=82=E5=88=BB=E3=81=8C=E8=A1=A8?= =?UTF-8?q?=E7=A4=BA=E3=81=A7=E3=81=8D=E3=81=AA=E3=81=84=E3=83=90=E3=82=B0?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EachTrainInfo/EachStopList.tsx | 45 ++++++++++--------- .../EachTrainInfoCore.js | 4 +- 2 files changed, 27 insertions(+), 22 deletions(-) diff --git a/components/ActionSheetComponents/EachTrainInfo/EachStopList.tsx b/components/ActionSheetComponents/EachTrainInfo/EachStopList.tsx index 259c64a..e5eb06a 100644 --- a/components/ActionSheetComponents/EachTrainInfo/EachStopList.tsx +++ b/components/ActionSheetComponents/EachTrainInfo/EachStopList.tsx @@ -8,7 +8,7 @@ type seTypes = "発編" | "着編" | "通編" | "頃編" | "発" | "着" | strin type currentTrainDataType = { Index: number; num: string; - delay: "入線" | number; + delay: "入線" | number | undefined; Pos: string; PosNum: number; Direction: number; @@ -128,22 +128,24 @@ export const EachStopList: FC = ({ )} - {currentTrainData.delay != "入線" && currentTrainData?.delay != 0 && ( - - {time} - - )} + {currentTrainData?.delay && + currentTrainData?.delay != "入線" && + currentTrainData?.delay != 0 && ( + + {time} + + )} = (props) => { }; type StationTimeBoxType = { - delay: "入線" | number; + delay: "入線" | number | undefined; textColor: string; seType: seTypes; se: string; @@ -198,13 +200,16 @@ const StationTimeBox: FC = (props) => { const dates = dayjs() .set("hour", parseInt(time.split(":")[0])) .set("minute", parseInt(time.split(":")[1])) - .add(delay == "入線" ? 0 : delay, "minute"); + .add(delay == "入線" || delay == undefined ? 0 : delay, "minute"); const timeString = se == "通過" ? "" : dates.format("HH:mm"); return ( - + Twitterで検索
From fd699c81509ba767315f54a52a8ee68265a85381 Mon Sep 17 00:00:00 2001 From: harukin-expo-dev-env Date: Sun, 24 Aug 2025 03:43:41 +0000 Subject: [PATCH 12/17] =?UTF-8?q?=E3=82=B9=E3=82=BF=E3=82=A4=E3=83=AB?= =?UTF-8?q?=E3=81=AE=E5=BE=AE=E8=AA=BF=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ActionSheetComponents/EachTrainInfoCore/HeaderText.tsx | 6 +++--- .../EachTrainInfoCore/trainIconStatus.tsx | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/components/ActionSheetComponents/EachTrainInfoCore/HeaderText.tsx b/components/ActionSheetComponents/EachTrainInfoCore/HeaderText.tsx index 8fea967..80b7a36 100644 --- a/components/ActionSheetComponents/EachTrainInfoCore/HeaderText.tsx +++ b/components/ActionSheetComponents/EachTrainInfoCore/HeaderText.tsx @@ -168,15 +168,15 @@ export const HeaderText: FC = ({ {typeName} {isOneMan && } - {trainName} + 10 ?{fontSize:14}:{} }}>{trainName} - {trainInfoUrl && ( + {/* {trainInfoUrl && ( - )} + )} */} {isEdit && ( = ({ data, navigate, from }) => { ) : ( )} From 8daffd3d3b7433f818f92757d268ef186d3f45f3 Mon Sep 17 00:00:00 2001 From: harukin-expo-dev-env Date: Sun, 24 Aug 2025 04:20:55 +0000 Subject: [PATCH 13/17] =?UTF-8?q?LED=E3=81=AB=E8=A1=8C=E5=85=88=E5=A4=89?= =?UTF-8?q?=E6=9B=B4=E3=81=A8=E5=99=82=E3=81=8C=E8=A1=A8=E7=A4=BA=E3=81=95?= =?UTF-8?q?=E3=82=8C=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/発車時刻表/EachData.tsx | 28 ++++++++++++++----- .../LED_inside_Component/LastStation.tsx | 8 ++++-- 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/components/発車時刻表/EachData.tsx b/components/発車時刻表/EachData.tsx index 56e4a35..ab39362 100644 --- a/components/発車時刻表/EachData.tsx +++ b/components/発車時刻表/EachData.tsx @@ -101,7 +101,19 @@ export const EachData: FC = (props) => { return customTrainData; } }; - const [train, setTrain] = useState(getTrainDataFromCurrentTrain(d.train)); + const [train, setTrain] = useState<{ + ToData: string; + TrainNumber: string; + id: string; + img: string; + isWanman: boolean; + trainName: string; + trainNumDistance: number; + type:string; + viaData:string; + info?:string; + uwasa?:string; + }>(getTrainDataFromCurrentTrain(d.train)); useEffect(() => { setTrain(getTrainDataFromCurrentTrain(d.train)); }, [currentTrain, d.train, trainDescriptionSwitch]); @@ -115,7 +127,6 @@ export const EachData: FC = (props) => { station.Station_JP )}`; - // 投稿システム関係 // Dialog表示関係 const [dialog, setDialog] = useState(false); @@ -131,7 +142,6 @@ export const EachData: FC = (props) => { const [posInput, setPosInput] = useState(""); const [descInput, setDescInput] = useState(""); - const [isShow, setIsShow] = useState(true); const [isDepartureNow, setIsDepartureNow] = useState(false); useEffect(() => { @@ -200,18 +210,20 @@ export const EachData: FC = (props) => { trainID={d.train} type={train.type} /> - + {!!isDepartureNow && ( )} {trainDescriptionSwitch && ( @@ -227,7 +239,6 @@ export const EachData: FC = (props) => { setPosNum={setPosNum} setLine={setLine} setStationNum={setStationNum} - //編集機能関係 setLineInput={setLineInput} setPosInput={setPosInput} @@ -238,6 +249,9 @@ export const EachData: FC = (props) => { {trainDescriptionSwitch && !!train.info && ( )} + {trainDescriptionSwitch && !!train.uwasa && ( + + )} ); }; diff --git a/components/発車時刻表/LED_inside_Component/LastStation.tsx b/components/発車時刻表/LED_inside_Component/LastStation.tsx index 3238a0b..913b5e8 100644 --- a/components/発車時刻表/LED_inside_Component/LastStation.tsx +++ b/components/発車時刻表/LED_inside_Component/LastStation.tsx @@ -3,18 +3,20 @@ import { Text, View } from "react-native"; type Props = { lastStation: string; + ToData: string; }; -export const LastStation: FC = ({ lastStation }) => { +export const LastStation: FC = ({ lastStation, ToData }) => { + const isEdit = ToData === "" ? false : ToData !== lastStation; return ( 4 ? parseInt("12%") : parseInt("16%"), - color: "white", + color: isEdit? "#ffd16fff":"white", fontWeight: "bold", }} > - {lastStation} + {isEdit ? ToData : lastStation} ); From 56240b0614c9ee7a344d7c0a7ea191736868e3bb Mon Sep 17 00:00:00 2001 From: harukin-expo-dev-env Date: Sun, 24 Aug 2025 04:28:30 +0000 Subject: [PATCH 14/17] =?UTF-8?q?key=E5=BF=98=E3=82=8C=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/ActionSheetComponents/EachTrainInfoCore.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/components/ActionSheetComponents/EachTrainInfoCore.js b/components/ActionSheetComponents/EachTrainInfoCore.js index 1c29e30..c4e3cce 100644 --- a/components/ActionSheetComponents/EachTrainInfoCore.js +++ b/components/ActionSheetComponents/EachTrainInfoCore.js @@ -443,6 +443,7 @@ export const EachTrainInfoCore = ({ borderRadius: 5, alignItems: "center", }} + key={i.station + "-head"} > ) From 172f5aa2c809a2cb0488090f0334daf45fe087eb Mon Sep 17 00:00:00 2001 From: harukin-expo-dev-env Date: Sun, 24 Aug 2025 04:36:01 +0000 Subject: [PATCH 15/17] =?UTF-8?q?=E7=89=B9=E5=AE=9A=E6=9D=A1=E4=BB=B6?= =?UTF-8?q?=E3=81=A7ActionSheet=E3=81=8C=E9=96=8B=E3=81=91=E3=81=AA?= =?UTF-8?q?=E3=81=8F=E3=81=AA=E3=82=8B=E3=83=90=E3=82=B0=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/ActionSheetComponents/EachTrainInfo/EachStopList.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/ActionSheetComponents/EachTrainInfo/EachStopList.tsx b/components/ActionSheetComponents/EachTrainInfo/EachStopList.tsx index e5eb06a..747ca76 100644 --- a/components/ActionSheetComponents/EachTrainInfo/EachStopList.tsx +++ b/components/ActionSheetComponents/EachTrainInfo/EachStopList.tsx @@ -128,7 +128,7 @@ export const EachStopList: FC = ({ )} - {currentTrainData?.delay && + {!!currentTrainData?.delay && currentTrainData?.delay != "入線" && currentTrainData?.delay != 0 && ( Date: Sun, 24 Aug 2025 04:43:42 +0000 Subject: [PATCH 16/17] =?UTF-8?q?undefined=E3=81=AB=E3=82=88=E3=81=A3?= =?UTF-8?q?=E3=81=A6=E6=A9=9F=E8=83=BD=E3=81=97=E3=81=A6=E3=81=84=E3=81=AA?= =?UTF-8?q?=E3=81=8B=E3=81=A3=E3=81=9F=E9=83=A8=E5=88=86=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/ActionSheetComponents/EachTrainInfoCore.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/ActionSheetComponents/EachTrainInfoCore.js b/components/ActionSheetComponents/EachTrainInfoCore.js index c4e3cce..8cb31d9 100644 --- a/components/ActionSheetComponents/EachTrainInfoCore.js +++ b/components/ActionSheetComponents/EachTrainInfoCore.js @@ -493,7 +493,7 @@ export const EachTrainInfoCore = ({ currentTrainData, openStationACFromEachTrainInfo, showThrew, - key: i.station + "-stop" + key: i + "-stop" }} /> ) From 0eef74a799ae8df7765d39f3d807ce2adaff6ce7 Mon Sep 17 00:00:00 2001 From: harukin-expo-dev-env Date: Sun, 24 Aug 2025 04:44:58 +0000 Subject: [PATCH 17/17] 6.1.6 release --- components/Settings/SettingTopPage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/Settings/SettingTopPage.js b/components/Settings/SettingTopPage.js index 7ff47f0..3e66d79 100644 --- a/components/Settings/SettingTopPage.js +++ b/components/Settings/SettingTopPage.js @@ -17,7 +17,7 @@ import { SwitchArea } from "../atom/SwitchArea"; import { useNotification } from "../../stateBox/useNotifications"; import { SheetHeaderItem } from "@/components/atom/SheetHeaderItem"; -const versionCode = "6.1.5"; // Update this version code as needed +const versionCode = "6.1.6"; // Update this version code as needed export const SettingTopPage = ({ testNFC,