|
@@ -4,9 +4,9 @@ import see from '@/assets/icons/landlord/lookPerson.png'
|
4
|
4
|
import share from '@/assets/icons/landlord/shareLink.png'
|
5
|
5
|
import del from '@/assets/icons/landlord/delete.png'
|
6
|
6
|
import addImg from '@/assets/icons/landlord/add.png'
|
7
|
|
-import copyRoom from '@/assets/icons/landlord/copyroom.png'
|
|
7
|
+import copyRoomImg from '@/assets/icons/landlord/copyroom.png'
|
8
|
8
|
import React, { useState, useEffect, useRef, useImperativeHandle, useMemo } from 'react'
|
9
|
|
-import { getRoomList,getRoomDetail, saveRoom, deleteRoom, saveExtend } from '@/services/landlord'
|
|
9
|
+import { getRoomList,getRoomDetail, saveRoom, deleteRoom, saveExtend,copyRoom } from '@/services/landlord'
|
10
|
10
|
import { getExtendContent } from "@/services/home";
|
11
|
11
|
import Spin3 from '@/components/Spin/Spin3';
|
12
|
12
|
import cutoverUser from '@/assets/icons/UserCenter/cutoverUser.png'
|
|
@@ -138,11 +138,7 @@ export default React.forwardRef((props, ref) => {
|
138
|
138
|
}
|
139
|
139
|
//本店指南
|
140
|
140
|
const [loading, setLoading] = useState(false)
|
141
|
|
- const handelCopy = (e, val) => {
|
142
|
|
- let del
|
143
|
|
- getRoomDetail(val.roomId).then((res) => {
|
144
|
|
- del=res
|
145
|
|
- })
|
|
141
|
+ const handelCopy = (e, val) => {
|
146
|
142
|
//阻止冒泡不允许执行父元素的点击事件
|
147
|
143
|
e.stopPropagation()
|
148
|
144
|
setLoading(true)
|
|
@@ -152,13 +148,7 @@ export default React.forwardRef((props, ref) => {
|
152
|
148
|
copy = index
|
153
|
149
|
}
|
154
|
150
|
})
|
155
|
|
- getExtendContent('room', val.roomId, { pageSize: 500 }).then((res2) => {
|
156
|
|
- saveRoom({ ...del, roomId: null, roomName: val.roomName + '复制' }).then((res) => {
|
157
|
|
- res2.records.lenght != 0 ?
|
158
|
|
- //如果原房源有更多指引查出列表遍历每条拿出来放到新的房源的更多指引里
|
159
|
|
- res2.records.map((item) => {
|
160
|
|
- saveExtend({ ...item, targetId: res.roomId })
|
161
|
|
- }) : null
|
|
151
|
+ copyRoom(val.roomId).then((res) => {
|
162
|
152
|
setLoading(false)
|
163
|
153
|
Taro.showToast({
|
164
|
154
|
title: '复制房源成功',
|
|
@@ -166,7 +156,6 @@ export default React.forwardRef((props, ref) => {
|
166
|
156
|
})
|
167
|
157
|
setDetail([...detail.slice(0, copy), res, ...detail.slice(copy)])
|
168
|
158
|
})
|
169
|
|
- })
|
170
|
159
|
|
171
|
160
|
}
|
172
|
161
|
const [showCutover3, setShowCutover3] = useState(false)
|
|
@@ -208,7 +197,7 @@ export default React.forwardRef((props, ref) => {
|
208
|
197
|
{
|
209
|
198
|
detail.map((item, index) =>
|
210
|
199
|
<view className='houseCard' key={index}>
|
211
|
|
- <View className='houseName' onClick={() => handelDetail(item)}>{item.roomName || ''}<Image src={copyRoom} onClick={(e) => handelCopy(e, item)} /></View>
|
|
200
|
+ <View className='houseName' onClick={() => handelDetail(item)}>{item.roomName || ''}<Image src={copyRoomImg} onClick={(e) => handelCopy(e, item)} /></View>
|
212
|
201
|
<view className='operation'>
|
213
|
202
|
<view onClick={() => handelOrder(item)}><image src={see} />查看入住人</view>
|
214
|
203
|
<view onClick={() => ShowMoldeOn(item)}><image src={share} />分享链接</view>
|