|
@@ -1,6 +1,8 @@
|
1
|
1
|
import { useState, useEffect, useRef } from "react";
|
2
|
|
-import withLayout from '@/layouts'
|
3
|
2
|
import Taro from '@tarojs/taro'
|
|
3
|
+import MoreGuide from "@/components/MoreGuide";
|
|
4
|
+import Cards from '@/components/foodCards/foodCards.jsx'
|
|
5
|
+
|
4
|
6
|
import image from '@/assets/icons/ProCard/8kb.jpg'
|
5
|
7
|
import Pay from '@/assets/icons/GuideCheck/Pay_logo.png'
|
6
|
8
|
import food from '@/assets/icons/ProCard/food.png'
|
|
@@ -13,11 +15,11 @@ import Cup from '@/assets/icons/GuideCheck/Cup.png'
|
13
|
15
|
import BlackSpot from '@/assets/icons/GuideCheck/BlackSpot.png'
|
14
|
16
|
import starOn from '@/assets/icons/GuideCheck/starOn.png'
|
15
|
17
|
import starOff from '@/assets/icons/GuideCheck/starOff.png'
|
16
|
|
-import { getTouristDetail, getExtendContent, getRecommendList } from '@/services/home'
|
|
18
|
+import { getRecommendList, getExtendContent, getShopPackage } from '@/services/home'
|
17
|
19
|
import sleep from '@/assets/icons/GuideCheck/sleep_logo.png'
|
18
|
20
|
import { getTaRoom, goToRoomForm } from '@/services/taRoom'
|
|
21
|
+import showMore from '../../../assets/icons/housemantj/查看更多.png'
|
19
|
22
|
|
20
|
|
-import MoreGuide from "@/components/MoreGuide";
|
21
|
23
|
import './GuideCss/style.less'
|
22
|
24
|
|
23
|
25
|
|
|
@@ -28,20 +30,37 @@ const score = '3.9'
|
28
|
30
|
|
29
|
31
|
export default (props) => {
|
30
|
32
|
const { router, person } = props
|
|
33
|
+ console.log("🚀 ~ file: Guide.jsx ~ line 34 ~ props", props)
|
31
|
34
|
const { roomId, location, roomOrderId } = router.params
|
32
|
35
|
const [value, setVaule] = useState('已收藏')
|
33
|
36
|
const [imageSrc, setImageSrc] = useState(starOn)
|
34
|
37
|
const [extend, setExtend] = useState([])
|
35
|
38
|
const [ifroomId, setIfroomId] = useState('havenot')
|
|
39
|
+ const [spackage, setPackage] = useState([])
|
|
40
|
+
|
36
|
41
|
// 住宿经纬度
|
37
|
42
|
const Roomlog = useRef('')
|
38
|
43
|
const Roomlat = useRef('')
|
39
|
44
|
// 停车场经纬度
|
40
|
45
|
const Parklog = useRef('')
|
41
|
46
|
const Parklat = useRef('')
|
42
|
|
-
|
43
|
47
|
const [taRoomContent, setTaRoomContent] = useState([])
|
44
|
48
|
|
|
49
|
+
|
|
50
|
+ //当前指南总数
|
|
51
|
+ const [newextNum, setNewextNum] = useState(0)
|
|
52
|
+ //全部指南个数
|
|
53
|
+ const [AllextNum, setAllextNum] = useState(0)
|
|
54
|
+ //指南当前页数
|
|
55
|
+ const [epage, setepage] = useState(2)
|
|
56
|
+ const extendMore = () => {
|
|
57
|
+ setepage(epage + 1)
|
|
58
|
+ getExtendContent('room', roomId, { pageNum: epage }).then((res) => {
|
|
59
|
+ setExtend([...extend, ...res.records])
|
|
60
|
+ setNewextNum(newextNum + res.records.length)
|
|
61
|
+ })
|
|
62
|
+ }
|
|
63
|
+
|
45
|
64
|
useEffect(() => {
|
46
|
65
|
if (roomOrderId) {
|
47
|
66
|
goToRoomForm(roomOrderId).then((res) => {
|
|
@@ -55,9 +74,17 @@ export default (props) => {
|
55
|
74
|
}
|
56
|
75
|
}, [roomOrderId])
|
57
|
76
|
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
|
58
|
80
|
useEffect(() => {
|
|
81
|
+ // 老板推荐的套餐
|
|
82
|
+ getRecommendList({ location: location }).then((res) => {
|
|
83
|
+ setPackage(res || [])
|
|
84
|
+ })
|
59
|
85
|
|
60
|
86
|
if (roomId) {
|
|
87
|
+ // 点击’去这里‘跳转导航
|
61
|
88
|
getTaRoom(roomId).then((res) => {
|
62
|
89
|
Roomlog.current = (res.location).toString().split(',')[0]
|
63
|
90
|
Roomlat.current = (res.location).toString().split(',')[1]
|
|
@@ -66,18 +93,20 @@ export default (props) => {
|
66
|
93
|
setTaRoomContent(res || [])
|
67
|
94
|
console.log(res);
|
68
|
95
|
})
|
|
96
|
+ //更多指引
|
69
|
97
|
getExtendContent('room', roomId).then((res) => {
|
70
|
98
|
setExtend(res.records || [])
|
71
|
99
|
setIfroomId('reality')
|
|
100
|
+ setAllextNum(res.total)
|
|
101
|
+ setNewextNum(res.records.length)
|
72
|
102
|
})
|
73
|
103
|
|
74
|
104
|
|
75
|
105
|
} else {
|
76
|
106
|
console.log('房源没有ID');
|
|
107
|
+ return
|
77
|
108
|
}
|
78
|
|
- // getRecommendList({ location: location }).then((res) => {
|
79
|
|
- // setRecommend(res || [])
|
80
|
|
- // })
|
|
109
|
+
|
81
|
110
|
}, [roomId])
|
82
|
111
|
|
83
|
112
|
|
|
@@ -121,14 +150,12 @@ export default (props) => {
|
121
|
150
|
|
122
|
151
|
|
123
|
152
|
|
|
153
|
+
|
124
|
154
|
const AddCollect = () => {
|
125
|
155
|
setImageSrc(starOff)
|
126
|
156
|
setVaule('加入收藏')
|
127
|
157
|
|
128
|
158
|
}
|
129
|
|
- const handleClick = () => {
|
130
|
|
- Taro.navigateTo({ url: '/pages/test/index' })
|
131
|
|
- }
|
132
|
159
|
// onClick={handleClick}
|
133
|
160
|
return (
|
134
|
161
|
<scroll-view scroll-y style='height: 77vh;' >
|
|
@@ -200,114 +227,30 @@ export default (props) => {
|
200
|
227
|
<text className='MessageCard-text' onClick={() => { wifiCopy() }}>复制</text>
|
201
|
228
|
</view>
|
202
|
229
|
</view>
|
203
|
|
- </view>
|
204
|
230
|
|
|
231
|
+ <view className='Guide-Content-box' >
|
|
232
|
+ <view className='title-image'>
|
|
233
|
+ <image mode='scaleToFill' className='title-image-cup' src={BlackSpot} />
|
|
234
|
+ <text className='title-title-boss' >更多指引</text>
|
|
235
|
+ </view>
|
|
236
|
+ {extend?.map((item, index) => <MoreGuide key={(index)} item={item} />)}
|
|
237
|
+
|
|
238
|
+ <view className='showMore' style={{ display: newextNum == AllextNum ? 'none' : '' }} onClick={extendMore}>
|
|
239
|
+ <view>点击查看更多</view>
|
|
240
|
+ <image src={showMore} className='moreTip' />
|
|
241
|
+ </view>
|
|
242
|
+ </view>
|
|
243
|
+ </view>
|
205
|
244
|
)
|
206
|
245
|
}
|
207
|
|
-
|
208
|
|
-
|
209
|
|
- {/* 更多指引开始 */}
|
210
|
|
- <view className='Guide-Content-box'>
|
211
|
|
- <view className='title-image'>
|
212
|
|
- <image mode='scaleToFill' className='title-image-cup' src={BlackSpot} />
|
213
|
|
- <text className='title-title-boss' >更多指引</text>
|
214
|
|
- </view>
|
215
|
|
- </view>
|
216
|
|
- {extend?.map((item, index) => <MoreGuide key={(index)} item={item} />)}
|
217
|
|
- {/* 更多指引结束 */}
|
218
|
246
|
<view className='Guide-Content-box'>
|
219
|
247
|
<view className='title-image'>
|
220
|
248
|
<image mode='scaleToFill' className='title-image-cup' src={Cup} />
|
221
|
249
|
<text className='title-title-boss' >老板推荐好吃的</text>
|
222
|
250
|
</view>
|
223
|
251
|
</view>
|
224
|
|
- {/* 小标题结束 */}
|
225
|
|
- <view class='wrapper'>
|
226
|
|
- <view class='left-complete-one'>
|
227
|
|
- <image className='left-image-1' src={ProCard_hot}></image>
|
228
|
|
- <view className='left-viewText'>
|
229
|
|
- 返现¥16.00
|
230
|
|
- </view>
|
231
|
|
- {/* 评分 */}
|
232
|
|
- <view className='card-box-star'>
|
233
|
|
- {
|
234
|
|
- scoreList.map((_, index) => {
|
235
|
|
- const src = (index + '0.1') < score ? starOn : starOff
|
236
|
|
- return (
|
237
|
|
- <image className='card-star-image' key={index} src={src} />
|
238
|
|
- )
|
239
|
|
- })
|
240
|
|
- }
|
241
|
|
- <text className='card-star-text' >{score}</text>
|
242
|
|
- </view>
|
243
|
|
- <view className='title-image'>
|
244
|
|
- <image className='image-1' mode='scaleToFill' src={image}></image>
|
245
|
|
- <image className='image-2' src={food}></image>
|
246
|
|
- </view>
|
247
|
|
- <view className='title-content'>
|
248
|
|
- <view className='Pro-title'>
|
249
|
|
- <view className='title-text'>【橘里橘啊换行啊啊啊气咖啡店】新鲜出炉啦!</view>
|
250
|
|
- </view>
|
251
|
|
- <text className='title-money' >¥6990元<text className='title-money-2'>门市价78元</text></text>
|
252
|
|
- <view className='title-position-on'>
|
253
|
|
- <image className='title-position' src={position} />
|
254
|
|
- <text className='title-position-image'>南京市/秦淮区</text>
|
255
|
|
- <image className='title-on' src={imageSrc} />
|
256
|
|
- <text onClick={() => AddCollect()} className='title-on-text'>{value}</text>
|
257
|
|
- </view>
|
258
|
|
- </view>
|
259
|
|
- </view>
|
260
|
|
- <view class='right-complete-two'>
|
261
|
|
- <view className='right-content'>
|
262
|
|
- <image className='right-image' src={Pay} />
|
263
|
|
- <view className='right-title'>支付</view>
|
264
|
|
- </view>
|
265
|
|
- </view>
|
266
|
|
- </view>
|
267
|
|
- {/* 卡片----------------- */}
|
268
|
|
- <view class='wrapper'>
|
269
|
|
- <view class='left-complete-one'>
|
270
|
|
- <image className='left-image-1' src={ProCard_hot}></image>
|
271
|
|
- <view className='left-viewText'>
|
272
|
|
- 返现¥16.00
|
273
|
|
- </view>
|
274
|
|
- {/* 评分 */}
|
275
|
|
- <view className='card-box-star'>
|
276
|
|
- {
|
277
|
|
- scoreList.map((_, index) => {
|
278
|
|
- const src = (index + '0.1') < score ? starOn : starOff
|
279
|
|
- return (
|
280
|
|
- <image className='card-star-image' key={index} src={src} />
|
281
|
|
- )
|
282
|
|
- })
|
283
|
|
- }
|
284
|
|
- <text className='card-star-text' >{score}</text>
|
285
|
|
- </view>
|
286
|
|
- <view className='title-image'>
|
287
|
|
- <image className='image-1' mode='scaleToFill' src={image}></image>
|
288
|
|
- <image className='image-2' src={food}></image>
|
289
|
|
- </view>
|
290
|
|
- <view className='title-content'>
|
291
|
|
- <view className='Pro-title'>
|
292
|
|
- <view className='title-text'>【橘里橘啊换行啊啊啊气咖啡店】新鲜出炉啦!</view>
|
293
|
|
- </view>
|
294
|
|
- <text className='title-money' >¥6990元<text className='title-money-2'>门市价78元</text></text>
|
295
|
|
- <view className='title-position-on'>
|
296
|
|
- <image className='title-position' src={position} />
|
297
|
|
- <text className='title-position-image'>南京市/秦淮区</text>
|
298
|
|
- <image className='title-on' src={imageSrc} />
|
299
|
|
- <text onClick={() => AddCollect()} className='title-on-text'>{value}</text>
|
300
|
|
- </view>
|
301
|
|
- </view>
|
302
|
|
- </view>
|
303
|
|
- <view class='right-complete-two'>
|
304
|
|
- <view className='right-content'>
|
305
|
|
- {/* <view className='right-number'>×1</view> */}
|
306
|
|
- <image className='right-image' src={Pay} />
|
307
|
|
- <view className='right-title'>支付</view>
|
308
|
|
- </view>
|
309
|
|
- </view>
|
310
|
|
- </view>
|
|
252
|
+ {spackage?.map((item, index) => <Cards key={(index)} item={item} />)}
|
|
253
|
+
|
311
|
254
|
{/* 卡片------------- */}
|
312
|
255
|
{/* <view className='Guide-Content-box-two'>
|
313
|
256
|
<view className='title-image-two'>
|