zlisen 4 年之前
父節點
當前提交
43b0ff8b07

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

@@ -4,7 +4,7 @@ module.exports = {
4 4
     NODE_ENV: '"development"'
5 5
   },
6 6
   defineConstants: {
7
-    HOST: '"http://localhost:7080"',
7
+    HOST: '"http://10.161.7.66:7080"',
8 8
     // HOST: '"https://sgl.njyunzhi.com"',
9 9
     // HOST: '"http://192.168.31.211:7080"',
10 10
     // HOST: '"http://192.168.211.105:7080"',

二進制
src/assets/copy.png 查看文件


+ 3
- 3
src/compents/tab/index.scss 查看文件

@@ -3,10 +3,10 @@
3 3
     position:absolute;
4 4
     bottom: 0;
5 5
     width: 100%;
6
-    height: 85px;
6
+    height: 130px;
7 7
     border-radius:30px 30px 0 0;
8 8
     text-align: center;
9
-    line-height: 85px;
9
+    line-height: 130px;
10 10
     z-index:999;
11 11
     &-btn{
12 12
         line-height: unset;
@@ -15,7 +15,7 @@
15 15
     .tab1 {
16 16
         background-color: #274291;
17 17
         font-size: 40px;
18
-        font-weight: 600;
18
+        font-weight: 500;
19 19
         letter-spacing: 14px;
20 20
     }
21 21
 

+ 78
- 68
src/pages/house/household/index.jsx 查看文件

@@ -1,73 +1,84 @@
1
-import React, { useEffect, useMemo, useState } from 'react'
2
-import Taro, { useRouter } from '@tarojs/taro'
3
-import './index.scss'
4
-import { View, Text, Input, Image } from '@tarojs/components'
5
-import ContainerLayout from '../../../compents/container/index'
6
-import radio from '../../../assets/radio.png'
7
-import Layout from '../../../layout/index'
8
-import request from '../../../util/request'
9
-import groupby from 'lodash.groupby';
10
-
11
-const house = (props) => {
12
-
13
-  const router = useRouter()
14
-  const { houseId } = router.params
15
-
16
-  const [list, setList] = useState({})
17
-
18
-
1
+import React, { useEffect, useMemo, useState } from "react";
2
+import Taro, { useRouter } from "@tarojs/taro";
3
+import "./index.scss";
4
+import { View, Text, Input, Image } from "@tarojs/components";
5
+import ContainerLayout from "../../../compents/container/index";
6
+import radio from "../../../assets/radio.png";
7
+import Layout from "../../../layout/index";
8
+import request from "../../../util/request";
9
+import groupby from "lodash.groupby";
10
+import copy from '../../../assets/copy.png'
11
+const house = props => {
12
+  const router = useRouter();
13
+  const { houseId } = router.params;
14
+
15
+  const [list, setList] = useState({});
19 16
 
20 17
   useEffect(() => {
21
-    getList()
22
-  }, [])
18
+    getList();
19
+  }, []);
23 20
 
24 21
   const getList = () => {
25
-    request({ url: '/taHousePerson',params:{houseId:houseId,pageSize:9999} }).then((res) => {
26
-      const { records, ...page } = res.data.data
27
-      console.log(groupby(records, item => item.orderId))
28
-      setList(groupby(records, item => item.orderId))
22
+    request({
23
+      url: "/taHousePerson",
24
+      params: { houseId: houseId, pageSize: 9999 }
25
+    }).then(res => {
26
+      const { records, ...page } = res.data.data;
27
+      console.log(groupby(records, item => item.orderId));
28
+      setList(groupby(records, item => item.orderId));
29 29
       //   {
30 30
       //   const [date,_] = item.createDate.split('T')
31 31
       //   return date
32 32
       // }))
33
-    })
34
-  }
35
-
36
-const getDate =(value)=>{ 
37
-  const [date,time] = value.split('T')
38
-  console.log(time,'time')
39
-return `${date} ${time.split(':')[0]}:${time.split(':')[1]}`
40
-}
41
-  return <View className='household'>
42
-
43
-    <Layout>
44
-      {/* <View className='household-text'>vjoaphepionvodashvoia</View> */}
45
-
46
-      {
47
-        Object.keys(list).map((item) => {
48
-          return <View className='household-view'>
49
-            {/* {index + 1} */}
50
-            <Text className='household-view-title'>订单编号:{item}</Text>
51
-            <ContainerLayout className='household-view-card'>
52
-              {list[item].map((x) => {
53
-                return <view>{x.name}: {x.phone}</view>  
54
-              })}
55
-              {`入住时间:${getDate(list[item][0].createDate)}`}
56
-              {list[item].length == 0 && '暂无入住人信息'}
57
-
58
-            </ContainerLayout>
59
-
60
-          </View>
61
-        })
62
-
63
-      }
64
-      {
65
-        Object.keys(list).length === 0 && <view style={{textAlign:'center',paddingTop:30}}>
66
-           暂无入住信息
67
-        </view>
68
-      }
69
-
70
-      {/* {list.map((x, index) => {
33
+    });
34
+  };
35
+
36
+  const getDate = value => {
37
+    const [date, time] = value.split("T");
38
+    console.log(time, "time");
39
+    return `${date} ${time.split(":")[0]}:${time.split(":")[1]}`;
40
+  };
41
+
42
+  const onCopy = value => {
43
+    wx.setClipboardData({
44
+      data: value.name + " " + value.phone,
45
+      success(res) {}
46
+    });
47
+  };
48
+  return (
49
+    <View className="household">
50
+      <Layout>
51
+        {/* <View className='household-text'>vjoaphepionvodashvoia</View> */}
52
+
53
+        {Object.keys(list).map(item => {
54
+          return (
55
+            <View className="household-view">
56
+              {/* {index + 1} */}
57
+              <Text className="household-view-title">订单编号:{item}</Text>
58
+              <ContainerLayout className="household-view-card">
59
+                {list[item].map(x => {
60
+                  return (
61
+                    <view>
62
+                      <Text>
63
+                        {x.name}: {x.phone}   
64
+                      </Text>
65
+                      <Image className="household-view-card-icon" src={copy} onClick={() => onCopy(x)}></Image>
66
+                    </view>
67
+                  );
68
+                })}
69
+                <view>{`入住时间:${getDate(list[item][0].createDate)}`}</view>
70
+                {list[item].length == 0 && "暂无入住人信息"}
71
+              </ContainerLayout>
72
+            </View>
73
+          );
74
+        })}
75
+        {Object.keys(list).length === 0 && (
76
+          <view style={{ textAlign: "center", paddingTop: 30 }}>
77
+            暂无入住信息
78
+          </view>
79
+        )}
80
+
81
+        {/* {list.map((x, index) => {
71 82
       return <View className='household-view'>
72 83
 
73 84
         <Text className='household-view-title'>入住日期:{index + 1}</Text>
@@ -79,10 +90,9 @@ return `${date} ${time.split(':')[0]}:${time.split(':')[1]}`
79 90
       </View>
80 91
 
81 92
     })} */}
82
-    </Layout>
83
-
84
-
85
-  </View>
86
-}
93
+      </Layout>
94
+    </View>
95
+  );
96
+};
87 97
 
88
-export default house
98
+export default house;

+ 6
- 2
src/pages/house/household/index.scss 查看文件

@@ -23,12 +23,16 @@
23 23
       // font-weight: 600;
24 24
       margin-top: 26.67px;
25 25
       position: relative;
26
-      min-height: 150px;
26
+      // min-height: 150px;
27 27
 line-height: 45px;
28 28
  text-align: center;
29 29
 background-color:#274291;
30 30
 
31
-
31
+&-icon{
32
+  width: 30px;
33
+  height: 30px;
34
+  margin-left: 20px;
35
+}
32 36
     }
33 37
   }
34 38
 }

+ 2
- 1
src/pages/house/list/index.scss 查看文件

@@ -35,7 +35,8 @@
35 35
       .top {
36 36
         padding: 60px 40px;
37 37
         border-bottom: 1px solid #f4f4f4;
38
-        line-height: 32px;
38
+        line-height: 34px;
39
+        font-size: 32px;
39 40
         // min-height: 120px;
40 41
       }
41 42
 

+ 5
- 5
src/pages/share/index.jsx 查看文件

@@ -29,7 +29,7 @@ const Index = () => {
29 29
     // const [data,setData] = useState({})
30 30
     const [shareObj, setShareObj] = useState()
31 31
     const [showShareModal, setShowShareModal] = useState(false)
32
-
32
+    const nowtime=new Date()
33 33
     useEffect(() => {
34 34
         if (houseId) {
35 35
             request({ url: "/taHouseSetting/last", params: { houseId } }).then((res) => {
@@ -155,7 +155,7 @@ const Index = () => {
155 155
         setShowShareModal(false)
156 156
 
157 157
     }
158
-
158
+ 
159 159
     
160 160
 
161 161
     return <View className='share'>
@@ -163,7 +163,7 @@ const Index = () => {
163 163
             <View className='inputstyle-view'>
164 164
                 <Text className='title'>入住人数</Text>
165 165
                 <Container className='inputstyle-view-card ' style={{ borderRadius: '20rpx', padding: '0 40rpx' }} >
166
-                    <Input type='number' value={personNum} onInput={(e) => setPersonNum(e.detail.value)} placeholderClass='placeholderinput' className='input' type='text' placeholder='' />
166
+                    <Input type='number' value={personNum||0} onInput={(e) => setPersonNum(e.detail.value)} placeholderClass='placeholderinput' className='input' type='text' placeholder='' />
167 167
                 </Container>
168 168
             </View>
169 169
             <View className='inputstyle-view'>
@@ -172,7 +172,7 @@ const Index = () => {
172 172
 
173 173
                     <Picker mode='date' onChange={onTimeChange}>
174 174
                         <View className='input' style={{ height: '44rpx', lineHeight: '44rpx', fontsize: '28rpx' }}>
175
-                            {startTime}
175
+                            {startTime||`${nowtime.getFullYear()}-0${nowtime.getMonth()+1}-${nowtime.getDate()}`}
176 176
                         </View>
177 177
                     </Picker>
178 178
                     {/* <Input placeholderClass='placeholderinput' className='input' type='text' placeholder='' /> */}
@@ -184,7 +184,7 @@ const Index = () => {
184 184
                 <Container className='inputstyle-view-card ' style={{ borderRadius: '20rpx', padding: '0 40rpx' }} >
185 185
                     <Picker mode='date' onChange={(e) => { setEndTime(e.detail.value) }}>
186 186
                         <View className='input' style={{ height: '44rpx', lineHeight: '44rpx', fontsize: '28rpx' }}>
187
-                            {endTime}
187
+                            {endTime||`${nowtime.getFullYear()}-0${nowtime.getMonth()+1}-${nowtime.getDate()+1}`}
188 188
                         </View>
189 189
                     </Picker>
190 190
                 </Container>