李志伟 преди 3 години
родител
ревизия
dc50ef6c32

+ 14
- 8
src/hotel/components/HouseManage/houseManage.jsx Целия файл

@@ -9,6 +9,8 @@ import { getRoomList, deleteRoom } from '@/services/landlord'
9 9
 import ShareRoom from '../shareRoom/ShareRoom.jsx'
10 10
 import ShareCard from '../shareCard/shareCard'
11 11
 import './houseManage.less'
12
+import SearchBar from '@/components/SearchBar'
13
+
12 14
 
13 15
 export default React.forwardRef((props, ref) => {
14 16
   const { hotel } = props
@@ -86,18 +88,22 @@ export default React.forwardRef((props, ref) => {
86 88
   }
87 89
 
88 90
   const onSearch=(e)=>{
89
-    console.log(e.detail.value);
91
+    if(e.detail.value==''){
92
+      getRoomList({ hotelId: hotel.hotelId }).then((res) => {
93
+        setDetail(res.records || [])
94
+      })
95
+    }
96
+    else{
97
+      getRoomList({ hotelId: hotel.hotelId,roomName:e.detail.value }).then((res) => {
98
+      setDetail(res.records || [])
99
+    })
100
+    }
101
+    
90 102
   }
91 103
   return (
92 104
     <view>
93 105
       <view style={{ padding: '0 30rpx', height: '100%' }}>
94
-        <view className='search'>
95
-          <input className='searchInput' disabled />
96
-          <image className='searchicon' src={iconsearch} />
97
-          <view className="searchword">请输入关键字搜索</view>
98
-        </view>
99
-        <mp-searchbar onBlur={onSearch}></mp-searchbar>
100
-
106
+        <SearchBar placeholder='请输入房源名搜索' onBlur={onSearch} />
101 107
         <ShareRoom showCutover={showCutover} onClose={onClose} room={room} onFinish={handleFinish} />
102 108
         <ShareCard showCutover={showCard} onClose={onClose} />
103 109
         <scroll-view scroll-y="true" scroll-view='true' bindscrolltoupper="upper" bindscrolltolower="lower" bindscroll="scroll" style={{ height: 'calc(100vh - 255px)' }}>

+ 1
- 25
src/hotel/components/HouseManage/houseManage.less Целия файл

@@ -1,29 +1,5 @@
1 1
 
2
-.search{
3
-  padding: 40px 0 15px 0;
4
-  position: relative;
5
-  .searchInput{    
6
-    height: 68px;
7
-    background: #F8F8F8;
8
-    border-radius: 34px;
9
-    box-sizing: border-box;
10
-  }
11
-  .searchicon{
12
-    width: 25px;
13
-    height: 25px;
14
-    position: absolute;
15
-    left: calc(50% - 135px);
16
-    top: 64px;
17
-  }
18
-  .searchword{
19
-    height: 23px;
20
-    font-size: 24px;
21
-    color: #C0C8D3;
22
-    position: absolute;
23
-    left: calc(50% - 100px);
24
-    bottom: 45px;
25
-  }
26
-}
2
+
27 3
 .houseCard{
28 4
   background: #FFFFFF;
29 5
   box-shadow: 0px 8px 32px 0px rgba(0, 0, 0, 0.08);

+ 2
- 2
src/shop/components/ShopKeeper/shopKeeper.jsx Целия файл

@@ -73,7 +73,7 @@ export default (props) => {
73 73
     },
74 74
   ]
75 75
 
76
-  const onSeacrh = (e) => {
76
+  const onSearch = (e) => {
77 77
     console.log('eeeeeeeeeeeeeeeeee', e.detail.value);
78 78
   }
79 79
 
@@ -117,7 +117,7 @@ export default (props) => {
117 117
           </view>
118 118
           <view className='search'>
119 119
 
120
-            <SearchBar placeholder='搜索订单(输入客户手机号码)' onBlur={onSeacrh} />
120
+            <SearchBar placeholder='搜索订单(输入客户手机号码)' onBlur={onSearch} />
121 121
           </view>
122 122
           <view className='index-tabs'>
123 123
             <mp-tabs