Baozhangchao 3 years ago
parent
commit
9b31f4061b

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

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

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

@@ -35,6 +35,9 @@ export default (props) => {
35 35
 
36 36
 
37 37
   useEffect(() => {
38
+    if (item == []) {
39
+      console.log('asdasdsadasd');
40
+    }
38 41
     setValueList(travelMine.records)
39 42
 
40 43
 

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

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

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

@@ -18,7 +18,7 @@ export default (props) => {
18 18
 
19 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 22
   const Detail = () => {
23 23
 
24 24
     Taro.navigateTo({ url: `/pages/details/NoteDetails/index?id=${item.noteId}` });

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

@@ -118,6 +118,7 @@ export default (props) => {
118 118
             :
119 119
             <RecommendNote />
120 120
 
121
+
121 122
         }
122 123
 
123 124
       </view>

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

@@ -1,13 +1,10 @@
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 3
 import List from '@/components/List';
7 4
 import MasonryLayout from '@/components/MasonryLayout';
8
-import { getIndexType, getResourceList } from '@/services/home'
9 5
 import { random } from '@/utils'
10 6
 import { getNoteList } from '@/services/note'
7
+import NoData from '@/components/NoData'
11 8
 
12 9
 import NoteCard from '../../components/NoteCard'
13 10
 
@@ -79,6 +76,7 @@ export default (props) => {
79 76
         params={queryParamsSearch || queryParams}
80 77
         refresherEnabled={false}
81 78
         onDataChange={handleDataChange}
79
+        noData={<NoData />}
82 80
       >
83 81
         <view style={{ padding: '30rpx 15rpx' }}>
84 82
 
@@ -91,10 +89,6 @@ export default (props) => {
91 89
       </List>
92 90
 
93 91
 
94
-
95
-
96
-
97
-
98 92
     </view>
99 93
   )
100 94
 }

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

@@ -29,7 +29,6 @@ export default withLayout((props) => {
29 29
     // timeSel: '12:01',
30 30
     // dateSel: '2018-04-22'
31 31
   }
32
-
33 32
   const onChange = e => {
34 33
     setselectValue(state.selector[e.detail.value])
35 34
   }
@@ -38,6 +37,7 @@ export default withLayout((props) => {
38 37
       setHotList(res || [])
39 38
     })
40 39
   }, [])
40
+
41 41
   return (
42 42
     <View className='page-index'>
43 43
       <View className='index-navbar'>
@@ -51,18 +51,23 @@ export default withLayout((props) => {
51 51
           </View>
52 52
         </Picker>
53 53
         <View className='selector-box'>
54
-          <SearchBar placeholder='搜索笔记' onBlur={onSearch} />
54
+          <SearchBar placeholder={`搜索${selectValue}`} onBlur={onSearch} />
55 55
         </View>
56 56
 
57 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 71
     </View>
67 72
   )
68 73
 })

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

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