|
@@ -34,13 +34,12 @@ export default (props) => {
|
34
|
34
|
const trackClick = useTrackClick(router)
|
35
|
35
|
|
36
|
36
|
const [taRoomContent, setTaRoomContent] = useState([])
|
37
|
|
- const RoomLocation = taRoomContent?.location
|
38
|
37
|
//没有停车 wifi的就不显示按钮
|
39
|
38
|
const [wifiButtonStyle, setWifiButtonStyle] = useState('')
|
40
|
39
|
const [parkingButtonStyle, setParkingButtonStyle] = useState('')
|
41
|
40
|
const [guideStyle, setGuideStyle] = useState('')
|
42
|
|
- const parkingGps = taRoomContent?.parkingLocation
|
43
|
|
- const roomGps = taRoomContent?.location
|
|
41
|
+ const parkingGps = taRoomContent.parkingLocation || []
|
|
42
|
+ const roomGps = taRoomContent.location || []
|
44
|
43
|
|
45
|
44
|
|
46
|
45
|
|
|
@@ -82,26 +81,17 @@ export default (props) => {
|
82
|
81
|
setLoading(true)
|
83
|
82
|
// 点击’去这里‘跳转导航
|
84
|
83
|
getTaRoom(roomId).then((res) => {
|
85
|
|
- // Roomlog.current = (!res.location).toString().split(',')[0]
|
86
|
|
- // Roomlat.current = (!res.location).toString().split(',')[1]
|
87
|
|
- // Parklog.current = (!res.parkingLocation).toString().split(',')[0]
|
88
|
|
- // Parklat.current = (!res.parkingLocation).toString().split(',')[1]
|
89
|
84
|
setTaRoomContent(res || [])
|
90
|
85
|
setLoading(false)
|
91
|
86
|
})
|
92
|
87
|
//更多指引
|
93
|
88
|
geiZy()
|
94
|
|
-
|
95
|
|
- getRecommendList({ location: location }).then((res) => {
|
|
89
|
+ getRecommendList({ location: roomGps }).then((res) => {
|
96
|
90
|
setPackage(res || [])
|
97
|
91
|
setLoading(false)
|
98
|
|
-
|
99
|
92
|
})
|
100
|
|
- // setLoading(false)
|
101
|
|
-
|
102
|
93
|
} else {
|
103
|
94
|
setLoading(true)
|
104
|
|
-
|
105
|
95
|
getRecommendList({ location: location }).then((res) => {
|
106
|
96
|
setPackage(res || [])
|
107
|
97
|
setLoading(false)
|
|
@@ -115,7 +105,7 @@ export default (props) => {
|
115
|
105
|
if (taRoomContent?.parkingAddress === "") {
|
116
|
106
|
setParkingButtonStyle('none')
|
117
|
107
|
}
|
118
|
|
- }, [roomId, RoomLocation, taRoomContent?.wifiPassword, taRoomContent?.parkingAddress, location])
|
|
108
|
+ }, [roomId, roomGps, taRoomContent?.wifiPassword, taRoomContent?.parkingAddress, location])
|
119
|
109
|
|
120
|
110
|
|
121
|
111
|
const goRoomMap = () => {
|
|
@@ -161,104 +151,103 @@ export default (props) => {
|
161
|
151
|
|
162
|
152
|
return (
|
163
|
153
|
<scroll-view scrollY style={{ height: '100%' }} >
|
164
|
|
- <view className='Guide-Home-box'>
|
165
|
|
- {
|
166
|
|
- ifroomId === 'havenot' && (
|
167
|
|
- <view className='Guide-image-text-box'>
|
168
|
|
- <image className='Guide-images' src={sleep} />
|
169
|
|
- <view className='Guide-text'>您还没有入住订单哟~</view>
|
170
|
|
- </view>
|
171
|
|
- )
|
172
|
|
- }
|
173
|
|
- {/* 有民宿的情况下 */}
|
174
|
|
- {
|
175
|
|
- ifroomId === 'reality' && (
|
176
|
|
- <SpinBox loading={loading}>
|
177
|
|
- <view className='room-box-info-ROOM'>
|
178
|
|
- <view className='room-bi-name-ROOM' >
|
179
|
|
- <view className='room-bin-title-ROOM'>房屋名称</view>
|
180
|
|
- <view className='room-bint-nameInfo-ROOM'>{taRoomContent?.roomName}
|
181
|
|
- </view>
|
|
154
|
+ <view className='Guide-Home-box'>
|
|
155
|
+ {
|
|
156
|
+ ifroomId === 'havenot' && (
|
|
157
|
+ <view className='Guide-image-text-box'>
|
|
158
|
+ <image className='Guide-images' src={sleep} />
|
|
159
|
+ <view className='Guide-text'>您还没有入住订单哟~</view>
|
|
160
|
+ </view>
|
|
161
|
+ )
|
|
162
|
+ }
|
|
163
|
+ {/* 有民宿的情况下 */}
|
|
164
|
+ {
|
|
165
|
+ ifroomId === 'reality' && (
|
|
166
|
+ <SpinBox loading={loading}>
|
|
167
|
+ <view className='room-box-info-ROOM'>
|
|
168
|
+ <view className='room-bi-name-ROOM' >
|
|
169
|
+ <view className='room-bin-title-ROOM'>房屋名称</view>
|
|
170
|
+ <view className='room-bint-nameInfo-ROOM'>{taRoomContent?.roomName}
|
182
|
171
|
</view>
|
183
|
172
|
</view>
|
184
|
|
- {/* --------房屋位置-------- */}
|
185
|
|
- {
|
186
|
|
- !roomGps ? <view></view>
|
187
|
|
- :
|
188
|
|
- <view className='room-box-info-HouLocation'>
|
189
|
|
- <view className='room-bi-name-HouLocation' >
|
190
|
|
- <view className='room-bin-title-HouLocation'>房屋位置</view>
|
191
|
|
- <view className='room-bint-nameInfo-HouLocation'>
|
192
|
|
- <view className='room-bint-nameInfo-bool-HouLocation' >{taRoomContent?.address}</view>
|
193
|
|
- <view className='room-bintn-button-HouLocation' onClick={() => { goRoomMap() }} style={{ display: wifiButtonStyle }}>
|
194
|
|
- <image className='room-bintn-image-HouLocation' src={GPS} />
|
195
|
|
- <text className='room-bintn-text-HouLocation'>去这里</text>
|
196
|
|
- </view>
|
|
173
|
+ </view>
|
|
174
|
+ {/* --------房屋位置-------- */}
|
|
175
|
+ {
|
|
176
|
+ !roomGps ? <view></view>
|
|
177
|
+ :
|
|
178
|
+ <view className='room-box-info-HouLocation'>
|
|
179
|
+ <view className='room-bi-name-HouLocation' >
|
|
180
|
+ <view className='room-bin-title-HouLocation'>房屋位置</view>
|
|
181
|
+ <view className='room-bint-nameInfo-HouLocation'>
|
|
182
|
+ <view className='room-bint-nameInfo-bool-HouLocation' >{taRoomContent?.address}</view>
|
|
183
|
+ <view className='room-bintn-button-HouLocation' onClick={() => { goRoomMap() }} style={{ display: wifiButtonStyle }}>
|
|
184
|
+ <image className='room-bintn-image-HouLocation' src={GPS} />
|
|
185
|
+ <text className='room-bintn-text-HouLocation'>去这里</text>
|
197
|
186
|
</view>
|
198
|
187
|
</view>
|
199
|
188
|
</view>
|
|
189
|
+ </view>
|
200
|
190
|
|
201
|
|
- }
|
202
|
|
-
|
203
|
|
-
|
204
|
|
- {/* --------停车场-------- */}
|
205
|
|
- {
|
206
|
|
- !parkingGps ? <view></view>
|
207
|
|
- :
|
208
|
|
- <view className='room-box-info-Parking'>
|
209
|
|
- <view className='room-bi-name-Parking' >
|
210
|
|
- <view className='room-bin-title-Parking'>停车位置</view>
|
211
|
|
- <view className='room-bint-nameInfo-Parking'>
|
212
|
|
- <view className='room-bint-nameInfo-bool-Parking' >{taRoomContent?.parkingAddress}</view>
|
213
|
|
- <view className='room-bintn-button-Parking' onClick={() => { goParkMap() }} style={{ display: wifiButtonStyle }}>
|
214
|
|
- <image className='room-bintn-image-Parking' src={GPS} />
|
215
|
|
- <text className='room-bintn-text-Parking'>去这里</text>
|
216
|
|
- </view>
|
|
191
|
+ }
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+ {/* --------停车场-------- */}
|
|
195
|
+ {
|
|
196
|
+ !parkingGps ? <view></view>
|
|
197
|
+ :
|
|
198
|
+ <view className='room-box-info-Parking'>
|
|
199
|
+ <view className='room-bi-name-Parking' >
|
|
200
|
+ <view className='room-bin-title-Parking'>停车位置</view>
|
|
201
|
+ <view className='room-bint-nameInfo-Parking'>
|
|
202
|
+ <view className='room-bint-nameInfo-bool-Parking' >{taRoomContent?.parkingAddress}</view>
|
|
203
|
+ <view className='room-bintn-button-Parking' onClick={() => { goParkMap() }} style={{ display: wifiButtonStyle }}>
|
|
204
|
+ <image className='room-bintn-image-Parking' src={GPS} />
|
|
205
|
+ <text className='room-bintn-text-Parking'>去这里</text>
|
217
|
206
|
</view>
|
218
|
207
|
</view>
|
219
|
208
|
</view>
|
|
209
|
+ </view>
|
220
|
210
|
|
221
|
|
- }
|
|
211
|
+ }
|
222
|
212
|
|
223
|
213
|
|
224
|
|
- {/* --------无线网-------- */}
|
225
|
|
- <view className='room-box-info-WIFIContent'>
|
226
|
|
- <view className='room-bi-name-WIFIContent' >
|
227
|
|
- <view className='room-bin-title-WIFIContent'>WiFi信息</view>
|
228
|
|
- <view className='room-bint-nameInfo-WIFIContent'>
|
229
|
|
- <view className='room-bint-nameInfo-bool-WIFIContent-wifi' >名称:{taRoomContent?.wifiName}</view>
|
230
|
|
- <view className='room-bint-nameInfo-bool-WIFIContent-password' >密码:{taRoomContent?.wifiPassword}</view>
|
231
|
|
- <view className='room-bintn-button-WIFIContent' onClick={() => { wifiCopy() }} style={{ display: wifiButtonStyle }}>
|
232
|
|
- <image className='room-bintn-image-WIFIContent' src={copy_logo} />
|
233
|
|
- <text className='room-bintn-text-WIFIContent'>复制</text>
|
234
|
|
- </view>
|
|
214
|
+ {/* --------无线网-------- */}
|
|
215
|
+ <view className='room-box-info-WIFIContent'>
|
|
216
|
+ <view className='room-bi-name-WIFIContent' >
|
|
217
|
+ <view className='room-bin-title-WIFIContent'>WiFi信息</view>
|
|
218
|
+ <view className='room-bint-nameInfo-WIFIContent'>
|
|
219
|
+ <view className='room-bint-nameInfo-bool-WIFIContent-wifi' >名称:{taRoomContent?.wifiName}</view>
|
|
220
|
+ <view className='room-bint-nameInfo-bool-WIFIContent-password' >密码:{taRoomContent?.wifiPassword}</view>
|
|
221
|
+ <view className='room-bintn-button-WIFIContent' onClick={() => { wifiCopy() }} style={{ display: wifiButtonStyle }}>
|
|
222
|
+ <image className='room-bintn-image-WIFIContent' src={copy_logo} />
|
|
223
|
+ <text className='room-bintn-text-WIFIContent'>复制</text>
|
235
|
224
|
</view>
|
236
|
225
|
</view>
|
237
|
226
|
</view>
|
|
227
|
+ </view>
|
238
|
228
|
|
239
|
|
- <view className='Guide-Content-box' >
|
240
|
|
- <view className='title-image' style={{ display: guideStyle }} >
|
241
|
|
- <image mode='scaleToFill' className='title-image-cup' src={BlackSpot} />
|
242
|
|
- <text className='title-title-boss' >更多指引</text>
|
243
|
|
- </view>
|
244
|
|
- <view style={{ padding: '0 30rpx', boxSizing: 'border-box' }}>
|
245
|
|
- {(extend || []).map((item, index) => <MoreGuide key={(index)} item={item} />)}
|
246
|
|
- </view>
|
|
229
|
+ <view className='Guide-Content-box' >
|
|
230
|
+ <view className='title-image' style={{ display: guideStyle }} >
|
|
231
|
+ <image mode='scaleToFill' className='title-image-cup' src={BlackSpot} />
|
|
232
|
+ <text className='title-title-boss' >更多指引</text>
|
247
|
233
|
</view>
|
248
|
|
- </SpinBox>
|
249
|
|
- )
|
250
|
|
- }
|
251
|
|
- <view className='Guide-Content-box'>
|
252
|
|
- <view className='title-image'>
|
253
|
|
- <image mode='scaleToFill' className='title-image-cup' src={Cup} />
|
254
|
|
- <text className='title-title-boss' >老板推荐好吃的</text>
|
255
|
|
- </view>
|
256
|
|
- </view>
|
257
|
|
- <view style={{ marginTop: '10rpx', marginBottom: '60rpx' }}>
|
258
|
|
- {(spackage || []).map((item, index) => <BossCard det={item} st={parseFloat(item.score.toFixed(1))} key={(index)} trackClick={trackClick} taRoomContent={taRoomContent} item={item} />)}
|
|
234
|
+ <view style={{ padding: '0 30rpx', boxSizing: 'border-box' }}>
|
|
235
|
+ {(extend || []).map((item, index) => <MoreGuide key={(index)} item={item} />)}
|
|
236
|
+ </view>
|
|
237
|
+ </view>
|
|
238
|
+ </SpinBox>
|
|
239
|
+ )
|
|
240
|
+ }
|
|
241
|
+ <view className='Guide-Content-box'>
|
|
242
|
+ <view className='title-image'>
|
|
243
|
+ <image mode='scaleToFill' className='title-image-cup' src={Cup} />
|
|
244
|
+ <text className='title-title-boss' >老板推荐好吃的</text>
|
259
|
245
|
</view>
|
260
|
|
-
|
261
|
246
|
</view>
|
|
247
|
+ <view style={{ marginTop: '10rpx', marginBottom: '60rpx' }}>
|
|
248
|
+ {(spackage || []).map((item, index) => <BossCard det={item} st={parseFloat(item.score.toFixed(1))} key={(index)} trackClick={trackClick} taRoomContent={taRoomContent} item={item} />)}
|
|
249
|
+ </view>
|
|
250
|
+ </view>
|
262
|
251
|
</scroll-view>
|
263
|
252
|
)
|
264
|
253
|
}
|