|
@@ -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
|
|