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

+ 1
- 1
config/prod.js 查看文件

@@ -3,7 +3,7 @@ module.exports = {
3 3
     NODE_ENV: '"production"'
4 4
   },
5 5
   defineConstants: {
6
-    HOST: '"https://sgl-v2.njyunzhi.com"',
6
+    HOST: '"https://sgl-v2-test.njyunzhi.com"',
7 7
     OSS: '"yz-shigongli.oss-accelerate.aliyuncs.com"',
8 8
   },
9 9
   mini: {},

+ 1
- 1
project.config.json 查看文件

@@ -2,7 +2,7 @@
2 2
   "miniprogramRoot": "./dist",
3 3
   "projectname": "miniapp",
4 4
   "description": "十公里",
5
-  "appid": "wx06a7372d48d56843",
5
+  "appid": "wx835627a9b9b3932a",
6 6
   "setting": {
7 7
     "urlCheck": true,
8 8
     "es6": false,

+ 41
- 43
src/hotel/pages/landlord/roomOrder/roomOrder.jsx 查看文件

@@ -1,12 +1,13 @@
1 1
 import withLayout from '@/layouts'
2
-import React, { useState, useEffect, useRef } from 'react'
2
+import React, { useState, useEffect, useRef, useMemo } from 'react'
3 3
 import CustomNav from '@/components/CustomNav'
4 4
 import Taro from '@tarojs/taro'
5 5
 import { useModel } from '@/store'
6 6
 import SpinBox from "@/components/Spin/SpinBox";
7 7
 import copy from '@/assets/icons/landlord/copy.png'
8 8
 import { Input, Button, View, Picker, Label, Image } from '@tarojs/components'
9
-import { getRoomOrderList,getHotelDetail } from '@/services/landlord'
9
+import List from '@/components/List';
10
+import { getRoomOrderList, getHotelDetail } from '@/services/landlord'
10 11
 import './roomOrder.less'
11 12
 
12 13
 
@@ -14,23 +15,16 @@ export default withLayout((props) => {
14 15
   const { hotelId, roomId, roomName } = props.router.params
15 16
   const [detail, setDetail] = useState([])
16 17
   const { setHotel } = useModel('hotel')
17
-  const [loading, setLoading] = useState(false)
18 18
 
19
-  useEffect(() => {
20
-    setLoading(true)
21
-    if (roomId) {
22
-      getRoomOrderList({ roomId: roomId }).then((res) => {
23
-        setDetail(res.records || [])
24
-        setLoading(false)
25
-      })
26
-    }
27
-  }, [roomId])
28
-  
19
+  const queryParams = useMemo(() => ({
20
+    roomId: roomId
21
+  }), [roomId])
22
+
29 23
   useEffect(() => {
30 24
     if (hotelId) {
31
-      getHotelDetail(hotelId).then((res)=>{
25
+      getHotelDetail(hotelId).then((res) => {
32 26
         setHotel(res)
33
-      }) 
27
+      })
34 28
     }
35 29
   }, [hotelId])
36 30
 
@@ -61,40 +55,44 @@ export default withLayout((props) => {
61 55
   }
62 56
 
63 57
   return (
64
-    <View style={{ padding: '0 30px' }}>
58
+    <View className='page-index'>
65 59
       <view className='index-navbar'>
66 60
         <CustomNav title={roomName ? decodeURIComponent(roomName) : '房间名'} />
67 61
       </view>
68
-      <SpinBox loading={loading}>
69
-      <scroll-view scrollY style={{ height: 'calc(100vh - 65px)' }}>
70
-
71
-        {
72
-          detail.length == 0 ? <View className='houseCard'>暂无入住人数据</View>
73
-            : detail.map((item, index) =>
74
-              <View className='houseCard' key={index}>
75
-                {
76
-                  (item.personList || []).map((item2, inx) =>
77
-                    <View className='operation' key={inx}>
78
-                      <View style={{ display: 'inline-block' }} onClick={() => CopyName(item2.customerName)}>
79
-                        <Label>{item2.customerName}</Label>
80
-                        <Image src={copy} />
81
-                      </View>
82
-                      <View style={{ display: 'inline-block', marginLeft: '40rpx' }} onClick={() => CopyPhone(item2.customerPhone)}>
83
-                        <Label>{item2.customerPhone}</Label>
84
-                        <Image src={copy} />
62
+      <View className='index-container'>
63
+        <List
64
+          style={{ height: '100%' }}
65
+          request={getRoomOrderList}
66
+          params={queryParams}
67
+          onDataChange={setDetail}
68
+          refresherEnabled={false}
69
+          noData={<View style={{ padding: '15px 30px' }}><View className='houseCard'>暂无入住人数据</View></View>}
70
+        >
71
+          {
72
+            detail.map((item, index) =>
73
+              <View style={{ padding: '15px 30px' }}>
74
+                <View className='houseCard' key={index}>
75
+                  {
76
+                    (item.personList || []).map((item2, inx) =>
77
+                      <View className='operation' key={inx}>
78
+                        <View style={{ display: 'inline-block' }} onClick={() => CopyName(item2.customerName)}>
79
+                          <Label>{item2.customerName}</Label>
80
+                          <Image src={copy} />
81
+                        </View>
82
+                        <View style={{ display: 'inline-block', marginLeft: '40rpx' }} onClick={() => CopyPhone(item2.customerPhone)}>
83
+                          <Label>{item2.customerPhone}</Label>
84
+                          <Image src={copy} />
85
+                        </View>
85 86
                       </View>
86
-                    </View>
87
-
88
-                  )
89
-                }
90
-                <View className='operation'>入住时间:{item.startDate}  -  {item.endDate}</View>
91
-
87
+                    )
88
+                  }
89
+                  <View className='operation'>入住时间:{item.startDate}  -  {item.endDate}</View>
90
+                </View>
92 91
               </View>
93 92
             )
94
-        }
95
-
96
-      </scroll-view>
97
-    </SpinBox>
93
+          }
94
+        </List>
95
+      </View>
98 96
     </View>
99 97
   )
100 98
 })

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

@@ -3,7 +3,6 @@
3 3
   border-radius: 60px;
4 4
   padding: 40px 30px 41px 30px;
5 5
   text-align: center;
6
-  margin: 30px 0;
7 6
   font-size: 28px;
8 7
   color: #fff;  
9 8
   Image{
@@ -16,4 +15,11 @@
16 15
   .operation{
17 16
     margin: 10px 0;
18 17
   }
18
+}
19
+.botton {
20
+  font-size: 28px;
21
+  color: #c0c8d3;
22
+  line-height: 34px;
23
+  text-align: center;
24
+  padding: 40px 0;
19 25
 }