浏览代码

民宿端ok

李志伟 3 年前
父节点
当前提交
dc50ef6c32

+ 14
- 8
src/hotel/components/HouseManage/houseManage.jsx 查看文件

9
 import ShareRoom from '../shareRoom/ShareRoom.jsx'
9
 import ShareRoom from '../shareRoom/ShareRoom.jsx'
10
 import ShareCard from '../shareCard/shareCard'
10
 import ShareCard from '../shareCard/shareCard'
11
 import './houseManage.less'
11
 import './houseManage.less'
12
+import SearchBar from '@/components/SearchBar'
13
+
12
 
14
 
13
 export default React.forwardRef((props, ref) => {
15
 export default React.forwardRef((props, ref) => {
14
   const { hotel } = props
16
   const { hotel } = props
86
   }
88
   }
87
 
89
 
88
   const onSearch=(e)=>{
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
   return (
103
   return (
92
     <view>
104
     <view>
93
       <view style={{ padding: '0 30rpx', height: '100%' }}>
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
         <ShareRoom showCutover={showCutover} onClose={onClose} room={room} onFinish={handleFinish} />
107
         <ShareRoom showCutover={showCutover} onClose={onClose} room={room} onFinish={handleFinish} />
102
         <ShareCard showCutover={showCard} onClose={onClose} />
108
         <ShareCard showCutover={showCard} onClose={onClose} />
103
         <scroll-view scroll-y="true" scroll-view='true' bindscrolltoupper="upper" bindscrolltolower="lower" bindscroll="scroll" style={{ height: 'calc(100vh - 255px)' }}>
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
 
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
 .houseCard{
3
 .houseCard{
28
   background: #FFFFFF;
4
   background: #FFFFFF;
29
   box-shadow: 0px 8px 32px 0px rgba(0, 0, 0, 0.08);
5
   box-shadow: 0px 8px 32px 0px rgba(0, 0, 0, 0.08);

+ 2
- 2
src/shop/components/ShopKeeper/shopKeeper.jsx 查看文件

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