Browse Source

信息修改

1002884655 3 years ago
parent
commit
af77a7653a

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

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

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

36
   const CutCheckbox = (item, index) => {
36
   const CutCheckbox = (item, index) => {
37
     return () => {
37
     return () => {
38
       let newFormData = [...FormData]
38
       let newFormData = [...FormData]
39
-      newFormData[index].resultId = item.id
39
+      newFormData[index].resultId = item?.id
40
       newFormData[index].result = item.name
40
       newFormData[index].result = item.name
41
       setFormData([...newFormData])
41
       setFormData([...newFormData])
42
     }
42
     }
122
                           <view className='CheckList'>
122
                           <view className='CheckList'>
123
                             {
123
                             {
124
                               item.options.map((subItem, subIndex) => (
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
                                   {subItem.name}
126
                                   {subItem.name}
127
                                   <Image mode='heightFix' src={require('@/assets/findHouse-icon1.png')}></Image>
127
                                   <Image mode='heightFix' src={require('@/assets/findHouse-icon1.png')}></Image>
128
                                 </view>
128
                                 </view>