吃个甘蔗嚼一年 3 years ago
parent
commit
334b38140d

+ 5
- 21
src/components/SearchBar/index.jsx View File

1
 import Taro, { View } from "@tarojs/components"
1
 import Taro, { View } from "@tarojs/components"
2
-export default (props) => {
3
-
4
-  const { value, onChange } = props
5
-
6
 
2
 
3
+import './style.less'
7
 
4
 
8
-  const search = (e) => {
9
-    console.log(e);
10
-
11
-    return new Promise((resolve, reject) => {
12
-      console.log(resolve, reject);
13
-      resolve([{ text: '搜索结果', e: 1 }, { text: '搜索结果2', e: 2 }])
5
+export default (props) => {
14
 
6
 
15
-    })
16
-  }
17
-  const handeInput = (e) => {
18
-    const val = e.detail.value
19
-    onChange(val)
20
-    console.log("🚀 ~ file: shopKeeper.jsx ~ line 57 ~ handeInput ~ value", val)
7
+  const { placeholder, onBlur } = props
21
 
8
 
22
 
9
 
23
-  }
24
 
10
 
25
 
11
 
26
   return (
12
   return (
27
     <View className='search'>
13
     <View className='search'>
28
       <mp-searchbar
14
       <mp-searchbar
29
-        placeholder='搜索订单(输入客户手机号码)'
30
-        search={search}
31
-        onInput={(e) => handeInput(e)}
32
-        value={value}
15
+        placeholder={placeholder}
16
+        onBlur={onBlur}
33
       >
17
       >
34
       </mp-searchbar>
18
       </mp-searchbar>
35
     </View>
19
     </View>

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

9
 
9
 
10
 
10
 
11
 
11
 
12
-
13
 export default withLayout((props) => {
12
 export default withLayout((props) => {
14
   const { router, person } = props
13
   const { router, person } = props
15
   const { roomId, roomOrderId, status } = router.params
14
   const { roomId, roomOrderId, status } = router.params

+ 4
- 1
src/shop/components/ShopKeeper/shopKeeper.jsx View File

73
     },
73
     },
74
   ]
74
   ]
75
 
75
 
76
+  const onSeacrh = (e) => {
77
+    console.log('eeeeeeeeeeeeeeeeee', e.detail.value);
78
+  }
76
 
79
 
77
   const [showCutover, setShowCutover] = useState(false)
80
   const [showCutover, setShowCutover] = useState(false)
78
   const ShowMoldeOn = () => {
81
   const ShowMoldeOn = () => {
114
           </view>
117
           </view>
115
           <view className='search'>
118
           <view className='search'>
116
 
119
 
117
-            <SearchBar onChange={e => handleChange()} />
120
+            <SearchBar placeholder='搜索订单(输入客户手机号码)' onBlur={onSeacrh} />
118
           </view>
121
           </view>
119
           <view className='index-tabs'>
122
           <view className='index-tabs'>
120
             <mp-tabs
123
             <mp-tabs