吃个甘蔗嚼一年 3 years ago
parent
commit
5f1113d31b
1 changed files with 34 additions and 42 deletions
  1. 34
    42
      src/pages/index/tabs/Guide.jsx

+ 34
- 42
src/pages/index/tabs/Guide.jsx View File

45
   const [wifiButtonStyle, setWifiButtonStyle] = useState('')
45
   const [wifiButtonStyle, setWifiButtonStyle] = useState('')
46
   const [parkingButtonStyle, setParkingButtonStyle] = useState('')
46
   const [parkingButtonStyle, setParkingButtonStyle] = useState('')
47
   const [guideStyle, setGuideStyle] = useState('')
47
   const [guideStyle, setGuideStyle] = useState('')
48
+  const parkingGps = taRoomContent?.parkingLocation
49
+  const roomGps = taRoomContent?.location
50
+
48
 
51
 
49
-  //当前指南总数
50
-  const [newextNum, setNewextNum] = useState(0)
51
-  //全部指南个数
52
-  const [AllextNum, setAllextNum] = useState(0)
53
-  //指南当前页数
54
-  const extendMore = () => {
55
-    getExtendContent('room', roomId, { pageNum: 99999 }).then((res) => {
56
-      setExtend([...extend, ...res.records])
57
-      setNewextNum(newextNum + res.records.length)
58
-    })
59
-  }
60
 
52
 
61
   const goContent = () => {
53
   const goContent = () => {
62
     if (roomOrderId) {
54
     if (roomOrderId) {
81
       // 点击’去这里‘跳转导航
73
       // 点击’去这里‘跳转导航
82
       setLoading(true)
74
       setLoading(true)
83
       getTaRoom(roomId).then((res) => {
75
       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]
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]
88
         setTaRoomContent(res || [])
80
         setTaRoomContent(res || [])
89
         setLoading(false)
81
         setLoading(false)
90
 
82
 
92
       //更多指引
84
       //更多指引
93
       setLoading(true)
85
       setLoading(true)
94
 
86
 
95
-      getExtendContent('room', roomId).then((res) => {
96
-        setExtend(res.records || [])
87
+      getExtendContent('room', roomId, {
88
+        pageNum: 99,
89
+        pageSize: 999,
90
+
91
+      }).then((res) => {
92
+        // setExtend(res.records || [])
93
+        setExtend(res.records)
94
+
97
         setIfroomId('reality')
95
         setIfroomId('reality')
98
-        setAllextNum(res.total)
99
-        setNewextNum(res.records.length)
96
+
100
         setLoading(false)
97
         setLoading(false)
101
 
98
 
102
       })
99
       })
125
       setParkingButtonStyle('none')
122
       setParkingButtonStyle('none')
126
     }
123
     }
127
   })
124
   })
125
+  const geiZy = () => {
126
+    setLoading(true)
127
+    getExtendContent('room', roomId, {
128
 
128
 
129
-  const parkingGps = taRoomContent?.parkingLocation
130
-  const roomGps = taRoomContent?.location
131
-  useEffect(() => {
129
+    }).then((res) => {
130
+      // setExtend(res.records || [])
131
+      setExtend(res.records)
132
+      setIfroomId('reality')
133
+      setLoading(false)
132
 
134
 
135
+    })
136
+    setLoading(true)
137
+  }
138
+
139
+  useEffect(() => {
133
     if (roomId) {
140
     if (roomId) {
134
       setLoading(true)
141
       setLoading(true)
135
       // 点击’去这里‘跳转导航
142
       // 点击’去这里‘跳转导航
136
       getTaRoom(roomId).then((res) => {
143
       getTaRoom(roomId).then((res) => {
137
-        Roomlog.current = (res.location).toString().split(',')[0]
138
-        Roomlat.current = (res.location).toString().split(',')[1]
139
-        Parklog.current = (res.parkingLocation).toString().split(',')[0]
140
-        Parklat.current = (res.parkingLocation).toString().split(',')[1]
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]
141
         setTaRoomContent(res || [])
148
         setTaRoomContent(res || [])
142
         setLoading(false)
149
         setLoading(false)
143
       })
150
       })
144
       //更多指引
151
       //更多指引
145
-      setLoading(true)
146
-
147
-      getExtendContent('room', roomId).then((res) => {
148
-        setExtend(res.records || [])
149
-        setIfroomId('reality')
150
-        setAllextNum(res.total)
151
-        setNewextNum(res.records.length)
152
-        setLoading(false)
153
-
154
-      })
155
-      setLoading(true)
152
+      geiZy()
156
 
153
 
157
       getRecommendList({ location: location }).then((res) => {
154
       getRecommendList({ location: location }).then((res) => {
158
         setPackage(res || [])
155
         setPackage(res || [])
305
                     <text className='title-title-boss' >更多指引</text>
302
                     <text className='title-title-boss' >更多指引</text>
306
                   </view>
303
                   </view>
307
                   {(extend || []).map((item, index) => <MoreGuide key={(index)} item={item} />)}
304
                   {(extend || []).map((item, index) => <MoreGuide key={(index)} item={item} />)}
308
-                  {/* 
309
-                <view className='showMore' style={{ display: newextNum == AllextNum ? 'none' : '' }} onClick={extendMore}>
310
-                  <view>点击查看更多</view>
311
-                  <image src={showMore} className='moreTip' />
312
-                </view> */}
313
                 </view>
305
                 </view>
314
               </view>
306
               </view>
315
             )
307
             )