横画面で画面更新が不完全になるバグを修正
This commit is contained in:
parent
a713ae576d
commit
f3f9ee60c2
10
Apps.js
10
Apps.js
@ -298,7 +298,7 @@ export default function Apps({ navigation, webview, stationData }) {
|
|||||||
}}
|
}}
|
||||||
onLayout={handleLayout}
|
onLayout={handleLayout}
|
||||||
>
|
>
|
||||||
{!trainInfo.trainData && isLandscape ? (
|
{!trainInfo.trainNum && isLandscape ? (
|
||||||
<TrainMenu
|
<TrainMenu
|
||||||
webview={webview}
|
webview={webview}
|
||||||
stationData={stationData}
|
stationData={stationData}
|
||||||
@ -347,7 +347,7 @@ export default function Apps({ navigation, webview, stationData }) {
|
|||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
{isLandscape && trainInfo.trainData && (
|
{isLandscape && trainInfo.trainNum && (
|
||||||
<View
|
<View
|
||||||
style={{
|
style={{
|
||||||
width: (width / 100) * 40,
|
width: (width / 100) * 40,
|
||||||
@ -357,7 +357,7 @@ export default function Apps({ navigation, webview, stationData }) {
|
|||||||
>
|
>
|
||||||
<EachTrainInfoCore
|
<EachTrainInfoCore
|
||||||
{...{
|
{...{
|
||||||
data: trainInfo.trainData ? trainInfo : undefined,
|
data: trainInfo.trainNum ? trainInfo : undefined,
|
||||||
navigate,
|
navigate,
|
||||||
originalStationList,
|
originalStationList,
|
||||||
openStationACFromEachTrainInfo,
|
openStationACFromEachTrainInfo,
|
||||||
@ -374,7 +374,7 @@ export default function Apps({ navigation, webview, stationData }) {
|
|||||||
mapSwitch={mapSwitch == "true" ? "flex" : "none"}
|
mapSwitch={mapSwitch == "true" ? "flex" : "none"}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{isLandscape && trainInfo.trainData && (
|
{isLandscape && trainInfo.trainNum && (
|
||||||
<LandscapeBackButton
|
<LandscapeBackButton
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
LayoutAnimation.easeInEaseOut();
|
LayoutAnimation.easeInEaseOut();
|
||||||
@ -390,7 +390,7 @@ export default function Apps({ navigation, webview, stationData }) {
|
|||||||
<ReloadButton
|
<ReloadButton
|
||||||
onPress={() => webview.current.reload()}
|
onPress={() => webview.current.reload()}
|
||||||
top={Platform.OS == "ios" ? Constants.statusBarHeight : 0}
|
top={Platform.OS == "ios" ? Constants.statusBarHeight : 0}
|
||||||
right={isLandscape && trainInfo.trainData ? (width / 100) * 40 : 0}
|
right={isLandscape && trainInfo.trainNum ? (width / 100) * 40 : 0}
|
||||||
LoadError={LoadError}
|
LoadError={LoadError}
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
|
@ -113,6 +113,9 @@ export const EachTrainInfoCore = ({
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!data.trainNum) return;
|
if (!data.trainNum) return;
|
||||||
const TD = trainList[data.trainNum];
|
const TD = trainList[data.trainNum];
|
||||||
|
setIsConcatNear(false);
|
||||||
|
setHeadStation();
|
||||||
|
setTailStation();
|
||||||
if (!TD) {
|
if (!TD) {
|
||||||
const specialTrainActualID = searchSpecialTrain(data.trainNum, trainList);
|
const specialTrainActualID = searchSpecialTrain(data.trainNum, trainList);
|
||||||
setTrueTrainID(specialTrainActualID || undefined);
|
setTrueTrainID(specialTrainActualID || undefined);
|
||||||
@ -129,14 +132,22 @@ export const EachTrainInfoCore = ({
|
|||||||
setShowNearTrain(TDArray);
|
setShowNearTrain(TDArray);
|
||||||
if (trainData.length == 0) return;
|
if (trainData.length == 0) return;
|
||||||
if (TDArray.length == 0) return;
|
if (TDArray.length == 0) return;
|
||||||
|
let head;
|
||||||
|
let tail;
|
||||||
TDArray.forEach((d) => {
|
TDArray.forEach((d) => {
|
||||||
const [station, se, time] = d.split(",");
|
const [station, se, time] = d.split(",");
|
||||||
|
|
||||||
if (station == trainData[0].split(",")[0])
|
if (station == trainData[0].split(",")[0]) {
|
||||||
setHeadStation(trainData[0].split(",")[0]);
|
head = trainData[0].split(",")[0];
|
||||||
if (station == trainData[trainData.length - 1].split(",")[0])
|
}
|
||||||
setTailStation(trainData[trainData.length - 1].split(",")[0]);
|
if (station == trainData[trainData.length - 1].split(",")[0]) {
|
||||||
|
tail = trainData[trainData.length - 1].split(",")[0];
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
if (head) setHeadStation(head);
|
||||||
|
else setHeadStation();
|
||||||
|
if (tail) setTailStation(tail);
|
||||||
|
else setTailStation();
|
||||||
}, [trainData, data]);
|
}, [trainData, data]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
Loading…
Reference in New Issue
Block a user