|
@@ -33,12 +33,6 @@ export default (props) => {
|
33
|
33
|
|
34
|
34
|
const trackClick = useTrackClick(router)
|
35
|
35
|
|
36
|
|
- // 住宿经纬度
|
37
|
|
- const Roomlog = useRef('')
|
38
|
|
- const Roomlat = useRef('')
|
39
|
|
- // 停车场经纬度
|
40
|
|
- const Parklog = useRef('')
|
41
|
|
- const Parklat = useRef('')
|
42
|
36
|
const [taRoomContent, setTaRoomContent] = useState([])
|
43
|
37
|
const RoomLocation = taRoomContent?.location
|
44
|
38
|
//没有停车 wifi的就不显示按钮
|
|
@@ -73,10 +67,6 @@ export default (props) => {
|
73
|
67
|
// 点击’去这里‘跳转导航
|
74
|
68
|
setLoading(true)
|
75
|
69
|
getTaRoom(roomId).then((res) => {
|
76
|
|
- Roomlog.current = (!res.location).toString().split(',')[0]
|
77
|
|
- Roomlat.current = (!res.location).toString().split(',')[1]
|
78
|
|
- Parklog.current = (!res.parkingLocation).toString().split(',')[0]
|
79
|
|
- Parklat.current = (!res.parkingLocation).toString().split(',')[1]
|
80
|
70
|
setTaRoomContent(res || [])
|
81
|
71
|
setLoading(false)
|
82
|
72
|
|
|
@@ -141,10 +131,10 @@ export default (props) => {
|
141
|
131
|
setLoading(true)
|
142
|
132
|
// 点击’去这里‘跳转导航
|
143
|
133
|
getTaRoom(roomId).then((res) => {
|
144
|
|
- Roomlog.current = (!res.location).toString().split(',')[0]
|
145
|
|
- Roomlat.current = (!res.location).toString().split(',')[1]
|
146
|
|
- Parklog.current = (!res.parkingLocation).toString().split(',')[0]
|
147
|
|
- Parklat.current = (!res.parkingLocation).toString().split(',')[1]
|
|
134
|
+ // Roomlog.current = (!res.location).toString().split(',')[0]
|
|
135
|
+ // Roomlat.current = (!res.location).toString().split(',')[1]
|
|
136
|
+ // Parklog.current = (!res.parkingLocation).toString().split(',')[0]
|
|
137
|
+ // Parklat.current = (!res.parkingLocation).toString().split(',')[1]
|
148
|
138
|
setTaRoomContent(res || [])
|
149
|
139
|
setLoading(false)
|
150
|
140
|
})
|
|
@@ -178,28 +168,33 @@ export default (props) => {
|
178
|
168
|
|
179
|
169
|
|
180
|
170
|
const goRoomMap = () => {
|
181
|
|
- Taro.openLocation({
|
182
|
|
- longitude: Roomlog.current - 0,
|
183
|
|
- latitude: Roomlat.current - 0,
|
184
|
|
- name: taRoomContent.roomName,
|
185
|
|
- address: taRoomContent.address,
|
186
|
|
- scale: 12,
|
187
|
|
- })
|
|
171
|
+ if (taRoomContent.location) {
|
|
172
|
+ const [longitude, latitude] = taRoomContent.location.split(',').map(x => x - 0)
|
|
173
|
+
|
|
174
|
+ Taro.openLocation({
|
|
175
|
+ longitude,
|
|
176
|
+ latitude,
|
|
177
|
+ name: taRoomContent.roomName,
|
|
178
|
+ address: taRoomContent.address,
|
|
179
|
+ scale: 12,
|
|
180
|
+ })
|
|
181
|
+ }
|
188
|
182
|
}
|
189
|
183
|
|
190
|
184
|
const goParkMap = () => {
|
191
|
|
- Taro.openLocation({
|
192
|
|
- longitude: Parklog.current - 0,
|
193
|
|
- latitude: Parklat.current - 0,
|
194
|
|
- name: taRoomContent.parkingAddress,
|
195
|
|
- address: taRoomContent.parkingAddress,
|
196
|
|
- scale: 12,
|
197
|
|
- })
|
|
185
|
+ if (taRoomContent.parkingLocation) {
|
|
186
|
+ const [longitude, latitude] = taRoomContent.parkingLocation.split(',').map(x => x - 0)
|
|
187
|
+
|
|
188
|
+ Taro.openLocation({
|
|
189
|
+ longitude,
|
|
190
|
+ latitude,
|
|
191
|
+ name: taRoomContent.parkingAddress,
|
|
192
|
+ address: taRoomContent.parkingAddress,
|
|
193
|
+ scale: 12,
|
|
194
|
+ })
|
|
195
|
+ }
|
198
|
196
|
}
|
199
|
197
|
|
200
|
|
-
|
201
|
|
-
|
202
|
|
-
|
203
|
198
|
const wifiCopy = () => {
|
204
|
199
|
Taro.setClipboardData({
|
205
|
200
|
data: taRoomContent?.wifiPassword,
|
|
@@ -213,12 +208,9 @@ export default (props) => {
|
213
|
208
|
})
|
214
|
209
|
}
|
215
|
210
|
|
216
|
|
-
|
217
|
|
-
|
218
|
|
-
|
219
|
211
|
return (
|
220
|
212
|
<scroll-view scrollY style='height:100%;' >
|
221
|
|
- <SpinBox loading={loading} className='index-container' >
|
|
213
|
+ <SpinBox loading={loading}>
|
222
|
214
|
|
223
|
215
|
<view className='Guide-Home-box'>
|
224
|
216
|
{
|