|
@@ -1,16 +1,13 @@
|
1
|
1
|
import { useState, useEffect } from "react";
|
2
|
2
|
import Taro, { useDidShow } from '@tarojs/taro'
|
3
|
3
|
import MoreGuide from "@/components/MoreGuide";
|
4
|
|
-import BossCard from '@/components/BossCard'
|
5
|
4
|
import SpinBox from "@/components/Spin/SpinBox";
|
6
|
|
-import { Image, View } from "@tarojs/components";
|
|
5
|
+import { Image, View,Text } from "@tarojs/components";
|
7
|
6
|
import GPS from '@/assets/icons/GuideCheck/GPS.png'
|
8
|
7
|
import copy_logo from '@/assets/icons/GuideCheck/copy_logo.png'
|
9
|
|
-import Cup from '@/assets/icons/GuideCheck/Cup.png'
|
10
|
8
|
import BlackSpot from '@/assets/icons/GuideCheck/BlackSpot.png'
|
11
|
|
-import { getRecommendList, getExtendContent } from '@/services/home'
|
|
9
|
+import { getExtendContent } from '@/services/home'
|
12
|
10
|
import { getTaRoom, goToRoomForm } from '@/services/taRoom'
|
13
|
|
-import useTrackClick from '@/utils/hooks/useTrackClick'
|
14
|
11
|
import { useModel } from "@/store";
|
15
|
12
|
import Customized from '../components/Customized'
|
16
|
13
|
import './GuideCss/style.less'
|
|
@@ -21,7 +18,6 @@ export default (props) => {
|
21
|
18
|
let { roomId, roomOrderId } = router.params
|
22
|
19
|
const [extend, setExtend] = useState([])
|
23
|
20
|
const [ifroomId, setIfroomId] = useState('havenot')
|
24
|
|
- const [spackage, setPackage] = useState([])
|
25
|
21
|
const [loading, setLoading] = useState(false)
|
26
|
22
|
|
27
|
23
|
const { roomId: rid } = useModel('hotel')
|
|
@@ -30,8 +26,6 @@ export default (props) => {
|
30
|
26
|
roomId = rid
|
31
|
27
|
}
|
32
|
28
|
|
33
|
|
- const trackClick = useTrackClick(router)
|
34
|
|
-
|
35
|
29
|
const [taRoomContent, setTaRoomContent] = useState([])
|
36
|
30
|
|
37
|
31
|
const goContent = () => {
|
|
@@ -46,10 +40,6 @@ export default (props) => {
|
46
|
40
|
}
|
47
|
41
|
}
|
48
|
42
|
|
49
|
|
- useEffect(() => {
|
50
|
|
- goContent()
|
51
|
|
- }, [roomId, roomOrderId])
|
52
|
|
-
|
53
|
43
|
useDidShow(() => {
|
54
|
44
|
goContent()
|
55
|
45
|
})
|
|
@@ -74,17 +64,6 @@ export default (props) => {
|
74
|
64
|
})
|
75
|
65
|
//更多指引
|
76
|
66
|
getGuidelist()
|
77
|
|
- getRecommendList({ location: taRoomContent.location || '' }).then((res) => {
|
78
|
|
- setPackage(res || [])
|
79
|
|
- setLoading(false)
|
80
|
|
- })
|
81
|
|
- } else {
|
82
|
|
- setLoading(true)
|
83
|
|
- getRecommendList({ location: location }).then((res) => {
|
84
|
|
- setPackage(res || [])
|
85
|
|
- setLoading(false)
|
86
|
|
- })
|
87
|
|
- return
|
88
|
67
|
}
|
89
|
68
|
}, [roomId, taRoomContent?.wifiPassword, taRoomContent?.parkingAddress, location, taRoomContent.location])
|
90
|
69
|
|
|
@@ -133,89 +112,87 @@ export default (props) => {
|
133
|
112
|
Taro.redirectTo({ url: '/pages/index/index' })
|
134
|
113
|
}
|
135
|
114
|
return (
|
136
|
|
- <scroll-view scrollY style={{ height: '100%' }} >
|
137
|
|
- <view className='Guide-Home-box'>
|
138
|
|
- {/* 有民宿的情况下 */}
|
139
|
|
- {
|
140
|
|
- ifroomId === 'reality' && (
|
141
|
|
- <SpinBox loading={loading}>
|
142
|
|
- <view className='room-box-info-ROOM'>
|
143
|
|
- <view className='room-bi-name-ROOM' >
|
144
|
|
- <view className='room-bin-title-ROOM'>房屋名称</view>
|
145
|
|
- <view className='room-bint-nameInfo-ROOM'>{taRoomContent?.roomName}
|
146
|
|
- </view>
|
147
|
|
- </view>
|
148
|
|
- </view>
|
149
|
|
- {/* --------房屋位置-------- */}
|
150
|
|
- <view className='room-box-info-HouLocation'>
|
151
|
|
- <view className='room-bi-name-HouLocation' >
|
152
|
|
- <view className='room-bin-title-HouLocation'>房屋位置</view>
|
153
|
|
- <view className='room-bint-nameInfo-HouLocation'>
|
154
|
|
- <view className='room-bint-nameInfo-bool-HouLocation' >{taRoomContent?.address}</view>
|
155
|
|
- <view className='room-bintn-button-HouLocation' onClick={() => { goRoomMap() }}>
|
156
|
|
- <image className='room-bintn-image-HouLocation' src={GPS} />
|
157
|
|
- <text className='room-bintn-text-HouLocation'>去这里</text>
|
158
|
|
- </view>
|
159
|
|
- </view>
|
160
|
|
- </view>
|
161
|
|
- </view>
|
162
|
|
- {/* --------停车场-------- */}
|
163
|
|
- {
|
164
|
|
- !taRoomContent.parkingLocation ? null :
|
165
|
|
- <view className='room-box-info-Parking'>
|
166
|
|
- <view className='room-bi-name-Parking' >
|
167
|
|
- <view className='room-bin-title-Parking'>停车位置</view>
|
168
|
|
- <view className='room-bint-nameInfo-Parking'>
|
169
|
|
- <view className='room-bint-nameInfo-bool-Parking' >{taRoomContent?.parkingAddress}</view>
|
170
|
|
- <view className='room-bintn-button-Parking' onClick={() => { goParkMap() }}>
|
171
|
|
- <image className='room-bintn-image-Parking' src={GPS} />
|
172
|
|
- <text className='room-bintn-text-Parking'>去这里</text>
|
173
|
|
- </view>
|
174
|
|
- </view>
|
175
|
|
- </view>
|
176
|
|
- </view>
|
177
|
|
- }
|
178
|
|
- {/* --------无线网-------- */}
|
179
|
|
- {
|
180
|
|
- !taRoomContent.wifiName && !taRoomContent.wifiPassword ? null :
|
181
|
|
- <view className='room-box-info-WIFIContent'>
|
182
|
|
- <view className='room-bi-name-WIFIContent' >
|
183
|
|
- <view className='room-bin-title-WIFIContent'>WiFi信息</view>
|
184
|
|
- <view className='room-bint-nameInfo-WIFIContent'>
|
185
|
|
- <view className='room-bint-nameInfo-bool-WIFIContent-wifi' >名称:{taRoomContent?.wifiName}</view>
|
186
|
|
- <view className='room-bint-nameInfo-bool-WIFIContent-password' >密码:{taRoomContent?.wifiPassword}</view>
|
187
|
|
- <view className='room-bintn-button-WIFIContent' onClick={() => { wifiCopy() }}>
|
188
|
|
- <image className='room-bintn-image-WIFIContent' src={copy_logo} />
|
189
|
|
- <text className='room-bintn-text-WIFIContent'>复制</text>
|
190
|
|
- </view>
|
191
|
|
- </view>
|
192
|
|
- </view>
|
193
|
|
- </view>
|
194
|
|
- }
|
195
|
|
- {
|
196
|
|
- extend.length === 0 ? null :
|
197
|
|
- <view className='Guide-Content-box' >
|
198
|
|
- <view className='title-image'>
|
199
|
|
- <image mode='scaleToFill' className='title-image-cup' src={BlackSpot} />
|
200
|
|
- <text className='title-title-boss' >更多指引</text>
|
201
|
|
- </view>
|
202
|
|
- <view>
|
203
|
|
- {(extend || []).map((item, index) => <MoreGuide key={(index)} item={item} />)}
|
204
|
|
- </view>
|
205
|
|
- </view>
|
206
|
|
- }
|
207
|
|
- </SpinBox>
|
208
|
|
- )
|
209
|
|
- }
|
210
|
|
- <view className='Guide-Content-box'>
|
211
|
|
- <Customized />
|
212
|
|
- </view>
|
213
|
|
- <view className={`Guide-bottom-box ${ifroomId === 'reality' ? '' : 'Guide-bottom-two'}`}>
|
214
|
|
- <Image mode='widthFix' style={{ width: '100%' }} src='http://yz-shigongli.oss-cn-shanghai.aliyuncs.com/images/hotel_guide_help.png' onClick={goIndex} />
|
215
|
|
-
|
216
|
|
- </view>
|
217
|
|
- </view>
|
218
|
|
-
|
219
|
|
- </scroll-view>
|
|
115
|
+ <scroll-view scrollY style={{ height: '100%' }} >
|
|
116
|
+ <View className='Guide-Home-box'>
|
|
117
|
+ {/* 有民宿的情况下 */}
|
|
118
|
+ {
|
|
119
|
+ ifroomId === 'reality' && (
|
|
120
|
+ <SpinBox loading={loading}>
|
|
121
|
+ <View className='room-box-info-ROOM'>
|
|
122
|
+ <View className='room-bi-name-ROOM' >
|
|
123
|
+ <View className='room-bin-title-ROOM'>房屋名称</View>
|
|
124
|
+ <View className='room-bint-nameInfo-ROOM'>{taRoomContent?.roomName}
|
|
125
|
+ </View>
|
|
126
|
+ </View>
|
|
127
|
+ </View>
|
|
128
|
+ {/* --------房屋位置-------- */}
|
|
129
|
+ <View className='room-box-info-HouLocation'>
|
|
130
|
+ <View className='room-bi-name-HouLocation' >
|
|
131
|
+ <View className='room-bin-title-HouLocation'>房屋位置</View>
|
|
132
|
+ <View className='room-bint-nameInfo-HouLocation'>
|
|
133
|
+ <View className='room-bint-nameInfo-bool-HouLocation' >{taRoomContent?.address}</View>
|
|
134
|
+ <View className='room-bintn-button-HouLocation' onClick={() => { goRoomMap() }}>
|
|
135
|
+ <Image className='room-bintn-image-HouLocation' src={GPS} />
|
|
136
|
+ <Text className='room-bintn-text-HouLocation'>去这里</Text>
|
|
137
|
+ </View>
|
|
138
|
+ </View>
|
|
139
|
+ </View>
|
|
140
|
+ </View>
|
|
141
|
+ {/* --------停车场-------- */}
|
|
142
|
+ {
|
|
143
|
+ !taRoomContent.parkingLocation ? null :
|
|
144
|
+ <View className='room-box-info-Parking'>
|
|
145
|
+ <View className='room-bi-name-Parking' >
|
|
146
|
+ <View className='room-bin-title-Parking'>停车位置</View>
|
|
147
|
+ <View className='room-bint-nameInfo-Parking'>
|
|
148
|
+ <View className='room-bint-nameInfo-bool-Parking' >{taRoomContent?.parkingAddress}</View>
|
|
149
|
+ <View className='room-bintn-button-Parking' onClick={() => { goParkMap() }}>
|
|
150
|
+ <Image className='room-bintn-image-Parking' src={GPS} />
|
|
151
|
+ <Text className='room-bintn-text-Parking'>去这里</Text>
|
|
152
|
+ </View>
|
|
153
|
+ </View>
|
|
154
|
+ </View>
|
|
155
|
+ </View>
|
|
156
|
+ }
|
|
157
|
+ {/* --------无线网-------- */}
|
|
158
|
+ {
|
|
159
|
+ !taRoomContent.wifiName && !taRoomContent.wifiPassword ? null :
|
|
160
|
+ <View className='room-box-info-WIFIContent'>
|
|
161
|
+ <View className='room-bi-name-WIFIContent' >
|
|
162
|
+ <View className='room-bin-title-WIFIContent'>WiFi信息</View>
|
|
163
|
+ <View className='room-bint-nameInfo-WIFIContent'>
|
|
164
|
+ <View className='room-bint-nameInfo-bool-WIFIContent-wifi' >名称:{taRoomContent?.wifiName}</View>
|
|
165
|
+ <View className='room-bint-nameInfo-bool-WIFIContent-password' >密码:{taRoomContent?.wifiPassword}</View>
|
|
166
|
+ <View className='room-bintn-button-WIFIContent' onClick={() => { wifiCopy() }}>
|
|
167
|
+ <Image className='room-bintn-image-WIFIContent' src={copy_logo} />
|
|
168
|
+ <Text className='room-bintn-text-WIFIContent'>复制</Text>
|
|
169
|
+ </View>
|
|
170
|
+ </View>
|
|
171
|
+ </View>
|
|
172
|
+ </View>
|
|
173
|
+ }
|
|
174
|
+ {
|
|
175
|
+ extend.length === 0 ? null :
|
|
176
|
+ <View className='Guide-Content-box' >
|
|
177
|
+ <View className='title-image'>
|
|
178
|
+ <Image mode='scaleToFill' className='title-image-cup' src={BlackSpot} />
|
|
179
|
+ <Text className='title-title-boss' >更多指引</Text>
|
|
180
|
+ </View>
|
|
181
|
+ <View>
|
|
182
|
+ {(extend || []).map((item, index) => <MoreGuide key={(index)} item={item} />)}
|
|
183
|
+ </View>
|
|
184
|
+ </View>
|
|
185
|
+ }
|
|
186
|
+ </SpinBox>
|
|
187
|
+ )
|
|
188
|
+ }
|
|
189
|
+ <View className='Guide-Content-box'>
|
|
190
|
+ <Customized />
|
|
191
|
+ </View>
|
|
192
|
+ <View className={`Guide-bottom-box ${ifroomId === 'reality' ? '' : 'Guide-bottom-two'}`}>
|
|
193
|
+ <Image mode='widthFix' style={{ width: '100%' }} src='http://yz-shigongli.oss-cn-shanghai.aliyuncs.com/images/hotel_guide_help.png' onClick={goIndex} />
|
|
194
|
+ </View>
|
|
195
|
+ </View>
|
|
196
|
+ </scroll-view>
|
220
|
197
|
)
|
221
|
198
|
}
|