浏览代码

静态页面

1002884655 3 年前
父节点
当前提交
38892d2af7

+ 105
- 0
src/components/AreaPickerView/index.jsx 查看文件

1
+import { useState, useEffect } from 'react'
2
+import { PickerView, PickerViewColumn } from '@tarojs/components'
3
+import { fetch } from '@/utils/request'
4
+import { API_AREA_LIST } from '@/constants/api'
5
+import './style.scss'
6
+
7
+export default (props) => {
8
+
9
+  const { show = false, Change = () => {}, Cancel = () => {} } = props
10
+  const [Value, setValue] = useState([0, 0, 0])
11
+  const [StateList, setStateList] = useState([])
12
+  const [CurrentState, setCurrentState] = useState({})
13
+  const [CityList, setCityList] = useState([])
14
+  const [CurrentCity, setCurrentCity] = useState({})
15
+  const [IntentAreaList, setIntentAreaList] = useState([])
16
+  const [CurrentIntentArea, setCurrentIntentArea] = useState({})
17
+
18
+  useEffect(() => {
19
+    GetAreaList()
20
+  }, [])
21
+
22
+  useEffect(() => {
23
+    if (StateList.length) {
24
+      if (StateList[Value[0]].id !== CurrentState.id) { // 省份更新
25
+        setCurrentState(StateList[Value[0]])
26
+      } else if (CityList[Value[1]].id !== CurrentCity.id) { // 城市更新
27
+        setCurrentCity(CityList[Value[1]])
28
+      } else if (IntentAreaList[Value[2]].id !== CurrentIntentArea.id) { // 区县更新
29
+        setCurrentIntentArea(IntentAreaList[Value[2]])
30
+      }
31
+    }
32
+  }, [Value])
33
+
34
+  useEffect(() => {
35
+    if (CurrentState.id) {
36
+      GetAreaList(CurrentState.id, 2)
37
+    }
38
+  }, [CurrentState])
39
+
40
+  useEffect(() => {
41
+    if (CurrentCity.id) {
42
+      GetAreaList(CurrentCity.id, 3)
43
+    }
44
+  }, [CurrentCity])
45
+
46
+  const Sure = () => {
47
+    Change([CurrentState, CurrentCity, CurrentIntentArea])
48
+  }
49
+
50
+  const PickerChange = (e) => {
51
+    setValue(e.detail.value)
52
+  }
53
+
54
+  const GetAreaList = (parentCity = 100000, levelType = 1) => {
55
+    fetch({ url: API_AREA_LIST, method: 'get', payload: { parentCity, levelType } }).then((res) => {
56
+      if (levelType === 1) { // 省份
57
+        setStateList(res || [])
58
+        setValue([0, 0, 0])
59
+      } else if (levelType === 2) { // 城市
60
+        setCityList(res || [])
61
+        setValue([Value[0], 0, 0])
62
+      } else { // 区县
63
+        setIntentAreaList(res || [])
64
+        setValue([Value[0], Value[1], 0])
65
+      }
66
+    })
67
+  }
68
+
69
+  return (
70
+    <view className='components AreaPickerView' style={{ display: show ? 'block' : 'none' }}>
71
+      <view className='flex-v'>
72
+        <view className='flex-h'>
73
+          <text onClick={Cancel}>取消</text>
74
+          <view className='flex-item'></view>
75
+          <text onClick={Sure}>确认</text>
76
+        </view>
77
+        <view className='flex-item'>
78
+          <PickerView value={Value} indicator-style='height: 50px;' style='width: 100%; height: 300px;' onChange={PickerChange}>
79
+            <PickerViewColumn>
80
+              {
81
+                StateList.map((item, index) => (
82
+                  <view key={index} style='line-height: 50px; text-align: center;'>{item.name}</view>
83
+                ))
84
+              }
85
+            </PickerViewColumn>
86
+            <PickerViewColumn>
87
+              {
88
+                CityList.map((item, index) => (
89
+                  <view key={index} style='line-height: 50px; text-align: center;'>{item.name}</view>
90
+                ))
91
+              }
92
+            </PickerViewColumn>
93
+            <PickerViewColumn>
94
+              {
95
+                IntentAreaList.map((item, index) => (
96
+                  <view key={index} style='line-height: 50px; text-align: center;'>{item.name}</view>
97
+                ))
98
+              }
99
+            </PickerViewColumn>
100
+          </PickerView>
101
+        </view>
102
+      </view>
103
+    </view>
104
+  )
105
+}

+ 30
- 0
src/components/AreaPickerView/style.scss 查看文件

1
+.components.AreaPickerView {
2
+  width: 100%;
3
+  position: fixed;
4
+  left: 0;
5
+  top: 0;
6
+  bottom: 0;
7
+  z-index: 100;
8
+  background: rgba(0, 0, 0, 0.6);
9
+  > view {
10
+    width: 100%;
11
+    position: absolute;
12
+    left: 0;
13
+    bottom: 0;
14
+    height: 600px;
15
+    background: #fff;
16
+    >.flex-h {
17
+      align-items: center;
18
+      padding: 0 30px;
19
+      border-bottom: 2px solid rgba(0, 0, 0, 0.08);
20
+      >text {
21
+        font-size: 28px;
22
+        line-height: 80px;
23
+        color: #193C83;
24
+        &:first-child {
25
+          color: #ccc;
26
+        }
27
+      }
28
+    }
29
+  }
30
+}

+ 1
- 0
src/constants/api.js 查看文件

33
 export const API_QRCODE = resolvePath('qrcode')
33
 export const API_QRCODE = resolvePath('qrcode')
34
 export const API_BANNER_LIST = resolvePath('extendContent')
34
 export const API_BANNER_LIST = resolvePath('extendContent')
35
 export const API_QUERY_CODE_SCENE = resolvePath('qrcode/scene')
35
 export const API_QUERY_CODE_SCENE = resolvePath('qrcode/scene')
36
+export const API_AREA_LIST = resolvePath('city/cascade')
36
 
37
 
37
 // user
38
 // user
38
 export const API_USER_LOGIN = resolvePath('login')
39
 export const API_USER_LOGIN = resolvePath('login')

+ 1
- 1
src/pages/index/addedValueService/index.jsx 查看文件

48
     params.map((item) => {
48
     params.map((item) => {
49
       payload[item.key] = item.result || item.resultId
49
       payload[item.key] = item.result || item.resultId
50
     })
50
     })
51
-    fetch({ url: API_HELP_FIND_HOUSE_SUBMIT, method: 'post', payload: { ...payload, questionnaire: JSON.stringify(params) } }).then((res) => {
51
+    fetch({ url: API_HELP_FIND_HOUSE_SUBMIT, method: 'post', payload: { ...payload, questionnaire: JSON.stringify(params), type: 4 } }).then((res) => {
52
       setResultList(res.taBuildingList || [])
52
       setResultList(res.taBuildingList || [])
53
       setShowPopup(true)
53
       setShowPopup(true)
54
     })
54
     })

+ 6
- 18
src/pages/index/helpToFindHouse/components/BuyHouse/index.jsx 查看文件

1
 import { useState, useEffect } from 'react'
1
 import { useState, useEffect } from 'react'
2
 import '@/assets/css/iconfont.css'
2
 import '@/assets/css/iconfont.css'
3
-import { Image, Slider, Textarea, Picker } from '@tarojs/components'
3
+import { Image, Slider, Textarea } from '@tarojs/components'
4
 import './index.scss'
4
 import './index.scss'
5
 import questions from './formData'
5
 import questions from './formData'
6
 
6
 
7
 export default function BuyHouse (props) {
7
 export default function BuyHouse (props) {
8
-  const { change = () => { }, toSubmit = () => { }, CityList = [] } = props
8
+  const { change = () => { }, toSubmit = () => { }, AreaInfo = {}, selectArea = () => {} } = props
9
 
9
 
10
   const [FormData, setFormData] = useState(questions)
10
   const [FormData, setFormData] = useState(questions)
11
 
11
 
12
   const [StepId, setStepId] = useState(1)
12
   const [StepId, setStepId] = useState(1)
13
   const [StepRange, setStepRange] = useState([0, 4])
13
   const [StepRange, setStepRange] = useState([0, 4])
14
 
14
 
15
-  const [CityName, setCityName] = useState(null)
16
-  const [CityId, setCityId] = useState(null)
17
-
18
   useEffect(() => {
15
   useEffect(() => {
19
     if (StepId === 1) {
16
     if (StepId === 1) {
20
       setStepRange([0, 4])
17
       setStepRange([0, 4])
59
     if (StepId < 4) {
56
     if (StepId < 4) {
60
       setStepId(StepId + 1)
57
       setStepId(StepId + 1)
61
     } else {
58
     } else {
62
-      toSubmit(FormData.concat([{result: CityId, key: 'intentArea', question: '意向区域'}]))
59
+      toSubmit(FormData)
63
     }
60
     }
64
   }
61
   }
65
 
62
 
69
     }
66
     }
70
   }
67
   }
71
 
68
 
72
-  const PickerChange = (e) => {
73
-    setCityName(CityList[e.detail.value - 0].name)
74
-    setCityId(CityList[e.detail.value - 0].id)
75
-  }
76
-
77
   return (
69
   return (
78
     <view className='components BuyHouse'>
70
     <view className='components BuyHouse'>
79
       {
71
       {
114
                 {
106
                 {
115
                   item.type === 'select' &&
107
                   item.type === 'select' &&
116
                   <view className='Area'>
108
                   <view className='Area'>
117
-                    <view className='flex-h'>
109
+                    <view className='flex-h' onClick={selectArea}>
118
                       {
110
                       {
119
                         item.key === 'intentArea' &&
111
                         item.key === 'intentArea' &&
120
                         <text className='iconfont icon-dingwei'></text>
112
                         <text className='iconfont icon-dingwei'></text>
121
                       }
113
                       }
122
-                      {/* <text>不限</text> */}
123
-                      <view className='flex-item'>
124
-                        <Picker range-key='name' onChange={PickerChange} value={0} range={CityList}>
125
-                          <text>{CityName || '请选择'}</text>
126
-                        </Picker>
127
-                      </view>
114
+                      <text>{AreaInfo.name || '不限'}</text>
115
+                      <view className='flex-item'></view>
128
                       <text className='iconfont icon-jiantoudown'></text>
116
                       <text className='iconfont icon-jiantoudown'></text>
129
                     </view>
117
                     </view>
130
                   </view>
118
                   </view>

+ 6
- 18
src/pages/index/helpToFindHouse/components/HousePurchasing/index.jsx 查看文件

1
 import { useState, useEffect } from 'react'
1
 import { useState, useEffect } from 'react'
2
 import '@/assets/css/iconfont.css'
2
 import '@/assets/css/iconfont.css'
3
-import { Image, Slider, Textarea, Picker } from '@tarojs/components'
3
+import { Image, Slider, Textarea } from '@tarojs/components'
4
 import './index.scss'
4
 import './index.scss'
5
 import questions from './formData'
5
 import questions from './formData'
6
 
6
 
7
 export default function HousePurchasing (props) {
7
 export default function HousePurchasing (props) {
8
-  const { change = () => { }, toSubmit = () => {}, CityList = [] } = props
8
+  const { change = () => { }, toSubmit = () => {}, AreaInfo = {}, selectArea = () => {} } = props
9
 
9
 
10
   const [FormData, setFormData] = useState(questions)
10
   const [FormData, setFormData] = useState(questions)
11
 
11
 
12
   const [StepId, setStepId] = useState(1)
12
   const [StepId, setStepId] = useState(1)
13
   const [StepRange, setStepRange] = useState([0, 5])
13
   const [StepRange, setStepRange] = useState([0, 5])
14
 
14
 
15
-  const [CityName, setCityName] = useState(null)
16
-  const [CityId, setCityId] = useState(null)
17
-
18
   useEffect(() => {
15
   useEffect(() => {
19
     if(StepId === 1) {
16
     if(StepId === 1) {
20
       setStepRange([0, 5])
17
       setStepRange([0, 5])
53
     if (StepId < 1) {
50
     if (StepId < 1) {
54
       setStepId(StepId + 1)
51
       setStepId(StepId + 1)
55
     } else {
52
     } else {
56
-      toSubmit(FormData.concat([{result: CityId, key: 'intentArea', question: '意向区域'}]))
53
+      toSubmit(FormData)
57
     }
54
     }
58
   }
55
   }
59
 
56
 
63
     }
60
     }
64
   }
61
   }
65
 
62
 
66
-  const PickerChange = (e) => {
67
-    setCityName(CityList[e.detail.value - 0].name)
68
-    setCityId(CityList[e.detail.value - 0].id)
69
-  }
70
-
71
   return (
63
   return (
72
     <view className='components BuyHouse'>
64
     <view className='components BuyHouse'>
73
       {
65
       {
108
                 {
100
                 {
109
                   item.type === 'select' &&
101
                   item.type === 'select' &&
110
                   <view className='Area'>
102
                   <view className='Area'>
111
-                    <view className='flex-h'>
103
+                    <view className='flex-h' onClick={selectArea}>
112
                       {
104
                       {
113
                         item.key === 'district' &&
105
                         item.key === 'district' &&
114
                         <text className='iconfont icon-dingwei'></text>
106
                         <text className='iconfont icon-dingwei'></text>
115
                       }
107
                       }
116
-                      {/* <text>不限</text> */}
117
-                      <view className='flex-item'>
118
-                        <Picker range-key='name' onChange={PickerChange} value={0} range={CityList}>
119
-                          <text>{CityName || '请选择'}</text>
120
-                        </Picker>
121
-                      </view>
108
+                      <text>{AreaInfo.name || '不限'}</text>
109
+                      <view className='flex-item'></view>
122
                       <text className='iconfont icon-jiantoudown'></text>
110
                       <text className='iconfont icon-jiantoudown'></text>
123
                     </view>
111
                     </view>
124
                   </view>
112
                   </view>

+ 6
- 18
src/pages/index/helpToFindHouse/components/RentingHouse/index.jsx 查看文件

1
 import { useState, useEffect } from 'react'
1
 import { useState, useEffect } from 'react'
2
 import '@/assets/css/iconfont.css'
2
 import '@/assets/css/iconfont.css'
3
-import { Image, Slider, Textarea, Picker } from '@tarojs/components'
3
+import { Image, Slider, Textarea } from '@tarojs/components'
4
 import './index.scss'
4
 import './index.scss'
5
 import questions from './formData'
5
 import questions from './formData'
6
 
6
 
7
 export default function RentingHouse (props) {
7
 export default function RentingHouse (props) {
8
-  const { change = () => { }, toSubmit = () => {}, CityList = [] } = props
8
+  const { change = () => { }, toSubmit = () => {}, AreaInfo = {}, selectArea = () => {} } = props
9
 
9
 
10
   const [FormData, setFormData] = useState(questions)
10
   const [FormData, setFormData] = useState(questions)
11
 
11
 
12
   const [StepId, setStepId] = useState(1)
12
   const [StepId, setStepId] = useState(1)
13
   const [StepRange, setStepRange] = useState([0, 4])
13
   const [StepRange, setStepRange] = useState([0, 4])
14
 
14
 
15
-  const [CityName, setCityName] = useState(null)
16
-  const [CityId, setCityId] = useState(null)
17
-
18
   useEffect(() => {
15
   useEffect(() => {
19
     if(StepId === 1) {
16
     if(StepId === 1) {
20
       setStepRange([0, 4])
17
       setStepRange([0, 4])
55
     if (StepId < 2) {
52
     if (StepId < 2) {
56
       setStepId(StepId + 1)
53
       setStepId(StepId + 1)
57
     } else {
54
     } else {
58
-      toSubmit(FormData.concat([{result: CityId, key: 'intentArea', question: '意向区域'}]))
55
+      toSubmit(FormData)
59
     }
56
     }
60
   }
57
   }
61
 
58
 
65
     }
62
     }
66
   }
63
   }
67
 
64
 
68
-  const PickerChange = (e) => {
69
-    setCityName(CityList[e.detail.value - 0].name)
70
-    setCityId(CityList[e.detail.value - 0].id)
71
-  }
72
-
73
   return (
65
   return (
74
     <view className='components BuyHouse'>
66
     <view className='components BuyHouse'>
75
       {
67
       {
110
                 {
102
                 {
111
                   item.type === 'select' &&
103
                   item.type === 'select' &&
112
                   <view className='Area'>
104
                   <view className='Area'>
113
-                    <view className='flex-h'>
105
+                    <view className='flex-h' onClick={selectArea}>
114
                       {
106
                       {
115
                         item.key === 'district' &&
107
                         item.key === 'district' &&
116
                         <text className='iconfont icon-dingwei'></text>
108
                         <text className='iconfont icon-dingwei'></text>
117
                       }
109
                       }
118
-                      {/* <text>不限</text> */}
119
-                      <view className='flex-item'>
120
-                        <Picker range-key='name' onChange={PickerChange} value={0} range={CityList}>
121
-                          <text>{CityName || '请选择'}</text>
122
-                        </Picker>
123
-                      </view>
110
+                      <text>{AreaInfo.name || '不限'}</text>
111
+                      <view className='flex-item'></view>
124
                       <text className='iconfont icon-jiantoudown'></text>
112
                       <text className='iconfont icon-jiantoudown'></text>
125
                     </view>
113
                     </view>
126
                   </view>
114
                   </view>

+ 2
- 1
src/pages/index/helpToFindHouse/components/SubmitBuyHouseResult/index.jsx 查看文件

1
 
1
 
2
 import '@/assets/css/iconfont.css'
2
 import '@/assets/css/iconfont.css'
3
 import { Image, Block } from '@tarojs/components'
3
 import { Image, Block } from '@tarojs/components'
4
+import { getImgURL } from '@/utils/image'
4
 import Taro from '@tarojs/taro'
5
 import Taro from '@tarojs/taro'
5
 import './index.scss'
6
 import './index.scss'
6
 
7
 
44
                       <view className='RecommendBuildingItem' onClick={() => {Taro.navigateTo({ url: `/pages/index/buildingDetail/index?id=${item.buildingId}` })}}>
45
                       <view className='RecommendBuildingItem' onClick={() => {Taro.navigateTo({ url: `/pages/index/buildingDetail/index?id=${item.buildingId}` })}}>
45
                         <view>
46
                         <view>
46
                           <view className='Img'>
47
                           <view className='Img'>
47
-                            <Image mode='aspectFill' src={item.poster} className='centerLabel'></Image>
48
+                            <Image mode='aspectFill' src={getImgURL(item.poster || item.preSalePermit)} className='centerLabel'></Image>
48
                           </view>
49
                           </view>
49
                           <view className='Title flex-h'>
50
                           <view className='Title flex-h'>
50
                             <view className='flex-item'>
51
                             <view className='flex-item'>

+ 59
- 59
src/pages/index/helpToFindHouse/index.jsx 查看文件

1
-import { useState, useEffect } from 'react'
1
+import { useState } from 'react'
2
 import withLayout from '@/layout'
2
 import withLayout from '@/layout'
3
 import { ScrollView, Image } from '@tarojs/components'
3
 import { ScrollView, Image } from '@tarojs/components'
4
 import { fetch } from '@/utils/request'
4
 import { fetch } from '@/utils/request'
5
-import { API_HELP_FIND_HOUSE_SUBMIT, API_CITY_AREA } from '@/constants/api'
5
+import { API_HELP_FIND_HOUSE_SUBMIT } from '@/constants/api'
6
 import '@/assets/css/iconfont.css'
6
 import '@/assets/css/iconfont.css'
7
 import { useSelector } from 'react-redux'
7
 import { useSelector } from 'react-redux'
8
+import AreaPickerView from '@/components/AreaPickerView/index'
8
 import './index.scss'
9
 import './index.scss'
9
 import BuyHouse from './components/BuyHouse/index'
10
 import BuyHouse from './components/BuyHouse/index'
10
 import RentingHouse from './components/RentingHouse/index'
11
 import RentingHouse from './components/RentingHouse/index'
14
 export default withLayout(() => {
15
 export default withLayout(() => {
15
 
16
 
16
   const user = useSelector(state => state.user)
17
   const user = useSelector(state => state.user)
17
-  const city = useSelector(state => state.city)
18
   const [DemandList] = useState([
18
   const [DemandList] = useState([
19
     { name: '我要买房', id: 1, icon: '', spell: 'MAI FANG' },
19
     { name: '我要买房', id: 1, icon: '', spell: 'MAI FANG' },
20
     { name: '我要租房', id: 2, icon: '', spell: 'ZU FANG' },
20
     { name: '我要租房', id: 2, icon: '', spell: 'ZU FANG' },
22
   ])
22
   ])
23
   const [CurrentDemandId, setCurrentDemandId] = useState(1)
23
   const [CurrentDemandId, setCurrentDemandId] = useState(1)
24
   const [ShowDemand, setShowDemand] = useState(true)
24
   const [ShowDemand, setShowDemand] = useState(true)
25
-  const [CityAreaList, setCityAreaList] = useState([])
26
   const [ResultList, setResultList] = useState([])
25
   const [ResultList, setResultList] = useState([])
27
   const [ShowPopup, setShowPopup] = useState(false)
26
   const [ShowPopup, setShowPopup] = useState(false)
28
-
29
-  useEffect(() => {
30
-    CityArea()
31
-  }, [])
32
-
33
-  const CityArea = () => {
34
-    fetch({ url: API_CITY_AREA, method: 'get', payload: { cityId: city.curCity.id, leveltype: 3 } }).then((res) => {
35
-      setCityAreaList(res || [])
36
-    })
37
-  }
27
+  const [ShowCitysPopup, setShowCitysPopup] = useState(false)
28
+  const [AreaInfo, setAreaInfo] = useState({})
38
 
29
 
39
   const CutDemandId = (id) => {
30
   const CutDemandId = (id) => {
40
     return () => {
31
     return () => {
46
     setShowDemand(id === 1)
37
     setShowDemand(id === 1)
47
   }
38
   }
48
 
39
 
40
+  const AreaChange = (e) => {
41
+    setAreaInfo(e[2])
42
+    setShowCitysPopup(false)
43
+  }
44
+
49
   const submitForm = (data) => {
45
   const submitForm = (data) => {
50
     data = data || []
46
     data = data || []
51
     let params = []
47
     let params = []
60
       }
56
       }
61
     })
57
     })
62
     params.push({ question: '创建人小程序人员', result: user?.userInfo?.person?.personId, key: 'personId' })
58
     params.push({ question: '创建人小程序人员', result: user?.userInfo?.person?.personId, key: 'personId' })
59
+    params.push({ question: '意向区域', result: AreaInfo.id, key: 'intentArea' })
63
     let payload = {}
60
     let payload = {}
64
     params.map((item) => {
61
     params.map((item) => {
65
       payload[item.key] = item.result || item.resultId
62
       payload[item.key] = item.result || item.resultId
66
     })
63
     })
67
-    fetch({ url: API_HELP_FIND_HOUSE_SUBMIT, method: 'post', payload: { ...payload, questionnaire: JSON.stringify(params) } }).then((res) => {
64
+    fetch({ url: API_HELP_FIND_HOUSE_SUBMIT, method: 'post', payload: { ...payload, questionnaire: JSON.stringify(params), type: CurrentDemandId } }).then((res) => {
68
       setResultList(res.taBuildingList || [])
65
       setResultList(res.taBuildingList || [])
69
       setShowPopup(true)
66
       setShowPopup(true)
70
     })
67
     })
71
   }
68
   }
72
 
69
 
73
-return (
74
-  <view className='Page helpToFindHouse'>
75
-    {
76
-      ShowPopup &&
77
-      <SubmitBuyHouseResult List={ResultList}></SubmitBuyHouseResult>
78
-    }
70
+  return (
71
+    <view className='Page helpToFindHouse'>
72
+
73
+      <AreaPickerView show={ShowCitysPopup} Change={AreaChange} Cancel={() => { setShowCitysPopup(false) }}></AreaPickerView>
79
 
74
 
80
-    <ScrollView scroll-y refresher-enabled={false}>
81
-      <view className='PageContent'>
82
-
83
-        {
84
-          ShowDemand &&
85
-          <view>
86
-            <text>选择您的需求</text>
87
-            <view className='Demand flex-h' style='margin-top: 10px;'>
88
-              {
89
-                DemandList.map((item, index) => (
90
-                  <view key={`DemandItem-${index}`} className={CurrentDemandId === item.id ? 'flex-item active' : 'flex-item'} onClick={CutDemandId(item.id)}>
91
-                    <Image mode='heightFix' src={item.icon || null}></Image>
92
-                    <text>{item.name}</text>
93
-                    <text>{item.spell}</text>
94
-                  </view>
95
-                ))
96
-              }
75
+      {
76
+        ShowPopup &&
77
+        <SubmitBuyHouseResult List={ResultList}></SubmitBuyHouseResult>
78
+      }
79
+
80
+      <ScrollView scroll-y refresher-enabled={false}>
81
+        <view className='PageContent'>
82
+
83
+          {
84
+            ShowDemand &&
85
+            <view>
86
+              <text>选择您的需求</text>
87
+              <view className='Demand flex-h' style='margin-top: 10px;'>
88
+                {
89
+                  DemandList.map((item, index) => (
90
+                    <view key={`DemandItem-${index}`} className={CurrentDemandId === item.id ? 'flex-item active' : 'flex-item'} onClick={CutDemandId(item.id)}>
91
+                      <Image mode='heightFix' src={item.icon || null}></Image>
92
+                      <text>{item.name}</text>
93
+                      <text>{item.spell}</text>
94
+                    </view>
95
+                  ))
96
+                }
97
+              </view>
97
             </view>
98
             </view>
98
-          </view>
99
-        }
99
+          }
100
 
100
 
101
-        {/* 买房 */}
102
-        {
103
-          CurrentDemandId === 1 &&
104
-          <BuyHouse change={StepChange} toSubmit={submitForm} CityList={CityAreaList}></BuyHouse>
105
-        }
101
+          {/* 买房 */}
102
+          {
103
+            CurrentDemandId === 1 &&
104
+            <BuyHouse change={StepChange} toSubmit={submitForm} AreaInfo={AreaInfo} selectArea={() => { setShowCitysPopup(true) }}></BuyHouse>
105
+          }
106
 
106
 
107
-        {/* 租房 */}
108
-        {
109
-          CurrentDemandId === 2 &&
110
-          <RentingHouse change={StepChange} toSubmit={submitForm} CityList={CityAreaList}></RentingHouse>
111
-        }
107
+          {/* 租房 */}
108
+          {
109
+            CurrentDemandId === 2 &&
110
+            <RentingHouse change={StepChange} toSubmit={submitForm} AreaInfo={AreaInfo} selectArea={() => { setShowCitysPopup(true) }}></RentingHouse>
111
+          }
112
 
112
 
113
-        {/* 置业 */}
114
-        {
115
-          CurrentDemandId === 3 &&
116
-          <HousePurchasing change={StepChange} toSubmit={submitForm} CityList={CityAreaList}></HousePurchasing>
117
-        }
113
+          {/* 置业 */}
114
+          {
115
+            CurrentDemandId === 3 &&
116
+            <HousePurchasing change={StepChange} toSubmit={submitForm} AreaInfo={AreaInfo} selectArea={() => { setShowCitysPopup(true) }}></HousePurchasing>
117
+          }
118
 
118
 
119
-      </view>
120
-    </ScrollView>
119
+        </view>
120
+      </ScrollView>
121
 
121
 
122
-  </view>
123
-)
122
+    </view>
123
+  )
124
 })
124
 })

+ 6
- 0
src/pages/index/helpToFindHouse/index.scss 查看文件

1
 .Page.helpToFindHouse {
1
 .Page.helpToFindHouse {
2
   background: #fff;
2
   background: #fff;
3
+  width: 100%;
4
+  height: 100%;
5
+  position: relative;
6
+  overflow: hidden;
3
   > scroll-view {
7
   > scroll-view {
4
     width: 100%;
8
     width: 100%;
5
     height: 100%;
9
     height: 100%;
10
+    position: relative;
11
+    z-index: 1;
6
     .PageContent {
12
     .PageContent {
7
       position: relative;
13
       position: relative;
8
       overflow: hidden;
14
       overflow: hidden;