Browse Source

信息修改

1002884655 3 years ago
parent
commit
af77a7653a

+ 7
- 7
src/components/AreaPickerView/index.jsx View File

@@ -21,25 +21,25 @@ export default (props) => {
21 21
 
22 22
   useEffect(() => {
23 23
     if (StateList.length) {
24
-      if (StateList[Value[0]].id !== CurrentState.id) { // 省份更新
24
+      if (StateList[Value[0]]?.id !== CurrentState?.id) { // 省份更新
25 25
         setCurrentState(StateList[Value[0]])
26
-      } else if (CityList[Value[1]].id !== CurrentCity.id) { // 城市更新
26
+      } else if (CityList[Value[1]]?.id !== CurrentCity?.id) { // 城市更新
27 27
         setCurrentCity(CityList[Value[1]])
28
-      } else if (IntentAreaList[Value[2]].id !== CurrentIntentArea.id) { // 区县更新
28
+      } else if (IntentAreaList[Value[2]]?.id !== CurrentIntentArea?.id) { // 区县更新
29 29
         setCurrentIntentArea(IntentAreaList[Value[2]])
30 30
       }
31 31
     }
32 32
   }, [Value])
33 33
 
34 34
   useEffect(() => {
35
-    if (CurrentState.id) {
36
-      GetAreaList(CurrentState.id, 2)
35
+    if (CurrentState?.id) {
36
+      GetAreaList(CurrentState?.id, 2)
37 37
     }
38 38
   }, [CurrentState])
39 39
 
40 40
   useEffect(() => {
41
-    if (CurrentCity.id) {
42
-      GetAreaList(CurrentCity.id, 3)
41
+    if (CurrentCity?.id) {
42
+      GetAreaList(CurrentCity?.id, 3)
43 43
     }
44 44
   }, [CurrentCity])
45 45
 

+ 2
- 2
src/pages/index/helpToFindHouse/components/BuyHouse/index.jsx View File

@@ -36,7 +36,7 @@ export default function BuyHouse (props) {
36 36
   const CutCheckbox = (item, index) => {
37 37
     return () => {
38 38
       let newFormData = [...FormData]
39
-      newFormData[index].resultId = item.id
39
+      newFormData[index].resultId = item?.id
40 40
       newFormData[index].result = item.name
41 41
       setFormData([...newFormData])
42 42
     }
@@ -122,7 +122,7 @@ export default function BuyHouse (props) {
122 122
                           <view className='CheckList'>
123 123
                             {
124 124
                               item.options.map((subItem, subIndex) => (
125
-                                <view key={`${item.key}-${subIndex}`} className={item.resultId === subItem.id ? 'active' : ''} onClick={CutCheckbox(subItem, index)}>
125
+                                <view key={`${item.key}-${subIndex}`} className={item.resultId === subItem?.id ? 'active' : ''} onClick={CutCheckbox(subItem, index)}>
126 126
                                   {subItem.name}
127 127
                                   <Image mode='heightFix' src={require('@/assets/findHouse-icon1.png')}></Image>
128 128
                                 </view>