Merge commit '47d84777e2a26235d5442a68ae3b6bcb07f580cb' into patch/4.5.x-master|dev
This commit is contained in:
commit
c00073bb32
1
App.js
1
App.js
@ -177,6 +177,7 @@ const Top = ({
|
|||||||
favoriteStation={favoriteStation}
|
favoriteStation={favoriteStation}
|
||||||
setFavoriteStation={setFavoriteStation}
|
setFavoriteStation={setFavoriteStation}
|
||||||
busAndTrainData={busAndTrainData}
|
busAndTrainData={busAndTrainData}
|
||||||
|
stationData={mapsStationData}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</Stack.Screen>
|
</Stack.Screen>
|
||||||
|
23
Apps.js
23
Apps.js
@ -25,6 +25,7 @@ export default function Apps({
|
|||||||
favoriteStation,
|
favoriteStation,
|
||||||
setFavoriteStation,
|
setFavoriteStation,
|
||||||
busAndTrainData,
|
busAndTrainData,
|
||||||
|
stationData,
|
||||||
}) {
|
}) {
|
||||||
const { navigate } = navigation;
|
const { navigate } = navigation;
|
||||||
var urlcache = "";
|
var urlcache = "";
|
||||||
@ -39,10 +40,12 @@ export default function Apps({
|
|||||||
const [stationBoardData, setStationBoardData] = useState(undefined);
|
const [stationBoardData, setStationBoardData] = useState(undefined);
|
||||||
const [originalStationList, setOriginalStationList] = useState();
|
const [originalStationList, setOriginalStationList] = useState();
|
||||||
const [selectedStation, setSelectedStation] = useState(undefined);
|
const [selectedStation, setSelectedStation] = useState(undefined);
|
||||||
|
let once = false;
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
getStationList().then(setOriginalStationList);
|
getStationList().then(setOriginalStationList);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
useEffect(() => {}, [stationData, favoriteStation]);
|
||||||
//地図表示テキスト
|
//地図表示テキスト
|
||||||
const injectJavascript = injectJavascriptData(
|
const injectJavascript = injectJavascriptData(
|
||||||
mapSwitch,
|
mapSwitch,
|
||||||
@ -183,6 +186,26 @@ export default function Apps({
|
|||||||
onMessage={onMessage}
|
onMessage={onMessage}
|
||||||
injectedJavaScript={injectJavascript}
|
injectedJavaScript={injectJavascript}
|
||||||
onTouchMove={() => StationBoardAcSR.current?.hide()}
|
onTouchMove={() => StationBoardAcSR.current?.hide()}
|
||||||
|
onLoadEnd={() => {
|
||||||
|
if (once) return () => {};
|
||||||
|
if (!stationData) return () => {};
|
||||||
|
if (favoriteStation.length > 0) {
|
||||||
|
const getStationLine = (now) => {
|
||||||
|
const returnData = Object.keys(stationData).filter((d) => {
|
||||||
|
const cache = stationData[d].findIndex(
|
||||||
|
(data) => data.Station_JP == now.Station_JP
|
||||||
|
);
|
||||||
|
return cache != -1;
|
||||||
|
});
|
||||||
|
return returnData[0];
|
||||||
|
};
|
||||||
|
const lineName = getStationLine(favoriteStation[0][0]);
|
||||||
|
webview.current?.injectJavaScript(
|
||||||
|
`MoveDisplayStation('${lineName}_${favoriteStation[0][0].MyStation}_${favoriteStation[0][0].Station_JP}')`
|
||||||
|
);
|
||||||
|
once = true;
|
||||||
|
}
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
<MapsButton
|
<MapsButton
|
||||||
onPress={() => navigate("trainMenu", { webview })}
|
onPress={() => navigate("trainMenu", { webview })}
|
||||||
|
@ -14,7 +14,7 @@ export default [
|
|||||||
{"Station_JP" : "八幡浜", "Station_EN" : "Yawatahama", "MyStation" : "11", "StationNumber" : "U18", "DispNum" : "3", "StationTimeTable" : "http://www.jr-shikoku.co.jp/01_trainbus/jikoku/pdf/yawatahama.pdf", "StationMap":"https://www.google.co.jp/maps/place/33.458146,132.436002", "JrHpUrl" : "http://www.jr-shikoku.co.jp/01_trainbus/kakueki/yawatahama/"},
|
{"Station_JP" : "八幡浜", "Station_EN" : "Yawatahama", "MyStation" : "11", "StationNumber" : "U18", "DispNum" : "3", "StationTimeTable" : "http://www.jr-shikoku.co.jp/01_trainbus/jikoku/pdf/yawatahama.pdf", "StationMap":"https://www.google.co.jp/maps/place/33.458146,132.436002", "JrHpUrl" : "http://www.jr-shikoku.co.jp/01_trainbus/kakueki/yawatahama/"},
|
||||||
{"Station_JP" : "双岩", "Station_EN" : "Futaiwa", "MyStation" : "12", "StationNumber" : "U19", "DispNum" : "2", "StationTimeTable" : "http://www.jr-shikoku.co.jp/01_trainbus/jikoku/pdf/futaiwa.pdf", "StationMap":"https://www.google.co.jp/maps/place/33.424669,132.457934", "JrHpUrl" : ""},
|
{"Station_JP" : "双岩", "Station_EN" : "Futaiwa", "MyStation" : "12", "StationNumber" : "U19", "DispNum" : "2", "StationTimeTable" : "http://www.jr-shikoku.co.jp/01_trainbus/jikoku/pdf/futaiwa.pdf", "StationMap":"https://www.google.co.jp/maps/place/33.424669,132.457934", "JrHpUrl" : ""},
|
||||||
{"Station_JP" : "伊予石城", "Station_EN" : "Iyo-Iwaki", "MyStation" : "13", "StationNumber" : "U20", "DispNum" : "2", "StationTimeTable" : "http://www.jr-shikoku.co.jp/01_trainbus/jikoku/pdf/iyo-iwaki.pdf", "StationMap":"https://www.google.co.jp/maps/place/33.391413,132.473259", "JrHpUrl" : ""},
|
{"Station_JP" : "伊予石城", "Station_EN" : "Iyo-Iwaki", "MyStation" : "13", "StationNumber" : "U20", "DispNum" : "2", "StationTimeTable" : "http://www.jr-shikoku.co.jp/01_trainbus/jikoku/pdf/iyo-iwaki.pdf", "StationMap":"https://www.google.co.jp/maps/place/33.391413,132.473259", "JrHpUrl" : ""},
|
||||||
{"Station_JP" : "卯之町", "Station_EN" : "Unomachi", "MyStation" : "14", "StationNumber" : "U22", "DispNum" : "3", "StationTimeTable" : "http://www.jr-shikoku.co.jp/01_trainbus/jikoku/pdf/unomachi.pdf", "StationMap":"https://www.google.co.jp/maps/place/33.363175,132.509959", "JrHpUrl" : "http://www.jr-shikoku.co.jp/01_trainbus/kakueki/unomachi/"},
|
{"Station_JP" : "卯之町", "Station_EN" : "Unomachi", "MyStation" : "14", "StationNumber" : "U22", "DispNum" : "3", "StationTimeTable" : "http://www.jr-shikoku.co.jp/01_trainbus/jikoku/pdf/unomachi.pdf", "StationMap":"https://www.google.co.jp/maps/place/33.363175,132.509959", "JrHpUrl" : ""},
|
||||||
{"Station_JP" : "下宇和", "Station_EN" : "Shimo-Uwa", "MyStation" : "15", "StationNumber" : "U23", "DispNum" : "2", "StationTimeTable" : "http://www.jr-shikoku.co.jp/01_trainbus/jikoku/pdf/shimo-uwa.pdf", "StationMap":"https://www.google.co.jp/maps/place/33.349786,132.531172", "JrHpUrl" : ""},
|
{"Station_JP" : "下宇和", "Station_EN" : "Shimo-Uwa", "MyStation" : "15", "StationNumber" : "U23", "DispNum" : "2", "StationTimeTable" : "http://www.jr-shikoku.co.jp/01_trainbus/jikoku/pdf/shimo-uwa.pdf", "StationMap":"https://www.google.co.jp/maps/place/33.349786,132.531172", "JrHpUrl" : ""},
|
||||||
{"Station_JP" : "立間", "Station_EN" : "Tachima", "MyStation" : "16", "StationNumber" : "U24", "DispNum" : "2", "StationTimeTable" : "http://www.jr-shikoku.co.jp/01_trainbus/jikoku/pdf/tachima.pdf", "StationMap":"https://www.google.co.jp/maps/place/33.296721,132.539509", "JrHpUrl" : ""},
|
{"Station_JP" : "立間", "Station_EN" : "Tachima", "MyStation" : "16", "StationNumber" : "U24", "DispNum" : "2", "StationTimeTable" : "http://www.jr-shikoku.co.jp/01_trainbus/jikoku/pdf/tachima.pdf", "StationMap":"https://www.google.co.jp/maps/place/33.296721,132.539509", "JrHpUrl" : ""},
|
||||||
{"Station_JP" : "伊予吉田", "Station_EN" : "Iyo-Yoshida", "MyStation" : "17", "StationNumber" : "U25", "DispNum" : "2", "StationTimeTable" : "http://www.jr-shikoku.co.jp/01_trainbus/jikoku/pdf/iyo-yoshida.pdf", "StationMap":"https://www.google.co.jp/maps/place/33.273287,132.544098", "JrHpUrl" : ""},
|
{"Station_JP" : "伊予吉田", "Station_EN" : "Iyo-Yoshida", "MyStation" : "17", "StationNumber" : "U25", "DispNum" : "2", "StationTimeTable" : "http://www.jr-shikoku.co.jp/01_trainbus/jikoku/pdf/iyo-yoshida.pdf", "StationMap":"https://www.google.co.jp/maps/place/33.273287,132.544098", "JrHpUrl" : ""},
|
||||||
|
@ -8,6 +8,7 @@ import {
|
|||||||
Text,
|
Text,
|
||||||
TouchableOpacity,
|
TouchableOpacity,
|
||||||
} from "react-native";
|
} from "react-native";
|
||||||
|
import AutoHeightImage from "react-native-auto-height-image";
|
||||||
import { FontAwesome, Foundation, Ionicons } from "@expo/vector-icons";
|
import { FontAwesome, Foundation, Ionicons } from "@expo/vector-icons";
|
||||||
import ActionSheet from "react-native-actions-sheet";
|
import ActionSheet from "react-native-actions-sheet";
|
||||||
import Sign from "../../components/駅名表/Sign";
|
import Sign from "../../components/駅名表/Sign";
|
||||||
@ -94,6 +95,13 @@ export const StationDeteilView = (props) => {
|
|||||||
setFavoriteStation={setFavoriteStation}
|
setFavoriteStation={setFavoriteStation}
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
|
{currentStation &&
|
||||||
|
currentStation[0].JrHpUrl &&
|
||||||
|
currentStation[0].StationNumber != "M12" && (
|
||||||
|
<駅構内図 //高松/阿波池田&後免&須崎kounai.png児島例外/
|
||||||
|
uri={currentStation[0].JrHpUrl.replace("/index.html", "/")}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
{currentStation && (
|
{currentStation && (
|
||||||
<View style={{ flexDirection: "row" }}>
|
<View style={{ flexDirection: "row" }}>
|
||||||
{!currentStation[0].JrHpUrl || (
|
{!currentStation[0].JrHpUrl || (
|
||||||
@ -291,6 +299,65 @@ const NexPreStationLine = ({
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const 駅構内図 = (props) => {
|
||||||
|
const [open, setOpen] = useState(false);
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<TouchableOpacity
|
||||||
|
style={{
|
||||||
|
height: 50,
|
||||||
|
backgroundColor: "#888A85",
|
||||||
|
flexDirection: "column",
|
||||||
|
alignContent: "center",
|
||||||
|
alignItems: "center",
|
||||||
|
margin: 2,
|
||||||
|
}}
|
||||||
|
onPress={() => Linking.openURL(props.uri + "/kounai_map.html")}
|
||||||
|
//onPress={() => setOpen(!open)}
|
||||||
|
>
|
||||||
|
<View style={{ flex: 1 }} />
|
||||||
|
<Text
|
||||||
|
style={{
|
||||||
|
color: "white",
|
||||||
|
textAlign: "center",
|
||||||
|
textAlignVertical: "center",
|
||||||
|
flex: 1,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{open ? "駅構内図を非表示" : "駅構内図を表示"}
|
||||||
|
</Text>
|
||||||
|
<View style={{ flex: 1 }} />
|
||||||
|
</TouchableOpacity>
|
||||||
|
<View>
|
||||||
|
{open && (
|
||||||
|
<>
|
||||||
|
<AutoHeightImage
|
||||||
|
source={{ uri: props.uri + "images/kounai.gif" }}
|
||||||
|
resizeMode="contain"
|
||||||
|
width={wp("100%")}
|
||||||
|
/>
|
||||||
|
<AutoHeightImage
|
||||||
|
source={{ uri: props.uri + "images/kounai.png" }}
|
||||||
|
resizeMode="contain"
|
||||||
|
width={wp("100%")}
|
||||||
|
/>
|
||||||
|
<AutoHeightImage
|
||||||
|
source={{ uri: props.uri + "images/kounai_1f.gif" }}
|
||||||
|
resizeMode="contain"
|
||||||
|
width={wp("100%")}
|
||||||
|
/>
|
||||||
|
<AutoHeightImage
|
||||||
|
source={{ uri: props.uri + "images/kounai_2f.png" }}
|
||||||
|
resizeMode="contain"
|
||||||
|
width={wp("100%")}
|
||||||
|
/>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
</View>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
const styleSheet = {
|
const styleSheet = {
|
||||||
外枠: {
|
外枠: {
|
||||||
width: wp("80%"),
|
width: wp("80%"),
|
||||||
|
Loading…
Reference in New Issue
Block a user