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