李志伟 3 vuotta sitten
vanhempi
commit
38e2d3be2e

+ 23
- 16
src/hotel/components/HouseManage/houseManage.jsx Näytä tiedosto

3
 import share from '@/assets/icons/landlord/分享链接.png'
3
 import share from '@/assets/icons/landlord/分享链接.png'
4
 import del from '@/assets/icons/landlord/删除.png'
4
 import del from '@/assets/icons/landlord/删除.png'
5
 import addImg from '@/assets/icons/landlord/添加.png'
5
 import addImg from '@/assets/icons/landlord/添加.png'
6
-import iconsearch from '@/assets/icons/housemantj/search.png'
7
 import React, { useState, useEffect, useRef, useImperativeHandle } from 'react'
6
 import React, { useState, useEffect, useRef, useImperativeHandle } from 'react'
8
 import { getRoomList, deleteRoom } from '@/services/landlord'
7
 import { getRoomList, deleteRoom } from '@/services/landlord'
8
+import SearchBar from '@/components/SearchBar'
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
 
15
 export default React.forwardRef((props, ref) => {
14
 export default React.forwardRef((props, ref) => {
24
   const handelClick = () => {
23
   const handelClick = () => {
25
     Taro.navigateTo({ url: `/hotel/pages/landlord/addRoom/addRoom?hotelId=${hotel.hotelId}&hotelName=${hotel.hotelName}` });
24
     Taro.navigateTo({ url: `/hotel/pages/landlord/addRoom/addRoom?hotelId=${hotel.hotelId}&hotelName=${hotel.hotelName}` });
26
   }
25
   }
27
-  const handelDelete = (roomId) => {
28
-    deleteRoom(roomId).then(() => {
29
-      Taro.showToast({
30
-        title: '删除房源成功',
31
-        icon: 'none',
32
-      })
33
-      getRoomList({ hotelId: hotel.hotelId }).then((res) => {
34
-        setDetail(res.records || [])
35
-      })
26
+  const handelDelete = (val) => {
27
+    Taro.showModal({
28
+      title: '提示',
29
+      content: `确认删除${val.roomName}?`,
30
+      success: function (res) {
31
+        if (res.confirm) {
32
+          deleteRoom(val.roomId).then(() => {
33
+            Taro.showToast({
34
+              title: '删除房源成功',
35
+              icon: 'none',
36
+            })
37
+            getRoomList({ hotelId: hotel.hotelId }).then((res) => {
38
+              setDetail(res.records || [])
39
+            })
40
+          })       
41
+        } 
42
+      }
36
     })
43
     })
44
+   
37
   }
45
   }
38
 
46
 
39
   const [showCutover, setShowCutover] = useState(false)
47
   const [showCutover, setShowCutover] = useState(false)
97
       getRoomList({ hotelId: hotel.hotelId,roomName:e.detail.value }).then((res) => {
105
       getRoomList({ hotelId: hotel.hotelId,roomName:e.detail.value }).then((res) => {
98
       setDetail(res.records || [])
106
       setDetail(res.records || [])
99
     })
107
     })
100
-    }
101
-    
108
+    }    
102
   }
109
   }
103
   return (
110
   return (
104
     <view>
111
     <view>
105
       <view style={{ padding: '0 30rpx', height: '100%' }}>
112
       <view style={{ padding: '0 30rpx', height: '100%' }}>
106
-        <SearchBar placeholder='请输入房源名搜索' onBlur={onSearch} />
113
+        <SearchBar placeholder='请输入房源名搜索' onBlur={onSearch}/>
107
         <ShareRoom showCutover={showCutover} onClose={onClose} room={room} onFinish={handleFinish} />
114
         <ShareRoom showCutover={showCutover} onClose={onClose} room={room} onFinish={handleFinish} />
108
         <ShareCard showCutover={showCard} onClose={onClose} />
115
         <ShareCard showCutover={showCard} onClose={onClose} />
109
-        <scroll-view scroll-y="true" scroll-view='true' bindscrolltoupper="upper" bindscrolltolower="lower" bindscroll="scroll" style={{ height: 'calc(100vh - 255px)' }}>
116
+        <scroll-view scroll-y="true" scroll-view='true' bindscrolltoupper="upper" bindscrolltolower="lower" bindscroll="scroll" style={{ height: 'calc(100vh - 244px)' }}>
110
           {
117
           {
111
             detail?.map((item) =>
118
             detail?.map((item) =>
112
               <view className='houseCard'>
119
               <view className='houseCard'>
114
                 <view className='operation'>
121
                 <view className='operation'>
115
                   <view onClick={() => handelOrder(item)}><image src={see} />查看入住人</view>
122
                   <view onClick={() => handelOrder(item)}><image src={see} />查看入住人</view>
116
                   <view onClick={() => ShowMoldeOn(item)}><image src={share} />分享链接</view>
123
                   <view onClick={() => ShowMoldeOn(item)}><image src={share} />分享链接</view>
117
-                  <view onClick={() => handelDelete(item.roomId)}><image src={del} />删除房源</view>
124
+                  <view onClick={() => handelDelete(item)}><image src={del} />删除房源</view>
118
                 </view>
125
                 </view>
119
               </view>
126
               </view>
120
             )
127
             )

+ 2
- 2
src/hotel/components/HouseManage/houseManage.less Näytä tiedosto

6
   border-radius: 12px;
6
   border-radius: 12px;
7
   padding: 40px 30px 41px 30px;
7
   padding: 40px 30px 41px 30px;
8
   text-align: center;
8
   text-align: center;
9
-  margin: 30px 0;
9
+  margin: 30px 10px;
10
   .houseName{
10
   .houseName{
11
     height: 122px;
11
     height: 122px;
12
     font-size: 32px;
12
     font-size: 32px;
39
   text-align: center;
39
   text-align: center;
40
   line-height: 88px;
40
   line-height: 88px;
41
   position: absolute;
41
   position: absolute;
42
-  bottom: 30px;
42
+  bottom: 18px;
43
   image{
43
   image{
44
     width: 32px;
44
     width: 32px;
45
     height: 32px;
45
     height: 32px;

+ 2
- 1
src/hotel/components/Income/income.less Näytä tiedosto

62
   border-radius: 24px;
62
   border-radius: 24px;
63
   padding: 50px 30px 64px 40px;
63
   padding: 50px 30px 64px 40px;
64
   box-sizing: border-box;
64
   box-sizing: border-box;
65
+  margin: 0 10px;
65
   .storeName{
66
   .storeName{
66
     height: 26px;
67
     height: 26px;
67
     font-size: 28px;
68
     font-size: 28px;
145
   margin: 62px 0 10px 1px;
146
   margin: 62px 0 10px 1px;
146
 }
147
 }
147
 .spreadCard{
148
 .spreadCard{
148
-  margin-bottom: 60px;  
149
+  margin:0 10px 60px 10px;  
149
   .card{
150
   .card{
150
     height: 166px;
151
     height: 166px;
151
     background: #FFF;
152
     background: #FFF;

+ 32
- 1
src/hotel/components/shareRoom/ShareRoom.jsx Näytä tiedosto

31
   return (
31
   return (
32
     <Popup show={showCutover} onClose={onClose}>
32
     <Popup show={showCutover} onClose={onClose}>
33
       <View className='from-room'>
33
       <View className='from-room'>
34
+      <mp-form  >
35
+        <Label style={{color:'black'}}>请输入入住人信息</Label>
36
+        <mp-cells    footer='  ' >
37
+          <mp-cell title='入住人数:' extClass='font'>
38
+            <Input focus dataField='nm' onInput={(e) => setRoomNum(e.detail.value)} value={roomNum} type='number' placeholder='请输入入住人数' />
39
+          </mp-cell>
40
+          <mp-cell title='入住开始时间:' extClass='font'>
41
+            <Picker mode='date' onChange={handelStartDate}>
42
+              {startDate == '' ? '请选择入住开始时间' : startDate}
43
+            </Picker>
44
+          </mp-cell>
45
+          <mp-cell title='入住结束时间:' extClass='font'>
46
+            <Picker  mode='date' onChange={handelEndDate}>
47
+            {endDate == '' ? '请选择入住结束时间' : endDate}
48
+          </Picker>
49
+          </mp-cell>
50
+          <mp-cell>
51
+            <Button className='cancel' onClick={onClose}>取消</Button><Button className='btn' onClick={handelShare}>分享</Button>
52
+            {/* <button className='button-OK' onClick={sumbit}>确定</button> */}
53
+          </mp-cell>
54
+        </mp-cells>
55
+      </mp-form>
56
+      </View>
57
+
58
+
59
+
60
+
61
+
62
+
63
+
64
+      {/* <View className='from-room'>
34
         <Label style={{ color: 'black' }}>请输入入住人信息</Label>
65
         <Label style={{ color: 'black' }}>请输入入住人信息</Label>
35
         <View className='flex'>
66
         <View className='flex'>
36
           <Label>入住人数:</Label><Input focus dataField='nm' onInput={(e) => setRoomNum(e.detail.value)} value={roomNum} type='number' placeholder='请输入入住人数' /></View>
67
           <Label>入住人数:</Label><Input focus dataField='nm' onInput={(e) => setRoomNum(e.detail.value)} value={roomNum} type='number' placeholder='请输入入住人数' /></View>
47
           </Picker>
78
           </Picker>
48
         </View>
79
         </View>
49
         <View><Button className='cancel' onClick={onClose}>取消</Button><Button className='btn' onClick={handelShare}>分享</Button></View>
80
         <View><Button className='cancel' onClick={onClose}>取消</Button><Button className='btn' onClick={handelShare}>分享</Button></View>
50
-      </View>
81
+      </View> */}
51
     </Popup>
82
     </Popup>
52
   )
83
   )
53
 }
84
 }

+ 23
- 33
src/hotel/components/shareRoom/ShareRoom.less Näytä tiedosto

1
-  .from-room{
2
-    font-size: 34px;
3
-    padding-top: 30px;
4
-    .flex{
5
-      display: flex;
6
-      margin: 10px 0;
7
-      Input{
8
-        width: 345px;
9
-        border-radius: 15px;
10
-        border: solid 1px rgb(121, 116, 116);
11
-        margin-left: 70px;
12
-      }
13
-      .picker{
14
-        width: 345px;
15
-        border-radius: 15px;
16
-        border: solid 1px rgb(121, 116, 116);
17
-      }
18
-    }
1
+.from-room{
2
+  padding-top: 30px;
3
+  .font{
4
+    font-size: 28px;
5
+    color: #202020;
19
   }
6
   }
20
   .cancel{
7
   .cancel{
21
-      width: 150px;
22
-      height: 70px;
23
-      display: inline-block;
24
-      line-height: 70px;
25
-      border-radius: 12px;
26
-      font-size: 36px;
27
-      margin-right: 20px;
8
+    width: 150px;
9
+    height: 70px;
10
+    display: inline-block;
11
+    line-height: 70px;
12
+    border-radius: 12px;
13
+    font-size: 36px;
14
+    margin-right: 20px;
28
   }
15
   }
29
   .btn {
16
   .btn {
30
-      width: 150px;
31
-      height: 70px;
32
-      background: #1A3B83;
33
-      display: inline-block;
34
-      line-height: 70px;
35
-      border-radius: 12px;
36
-      font-size: 36px;
37
-      color: #fff;
17
+    width: 150px;
18
+    height: 70px;
19
+    background: #1A3B83;
20
+    display: inline-block;
21
+    line-height: 70px;
22
+    border-radius: 12px;
23
+    font-size: 36px;
24
+    color: #fff;
38
   }
25
   }
26
+}
27
+  
28
+  

+ 4
- 1
src/hotel/pages/landlord/landlord.config.js Näytä tiedosto

5
   usingComponents: {
5
   usingComponents: {
6
     "mp-tabbar": "weui-miniprogram/tabbar/tabbar",
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
+    "mp-searchbar": "weui-miniprogram/searchbar/searchbar",    
9
+    "mp-cells": "weui-miniprogram/cells/cells",
10
+    "mp-cell": "weui-miniprogram/cell/cell",
11
+    "mp-form": "weui-miniprogram/form/form"
9
   },
12
   },
10
   enableShareAppMessage: true
13
   enableShareAppMessage: true
11
 }
14
 }