吃个甘蔗嚼一年 преди 3 години
родител
ревизия
442ec93efd

+ 1
- 1
src/components/SearchBar/index.jsx Целия файл

@@ -10,7 +10,7 @@ export default (props) => {
10 10
 
11 11
 
12 12
   return (
13
-    <View className='search'>
13
+    <View className='searchBar'>
14 14
       <mp-searchbar
15 15
         placeholder={placeholder}
16 16
         onBlur={onBlur}

+ 1
- 1
src/components/SearchBar/style.less Целия файл

@@ -1,5 +1,5 @@
1 1
 
2
-.search{
2
+.searchBar{
3 3
   margin: 35px 0;
4 4
   .weui-search-bar{
5 5
     padding: 0px;

+ 17
- 5
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
@@ -84,14 +86,24 @@ export default React.forwardRef((props, ref) => {
84 86
   const handelOrder = (val) => {
85 87
     Taro.navigateTo({ url: `/hotel/pages/landlord/roomOrder/roomOrder?roomId=${val.roomId}&roomName=${val.roomName}` });
86 88
   }
89
+
90
+  const onSearch=(e)=>{
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
+    
102
+  }
87 103
   return (
88 104
     <view>
89 105
       <view style={{ padding: '0 30rpx', height: '100%' }}>
90
-        <view className='search'>
91
-          <input className='searchInput' disabled />
92
-          <image className='searchicon' src={iconsearch} />
93
-          <view className="searchword">请输入关键字搜索</view>
94
-        </view>
106
+        <SearchBar placeholder='请输入房源名搜索' onBlur={onSearch} />
95 107
         <ShareRoom showCutover={showCutover} onClose={onClose} room={room} onFinish={handleFinish} />
96 108
         <ShareCard showCutover={showCard} onClose={onClose} />
97 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
- 1
src/hotel/pages/landlord/landlord.config.js Целия файл

@@ -4,7 +4,8 @@ export default {
4 4
   styleIsolation: 'shared',
5 5
   usingComponents: {
6 6
     "mp-tabbar": "weui-miniprogram/tabbar/tabbar",
7
-    "mp-dialog": "weui-miniprogram/dialog/dialog"
7
+    "mp-dialog": "weui-miniprogram/dialog/dialog",
8
+    "mp-searchbar": "weui-miniprogram/searchbar/searchbar"
8 9
   },
9 10
   enableShareAppMessage: true
10 11
 }

+ 2
- 2
src/pages/index/tabs/Recommend.jsx Целия файл

@@ -1,7 +1,7 @@
1 1
 import Taro, { useRouter } from '@tarojs/taro'
2 2
 import { React, useState, useEffect, useRef } from 'react'
3 3
 import iconsearch from '@/assets/icons/housemantj/search.png'
4
-import location from '@/assets/icons/housemantj/location.png'
4
+import locationimg from '@/assets/icons/housemantj/location.png'
5 5
 import Tip from '@/components/tip'
6 6
 import { getIndexType,  getResourceList } from '@/services/home'
7 7
 import Card from '../components/Card'
@@ -69,7 +69,7 @@ export default (props) => {
69 69
       <Tip />
70 70
       <view className='index-tabs'>
71 71
         <view className='position'>
72
-          <image className='location' src={location} />
72
+          <image className='location' src={locationimg} />
73 73
           <view className='city'>南京</view>
74 74
           <view className='line' />
75 75
         </view>

+ 0
- 1
src/pages/index/tabs/less/Recommend.less Целия файл

@@ -2,7 +2,6 @@
2 2
     padding: 10px 30px 0 30px;
3 3
     position: relative;
4 4
     .searchInput{    
5
-        width: calc(100% - 60px);
6 5
         height: 68px;
7 6
         background: #F8F8F8;
8 7
         border-radius: 34px;

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

@@ -121,7 +121,7 @@ export default (props) => {
121 121
           </view>
122 122
           <view className='search'>
123 123
 
124
-            <SearchBar placeholder='搜索订单(输入客户手机号码)' onBlur={onSeacrh} />
124
+            <SearchBar placeholder='搜索订单(输入客户手机号码)' onBlur={onSearch} />
125 125
           </view>
126 126
           <view className='index-tabs'>
127 127
             <mp-tabs