Baozhangchao 3 years ago
parent
commit
9b31f4061b

+ 6
- 1
src/components/BottomMoadl/index.jsx View File

40
 
40
 
41
 
41
 
42
   useEffect(() => {
42
   useEffect(() => {
43
-
43
+    setLoading(true)
44
     getRecommendList({ location: location, pageNum: textNextSum, pageSize: 3 }).then(e => {
44
     getRecommendList({ location: location, pageNum: textNextSum, pageSize: 3 }).then(e => {
45
       setRecommendContent(e.records)
45
       setRecommendContent(e.records)
46
+      setLoading(false)
47
+
48
+    }).catch(s => {
49
+      setLoading(false)
50
+
46
     })
51
     })
47
   }, [location, textNextSum])
52
   }, [location, textNextSum])
48
 
53
 

+ 3
- 0
src/components/foodCards/NoteCard/index.jsx View File

35
 
35
 
36
 
36
 
37
   useEffect(() => {
37
   useEffect(() => {
38
+    if (item == []) {
39
+      console.log('asdasdsadasd');
40
+    }
38
     setValueList(travelMine.records)
41
     setValueList(travelMine.records)
39
 
42
 
40
 
43
 

+ 0
- 1
src/components/foodCards/RecommendedCard/index.jsx View File

46
 
46
 
47
 
47
 
48
   const handlePayClick = (e) => {
48
   const handlePayClick = (e) => {
49
-    console.log("🚀 ~ file: index.jsx ~ line 25 ~ item", item, travelId)
50
 
49
 
51
     saveTravel(travelId, { dayOrder: dayNumber, targetId: targetId, targetType: targetType }).then((res) => {
50
     saveTravel(travelId, { dayOrder: dayNumber, targetId: targetId, targetType: targetType }).then((res) => {
52
       Taro.showToast({
51
       Taro.showToast({

+ 1
- 1
src/pages/index/components/NoteCard/index.jsx View File

18
 
18
 
19
   // const cls = useMemo(() => [className, 'contentCard', uqClass].filter(Boolean).join(' '), [className, uqClass])
19
   // const cls = useMemo(() => [className, 'contentCard', uqClass].filter(Boolean).join(' '), [className, uqClass])
20
 
20
 
21
-  const [isSaved, toggleSave] = useSave(item.isSaved, item.noteType, item.noteId)
21
+  const [isSaved, toggleSave] = useSave(item.isSaved, 'note', item.noteId)
22
   const Detail = () => {
22
   const Detail = () => {
23
 
23
 
24
     Taro.navigateTo({ url: `/pages/details/NoteDetails/index?id=${item.noteId}` });
24
     Taro.navigateTo({ url: `/pages/details/NoteDetails/index?id=${item.noteId}` });

+ 1
- 0
src/pages/index/tabs/Recommend.jsx View File

118
             :
118
             :
119
             <RecommendNote />
119
             <RecommendNote />
120
 
120
 
121
+
121
         }
122
         }
122
 
123
 
123
       </view>
124
       </view>

+ 4
- 10
src/pages/index/tabs/RecommendNote/index.jsx View File

1
-import Taro, { useDidShow } from '@tarojs/taro'
2
-import { React, useState, useEffect, useRef, useMemo } from 'react'
3
-import iconsearch from '@/assets/icons/housemantj/search.png'
4
-import locationimg from '@/assets/icons/housemantj/location.png'
5
-import Tip from '@/components/tip'
1
+import Taro from '@tarojs/taro'
2
+import { React, useState, useRef, useMemo } from 'react'
6
 import List from '@/components/List';
3
 import List from '@/components/List';
7
 import MasonryLayout from '@/components/MasonryLayout';
4
 import MasonryLayout from '@/components/MasonryLayout';
8
-import { getIndexType, getResourceList } from '@/services/home'
9
 import { random } from '@/utils'
5
 import { random } from '@/utils'
10
 import { getNoteList } from '@/services/note'
6
 import { getNoteList } from '@/services/note'
7
+import NoData from '@/components/NoData'
11
 
8
 
12
 import NoteCard from '../../components/NoteCard'
9
 import NoteCard from '../../components/NoteCard'
13
 
10
 
79
         params={queryParamsSearch || queryParams}
76
         params={queryParamsSearch || queryParams}
80
         refresherEnabled={false}
77
         refresherEnabled={false}
81
         onDataChange={handleDataChange}
78
         onDataChange={handleDataChange}
79
+        noData={<NoData />}
82
       >
80
       >
83
         <view style={{ padding: '30rpx 15rpx' }}>
81
         <view style={{ padding: '30rpx 15rpx' }}>
84
 
82
 
91
       </List>
89
       </List>
92
 
90
 
93
 
91
 
94
-
95
-
96
-
97
-
98
     </view>
92
     </view>
99
   )
93
   )
100
 }
94
 }

+ 15
- 10
src/pages/search/search.jsx View File

29
     // timeSel: '12:01',
29
     // timeSel: '12:01',
30
     // dateSel: '2018-04-22'
30
     // dateSel: '2018-04-22'
31
   }
31
   }
32
-
33
   const onChange = e => {
32
   const onChange = e => {
34
     setselectValue(state.selector[e.detail.value])
33
     setselectValue(state.selector[e.detail.value])
35
   }
34
   }
38
       setHotList(res || [])
37
       setHotList(res || [])
39
     })
38
     })
40
   }, [])
39
   }, [])
40
+
41
   return (
41
   return (
42
     <View className='page-index'>
42
     <View className='page-index'>
43
       <View className='index-navbar'>
43
       <View className='index-navbar'>
51
           </View>
51
           </View>
52
         </Picker>
52
         </Picker>
53
         <View className='selector-box'>
53
         <View className='selector-box'>
54
-          <SearchBar placeholder='搜索笔记' onBlur={onSearch} />
54
+          <SearchBar placeholder={`搜索${selectValue}`} onBlur={onSearch} />
55
         </View>
55
         </View>
56
 
56
 
57
       </View>
57
       </View>
58
-      {/* <View className='content'>
59
-        <View className='hotSearch'>热门搜索</View>
60
-        <View className='hotSearchtip'>
61
-          {
62
-            (hotList || []).map((item) => <View onClick={() => hotSearch(item.word)}>{item.word}</View>)
63
-          }
64
-        </View>
65
-      </View> */}
58
+      {
59
+        selectValue === '地点' && (
60
+          <View className='content'>
61
+            <View className='hotSearch'>热门搜索</View>
62
+            <View className='hotSearchtip'>
63
+              {
64
+                (hotList || []).map((item) => <View onClick={() => hotSearch(item.word)}>{item.word}</View>)
65
+              }
66
+            </View>
67
+          </View>
68
+        )
69
+      }
70
+
66
     </View>
71
     </View>
67
   )
72
   )
68
 })
73
 })

+ 1
- 1
src/pages/searchResult/searchResult.jsx View File

58
       </view>
58
       </view>
59
       <view className='index-container' style={{ display: 'flex', flexDirection: 'column' }}>
59
       <view className='index-container' style={{ display: 'flex', flexDirection: 'column' }}>
60
         <view className='search'>
60
         <view className='search'>
61
-          <input className='searchInput' placeholder='搜索笔记' disabled onClick={onSearch} />
61
+          <input className='searchInput' placeholder={`搜索${targetTypeValue}`} value={q} disabled onClick={onSearch} />
62
           <image className='searchicon' src={iconsearch} />
62
           <image className='searchicon' src={iconsearch} />
63
           <view className='lineSearch'></view>
63
           <view className='lineSearch'></view>
64
         </view>
64
         </view>