lisenzhou hace 2 años
padre
commit
27eaf1d920

+ 26
- 22
src/components/ProjectListItem/index.jsx Ver fichero

4
 import { getImgURL } from "@/utils/image";
4
 import { getImgURL } from "@/utils/image";
5
 import BrokerShare from "@/components/brokerShare";
5
 import BrokerShare from "@/components/brokerShare";
6
 import "./index.scss";
6
 import "./index.scss";
7
+import { useSelector } from "react-redux";
8
+import { ROLE_CODE } from "@/constants/user";
7
 
9
 
8
 export default function ProjectListItem(props) {
10
 export default function ProjectListItem(props) {
11
+  const person = useSelector(({user}) => user.userInfo?.person);
9
   const { Data = {}, ShowImgIcon = true } = props;
12
   const { Data = {}, ShowImgIcon = true } = props;
10
   const { uvList = [] } = Data;
13
   const { uvList = [] } = Data;
11
 
14
 
31
   };
34
   };
32
 
35
 
33
   return (
36
   return (
34
-    <view className='components ProjectListItem' onClick={LinkTo}>
35
-      <view className='ProjectListItem-top flex-h'>
36
-        <view className='Img'>
37
+    <view className="components ProjectListItem" onClick={LinkTo}>
38
+      <view className="ProjectListItem-top flex-h">
39
+        <view className="Img">
37
           <view>
40
           <view>
38
             <Image
41
             <Image
39
-              mode='aspectFill'
40
-              className='centerLabel'
42
+              mode="aspectFill"
43
+              className="centerLabel"
41
               src={getImgURL(
44
               src={getImgURL(
42
                 (Data?.buildingListImg || []).length
45
                 (Data?.buildingListImg || []).length
43
                   ? Data.buildingListImg[0].url
46
                   ? Data.buildingListImg[0].url
46
             />
49
             />
47
             {(Data?.panoramaList || []).length > 0 && ShowImgIcon && (
50
             {(Data?.panoramaList || []).length > 0 && ShowImgIcon && (
48
               <Image
51
               <Image
49
-                mode='heightFix'
50
-                className='Tips Vr'
52
+                mode="heightFix"
53
+                className="Tips Vr"
51
                 src={require("@/assets/index-icon18.png")}
54
                 src={require("@/assets/index-icon18.png")}
52
               />
55
               />
53
             )}
56
             )}
54
             {Data.videoUrl !== null && ShowImgIcon && (
57
             {Data.videoUrl !== null && ShowImgIcon && (
55
               <Image
58
               <Image
56
-                mode='heightFix'
57
-                className='Tips Video'
59
+                mode="heightFix"
60
+                className="Tips Video"
58
                 src={require("@/assets/index-icon19.png")}
61
                 src={require("@/assets/index-icon19.png")}
59
               />
62
               />
60
             )}
63
             )}
61
           </view>
64
           </view>
62
         </view>
65
         </view>
63
-        <view className='flex-item'>
64
-          <view className='Name flex-h'>
65
-            <view className='flex-item'>
66
+        <view className="flex-item">
67
+          <view className="Name flex-h">
68
+            <view className="flex-item">
66
               <text>{Data.buildingName}</text>
69
               <text>{Data.buildingName}</text>
67
             </view>
70
             </view>
68
             <text></text>
71
             <text></text>
69
           </view>
72
           </view>
70
-          <text className='Price'>{Data.price}</text>
71
-          <text className='Address'>{Data.address}</text>
72
-          <view className='Tags'>
73
+          <text className="Price">{Data.price}</text>
74
+          <text className="Address">{Data.address}</text>
75
+          <view className="Tags">
73
             {(Data.buildingTag || []).map((item, index) => (
76
             {(Data.buildingTag || []).map((item, index) => (
74
               <text key={`Tags-${index}`}>{item.tagName}</text>
77
               <text key={`Tags-${index}`}>{item.tagName}</text>
75
             ))}
78
             ))}
76
           </view>
79
           </view>
77
-          <view className='ShareInfo'>
78
-            <text className='iconfont icon-fenxiang'></text>
80
+          <view className="ShareInfo">
81
+            <text className="iconfont icon-fenxiang"></text>
79
             <text>{299 + (Data.shareNum || 0)}次分享</text>
82
             <text>{299 + (Data.shareNum || 0)}次分享</text>
80
-            <view className='Users'>
83
+            <view className="Users">
81
               {(uvList?.records || []).slice(0, 3).map((item, index) => (
84
               {(uvList?.records || []).slice(0, 3).map((item, index) => (
82
                 <view key={`uv-${index}`}>
85
                 <view key={`uv-${index}`}>
83
                   <Image
86
                   <Image
84
-                    mode='aspectFill'
85
-                    className='centerLabel'
87
+                    mode="aspectFill"
88
+                    className="centerLabel"
86
                     src={item.photoOravatar}
89
                     src={item.photoOravatar}
87
                   />
90
                   />
88
                 </view>
91
                 </view>
95
           </view>
98
           </view>
96
         </view>
99
         </view>
97
       </view>
100
       </view>
98
-      {Data?.isBroker&&<BrokerShare buildingId={Data.buildingId}></BrokerShare>}
99
-      
101
+      {Data?.isBroker && person?.personType === ROLE_CODE.BROKER && (
102
+        <BrokerShare buildingId={Data.buildingId}></BrokerShare>
103
+      )}
100
     </view>
104
     </view>
101
   );
105
   );
102
 }
106
 }

+ 1
- 0
src/constants/user.js Ver fichero

27
   '3': '认筹',
27
   '3': '认筹',
28
   '4': '签约',
28
   '4': '签约',
29
   '5': '结佣',
29
   '5': '结佣',
30
+  '6': '全款到账',
30
 }
31
 }

+ 2
- 2
src/pages/index/buildingDetail/components/BasicInfo/index.jsx Ver fichero

15
 
15
 
16
 
16
 
17
 export default function BasicInfo (props) {
17
 export default function BasicInfo (props) {
18
-  const { Info = {}, trackData } = props
18
+  const { Info = {}, trackData,person } = props
19
   const { buildingId, isSave } = Info
19
   const { buildingId, isSave } = Info
20
 
20
 
21
   const [isSaved, handleFavor] = useFavor(isSave, { id: buildingId, buildingId, ...trackData })
21
   const [isSaved, handleFavor] = useFavor(isSave, { id: buildingId, buildingId, ...trackData })
52
         }
52
         }
53
       </view>
53
       </view>
54
 
54
 
55
-      {Info?.isBroker&&<BrokerShare buildingId={buildingId}></BrokerShare>}
55
+      {Info?.isBroker&&person.personType===ROLE_CODE.BROKER&&<BrokerShare buildingId={buildingId}></BrokerShare>}
56
 
56
 
57
       {/* 项目列表 */}
57
       {/* 项目列表 */}
58
       {
58
       {

+ 1
- 1
src/pages/index/buildingDetail/index.jsx Ver fichero

107
 
107
 
108
                 {/* 基本信息 */}
108
                 {/* 基本信息 */}
109
                 <view className='BasicInfo'>
109
                 <view className='BasicInfo'>
110
-                  <BasicInfo Info={DetailInfo} trackData={fullTrackData}></BasicInfo>
110
+                  <BasicInfo Info={DetailInfo} trackData={fullTrackData}  person={person}></BasicInfo>
111
                 </view>
111
                 </view>
112
 
112
 
113
                 {/* 特价房源 */}
113
                 {/* 特价房源 */}

+ 437
- 252
src/subpackages/pages/marketing/changeVisit/index.jsx Ver fichero

1
-import { useState, useEffect } from 'react'
2
-import withLayout from '@/layout'
3
-import { ScrollView, Input, Image, Block, Picker } from '@tarojs/components'
4
-import '@/assets/css/iconfont.css'
5
-import { getCardList, getAgents } from '@/services/card'
6
-import { fetch } from '@/utils/request'
7
-import Taro from '@tarojs/taro'
1
+import { useState, useEffect } from "react";
2
+import withLayout from "@/layout";
3
+import { ScrollView, Input, Image, Block, Picker } from "@tarojs/components";
4
+import "@/assets/css/iconfont.css";
5
+import { getCardList, getAgents } from "@/services/card";
6
+import { fetch } from "@/utils/request";
7
+import Taro from "@tarojs/taro";
8
 import { formatDate } from "@/utils/chatDate";
8
 import { formatDate } from "@/utils/chatDate";
9
-import { API_SURE_CHIP, API_BUILDING_HOUSE_TYPE, API_SURE_SIGN, API_SURE_BUY, API_CUSTOMER_DETAILINFO } from '@/constants/api'
10
-import './index.scss'
9
+import {
10
+  API_SURE_CHIP,
11
+  API_BUILDING_HOUSE_TYPE,
12
+  API_SURE_SIGN,
13
+  API_SURE_BUY,
14
+  API_CUSTOMER_DETAILINFO,
15
+} from "@/constants/api";
16
+import "./index.scss";
17
+import { ROLE_CODE } from "@/constants/user";
11
 
18
 
12
 export default withLayout((props) => {
19
 export default withLayout((props) => {
13
-
14
-  const { router } = props
15
-  const { name, buildingId, type, id, channelId } = router.params
16
-
17
-
20
+  const { router, person } = props;
21
+  const { name, buildingId, type, id, channelId } = router.params;
22
+  console.log(person, "===");
18
   const [RenChouData, setRenChouData] = useState({
23
   const [RenChouData, setRenChouData] = useState({
19
     name,
24
     name,
20
-    realtyConsultant: '',
21
-    remark: '',
22
-  })
23
-
25
+    realtyConsultant: "",
26
+    remark: "",
27
+  });
24
 
28
 
25
   const [QianYueData, setQianYueData] = useState({
29
   const [QianYueData, setQianYueData] = useState({
26
     name,
30
     name,
27
-    realtyConsultant: '',
28
-    remark: '',
29
-    dividendsName: '',
30
-    dividendsPer: '',
31
-    houseInfo: '',
32
-    houseType: '',
33
-    price: '',
34
-    successDate: '',
35
-  })
36
-
37
-  const [FormData, setFormData] = useState({ ...RenChouData })
38
-
39
-  const [ConsultantList, setConsultantList] = useState([])
40
-  const [HouseTypeList, setHouseTypeList] = useState([])
41
-  const [CurrnetConsultant, setCurrnetConsultant] = useState({})
42
-
43
-  const [SuccessDate, setSuccessDate] = useState(null)
44
-  const [channelCustomerId, setChannelCustomerId] = useState(null)
45
-
31
+    realtyConsultant: "",
32
+    remark: "",
33
+    dividendsName: "",
34
+    dividendsPer: "",
35
+    houseInfo: "",
36
+    houseType: "",
37
+    price: "",
38
+    successDate: "",
39
+  });
40
+
41
+  const [FormData, setFormData] = useState({ ...RenChouData });
42
+
43
+  const [ConsultantList, setConsultantList] = useState([]);
44
+  const [HouseTypeList, setHouseTypeList] = useState([]);
45
+  const [CurrnetConsultant, setCurrnetConsultant] = useState({});
46
+
47
+  const [SuccessDate, setSuccessDate] = useState(null);
48
+  const [channelCustomerId, setChannelCustomerId] = useState(null);
49
+  const [channelCustomerInfo, setChannelCustomerIdInfo] = useState({});
46
   const [StatusList] = useState([
50
   const [StatusList] = useState([
47
-    { name: '认筹', id: 3 },
48
-    { name: '签约', id: 4 },
49
-    { name: '结佣', id: 5 },
50
-  ])
51
-  const [CurrentStatusId, setCurrentStatusId] = useState(3)
51
+    { name: "认筹", id: 3 },
52
+    { name: "签约", id: 4 },
53
+    { name: "全款到账", id: 6 },
54
+    { name: "结佣", id: 5 },
55
+  ]);
56
+  const [CurrentStatusId, setCurrentStatusId] = useState(3);
52
 
57
 
53
-  const [CurrentRoomTypeId, setCurrentRoomTypeId] = useState(null)
58
+  const [CurrentRoomTypeId, setCurrentRoomTypeId] = useState(null);
54
 
59
 
55
   useEffect(() => {
60
   useEffect(() => {
56
     if (buildingId) {
61
     if (buildingId) {
58
         pageNumber: 1,
63
         pageNumber: 1,
59
         pageSize: 50,
64
         pageSize: 50,
60
         buildingId,
65
         buildingId,
61
-      }
66
+      };
62
       getCardList(params).then((res) => {
67
       getCardList(params).then((res) => {
63
-        const { records } = res
64
-        setConsultantList(records || [])
65
-      })
68
+        const { records } = res;
69
+        setConsultantList(records || []);
70
+      });
66
     }
71
     }
67
-  }, [buildingId])
68
-
69
-
72
+  }, [buildingId]);
70
 
73
 
71
   const [agentsInfo, setAgentsInfo] = useState({
74
   const [agentsInfo, setAgentsInfo] = useState({
72
-    name: '',
73
-    channelName: ' ',
74
-  })
75
-
75
+    name: "",
76
+    channelName: " ",
77
+  });
76
 
78
 
77
   useEffect(() => {
79
   useEffect(() => {
78
-    fetch({ url: `${API_CUSTOMER_DETAILINFO}/${id}`, method: 'get' }).then((res) => {
79
-      //获取经纪人信息
80
-      setAgentsInfo({ name: res.name })
81
-      getAgents({ personId: res?.recommendPerson }).then((e) => {
82
-        let ganentsList = e.records
83
-        if ((ganentsList || []).length) {
84
-          // ganentsList
85
-          setAgentsInfo({ name: res.name, channelName: ganentsList[0].channelName })
80
+    fetch({ url: `${API_CUSTOMER_DETAILINFO}/${id}`, method: "get" }).then(
81
+      (res) => {
82
+        //获取经纪人信息
83
+        setChannelCustomerIdInfo(res);
84
+        setAgentsInfo({ name: res.name });
85
+        getAgents({ personId: res?.recommendPerson }).then((e) => {
86
+          let ganentsList = e.records;
87
+          if ((ganentsList || []).length) {
88
+            // ganentsList
89
+            setAgentsInfo({
90
+              name: res.name,
91
+              channelName: ganentsList[0].channelName,
92
+            });
93
+          }
94
+        });
95
+
96
+        if (CurrentStatusId - 0 === 3) {
97
+          setFormData({
98
+            ...FormData,
99
+            ...res?.customerPreparatory,
100
+            realtyConsultant: res?.realtyConsultant,
101
+          });
102
+        } else {
103
+          setFormData({
104
+            ...FormData,
105
+            ...res?.customerPreparatory,
106
+            realtyConsultant: res?.realtyConsultant,
107
+          });
86
         }
108
         }
87
-      })
88
-
89
-      if (CurrentStatusId - 0 === 3) {
90
-        setFormData({ ...FormData, ...res?.customerPreparatory, realtyConsultant: res?.realtyConsultant })
91
-      } else {
92
-        setFormData({ ...FormData, ...res?.customerPreparatory, realtyConsultant: res?.realtyConsultant })
93
 
109
 
94
-      }
95
-
96
-      setChannelCustomerId(res?.channelCustomer?.channelCustomerId)
97
-      setRenChouData({ ...RenChouData, ...res?.customerPreparatory, realtyConsultant: res?.realtyConsultant })
98
-      if ((res.customerSignatory || []).length) {
99
-        let customerSignatory = res.customerSignatory[0]
100
-        customerSignatory.dividendsPer = customerSignatory.dividendsName.substring(customerSignatory.dividendsName.indexOf('|') + 1, customerSignatory.dividendsName.indexOf('%'))
101
-        customerSignatory.dividendsName = customerSignatory.dividendsName.substring(0, customerSignatory.dividendsName.indexOf('|'))
102
-        setQianYueData({ ...QianYueData, ...customerSignatory, realtyConsultant: res?.realtyConsultant })
103
-        // setQianYueData({ ...QianYueData, ...customerSignatory, realtyConsultant:   (res.customerSignatory || []).length ? res.customerSignatory[0].realtyConsultant : null })
104
-
105
-        HouseTypeList.map((item) => {
106
-          if (item.apartmentId === res.customerSignatory[0].houseType) {
107
-            setCurrentRoomTypeId(item.apartmentId)
110
+        setChannelCustomerId(res?.channelCustomer?.channelCustomerId);
111
+        setRenChouData({
112
+          ...RenChouData,
113
+          ...res?.customerPreparatory,
114
+          realtyConsultant: res?.realtyConsultant,
115
+        });
116
+        if ((res.customerSignatory || []).length) {
117
+          let customerSignatory = res.customerSignatory[0];
118
+          customerSignatory.dividendsPer =
119
+            customerSignatory.dividendsName.substring(
120
+              customerSignatory.dividendsName.indexOf("|") + 1,
121
+              customerSignatory.dividendsName.indexOf("%")
122
+            );
123
+          customerSignatory.dividendsName =
124
+            customerSignatory.dividendsName.substring(
125
+              0,
126
+              customerSignatory.dividendsName.indexOf("|")
127
+            );
128
+          setQianYueData({
129
+            ...QianYueData,
130
+            ...customerSignatory,
131
+            realtyConsultant: res?.realtyConsultant,
132
+          });
133
+          // setQianYueData({ ...QianYueData, ...customerSignatory, realtyConsultant:   (res.customerSignatory || []).length ? res.customerSignatory[0].realtyConsultant : null })
134
+
135
+          HouseTypeList.map((item) => {
136
+            if (item.apartmentId === res.customerSignatory[0].houseType) {
137
+              setCurrentRoomTypeId(item.apartmentId);
138
+            }
139
+          });
140
+          setSuccessDate(
141
+            res.customerSignatory[0].successDate?.substring(0, 10)
142
+          );
143
+        }
144
+        // const ConsultantId = CurrentStatusId === 3 ? res.customerPreparatory?.realtyConsultant : (res.customerSignatory || []).length ? res.customerSignatory[0].realtyConsultant : null
145
+        const ConsultantId =
146
+          CurrentStatusId === 3
147
+            ? res?.realtyConsultant
148
+            : (res.customerSignatory || []).length
149
+            ? res.customerSignatory[0].realtyConsultant
150
+            : null;
151
+        // setRenChouData({ realtyConsultant: res?.realtyConsultant })
152
+        console.log(`ConsultantId is`, ConsultantId, id);
153
+
154
+        return ConsultantList.map((item) => {
155
+          if (item.id === ConsultantId || `${item.userId}` === ConsultantId) {
156
+            setCurrnetConsultant(item);
108
           }
157
           }
109
-        })
110
-        setSuccessDate(res.customerSignatory[0].successDate?.substring(0, 10))
158
+        });
111
       }
159
       }
112
-      // const ConsultantId = CurrentStatusId === 3 ? res.customerPreparatory?.realtyConsultant : (res.customerSignatory || []).length ? res.customerSignatory[0].realtyConsultant : null
113
-      const ConsultantId = CurrentStatusId === 3 ? res?.realtyConsultant : (res.customerSignatory || []).length ? res.customerSignatory[0].realtyConsultant : null
114
-      // setRenChouData({ realtyConsultant: res?.realtyConsultant })
115
-      console.log(`ConsultantId is`, ConsultantId, id)
116
-
117
-
118
-      return ConsultantList.map((item) => {
119
-        if (item.id === ConsultantId || `${item.userId}` === ConsultantId) {
120
-          setCurrnetConsultant(item)
121
-        }
122
-      })
123
-    })
124
-  }, [ConsultantList, HouseTypeList, CurrentStatusId,])
160
+    );
161
+  }, [ConsultantList, HouseTypeList, CurrentStatusId]);
125
 
162
 
126
   useEffect(() => {
163
   useEffect(() => {
127
     if (CurrentStatusId - 0 !== 3 && buildingId) {
164
     if (CurrentStatusId - 0 !== 3 && buildingId) {
128
-      fetch({ url: `${API_BUILDING_HOUSE_TYPE}?buildingId=${buildingId}&pageSize=${500}`, method: 'get' }).then((res) => {
129
-        setHouseTypeList(res.records || [])
130
-      })
165
+      fetch({
166
+        url: `${API_BUILDING_HOUSE_TYPE}?buildingId=${buildingId}&pageSize=${500}`,
167
+        method: "get",
168
+      }).then((res) => {
169
+        setHouseTypeList(res.records || []);
170
+      });
131
     }
171
     }
132
-  }, [CurrentStatusId, buildingId])
172
+  }, [CurrentStatusId, buildingId]);
133
 
173
 
134
   useEffect(() => {
174
   useEffect(() => {
135
-    console.log('FormData', FormData)
136
-  }, [FormData])
175
+    console.log("FormData", FormData);
176
+  }, [FormData]);
137
 
177
 
138
   const CutStatus = (item) => {
178
   const CutStatus = (item) => {
139
     return () => {
179
     return () => {
140
-      setCurrentStatusId(item.id)
180
+      setCurrentStatusId(item.id);
141
       if (item.id - 0 === 3) {
181
       if (item.id - 0 === 3) {
142
-        setFormData({ ...RenChouData })
143
-
182
+        setFormData({ ...RenChouData });
144
       } else if (item.id - 0 === 4) {
183
       } else if (item.id - 0 === 4) {
145
-        setFormData({ ...QianYueData })
146
-
184
+        setFormData({ ...QianYueData });
147
       } else if (item.id - 0 === 5) {
185
       } else if (item.id - 0 === 5) {
148
-        setFormData({ ...QianYueData })
186
+        setFormData({ ...QianYueData });
149
       }
187
       }
150
-    }
151
-  }
188
+    };
189
+  };
152
 
190
 
153
   const CutRoomType = (item) => {
191
   const CutRoomType = (item) => {
154
     return () => {
192
     return () => {
155
-      let resData = { ...FormData }
156
-      resData.houseType = item.apartmentId
157
-      setFormData({ ...resData })
158
-      setCurrentRoomTypeId(item.apartmentId)
159
-    }
160
-  }
193
+      let resData = { ...FormData };
194
+      resData.houseType = item.apartmentId;
195
+      setFormData({ ...resData });
196
+      setCurrentRoomTypeId(item.apartmentId);
197
+    };
198
+  };
161
 
199
 
162
   const InputChange = (key, e) => {
200
   const InputChange = (key, e) => {
163
-    let resData = { ...FormData }
164
-    resData[key] = e.detail.value
165
-    setFormData({ ...resData })
166
-  }
201
+    let resData = { ...FormData };
202
+    resData[key] = e.detail.value;
203
+    setFormData({ ...resData });
204
+  };
167
 
205
 
168
   const PickerChange = (key, e) => {
206
   const PickerChange = (key, e) => {
169
-    let resData = { ...FormData }
170
-    if (key === 'realtyConsultant') {
171
-      resData[key] = ConsultantList[e.detail.value].id
172
-      resData.realtyConsultantName = ConsultantList[e.detail.value].name
173
-      setCurrnetConsultant(ConsultantList[e.detail.value])
207
+    let resData = { ...FormData };
208
+    if (key === "realtyConsultant") {
209
+      resData[key] = ConsultantList[e.detail.value].id;
210
+      resData.realtyConsultantName = ConsultantList[e.detail.value].name;
211
+      setCurrnetConsultant(ConsultantList[e.detail.value]);
174
     }
212
     }
175
-    setFormData({ ...resData })
176
-  }
213
+    setFormData({ ...resData });
214
+  };
177
 
215
 
178
   const CheckForm = () => {
216
   const CheckForm = () => {
179
-    if (CurrentStatusId === 3) { // 认筹
180
-      if (FormData.name === '') {
181
-        Taro.showToast({ title: '姓名不能为空', icon: 'none', duration: 2000 })
182
-        return false
217
+    if (CurrentStatusId === 3) {
218
+      // 认筹
219
+      if (FormData.name === "") {
220
+        Taro.showToast({ title: "姓名不能为空", icon: "none", duration: 2000 });
221
+        return false;
183
       }
222
       }
184
       // if (FormData.realtyConsultant === '') {
223
       // if (FormData.realtyConsultant === '') {
185
       //   Taro.showToast({ title: '请选择内场接待', icon: 'none', duration: 2000 })
224
       //   Taro.showToast({ title: '请选择内场接待', icon: 'none', duration: 2000 })
186
       //   return false
225
       //   return false
187
       // }
226
       // }
188
-    } else if (CurrentStatusId === 4) { // 签约
189
-
227
+    } else if (CurrentStatusId === 4) {
228
+      // 签约
190
     }
229
     }
191
-    return true
192
-  }
230
+    return true;
231
+  };
193
 
232
 
194
   const ToSubmit = () => {
233
   const ToSubmit = () => {
195
     if (CurrentStatusId === 3) {
234
     if (CurrentStatusId === 3) {
196
-      fetch({ url: API_SURE_CHIP, method: 'put', payload: { customerId: id, customerPreparatory: { ...FormData, channelId: channelId === 'null' || channelId === null ? '' : channelId, channelCustomerId, } } }).then(() => {
197
-        Taro.showToast({ title: '修改成功', icon: 'none', duration: 2000 })
235
+      fetch({
236
+        url: API_SURE_CHIP,
237
+        method: "put",
238
+        payload: {
239
+          customerId: id,
240
+          customerPreparatory: {
241
+            ...FormData,
242
+            channelId:
243
+              channelId === "null" || channelId === null ? "" : channelId,
244
+            channelCustomerId,
245
+          },
246
+        },
247
+      }).then(() => {
248
+        Taro.showToast({ title: "修改成功", icon: "none", duration: 2000 });
198
         setTimeout(() => {
249
         setTimeout(() => {
199
-          Taro.navigateBack({ delta: 1 })
200
-        }, 2000)
201
-      })
250
+          Taro.navigateBack({ delta: 1 });
251
+        }, 2000);
252
+      });
202
     } else if (CurrentStatusId === 4) {
253
     } else if (CurrentStatusId === 4) {
203
-      let params = {}
254
+      let params = {};
204
       for (let key in FormData) {
255
       for (let key in FormData) {
205
-        if (key !== 'dividendsName' && key !== 'dividendsPer') {
206
-          params[key] = { ...FormData }[key]
207
-          console.log("🚀 ~ file: index.jsx ~ line 202 ~ ToSubmit ~ FormData", FormData)
256
+        if (key !== "dividendsName" && key !== "dividendsPer") {
257
+          params[key] = { ...FormData }[key];
258
+          console.log(
259
+            "🚀 ~ file: index.jsx ~ line 202 ~ ToSubmit ~ FormData",
260
+            FormData
261
+          );
208
         }
262
         }
209
       }
263
       }
210
-      params.dividendsName = `${FormData.dividendsName}|${FormData.dividendsPer}%`
211
-      fetch({ url: API_SURE_SIGN, method: 'put', payload: { customerId: id, customerSignatory: { ...params, channelId: channelId === 'null' || channelId === null ? '' : channelId, channelCustomerId, } } }).then(() => {
212
-        Taro.showToast({ title: '修改成功', icon: 'none', duration: 2000 })
264
+      params.dividendsName = `${FormData.dividendsName}|${FormData.dividendsPer}%`;
265
+      fetch({
266
+        url: API_SURE_SIGN,
267
+        method: "put",
268
+        payload: {
269
+          customerId: id,
270
+          customerSignatory: {
271
+            ...params,
272
+            channelId:
273
+              channelId === "null" || channelId === null ? "" : channelId,
274
+            channelCustomerId,
275
+          },
276
+        },
277
+      }).then(() => {
278
+        Taro.showToast({ title: "修改成功", icon: "none", duration: 2000 });
213
         setTimeout(() => {
279
         setTimeout(() => {
214
-          Taro.navigateBack({ delta: 1 })
215
-        }, 2000)
216
-      })
280
+          Taro.navigateBack({ delta: 1 });
281
+        }, 2000);
282
+      });
217
     } else if (CurrentStatusId === 5) {
283
     } else if (CurrentStatusId === 5) {
218
-      let params = {}
284
+      let params = {};
219
       for (let key in FormData) {
285
       for (let key in FormData) {
220
-        if (key !== 'dividendsName' && key !== 'dividendsPer') {
221
-          params[key] = { ...FormData }[key]
286
+        if (key !== "dividendsName" && key !== "dividendsPer") {
287
+          params[key] = { ...FormData }[key];
222
         }
288
         }
223
       }
289
       }
224
-      params.dividendsName = `${FormData.dividendsName}|${FormData.dividendsPer}%`
225
-      fetch({ url: API_SURE_BUY, method: 'put', payload: { customerId: id, customerSignatory: { ...params, channelId: channelId === 'null' || channelId === null ? '' : channelId, channelCustomerId, } } }).then(() => {
226
-        Taro.showToast({ title: '修改成功', icon: 'none', duration: 2000 })
290
+      params.dividendsName = `${FormData.dividendsName}|${FormData.dividendsPer}%`;
291
+      fetch({
292
+        url: API_SURE_BUY,
293
+        method: "put",
294
+        payload: {
295
+          customerId: id,
296
+          customerSignatory: {
297
+            ...params,
298
+            channelId:
299
+              channelId === "null" || channelId === null ? "" : channelId,
300
+            channelCustomerId,
301
+          },
302
+        },
303
+      }).then(() => {
304
+        Taro.showToast({ title: "修改成功", icon: "none", duration: 2000 });
227
         setTimeout(() => {
305
         setTimeout(() => {
228
-          Taro.navigateBack({ delta: 1 })
229
-        }, 2000)
230
-      })
306
+          Taro.navigateBack({ delta: 1 });
307
+        }, 2000);
308
+      });
231
     }
309
     }
232
-  }
310
+  };
233
 
311
 
234
   const SuccessDateChange = (e) => {
312
   const SuccessDateChange = (e) => {
235
-    let resData = { ...FormData }
236
-    resData.successDate = new Date(e.detail.value)
237
-    setFormData(resData)
238
-    setSuccessDate(e.detail.value)
239
-  }
240
-
313
+    let resData = { ...FormData };
314
+    resData.successDate = new Date(e.detail.value);
315
+    setFormData(resData);
316
+    setSuccessDate(e.detail.value);
317
+  };
241
 
318
 
242
   return (
319
   return (
243
-    <view className='Page changeVisit'>
244
-
320
+    <view className="Page changeVisit">
245
       <ScrollView scroll-y>
321
       <ScrollView scroll-y>
246
-        <view className='PageContent'>
247
-
248
-          <text className='required'>变更状态</text>
249
-          <view className='FormLine flex-h'>
250
-            <view className='flex-item'>
251
-              <view className='CheckBoxList'>
252
-                {
253
-                  StatusList.map((item, index) => (
254
-                    <view key={`StatusItem-${index}`} onClick={CutStatus(item)} style={{ marginRight: index === 2 ? '0px' : '44rpx' }}>
255
-                      <text>{item.name}</text>
256
-                      {
257
-                        CurrentStatusId === item.id &&
258
-                        <Image mode='widthFix' src={require('@/assets/findHouse-icon1.png')}></Image>
259
-                      }
260
-                    </view>
261
-                  ))
262
-                }
322
+        <view className="PageContent">
323
+          <text className="required">变更状态</text>
324
+          <view className="FormLine flex-h">
325
+            <view className="flex-item">
326
+              <view className="CheckBoxList">
327
+                {StatusList.map((item, index) => (
328
+                  <view
329
+                    key={`StatusItem-${index}`}
330
+                    onClick={CutStatus(item)}
331
+                    style={{ marginRight: index === 2 ? "0px" : "44rpx" }}
332
+                  >
333
+                    <text>{item.name}</text>
334
+                    {CurrentStatusId === item.id && (
335
+                      <Image
336
+                        mode="widthFix"
337
+                        src={require("@/assets/findHouse-icon1.png")}
338
+                      ></Image>
339
+                    )}
340
+                  </view>
341
+                ))}
263
               </view>
342
               </view>
264
             </view>
343
             </view>
265
           </view>
344
           </view>
266
 
345
 
267
-          <text className='required'>客户姓名</text>
268
-          <view className='FormLine flex-h'>
269
-            <view className='flex-item'>
270
-              <Input placeholder='请输入姓名' disabled={CurrentStatusId === 5} value={agentsInfo.name} onInput={InputChange.bind(this, 'name')}></Input>
346
+          <text className="required">客户姓名</text>
347
+          <view className="FormLine flex-h">
348
+            <view className="flex-item">
349
+              <Input
350
+                placeholder="请输入姓名"
351
+                disabled={CurrentStatusId === 5}
352
+                value={agentsInfo.name}
353
+                onInput={InputChange.bind(this, "name")}
354
+              ></Input>
271
             </view>
355
             </view>
272
           </view>
356
           </view>
273
 
357
 
274
-
275
-          <text>归属渠道</text>
276
-          <view className='FormLine flex-h'>
277
-            <view className='flex-item'>
278
-              <Input placeholder='请输入渠道' disabled value={agentsInfo.channelName}></Input>
279
-            </view>
280
-          </view>
358
+          {/* {channelCustomer.recommendPersonType === ROLE_CODE.BROKER ? (
359
+            <>
360
+              <text>报备经纪人</text>
361
+              <view className="FormLine flex-h">
362
+                <view className="flex-item">
363
+                  <text>{channelCustomer.recommendPersonName}</text>
364
+               
365
+                </view>
366
+              </view>
367
+            </>
368
+          ) : (
369
+            <>
370
+              <text>归属渠道</text>
371
+              <view className="FormLine flex-h">
372
+                <view className="flex-item">
373
+                  <text>{channelCustomer.channelName}</text>
374
+                
375
+                </view>
376
+              </view>
377
+            </>
378
+          )} */}
379
+
380
+          {channelCustomerInfo?.channelCustomer?.recommendPersonType ===
381
+          ROLE_CODE.BROKER ? (
382
+            <>
383
+              <text>报备经纪人</text>
384
+              <view className="FormLine flex-h">
385
+                <view className="flex-item">
386
+                  <Input
387
+                    placeholder="请输入经纪人"
388
+                    disabled
389
+                    value={
390
+                      channelCustomerInfo.channelCustomer?.recommendPersonName
391
+                    }
392
+                  ></Input>
393
+                </view>
394
+              </view>
395
+            </>
396
+          ) : (
397
+            <>
398
+              <text>归属渠道</text>
399
+              <view className="FormLine flex-h">
400
+                <view className="flex-item">
401
+                  <Input
402
+                    placeholder="请输入渠道"
403
+                    disabled
404
+                    value={agentsInfo.channelName}
405
+                  ></Input>
406
+                </view>
407
+              </view>
408
+            </>
409
+          )}
281
 
410
 
282
           <text>内场接待</text>
411
           <text>内场接待</text>
283
-          <view className='FormLine flex-h'>
284
-            <view className='flex-item'>
285
-              <Picker range-key='name' range={ConsultantList} value={0} onChange={PickerChange.bind(this, 'realtyConsultant')}>{CurrnetConsultant.name || '请选择'}</Picker>
412
+          <view className="FormLine flex-h">
413
+            <view className="flex-item">
414
+              <Picker
415
+                range-key="name"
416
+                range={ConsultantList}
417
+                value={0}
418
+                onChange={PickerChange.bind(this, "realtyConsultant")}
419
+              >
420
+                {CurrnetConsultant.name || "请选择"}
421
+              </Picker>
286
             </view>
422
             </view>
287
           </view>
423
           </view>
288
 
424
 
289
-          {
290
-            (CurrentStatusId === 4 || CurrentStatusId === 5) &&
425
+          {(CurrentStatusId === 4 ||
426
+            CurrentStatusId === 5 ||
427
+            CurrentStatusId === 6) && (
291
             <Block>
428
             <Block>
292
               <text>业绩分成人|占比/%</text>
429
               <text>业绩分成人|占比/%</text>
293
-              <view className='FormLine flex-h'>
294
-                <view className='flex-item'>
295
-                  <Input placeholder='请输入业绩分成人' value={FormData.dividendsName} onInput={InputChange.bind(this, 'dividendsName')}></Input>
430
+              <view className="FormLine flex-h">
431
+                <view className="flex-item">
432
+                  <Input
433
+                    placeholder="请输入业绩分成人"
434
+                    value={FormData.dividendsName}
435
+                    onInput={InputChange.bind(this, "dividendsName")}
436
+                  ></Input>
296
                 </view>
437
                 </view>
297
-                <view className='flex-item'>
298
-                  <Input placeholder='请输入占比%' value={FormData.dividendsPer} type='number' onInput={InputChange.bind(this, 'dividendsPer')}></Input>
438
+                <view className="flex-item">
439
+                  <Input
440
+                    placeholder="请输入占比%"
441
+                    value={FormData.dividendsPer}
442
+                    type="number"
443
+                    onInput={InputChange.bind(this, "dividendsPer")}
444
+                  ></Input>
299
                 </view>
445
                 </view>
300
               </view>
446
               </view>
301
             </Block>
447
             </Block>
302
-          }
448
+          )}
303
 
449
 
304
-          {
305
-            (CurrentStatusId === 4 || CurrentStatusId === 5) &&
450
+          {(CurrentStatusId === 4 ||
451
+            CurrentStatusId === 5 ||
452
+            CurrentStatusId === 6) && (
306
             <Block>
453
             <Block>
307
               <text>户型</text>
454
               <text>户型</text>
308
-              <view className='FormLine flex-h'>
309
-                <view className='flex-item'>
310
-                  <view className='CheckBoxList'>
311
-                    {
312
-                      HouseTypeList.map((item, index) => (
313
-                        <view key={`RoomTypeItem-${index}`} onClick={CutRoomType(item)}>
314
-                          <text>{item.apartmentName}</text>
315
-                          {
316
-                            CurrentRoomTypeId === item.apartmentId &&
317
-                            <Image mode='widthFix' src={require('@/assets/findHouse-icon1.png')}></Image>
318
-                          }
319
-                        </view>
320
-                      ))
321
-                    }
455
+              <view className="FormLine flex-h">
456
+                <view className="flex-item">
457
+                  <view className="CheckBoxList">
458
+                    {HouseTypeList.map((item, index) => (
459
+                      <view
460
+                        key={`RoomTypeItem-${index}`}
461
+                        onClick={CutRoomType(item)}
462
+                      >
463
+                        <text>{item.apartmentName}</text>
464
+                        {CurrentRoomTypeId === item.apartmentId && (
465
+                          <Image
466
+                            mode="widthFix"
467
+                            src={require("@/assets/findHouse-icon1.png")}
468
+                          ></Image>
469
+                        )}
470
+                      </view>
471
+                    ))}
322
                   </view>
472
                   </view>
323
                 </view>
473
                 </view>
324
               </view>
474
               </view>
325
             </Block>
475
             </Block>
326
-          }
476
+          )}
327
 
477
 
328
-          {
329
-            (CurrentStatusId === 4 || CurrentStatusId === 5) &&
478
+          {(CurrentStatusId === 4 ||
479
+            CurrentStatusId === 5 ||
480
+            CurrentStatusId === 6) && (
330
             <Block>
481
             <Block>
331
               <text>房号</text>
482
               <text>房号</text>
332
-              <view className='FormLine flex-h'>
333
-                <view className='flex-item'>
334
-                  <Input placeholder='请输入房号' value={FormData.houseInfo} onInput={InputChange.bind(this, 'houseInfo')}></Input>
483
+              <view className="FormLine flex-h">
484
+                <view className="flex-item">
485
+                  <Input
486
+                    placeholder="请输入房号"
487
+                    value={FormData.houseInfo}
488
+                    onInput={InputChange.bind(this, "houseInfo")}
489
+                  ></Input>
335
                 </view>
490
                 </view>
336
               </view>
491
               </view>
337
             </Block>
492
             </Block>
338
-          }
493
+          )}
339
 
494
 
340
-          {
341
-            (CurrentStatusId === 4 || CurrentStatusId === 5) &&
495
+          {(CurrentStatusId === 4 ||
496
+            CurrentStatusId === 5 ||
497
+            CurrentStatusId === 6) && (
342
             <Block>
498
             <Block>
343
               <text>签约日期</text>
499
               <text>签约日期</text>
344
-              <view className='FormLine flex-h'>
345
-                <view className='flex-item'>
346
-                  <Picker mode='date' value={FormData.successDate} onChange={SuccessDateChange}>{SuccessDate || '请选择开始日期'}</Picker>
500
+              <view className="FormLine flex-h">
501
+                <view className="flex-item">
502
+                  <Picker
503
+                    mode="date"
504
+                    value={FormData.successDate}
505
+                    onChange={SuccessDateChange}
506
+                  >
507
+                    {SuccessDate || "请选择开始日期"}
508
+                  </Picker>
347
                 </view>
509
                 </view>
348
-                <text className='iconfont icon-jiantoudown'></text>
510
+                <text className="iconfont icon-jiantoudown"></text>
349
               </view>
511
               </view>
350
             </Block>
512
             </Block>
351
-          }
513
+          )}
352
 
514
 
353
-          {
354
-            (CurrentStatusId === 4 || CurrentStatusId === 5) &&
515
+          {(CurrentStatusId === 4 ||
516
+            CurrentStatusId === 5 ||
517
+            CurrentStatusId === 6) && (
355
             <Block>
518
             <Block>
356
               <text>成交金额</text>
519
               <text>成交金额</text>
357
-              <view className='FormLine flex-h'>
358
-                <view className='flex-item'>
359
-                  <Input placeholder='请输入金额' value={FormData.price} onInput={InputChange.bind(this, 'price')}></Input>
520
+              <view className="FormLine flex-h">
521
+                <view className="flex-item">
522
+                  <Input
523
+                    placeholder="请输入金额"
524
+                    value={FormData.price}
525
+                    onInput={InputChange.bind(this, "price")}
526
+                  ></Input>
360
                 </view>
527
                 </view>
361
               </view>
528
               </view>
362
             </Block>
529
             </Block>
363
-          }
530
+          )}
364
 
531
 
532
+{/* {(CurrentStatusId === 4 ||
533
+            CurrentStatusId === 5 ||
534
+            CurrentStatusId === 6) && (
535
+            <Block>
536
+              <text>佣金总额</text>
537
+              <view className="FormLine flex-h">
538
+                <view className="flex-item">
539
+                  <Input
540
+                    placeholder="请输入金额"
541
+                    value={FormData.price}
542
+                    onInput={InputChange.bind(this, "price")}
543
+                  ></Input>
544
+                </view>
545
+              </view>
546
+            </Block>
547
+          )} */}
365
 
548
 
366
           <text>备注</text>
549
           <text>备注</text>
367
-          <view className='FormLine flex-h'>
368
-            <view className='flex-item'>
369
-              <Input placeholder='补充说明(选填)' value={FormData.remark} onInput={InputChange.bind(this, 'remark')}></Input>
550
+          <view className="FormLine flex-h">
551
+            <view className="flex-item">
552
+              <Input
553
+                placeholder="补充说明(选填)"
554
+                value={FormData.remark}
555
+                onInput={InputChange.bind(this, "remark")}
556
+              ></Input>
370
             </view>
557
             </view>
371
           </view>
558
           </view>
372
 
559
 
373
-          <view className='Btn'>
560
+          <view className="Btn">
374
             <text onClick={ToSubmit}>提交</text>
561
             <text onClick={ToSubmit}>提交</text>
375
           </view>
562
           </view>
376
-
377
         </view>
563
         </view>
378
       </ScrollView>
564
       </ScrollView>
379
-
380
     </view>
565
     </view>
381
-  )
382
-})
566
+  );
567
+});

+ 109
- 82
src/subpackages/pages/marketing/residentManager/index.jsx Ver fichero

1
-import { useState, useEffect, useCallback, useRef } from 'react'
2
-import withLayout from '@/layout'
3
-import { ScrollView, Input } from '@tarojs/components'
4
-import '@/assets/css/iconfont.css'
5
-import { useSelector } from 'react-redux'
6
-import { fetch } from '@/utils/request'
7
-import { API_MANAGE_CUSTOMER_LIST, API_MY_BUILDINGIDS } from '@/constants/api'
8
-import './index.scss'
9
-import ResidentListItem from '../components/ResidentListItem/index'
1
+import { useState, useEffect, useCallback, useRef } from "react";
2
+import withLayout from "@/layout";
3
+import { ScrollView, Input } from "@tarojs/components";
4
+import "@/assets/css/iconfont.css";
5
+import { useSelector } from "react-redux";
6
+import { fetch } from "@/utils/request";
7
+import { API_MANAGE_CUSTOMER_LIST, API_MY_BUILDINGIDS } from "@/constants/api";
8
+import "./index.scss";
9
+import ResidentListItem from "../components/ResidentListItem/index";
10
+import { useDidShow } from "@tarojs/taro";
10
 
11
 
11
 export default withLayout((props) => {
12
 export default withLayout((props) => {
12
-  const { person } = props
13
-  
14
-  const [BuildingIds, setBuildingIds] = useState([])
15
-  const [PageList, setPageList] = useState([])
16
-  const [IsPull, setPull] = useState(false)
17
-  const [HasNextPage, setHasNextPage] = useState(true)
18
-  const [CurrentBuildingId, setCurrentBuildingId] = useState(null)
19
-  const [CurrentBuildingName, setCurrentBuildingName] = useState(null)
20
-  const [page, setPage] = useState({ pageNumber: 1 })
21
-  const queryParamsRef = useRef({})
22
-  const getListRef = useRef()
13
+  const { person } = props;
14
+
15
+  const [BuildingIds, setBuildingIds] = useState([]);
16
+  const [PageList, setPageList] = useState([]);
17
+  const [IsPull, setPull] = useState(false);
18
+  const [HasNextPage, setHasNextPage] = useState(true);
19
+  const [CurrentBuildingId, setCurrentBuildingId] = useState(null);
20
+  const [CurrentBuildingName, setCurrentBuildingName] = useState(null);
21
+  const [page, setPage] = useState({ pageNumber: 1 });
22
+  const queryParamsRef = useRef({});
23
+  const getListRef = useRef();
24
+
25
+  useDidShow(() => {
26
+   
27
+      setPage({pageNumber: 1});
28
+
29
+
30
+  });
23
 
31
 
24
   const GetMyBuildingIds = () => {
32
   const GetMyBuildingIds = () => {
25
-    fetch({ url: API_MY_BUILDINGIDS, method: 'get' }).then((res) => {
26
-      setBuildingIds(res || [])
27
-    })
28
-  }
33
+    fetch({ url: API_MY_BUILDINGIDS, method: "get" }).then((res) => {
34
+      setBuildingIds(res || []);
35
+    });
36
+  };
29
 
37
 
30
-  const PageRefresh = () => { // 页面下拉刷新回调
31
-    setPull(true)
32
-  }
38
+  const PageRefresh = () => {
39
+    // 页面下拉刷新回调
40
+    setPull(true);
41
+  };
33
 
42
 
34
   getListRef.current = (params) => {
43
   getListRef.current = (params) => {
35
     if (!CurrentBuildingId) return;
44
     if (!CurrentBuildingId) return;
36
 
45
 
37
-    setHasNextPage(false)
46
+    setHasNextPage(false);
38
     fetch({
47
     fetch({
39
       url: API_MANAGE_CUSTOMER_LIST,
48
       url: API_MANAGE_CUSTOMER_LIST,
40
       payload: {
49
       payload: {
41
         pageSize: 10,
50
         pageSize: 10,
42
         ...params,
51
         ...params,
43
         ...queryParamsRef.current,
52
         ...queryParamsRef.current,
44
-        buildingId: CurrentBuildingId
53
+        buildingId: CurrentBuildingId,
45
       },
54
       },
46
     }).then((res) => {
55
     }).then((res) => {
47
-      setPageList(res.current === 1 ? res.records || [] : PageList.concat(res.records || []))
48
-      setHasNextPage(res.current < res.pages)
49
-      setPull(false)
50
-    })
51
-  }
56
+      setPageList(
57
+        res.current === 1
58
+          ? res.records || []
59
+          : PageList.concat(res.records || [])
60
+      );
61
+      setHasNextPage(res.current < res.pages);
62
+      setPull(false);
63
+    });
64
+  };
52
 
65
 
53
   const PickerChange = (e) => {
66
   const PickerChange = (e) => {
54
-    setCurrentBuildingId(BuildingIds[e.detail.value - 0].buildingId)
55
-    setCurrentBuildingName(BuildingIds[e.detail.value - 0].name)
56
-  }
67
+    setCurrentBuildingId(BuildingIds[e.detail.value - 0].buildingId);
68
+    setCurrentBuildingName(BuildingIds[e.detail.value - 0].name);
69
+  };
57
 
70
 
58
   const SearchConfirm = (e) => {
71
   const SearchConfirm = (e) => {
59
     queryParamsRef.current = {
72
     queryParamsRef.current = {
60
       ...queryParamsRef.current,
73
       ...queryParamsRef.current,
61
       keywords: e.detail.value,
74
       keywords: e.detail.value,
62
-    }
63
-    setPage({ pageNumber: 1 })
64
-  }
75
+    };
76
+    setPage({ pageNumber: 1 });
77
+  };
65
 
78
 
66
   const ListChange = (index) => {
79
   const ListChange = (index) => {
67
     return () => {
80
     return () => {
68
-      let List = [...PageList]
69
-      List.splice(index, 1)
70
-      setPageList(List)
71
-    }
72
-  }
81
+      let List = [...PageList];
82
+      List.splice(index, 1);
83
+      setPageList(List);
84
+    };
85
+  };
73
 
86
 
74
   // 页面上拉加载更多
87
   // 页面上拉加载更多
75
   const PageLoadMore = () => {
88
   const PageLoadMore = () => {
76
     if (HasNextPage) {
89
     if (HasNextPage) {
77
-      setPage({ pageNumber: page.pageNumber + 1 })
90
+      setPage({ pageNumber: page.pageNumber + 1 });
78
     }
91
     }
79
-  }
80
-  
92
+  };
93
+
81
   useEffect(() => {
94
   useEffect(() => {
82
-    GetMyBuildingIds()
83
-  }, [])
95
+    GetMyBuildingIds();
96
+  }, []);
84
 
97
 
85
   useEffect(() => {
98
   useEffect(() => {
86
     if (BuildingIds.length) {
99
     if (BuildingIds.length) {
87
-      setCurrentBuildingId(BuildingIds[0].buildingId)
88
-      setCurrentBuildingName(BuildingIds[0].name)
100
+      setCurrentBuildingId(BuildingIds[0].buildingId);
101
+      setCurrentBuildingName(BuildingIds[0].name);
89
     }
102
     }
90
-  }, [BuildingIds])
103
+  }, [BuildingIds]);
91
 
104
 
92
   // 选择楼盘
105
   // 选择楼盘
93
   useEffect(() => {
106
   useEffect(() => {
94
     if (CurrentBuildingId) {
107
     if (CurrentBuildingId) {
95
-      setPage({ pageNumber: 1 })
108
+      setPage({ pageNumber: 1 });
96
     }
109
     }
97
-  }, [CurrentBuildingId])
110
+  }, [CurrentBuildingId]);
98
 
111
 
99
   // 下拉刷新
112
   // 下拉刷新
100
   useEffect(() => {
113
   useEffect(() => {
101
     if (IsPull) {
114
     if (IsPull) {
102
-      setPage({ pageNumber: 1 })
115
+      setPage({ pageNumber: 1 });
103
     }
116
     }
104
-  }, [IsPull])
117
+  }, [IsPull]);
105
 
118
 
106
   useEffect(() => {
119
   useEffect(() => {
107
-    getListRef.current(page)
108
-  }, [page])
120
+    getListRef.current(page);
121
+  }, [page]);
109
 
122
 
110
   return (
123
   return (
111
-    <view className='Page residentManager flex-v'>
112
-
113
-      <view className='Search flex-h'>
114
-        <view className='flex-item'>
115
-          <text className='iconfont icon-sousuo'></text>
116
-          <Input confirm-type='search' placeholder='请输入关键字搜索' onConfirm={SearchConfirm}></Input>
124
+    <view className="Page residentManager flex-v">
125
+      <view className="Search flex-h">
126
+        <view className="flex-item">
127
+          <text className="iconfont icon-sousuo"></text>
128
+          <Input
129
+            confirm-type="search"
130
+            placeholder="请输入关键字搜索"
131
+            onConfirm={SearchConfirm}
132
+          ></Input>
117
         </view>
133
         </view>
118
         <text>{CurrentBuildingName}</text>
134
         <text>{CurrentBuildingName}</text>
119
-        <picker value={0} range-key='name' onChange={PickerChange} range={BuildingIds}>
120
-          <view class='picker'>更换</view>
135
+        <picker
136
+          value={0}
137
+          range-key="name"
138
+          onChange={PickerChange}
139
+          range={BuildingIds}
140
+        >
141
+          <view class="picker">更换</view>
121
         </picker>
142
         </picker>
122
       </view>
143
       </view>
123
 
144
 
124
-      <view className='flex-item'>
145
+      <view className="flex-item">
125
         <view>
146
         <view>
126
-          <ScrollView scroll-y refresher-enabled refresher-triggered={IsPull} onrefresherrefresh={PageRefresh} onscrolltolower={PageLoadMore} refresher-background='#fff'>
127
-            <view className='PageContent'>
128
-
147
+          <ScrollView
148
+            scroll-y
149
+            refresher-enabled
150
+            refresher-triggered={IsPull}
151
+            onrefresherrefresh={PageRefresh}
152
+            onscrolltolower={PageLoadMore}
153
+            refresher-background="#fff"
154
+          >
155
+            <view className="PageContent">
129
               {/* <view className='Filter'>
156
               {/* <view className='Filter'>
130
                 <text>筛选条件</text>
157
                 <text>筛选条件</text>
131
                 <view>
158
                 <view>
143
                 </view>
170
                 </view>
144
               </view> */}
171
               </view> */}
145
 
172
 
146
-              <view className='List'>
147
-                {
148
-                  PageList.map((item, index) => (
149
-                    <ResidentListItem data={item} key={`ResidentListItem-${index}`} change={ListChange(index)}></ResidentListItem>
150
-                  ))
151
-                }
173
+              <view className="List">
174
+                {PageList.map((item, index) => (
175
+                  <ResidentListItem
176
+                    data={item}
177
+                    key={`ResidentListItem-${index}`}
178
+                    change={ListChange(index)}
179
+                  ></ResidentListItem>
180
+                ))}
152
               </view>
181
               </view>
153
 
182
 
154
               {/* bottom */}
183
               {/* bottom */}
155
-              <view className='PageBottom'>
184
+              <view className="PageBottom">
156
                 <text>已经到底了~</text>
185
                 <text>已经到底了~</text>
157
               </view>
186
               </view>
158
-
159
             </view>
187
             </view>
160
           </ScrollView>
188
           </ScrollView>
161
         </view>
189
         </view>
162
       </view>
190
       </view>
163
-
164
     </view>
191
     </view>
165
-  )
166
-})
192
+  );
193
+});