张延森 4 vuotta sitten
vanhempi
commit
5b6bf8855d

+ 1
- 1
src/pages/customer/index.js Näytä tiedosto

@@ -67,7 +67,7 @@ const index = (props) => {
67 67
       })
68 68
     }
69 69
 
70
-    request({url:'/taHouseSurround', params:{houseId:houseId}}).then((res)=>{
70
+    request({url:'/taHouseSurround', params:{houseId:houseId, pageSize: 500}}).then((res)=>{
71 71
         const { records } = res.data.data  
72 72
         setSurroundList(records)
73 73
     })

+ 12
- 8
src/pages/house/household/index.jsx Näytä tiedosto

@@ -41,7 +41,7 @@ const house = props => {
41 41
 
42 42
   const onCopy = value => {
43 43
     wx.setClipboardData({
44
-      data: value.name + " " + value.phone,
44
+      data: value,
45 45
       success(res) {}
46 46
     });
47 47
   };
@@ -58,15 +58,19 @@ const house = props => {
58 58
               <ContainerLayout className="household-view-card">
59 59
                 {list[item].map(x => {
60 60
                   return (
61
-                    <view onClick={() => onCopy(x)}>
62
-                      <Text>
63
-                        {x.name}: {x.phone}   
64
-                      </Text>
65
-                      <Image className="household-view-card-icon" src={copy}></Image>
66
-                    </view>
61
+                    <View className="card-person">
62
+                      <View style="flex: none" onClick={() => onCopy(x.name)}>
63
+                        {x.name}
64
+                        <Image className="household-view-card-icon" src={copy}></Image>
65
+                      </View>
66
+                      <View style="flex: none; margin-left: 16px" onClick={() => onCopy(x.phone)}>
67
+                        {x.phone} 
68
+                        <Image className="household-view-card-icon" src={copy}></Image>
69
+                      </View>
70
+                    </View>
67 71
                   );
68 72
                 })}
69
-                <view>{`入住时间:${getDate(list[item][0].createDate)}`}</view>
73
+                <View style="margin-top: 1em">{`入住时间:${getDate(list[item][0].createDate)}`}</View>
70 74
                 {list[item].length == 0 && "暂无入住人信息"}
71 75
               </ContainerLayout>
72 76
             </View>

+ 18
- 8
src/pages/house/household/index.scss Näytä tiedosto

@@ -24,15 +24,25 @@
24 24
       margin-top: 26.67px;
25 25
       position: relative;
26 26
       // min-height: 150px;
27
-line-height: 45px;
28
- text-align: center;
29
-background-color:#274291;
27
+      line-height: 45px;
28
+      text-align: center;
29
+      background-color:#274291;
30 30
 
31
-&-icon{
32
-  width: 30px;
33
-  height: 30px;
34
-  margin-left: 20px;
35
-}
31
+      &-icon{
32
+        width: 30px;
33
+        height: 30px;
34
+        margin-left: 20px;
35
+      }
36
+
37
+      .card-person {
38
+        display: flex;
39
+        text-align: center;
40
+        justify-content: center;
41
+
42
+        & + .card-person {
43
+          margin-top: 1em;
44
+        }
45
+      }
36 46
     }
37 47
   }
38 48
 }

+ 1
- 1
src/pages/house/index.jsx Näytä tiedosto

@@ -44,7 +44,7 @@ const house = (props) => {
44 44
     })
45 45
 
46 46
     const getImageList=()=>{
47
-        request({url:'/taHouseSurround',params:{houseId:houseId}}).then((res)=>{
47
+        request({url:'/taHouseSurround',params:{houseId:houseId, pageSize: 500}}).then((res)=>{
48 48
             const {records,...page} =res.data.data  
49 49
             setImgSource(records)
50 50
         })

+ 4
- 1
src/util/request.js Näytä tiedosto

@@ -124,6 +124,10 @@ export const uploadFiles = async (files, url) => {
124 124
 function paramsToString(params) {
125 125
   return Object.keys(params).map((key) => {
126 126
     const val = params[key]
127
+    if (val === undefined || val === null) {
128
+      return `${key}=`
129
+    }
130
+
127 131
     return Array.isArray(val) ? val.map((x) => {
128 132
       return composeKeyValue(key, x)
129 133
     }).join('&') : composeKeyValue(key, val)
@@ -132,6 +136,5 @@ function paramsToString(params) {
132 136
 }
133 137
 
134 138
 function composeKeyValue(k, v, encode) {
135
-
136 139
   return encode === false ? `${k}=${v}` : `${encodeURIComponent(k)}=${encodeURIComponent(v)}`
137 140
 }