李志伟 3 年之前
父節點
當前提交
7b169361e4

二進制
src/assets/icons/landlord/复制.png 查看文件


+ 1
- 1
src/components/BossCard/style.less 查看文件

@@ -281,7 +281,7 @@
281 281
         margin-top: 3em;
282 282
         background-color: #274190;
283 283
         border-radius: 12px;
284
-        width: 690px;
284
+        width: calc(100% - 60px);
285 285
         height: 92px;
286 286
         color: @whiteColor;
287 287
         // position: absolute;

+ 1
- 1
src/components/CompoentsOrder/AlreadyUsed/style.less 查看文件

@@ -314,7 +314,7 @@
314 314
 
315 315
     .button-box {
316 316
       margin: 60px 0;
317
-      width: 690px;
317
+      width: calc(100% - 60px);
318 318
       height: 88px;
319 319
       line-height: 88px;
320 320
       background: #274291;

+ 1
- 1
src/components/CompoentsOrder/TobePaid/style.less 查看文件

@@ -257,7 +257,7 @@
257 257
 
258 258
     .button-box {
259 259
       margin: 60px 0;
260
-      width: 690px;
260
+      width: calc(100% - 60px);
261 261
       height: 88px;
262 262
       line-height: 88px;
263 263
       background: #274291;

+ 1
- 1
src/components/CompoentsOrder/TobeWritten/style.less 查看文件

@@ -258,7 +258,7 @@
258 258
 
259 259
     .button-box {
260 260
       margin: 60px 0;
261
-      width: 690px;
261
+      width: calc(100% - 60px);
262 262
       height: 88px;
263 263
       line-height: 88px;
264 264
       background: #274291;

+ 1
- 1
src/components/PayOrderCard/style.less 查看文件

@@ -281,7 +281,7 @@
281 281
         margin-top: 3em;
282 282
         background-color: #274190;
283 283
         border-radius: 12px;
284
-        width: 690px;
284
+        width: calc(100% - 60px);
285 285
         height: 92px;
286 286
         color: @whiteColor;
287 287
         // position: absolute;

+ 38
- 41
src/hotel/components/HouseManage/houseManage.jsx 查看文件

@@ -1,17 +1,17 @@
1
-import Taro, {useDidShow } from '@tarojs/taro'
1
+import Taro, { useDidShow } from '@tarojs/taro'
2 2
 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 6
 import iconsearch from '@/assets/icons/housemantj/search.png'
7
-import React,{useState, useEffect,useRef, useImperativeHandle } from 'react'
8
-import {getRoomList,deleteRoom} from '@/services/landlord'
7
+import React, { useState, useEffect, useRef, useImperativeHandle } from 'react'
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 12
 
13 13
 export default React.forwardRef((props, ref) => {
14
-  const {hotel}=props
14
+  const { hotel } = props
15 15
   const [detail, setDetail] = useState([])
16 16
 
17 17
   const shareDataRef = useRef()
@@ -19,17 +19,17 @@ export default React.forwardRef((props, ref) => {
19 19
   // 判断是否首次加载
20 20
   const mounted = useRef(false)
21 21
 
22
-  const handelClick=()=>{
22
+  const handelClick = () => {
23 23
     Taro.navigateTo({ url: `/hotel/pages/landlord/addRoom/addRoom?hotelId=${hotel.hotelId}&hotelName=${hotel.hotelName}` });
24 24
   }
25
-  const handelDelete=(roomId)=>{
26
-    deleteRoom(roomId).then(()=>{
25
+  const handelDelete = (roomId) => {
26
+    deleteRoom(roomId).then(() => {
27 27
       Taro.showToast({
28 28
         title: '删除房源成功',
29 29
         icon: 'none',
30 30
       })
31
-      getRoomList({hotelId:hotel.hotelId}).then((res)=>{
32
-        setDetail(res.records||[])
31
+      getRoomList({ hotelId: hotel.hotelId }).then((res) => {
32
+        setDetail(res.records || [])
33 33
       })
34 34
     })
35 35
   }
@@ -44,21 +44,21 @@ export default React.forwardRef((props, ref) => {
44 44
   const onClose = () => {
45 45
     setShowCutover(false)
46 46
   }
47
-  useEffect(()=>{
47
+  useEffect(() => {
48 48
     //首次加载页面时
49 49
     if (!mounted.current && hotel.hotelId) {
50
-      getRoomList({hotelId:hotel.hotelId}).then((res)=>{
51
-        setDetail(res.records||[])
50
+      getRoomList({ hotelId: hotel.hotelId }).then((res) => {
51
+        setDetail(res.records || [])
52 52
         mounted.current = true
53 53
       })
54 54
     }
55
-  },[hotel?.hotelId])
55
+  }, [hotel?.hotelId])
56 56
 
57 57
   //当前页面切换到前台时
58 58
   useDidShow(() => {
59 59
     if (mounted.current) {
60
-      getRoomList({hotelId:hotel.hotelId}).then((res)=>{
61
-        setDetail(res.records||[])
60
+      getRoomList({ hotelId: hotel.hotelId }).then((res) => {
61
+        setDetail(res.records || [])
62 62
       })
63 63
     }
64 64
   })
@@ -81,41 +81,38 @@ export default React.forwardRef((props, ref) => {
81 81
     // 打开分享弹窗
82 82
     setShowCard(true)
83 83
   }
84
-
84
+  const handelOrder = (val) => {
85
+    Taro.navigateTo({ url: `/hotel/pages/landlord/roomOrder/roomOrder?roomId=${val.roomId}&roomName=${val.roomName}` });
86
+  }
85 87
   return (
86 88
     <view>
87 89
       <view style={{ padding: '0 30rpx', height: '100%' }}>
88
-          <view className='search'>
89
-            <input className='searchInput' disabled />
90
-            <image className='searchicon' src={iconsearch} />
91
-            <view className="searchword">请输入关键字搜索</view>
92
-          </view>
93
-          <ShareRoom showCutover={showCutover} onClose={onClose}  room={room} onFinish={handleFinish} />
94
-          <ShareCard showCutover={showCard} onClose={onClose}/>
90
+        <view className='search'>
91
+          <input className='searchInput' disabled />
92
+          <image className='searchicon' src={iconsearch} />
93
+          <view className="searchword">请输入关键字搜索</view>
94
+        </view>
95
+        <ShareRoom showCutover={showCutover} onClose={onClose} room={room} onFinish={handleFinish} />
96
+        <ShareCard showCutover={showCard} onClose={onClose} />
95 97
         <scroll-view scroll-y="true" scroll-view='true' bindscrolltoupper="upper" bindscrolltolower="lower" bindscroll="scroll" style={{ height: 'calc(100vh - 255px)' }}>
96
-
97
-          <view>
98
-            {
99
-              detail?.map((item)=>
98
+          {
99
+            detail?.map((item) =>
100 100
               <view className='houseCard'>
101
-              <view className='houseName'>{item.roomName}</view>
102
-              <view className='operation'>
103
-                <view><image src={see} />查看入住人</view>
104
-                <view onClick={()=>ShowMoldeOn(item)}><image src={share}/>分享链接</view>
105
-                <view onClick={()=>{handelDelete(item.roomId)}}><image src={del} />删除房源</view>
101
+                <view className='houseName'>{item.roomName}</view>
102
+                <view className='operation'>
103
+                  <view onClick={() => handelOrder(item)}><image src={see} />查看入住人</view>
104
+                  <view onClick={() => ShowMoldeOn(item)}><image src={share} />分享链接</view>
105
+                  <view onClick={() => handelDelete(item.roomId)}><image src={del} />删除房源</view>
106
+                </view>
106 107
               </view>
107
-            </view>
108
-              )
109
-            }
110
-            
111
-           
112
-          </view>
113
-        </scroll-view>        
108
+            )
109
+          }
110
+        </scroll-view>
114 111
       </view>
115 112
       <view className='addHouse' onClick={handelClick}>
116 113
         <image className='addImg' src={addImg} />添加房源
117 114
       </view>
118
-    
119
-      </view>
115
+
116
+    </view>
120 117
   )
121 118
 })

+ 1
- 1
src/hotel/pages/landlord/addRoom/addRoom.less 查看文件

@@ -8,7 +8,7 @@
8 8
   display: inline;
9 9
 }
10 10
 button {
11
-  width: 690px;
11
+  width: calc(100% - 60px);
12 12
   height: 92px;
13 13
   background: #1A3B83;
14 14
   margin: 0 auto;

+ 6
- 0
src/hotel/pages/landlord/roomOrder/roomOrder.config.js 查看文件

@@ -0,0 +1,6 @@
1
+export default {
2
+  navigationBarTitleText: '',
3
+  navigationStyle: 'custom',
4
+  usingComponents: {
5
+  }
6
+}

+ 78
- 0
src/hotel/pages/landlord/roomOrder/roomOrder.jsx 查看文件

@@ -0,0 +1,78 @@
1
+import withLayout from '@/layouts'
2
+import React, { useState, useEffect, useRef } from 'react'
3
+import CustomNav from '@/components/CustomNav'
4
+import Taro from '@tarojs/taro'
5
+import copy from '@/assets/icons/landlord/复制.png'
6
+import { Input, Button, View, Picker, Label, Image } from '@tarojs/components'
7
+import { getRoomOrderList } from '@/services/landlord'
8
+import './roomOrder.less'
9
+
10
+
11
+
12
+
13
+export default withLayout((props) => {
14
+  const { roomId, roomName } = props.router.params
15
+  const [detail, setDetail] = useState([])
16
+  useEffect(() => {
17
+    getRoomOrderList({ roomId: roomId }).then((res) => {
18
+      setDetail(res.records || [])
19
+    })
20
+  }, [])
21
+  const CopyName = (val) => {
22
+    Taro.setClipboardData({
23
+      data: val,
24
+      success: e => {
25
+        Taro.showToast({
26
+          title: '入住人姓名已复制',
27
+          icon: 'success',
28
+          duration: 2000,
29
+        })
30
+      }
31
+    })
32
+  }
33
+  const CopyPhone = (val) => {
34
+    Taro.setClipboardData({
35
+      data: val,
36
+      success: e => {
37
+        Taro.showToast({
38
+          title: '入住人电话已复制',
39
+          icon: 'success',
40
+          duration: 2000,
41
+        })
42
+      }
43
+    })
44
+  }
45
+  return (
46
+    <View style={{ padding: '0 30px' }}>
47
+      <CustomNav title={roomName ? roomName : '房间名'} />
48
+      <scroll-view scroll-y="true" scroll-view='true' bindscrolltoupper="upper" bindscrolltolower="lower" bindscroll="scroll" style={{ height: 'calc(100vh - 65px)' }}>
49
+
50
+        {
51
+          detail.length==0?<View className='houseCard'>暂无入住人数据</View>
52
+           :detail?.map((item) =>
53
+            <View className='houseCard'>
54
+              {
55
+                item.personList?.map((item2) =>
56
+                  <View className='operation'>
57
+                    <View style={{display:'inline-block'}} onClick={()=>CopyName(item2.customerName)}>
58
+                      <Label>{item2.customerName}</Label>
59
+                      <Image src={copy} />
60
+                    </View>
61
+                    <View style={{display:'inline-block',marginLeft:'40rpx'}} onClick={()=>CopyPhone(item2.customerPhone)}>
62
+                      <Label>{item2.customerPhone}</Label>
63
+                      <Image src={copy} />
64
+                    </View>
65
+                  </View>
66
+
67
+                )
68
+              }              
69
+              <View className='operation'>入住时间:{item.startDate}  -  {item.endDate}</View>
70
+
71
+            </View>
72
+          )
73
+        }
74
+        
75
+      </scroll-view>
76
+    </View>
77
+  )
78
+})

+ 19
- 0
src/hotel/pages/landlord/roomOrder/roomOrder.less 查看文件

@@ -0,0 +1,19 @@
1
+.houseCard{
2
+  background: #1A3B83;
3
+  border-radius: 60px;
4
+  padding: 40px 30px 41px 30px;
5
+  text-align: center;
6
+  margin: 30px 0;
7
+  font-size: 28px;
8
+  color: #fff;  
9
+  Image{
10
+    width: 35px;
11
+    height: 35px;
12
+    margin-left:40px;
13
+    position: relative;
14
+    top: 5px;
15
+  }
16
+  .operation{
17
+    margin: 10px 0;
18
+  }
19
+}

+ 1
- 1
src/pages/MineUserAll/RefundMoney/CheckRefund/style.less 查看文件

@@ -402,7 +402,7 @@
402 402
 
403 403
     .button-box {
404 404
       margin: 60px 0;
405
-      width: 690px;
405
+      width: calc(100% - 60px);
406 406
       height: 88px;
407 407
       line-height: 88px;
408 408
       background: #274291;

+ 1
- 1
src/pages/PayOrder/style.less 查看文件

@@ -281,7 +281,7 @@
281 281
         margin-top: 3em;
282 282
         background-color: #274190;
283 283
         border-radius: 12px;
284
-        width: 690px;
284
+        width: calc(100% - 60px);
285 285
         height: 92px;
286 286
         color: @whiteColor;
287 287
         // position: absolute;

+ 1
- 1
src/pages/RoomOrder/style.less 查看文件

@@ -1,5 +1,5 @@
1 1
 button {
2
-  width: 690px;
2
+  width: calc(100% - 60px);
3 3
   height: 92px;
4 4
   background: #1A3B83;
5 5
   margin: 0 auto;

+ 1
- 1
src/pages/TobeShop/style.less 查看文件

@@ -303,7 +303,7 @@
303 303
 
304 304
     .button-box {
305 305
       margin: 60px 0;
306
-      width: 690px;
306
+      width: calc(100% - 60px);
307 307
       height: 88px;
308 308
       line-height: 88px;
309 309
       background: #274291;

+ 2
- 15
src/pages/index/index.jsx 查看文件

@@ -14,13 +14,11 @@ import { getIndexType,  getResourceList } from '@/services/home'
14 14
 
15 15
 
16 16
 export default withLayout((props) => {
17
-  const { router, person } = props
17
+  const { router, person,location } = props
18 18
   const { params, path } = router
19 19
   const { tab } = params || {}
20
-
21 20
   const [currentTab, setCurrentTab] = useState(0)
22 21
 
23
-  const locRef = useRef()
24 22
 
25 23
 
26 24
   const handleTabChange = (e) => {
@@ -28,18 +26,7 @@ export default withLayout((props) => {
28 26
     setCurrentTab(index)
29 27
   }
30 28
 
31
-  const [queryParams, setQueryParams] = useState({ location: '', pageNum: 1, pageSize: 10, typeId: '' })
32
-
33 29
 
34
-  useEffect(() => {
35
-    getLocation().then((res) => {
36
-      locRef.current = `${res.longitude},${res.latitude}`
37
-      setQueryParams({
38
-        ...queryParams,
39
-        location: locRef.current
40
-      })
41
-    })  
42
-  }, [])
43 30
 
44 31
   useEffect(() => {
45 32
     if (tab) {
@@ -52,7 +39,7 @@ export default withLayout((props) => {
52 39
         <CustomNav logo={logo} title='十公里' />
53 40
       </view>
54 41
       <view className='index-container'>
55
-        {currentTab === 0 && <Recommend loc={locRef} qp={queryParams}/>}
42
+        {currentTab === 0 && <Recommend location={location} />}
56 43
         {currentTab === 1 && <Guide person={person} router={router} />}
57 44
         {/* {currentTab === 2 && <Strategy />} */}
58 45
         {currentTab === 2 && <Mine person={person} />}

+ 2
- 2
src/pages/index/tabs/GuideCss/style.less 查看文件

@@ -5,7 +5,7 @@
5 5
   width: 94%;
6 6
   margin: auto;
7 7
   .MessageCard {
8
-    width: 690px;
8
+    width: calc(100% - 60px);
9 9
     height: 175px;
10 10
     background: @whiteColor;
11 11
     border-radius: 12px;
@@ -135,7 +135,7 @@
135 135
 
136 136
   .articleCard {
137 137
     margin-top: 60px;
138
-    width: 690px;
138
+    width: calc(100% - 60px);
139 139
     // height: 1066px;
140 140
     background: #ffffff;
141 141
     border-radius: 12px;

+ 1
- 1
src/pages/index/tabs/MineCss/style.less 查看文件

@@ -169,7 +169,7 @@
169 169
   .Badge-box {
170 170
     margin-top: 30px;
171 171
     .Badge-list {
172
-      width: 690px;
172
+      width: calc(100% - 60px);
173 173
       height: 102px;
174 174
       background: #ffffff;
175 175
       box-shadow: 0px 4px 24px 0px rgba(0, 0, 0, 0.08);

+ 7
- 26
src/pages/index/tabs/Recommend.jsx 查看文件

@@ -11,20 +11,14 @@ import './less/Recommend.less'
11 11
 
12 12
 
13 13
 export default (props) => {
14
-  const { router, person, loc,qp } = props
14
+  const { router, person, location } = props
15 15
   const [activeTab, setActiveTab] = useState(0)
16 16
   const { params } = useRouter()
17 17
   const { tabJump } = params || {}
18 18
   const [typeList, setTypeList] = useState([])
19 19
   
20
-  const locRef = useRef(loc)
21
-  // if(locRef.current==null){
22
-  //     Taro.showLoading()
23
-  //   }
24
-  //   if (locRef.current!=null) {
25
-  //     Taro.hideLoading()
26
-  //   }
27
-  const [queryParams, setQueryParams] = useState(qp)
20
+  
21
+  const [queryParams, setQueryParams] = useState({ location: location, pageNum: 1, pageSize: 10, typeId: '' })
28 22
 
29 23
   // 获取资源表信息
30 24
   const [alllist, setAllList] = useState([])
@@ -40,35 +34,22 @@ export default (props) => {
40 34
       typeId: tab
41 35
     })
42 36
     if (index == 0) {
43
-      setQueryParams({ location:  locRef.current, pageNum: 1, pageSize: 10, typeId: '' })
37
+      setQueryParams({ location: location, pageNum: 1, pageSize: 10, typeId: '' })
44 38
     }
45 39
   }
46 40
 
47
-  useEffect(() => {
48
-    
41
+  useEffect(() => {    
49 42
     //查询分类标签表
50 43
     getIndexType({ pageSize: 20 }).then((res) => {
51 44
       setTypeList(res.records || [])
52
-    })
53
-    
45
+    })    
54 46
   }, [])
55 47
 
56 48
   useEffect(() => {
57
-    if (tabJump) {
58
-      // 更新 typeId
59
-      // 更新 分页
60
-    }
61
-    setActiveTab(tabJump - 0)
62
-  }, [tabJump])
63
-
64
-
65
-  useEffect(() => {
66
-    if (locRef.current) {
67 49
       getResourceList(queryParams).then((res) => {
68 50
         setAllList(res.records || [])
69 51
       })
70
-    }
71
-  }, [queryParams])
52
+    }, [queryParams])
72 53
 
73 54
   const onSearch = () => {
74 55
     // 用绝对路径

+ 1
- 1
src/pages/index/tabs/less/Recommend.less 查看文件

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

+ 4
- 0
src/routes.js 查看文件

@@ -80,6 +80,10 @@ const hotelPages = [
80 80
     title: '新增房源',
81 81
     page: 'pages/landlord/addRoom/addRoom',
82 82
   },
83
+  {
84
+    title: '查看入住人',
85
+    page: 'pages/landlord/roomOrder/roomOrder',
86
+  },
83 87
 ];
84 88
 
85 89
 // 所有的页面

+ 7
- 1
src/services/landlord.js 查看文件

@@ -57,4 +57,10 @@ import request from '@/utils/request'
57 57
  * @param {*} data 
58 58
  * @returns 
59 59
  */
60
- export const shareRoom = (data) => request('/roomOrder', { method: 'post', data })
60
+ export const shareRoom = (data) => request('/roomOrder', { method: 'post', data })
61
+ /**
62
+ * 查看历史入住人列表
63
+ * @param {*} id 
64
+ * @returns 
65
+ */
66
+  export const getRoomOrderList = (params) => request('/roomOrder',{params})