|
@@ -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
|
)
|