多層建て列車対応
This commit is contained in:
parent
edaa16cf35
commit
e3a65b9127
@ -51,6 +51,7 @@ export const EachTrainInfo = (props) => {
|
|||||||
const [isConcatNear, setIsConcatNear] = useState(false);
|
const [isConcatNear, setIsConcatNear] = useState(false);
|
||||||
const [tailStation, setTailStation] = useState();
|
const [tailStation, setTailStation] = useState();
|
||||||
const [headStation, setHeadStation] = useState();
|
const [headStation, setHeadStation] = useState();
|
||||||
|
// const [actionSheetHorizonalScroll, setActionSheetHorizonalScroll] = useState(false);
|
||||||
|
|
||||||
//裏列車探索
|
//裏列車探索
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@ -165,7 +166,12 @@ export const EachTrainInfo = (props) => {
|
|||||||
originalStationList,
|
originalStationList,
|
||||||
from: "AllTrainDiagramView",
|
from: "AllTrainDiagramView",
|
||||||
};
|
};
|
||||||
//SheetManager.show("EachTrainInfo", { payload });
|
SheetManager.hide("EachTrainInfo").then(() => {
|
||||||
|
//0.1秒待機してから開く
|
||||||
|
setTimeout(() => {
|
||||||
|
SheetManager.show("EachTrainInfo", { payload });
|
||||||
|
}, 1);
|
||||||
|
});
|
||||||
};
|
};
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setCurrentTrainData(
|
setCurrentTrainData(
|
||||||
@ -380,7 +386,7 @@ export const EachTrainInfo = (props) => {
|
|||||||
const scrollHandlers = useScrollHandlers("scrollview-1", actionSheetRef);
|
const scrollHandlers = useScrollHandlers("scrollview-1", actionSheetRef);
|
||||||
return (
|
return (
|
||||||
<ActionSheet
|
<ActionSheet
|
||||||
gestureEnabled={true}
|
//gestureEnabled={!actionSheetHorizonalScroll}
|
||||||
CustomHeaderComponent={<></>}
|
CustomHeaderComponent={<></>}
|
||||||
ref={actionSheetRef}
|
ref={actionSheetRef}
|
||||||
drawUnderStatusBar={false}
|
drawUnderStatusBar={false}
|
||||||
@ -448,6 +454,9 @@ export const EachTrainInfo = (props) => {
|
|||||||
</View>
|
</View>
|
||||||
{from == "AllTrainDiagramView" || (
|
{from == "AllTrainDiagramView" || (
|
||||||
<ScrollView
|
<ScrollView
|
||||||
|
//onTouchStart={() => setActionSheetHorizonalScroll(true)}
|
||||||
|
//onScrollEndDrag={() => setActionSheetHorizonalScroll(false)}
|
||||||
|
//onScrollBeginDrag={() => console.log("onScrollBeginDrag")}
|
||||||
style={{
|
style={{
|
||||||
flexDirection: "row",
|
flexDirection: "row",
|
||||||
//width: widthPercentageToDP("200%"),
|
//width: widthPercentageToDP("200%"),
|
||||||
@ -460,6 +469,8 @@ export const EachTrainInfo = (props) => {
|
|||||||
<TrainDataView
|
<TrainDataView
|
||||||
currentTrainData={currentTrainData}
|
currentTrainData={currentTrainData}
|
||||||
currentPosition={currentPosition}
|
currentPosition={currentPosition}
|
||||||
|
nearTrainIDList={nearTrainIDList}
|
||||||
|
openTrainInfo={openTrainInfo}
|
||||||
/>
|
/>
|
||||||
{/* <View
|
{/* <View
|
||||||
style={{
|
style={{
|
||||||
@ -853,7 +864,12 @@ const StationButton = ({
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const TrainDataView = ({ currentTrainData, currentPosition }) => {
|
const TrainDataView = ({
|
||||||
|
currentTrainData,
|
||||||
|
currentPosition,
|
||||||
|
nearTrainIDList,
|
||||||
|
openTrainInfo,
|
||||||
|
}) => {
|
||||||
return (
|
return (
|
||||||
<View
|
<View
|
||||||
style={{
|
style={{
|
||||||
@ -880,23 +896,46 @@ const TrainDataView = ({ currentTrainData, currentPosition }) => {
|
|||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
<View style={{ flex: 1, flexDirection: "column" }}>
|
<View style={{ flex: 1, flexDirection: "column" }}>
|
||||||
|
<View style={{ flex: 1, flexDirection: "row" }}>
|
||||||
<StateBox
|
<StateBox
|
||||||
title={isNaN(currentTrainData?.delay) ? "状態" : "遅延時分"}
|
title={isNaN(currentTrainData?.delay) ? "状態" : "遅延時分"}
|
||||||
text={`${currentTrainData?.delay}${
|
text={`${currentTrainData?.delay}${
|
||||||
isNaN(currentTrainData?.delay) ? "" : "分"
|
isNaN(currentTrainData?.delay) ? "" : "分"
|
||||||
}`}
|
}`}
|
||||||
/>
|
/>
|
||||||
|
</View>
|
||||||
|
<TouchableOpacity
|
||||||
|
style={{ flex: 1, flexDirection: "row" }}
|
||||||
|
disabled={nearTrainIDList.length == 0}
|
||||||
|
onPress={() => {
|
||||||
|
if (nearTrainIDList.length == 0) return;
|
||||||
|
openTrainInfo(nearTrainIDList[0]);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{nearTrainIDList.length == 0 ? (
|
||||||
<StateBox title="列番" text={currentTrainData?.num} />
|
<StateBox title="列番" text={currentTrainData?.num} />
|
||||||
|
) : (
|
||||||
|
<StateBox
|
||||||
|
title="増解結相手を表示▶️"
|
||||||
|
text={`${nearTrainIDList}`}
|
||||||
|
style={{
|
||||||
|
borderWidth: 1,
|
||||||
|
borderColor: "red",
|
||||||
|
borderStyle: "solid",
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</TouchableOpacity>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const StateBox = ({ text, title }) => (
|
const StateBox = ({ text, title, style }) => (
|
||||||
<View style={boxStyle}>
|
<View style={{ ...boxStyle, ...style }}>
|
||||||
<Text style={{ fontSize: 15, color: "#0099CC" }}>{title}</Text>
|
<Text style={{ fontSize: 12, color: "#0099CC" }}>{title}</Text>
|
||||||
<View style={{ flex: 1 }} />
|
<View style={{ flex: 1 }} />
|
||||||
<View style={{ fontSize: 32, color: "#0099CC", textAlign: "right" }}>
|
<View style={{ fontSize: 25, color: "#0099CC", textAlign: "right" }}>
|
||||||
{text?.match("~") ? (
|
{text?.match("~") ? (
|
||||||
<>
|
<>
|
||||||
<Text style={boxTextStyle}>{text.split("~")[0]}</Text>
|
<Text style={boxTextStyle}>{text.split("~")[0]}</Text>
|
||||||
@ -917,7 +956,7 @@ const boxStyle = {
|
|||||||
margin: 10,
|
margin: 10,
|
||||||
};
|
};
|
||||||
const boxTextStyle = {
|
const boxTextStyle = {
|
||||||
fontSize: 28,
|
fontSize: 25,
|
||||||
color: "#0099CC",
|
color: "#0099CC",
|
||||||
textAlign: "right",
|
textAlign: "right",
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user