李志伟 3 yıl önce
ebeveyn
işleme
38e2d3be2e

+ 23
- 16
src/hotel/components/HouseManage/houseManage.jsx Dosyayı Görüntüle

@@ -3,13 +3,12 @@ import see from '@/assets/icons/landlord/查看入住人.png'
3 3
 import share from '@/assets/icons/landlord/分享链接.png'
4 4
 import del from '@/assets/icons/landlord/删除.png'
5 5
 import addImg from '@/assets/icons/landlord/添加.png'
6
-import iconsearch from '@/assets/icons/housemantj/search.png'
7 6
 import React, { useState, useEffect, useRef, useImperativeHandle } from 'react'
8 7
 import { getRoomList, deleteRoom } from '@/services/landlord'
8
+import SearchBar from '@/components/SearchBar'
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 14
 export default React.forwardRef((props, ref) => {
@@ -24,16 +23,25 @@ export default React.forwardRef((props, ref) => {
24 23
   const handelClick = () => {
25 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 47
   const [showCutover, setShowCutover] = useState(false)
@@ -97,16 +105,15 @@ export default React.forwardRef((props, ref) => {
97 105
       getRoomList({ hotelId: hotel.hotelId,roomName:e.detail.value }).then((res) => {
98 106
       setDetail(res.records || [])
99 107
     })
100
-    }
101
-    
108
+    }    
102 109
   }
103 110
   return (
104 111
     <view>
105 112
       <view style={{ padding: '0 30rpx', height: '100%' }}>
106
-        <SearchBar placeholder='请输入房源名搜索' onBlur={onSearch} />
113
+        <SearchBar placeholder='请输入房源名搜索' onBlur={onSearch}/>
107 114
         <ShareRoom showCutover={showCutover} onClose={onClose} room={room} onFinish={handleFinish} />
108 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 118
             detail?.map((item) =>
112 119
               <view className='houseCard'>
@@ -114,7 +121,7 @@ export default React.forwardRef((props, ref) => {
114 121
                 <view className='operation'>
115 122
                   <view onClick={() => handelOrder(item)}><image src={see} />查看入住人</view>
116 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 125
                 </view>
119 126
               </view>
120 127
             )

+ 2
- 2
src/hotel/components/HouseManage/houseManage.less Dosyayı Görüntüle

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

+ 2
- 1
src/hotel/components/Income/income.less Dosyayı Görüntüle

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

+ 32
- 1
src/hotel/components/shareRoom/ShareRoom.jsx Dosyayı Görüntüle

@@ -31,6 +31,37 @@ export default (props) => {
31 31
   return (
32 32
     <Popup show={showCutover} onClose={onClose}>
33 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 65
         <Label style={{ color: 'black' }}>请输入入住人信息</Label>
35 66
         <View className='flex'>
36 67
           <Label>入住人数:</Label><Input focus dataField='nm' onInput={(e) => setRoomNum(e.detail.value)} value={roomNum} type='number' placeholder='请输入入住人数' /></View>
@@ -47,7 +78,7 @@ export default (props) => {
47 78
           </Picker>
48 79
         </View>
49 80
         <View><Button className='cancel' onClick={onClose}>取消</Button><Button className='btn' onClick={handelShare}>分享</Button></View>
50
-      </View>
81
+      </View> */}
51 82
     </Popup>
52 83
   )
53 84
 }

+ 23
- 33
src/hotel/components/shareRoom/ShareRoom.less Dosyayı Görüntüle

@@ -1,38 +1,28 @@
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 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 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 Dosyayı Görüntüle

@@ -5,7 +5,10 @@ export default {
5 5
   usingComponents: {
6 6
     "mp-tabbar": "weui-miniprogram/tabbar/tabbar",
7 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 13
   enableShareAppMessage: true
11 14
 }