1002884655 преди 3 години
родител
ревизия
9e5989c222

+ 10
- 6
src/assets/css/iconfont.css
Файловите разлики са ограничени, защото са твърде много
Целия файл


BIN
src/assets/css/iconfont.eot Целия файл


+ 1
- 1
src/assets/css/iconfont.js
Файловите разлики са ограничени, защото са твърде много
Целия файл


+ 7
- 0
src/assets/css/iconfont.json Целия файл

@@ -5,6 +5,13 @@
5 5
   "css_prefix_text": "icon-",
6 6
   "description": "",
7 7
   "glyphs": [
8
+    {
9
+      "icon_id": "17169429",
10
+      "name": "分 享",
11
+      "font_class": "fenxiang",
12
+      "unicode": "e60e",
13
+      "unicode_decimal": 58894
14
+    },
8 15
     {
9 16
       "icon_id": "8353259",
10 17
       "name": "关  闭",

+ 3
- 0
src/assets/css/iconfont.svg Целия файл

@@ -20,6 +20,9 @@ Created by iconfont
20 20
   />
21 21
     <missing-glyph />
22 22
     
23
+    <glyph glyph-name="fenxiang" unicode="&#58894;" d="M857.03473144 234.56598896000003a145.69076425 145.69076425 0 0 1-135.99176748-84.51247763L422.04630781 277.24671973a176.12554658 176.12554658 0 0 1 27.0131212 95.83226191 180.47337276 180.47337276 0 0 1-5.14535625 43.55544112l190.86699198 148.13480829a153.56315918 153.56315918 0 0 1 93.28531026-30.48623613 149.85850253 149.85850253 0 1 1-149.88422901 149.80704873 159.50604551 159.50604551 0 0 1 11.31978341-59.17159775l-176.09982012-135.03987598a191.38152832 191.38152832 0 1 1-157.78235128-297.96758437 203.03576016 203.03576016 0 0 1 108.05248302 29.58579843l343.42680674-146.35966025a150.09004336 150.09004336 0 1 1 149.93568368 159.50604551z"  horiz-adv-x="1075" />
24
+
25
+    
23 26
     <glyph glyph-name="guanbi" unicode="&#58890;" d="M512-37.875C278.95608521-37.875 90.125 150.95608520999997 90.125 384S278.95608521 805.875 512 805.875s421.875-188.83108521 421.875-421.875-188.83108521-421.875-421.875-421.875z m0 803.56311035C301.73815917 765.68811036 130.31188964 594.2626647899999 130.31188964 384S301.73733521 2.311889640000004 512 2.311889640000004c210.26184083 0 381.68811036 171.42544555 381.68811036 381.68811036S722.26266479 765.68811036 512 765.68811036zM542.80841065 384l163.39910888 163.39828492c8.02716065 8.02798462 8.02716065 21.43157959 0 30.80841063l-1.35049438 1.32659913a21.02124023 21.02124023 0 0 1-29.45874023 0L512 414.80841065 348.60171508 578.20751953a21.02124023 21.02124023 0 0 1-29.45874023 0l-1.35049438-1.35049438c-8.02716065-8.02716065-8.02716065-21.43157959 0-30.80841065L481.19158935 384 317.79248047 220.60171507999996c-8.02716065-8.02798462-8.02716065-21.43157959 0-30.80841063l1.35049438-1.35049439a21.02124023 21.02124023 0 0 1 29.45874023 0L512 353.16687011l163.39828492-163.3982849a21.02124023 21.02124023 0 0 1 29.45874023 0l1.35049438 1.35049438c8.02716065 8.02716065 8.02716065 21.43157959 0 30.80841064L542.80841065 384z"  horiz-adv-x="1024" />
24 27
 
25 28
     

BIN
src/assets/css/iconfont.ttf Целия файл


BIN
src/assets/css/iconfont.woff Целия файл


BIN
src/assets/css/iconfont.woff2 Целия файл


BIN
src/assets/empty.png Целия файл


+ 16
- 15
src/components/ProjectListItem/index.jsx Целия файл

@@ -1,42 +1,43 @@
1 1
 import React, { useState, useEffect } from 'react'
2 2
 import './index.scss'
3
+import '@/assets/css/iconfont.css'
3 4
 import Taro from '@tarojs/taro'
5
+import { Image } from '@tarojs/components'
4 6
 
5 7
 export default function ProjectListItem (props) {
6 8
   const { Data = {} } = props
7 9
   return (
8
-    <view className='components ProjectListItem flex-h' onClick={() => {Taro.navigateTo({ url: `/pages/index/buildingDetail/index?id=${Data.id}` })}}>
10
+    <view className='components ProjectListItem flex-h' onClick={() => {Taro.navigateTo({ url: `/pages/index/buildingDetail/index?id=${Data.buildingId}` })}}>
9 11
       <view className='Img'>
10 12
         <view>
11
-          {
12
-            Data.img &&
13
-            <Image mode='aspectFill' className='centerLabel' src={Data.img || null} />
14
-          }
13
+          <Image mode='aspectFill' className='centerLabel' src={Data.buildingListImg.length ? Data.buildingListImg[0].url : null} />
15 14
         </view>
16 15
       </view>
17 16
       <view className='flex-item'>
18 17
         <view className='Name flex-h'>
19 18
           <view className='flex-item'>
20
-            <text>楼盘名称</text>
19
+            <text>{Data.buildingName}</text>
21 20
           </view>
22
-          <text></text>
23
-          <text>20000m²</text>
21
+          <text></text>
22
+          <text>{Data.price}</text>
24 23
         </view>
25
-        <text className='Address'>楼盘地址sdsdsdsdsds</text>
24
+        <text className='Address'>{Data.address}</text>
26 25
         <view className='Tags'>
27
-          <text>标签1</text>
28
-          <text>标签2</text>
29
-          <text>标签3</text>
26
+          {
27
+            Data.buildingTag.map((item, index) => (
28
+              <text key={`Tags-${index}`}>{item.tagName}</text>
29
+            ))
30
+          }
30 31
         </view>
31 32
         <view className='ShareInfo'>
32
-          {/* <text className='iconfont'></text> */}
33
-          <text>3次分享</text>
33
+          <text className='iconfont icon-fenxiang'></text>
34
+          <text>{Data.shareNum}次分享</text>
34 35
           <view className='Users'>
35 36
             <view></view>
36 37
             <view></view>
37 38
             <view></view>
38 39
           </view>
39
-          <text>...9人围观</text>
40
+          <text>...{Data.pvNum}人围观</text>
40 41
         </view>
41 42
       </view>
42 43
     </view>

+ 1
- 0
src/constants/api.js Целия файл

@@ -14,6 +14,7 @@ const resolvePath = api => `${host + pathname}/${api}`
14 14
 
15 15
 // 帮我找房
16 16
 export const API_HELP_FIND_HOUSE_QUESTION = resolvePath('houseProperty') // 问卷列表
17
+export const API_HELP_FIND_HOUSE_SUBMIT = resolvePath('searchHouse') // 问卷提交
17 18
 
18 19
 // common
19 20
 export const API_PRELOAD = resolvePath('preload')

+ 1
- 4
src/pages/index/components/Banner/index.jsx Целия файл

@@ -11,10 +11,7 @@ export default function Banner (props) {
11 11
           List.map((item, index) => (
12 12
             <SwiperItem key={`Banner-${index}`}>
13 13
               <view className="swiper-item">
14
-                {
15
-                  item.img &&
16
-                  <Image mode='aspectFill' className='centerLabel' src={item.img || null} />
17
-                }
14
+                <Image mode='aspectFill' className='centerLabel' src={item.image || null} />
18 15
               </view>
19 16
             </SwiperItem>
20 17
           ))

+ 23
- 1
src/pages/index/components/HotRecommend/index.jsx Целия файл

@@ -1,18 +1,40 @@
1 1
 import React, { useState, useEffect } from 'react'
2 2
 import './index.scss'
3 3
 import '../../../../assets/css/iconfont.css'
4
+import { useSelector } from 'react-redux'
5
+import Taro from '@tarojs/taro'
6
+import { fetch } from '@/utils/request'
7
+import { API_ACTIVITY_LIST } from '@/constants/api'
4 8
 
5 9
 export default function HotRecommend (props) {
10
+
11
+  const city = useSelector(state => state.city)
6 12
   const [MenuList] = useState([{ name: '热门活动', id: 1 }, { name: '热门团房', id: 2 }])
7 13
   const [CurrentId, setCurrentId] = useState(1)
8 14
   const [CurrentContentInfo, setCurrentContentInfo] = useState({ name: '#大运河孔雀城时代', desc: '5月30日六一儿童节表演赛案场展开!' })
9 15
 
16
+  useEffect(() => {
17
+    if(city.curCity.name) {
18
+      GetRecommendActivity()
19
+    }
20
+  }, [city])
21
+
22
+  const GetRecommendActivity = () => {
23
+    fetch({url: API_ACTIVITY_LIST, method: 'get', payload: {pageNum: 1, pageSize: 1, cityId: city.curCity.id}}).then((res) => {
24
+      
25
+    })
26
+  }
27
+
10 28
   const CutMenu = (id) => {
11 29
     return () => {
12 30
       setCurrentId(id)
13 31
     }
14 32
   }
15 33
 
34
+  const ToMore = () => {
35
+    Taro.navigateTo({url: `/pages/index/activityList/index?type=${CurrentId}`})
36
+  }
37
+
16 38
   return (
17 39
     <view className='components HotRecommend'>
18 40
       <view>
@@ -26,7 +48,7 @@ export default function HotRecommend (props) {
26 48
         <view className='Content'>
27 49
           <view className='flex-h'>
28 50
             <text className='flex-item'>{CurrentContentInfo.name}</text>
29
-            <text>{CurrentId === 1 ? '更多活动' : '更多团房'}</text>
51
+            <text onClick={ToMore}>{CurrentId === 1 ? '更多活动' : '更多团房'}</text>
30 52
           </view>
31 53
           <text>{CurrentContentInfo.desc}</text>
32 54
         </view>

+ 23
- 4
src/pages/index/components/LiveSale/index.jsx Целия файл

@@ -1,12 +1,31 @@
1
-import React, { useState, useEffect } from 'react'
1
+import React, { useState, useEffect, } from 'react'
2 2
 import './index.scss'
3 3
 import '../../../../assets/css/iconfont.css'
4 4
 import { ScrollView, Image } from '@tarojs/components'
5
+import Taro from '@tarojs/taro'
6
+import emptyImg from '@/assets/empty.png'
7
+import { useSelector } from 'react-redux'
8
+import { fetch } from '@/utils/request'
9
+import { API_LIVE_DEATIL } from '@/constants/api'
5 10
 
6 11
 export default function LiveSale (props) {
12
+
13
+  const city = useSelector(state => state.city)
7 14
   const [MenuList] = useState([{ name: '全部', id: 1 }, { name: '预告', id: 2 }, { name: '直播中', id: 3 }, { name: '新房推荐', id: 4 }])
8 15
   const [CurrentId, setCurrentId] = useState(1)
9
-  const [PageList, setPageList] = useState(['', '', '', '', '', '', '', ''])
16
+  const [PageList, setPageList] = useState([])
17
+
18
+  useEffect(() => {
19
+    if(city.curCity.name) {
20
+      GetLiveList()
21
+    }
22
+  }, [city])
23
+
24
+  const GetLiveList = () => {
25
+    fetch({url: API_LIVE_DEATIL, method: 'get', payload: {cityId: city.curCity.id, pageNum: 1, pageSize: 20}}).then((res) => {
26
+      setPageList(res.records || [])
27
+    })
28
+  }
10 29
 
11 30
   const CutMenu = (id) => {
12 31
     return () => {
@@ -28,8 +47,8 @@ export default function LiveSale (props) {
28 47
           <ScrollView scroll-x={true}>
29 48
             {
30 49
               PageList.map((item, index) => (
31
-                <view className='ListItem' key={`List-${index}`}>
32
-                  <Image mode='aspectFill' className='centerLabel' src={null} />
50
+                <view className='ListItem' key={`List-${index}`} style={{display: CurrentId === 1 || (CurrentId === 2 && item.kind === 'notice') || (CurrentId === 3 && item.kind === 'live')  || (CurrentId === 4 && item.kind !== 'notice') ? 'inline-block' : 'none'}}>
51
+                  <Image mode='aspectFill' className='centerLabel' src={`http://81.69.196.8:8567${item.images}`} />
33 52
                 </view>
34 53
               ))
35 54
             }

+ 4
- 1
src/pages/index/components/Location/index.jsx Целия файл

@@ -2,9 +2,12 @@ import React, { useState, useEffect } from 'react'
2 2
 import './index.scss'
3 3
 import '../../../../assets/css/iconfont.css'
4 4
 import Taro from '@tarojs/taro'
5
+import { useSelector } from 'react-redux'
5 6
 
6 7
 export default function Location (props) {
7 8
 
9
+  const city = useSelector(state => state.city)
10
+
8 11
   const ToLocation = () => {
9 12
     Taro.navigateTo({ url: `/pages/index/location/index` })
10 13
   }
@@ -16,7 +19,7 @@ export default function Location (props) {
16 19
   return (
17 20
     <view className='components Location flex-h'>
18 21
       <text className='iconfont icon-dingwei' onClick={ToLocation}></text>
19
-      <text onClick={ToLocation}>南京市</text>
22
+      <text onClick={ToLocation}>{city.curCity?.name || '正在定位'}</text>
20 23
       <text className='iconfont icon-jiantoudown' onClick={ToLocation}></text>
21 24
       <view className='flex-item'>
22 25
         <text className='iconfont icon-sousuo' onClick={ToSearch}></text>

+ 157
- 0
src/pages/index/helpToFindHouse/components/BuyHouse/formData.js Целия файл

@@ -0,0 +1,157 @@
1
+const questions = [
2
+  {
3
+    question: '你的购房预算是多少?',
4
+    key: 'budget',
5
+    type: 'range',
6
+    result: '',
7
+    resultId: null,
8
+    options: [100, 500]
9
+  },
10
+  {
11
+    question: '你想购买的是新房还是二手房?',
12
+    key: 'isNew',
13
+    type: 'checkbox',
14
+    result: '',
15
+    resultId: null,
16
+    options: [
17
+      { name: '新房', id: 1 },
18
+      { name: '二手房', id: 2 },
19
+      { name: '不限', id: 3 }
20
+    ]
21
+  },
22
+  {
23
+    question: '你想住几居室的房子?',
24
+    key: 'layout',
25
+    type: 'checkbox',
26
+    result: '',
27
+    resultId: null,
28
+    options: [
29
+      { name: '一室一厅', id: 1 },
30
+      { name: '二室一厅', id: 2 },
31
+      { name: '二室二厅', id: 3 },
32
+      { name: '三室一厅', id: 4 },
33
+      { name: '三室二厅', id: 5 },
34
+      { name: '四室一厅', id: 6 },
35
+      { name: '四室二厅', id: 7 },
36
+      { name: '五室及以上', id: 8 }
37
+    ]
38
+  },
39
+  {
40
+    question: '你想买的区域是?',
41
+    key: 'district',
42
+    type: 'select',
43
+    result: '',
44
+    resultId: null,
45
+    options: []
46
+  },
47
+  {
48
+    question: '你的购房目的?',
49
+    key: 'purpose',
50
+    type: 'checkbox',
51
+    result: '',
52
+    resultId: null,
53
+    options: [
54
+      { name: '刚需', id: 1 },
55
+      { name: '结婚', id: 2 },
56
+      { name: '养老', id: 3 },
57
+      { name: '改善', id: 4 },
58
+      { name: '教育', id: 5 },
59
+      { name: '投资', id: 6 }
60
+    ]
61
+  },
62
+  {
63
+    question: '你更注重项目的哪些优势?',
64
+    key: 'advantage',
65
+    type: 'checkbox',
66
+    result: '',
67
+    resultId: null,
68
+    options: [
69
+      { name: '发展规划', id: 1 },
70
+      { name: '学区', id: 2 },
71
+      { name: '交通', id: 3 },
72
+      { name: '配套', id: 4 },
73
+      { name: '环境', id: 5 }
74
+    ]
75
+  },
76
+  {
77
+    question: '你对小区物业管理和社区设施有什么要求?',
78
+    key: 'facility',
79
+    type: 'checkbox',
80
+    result: '',
81
+    resultId: null,
82
+    remark: '',
83
+    options: [
84
+      { name: '楼栋管家', id: 1 },
85
+      { name: '金钥匙服务', id: 2 },
86
+      { name: '社区娱乐', id: 3 },
87
+      { name: '会所功能', id: 4 }
88
+    ]
89
+  },
90
+  {
91
+    question: '你想买多大面积?',
92
+    key: 'area',
93
+    type: 'checkbox',
94
+    result: '',
95
+    resultId: null,
96
+    options: [
97
+      { name: '60㎡以下', id: 1 },
98
+      { name: '60-90㎡', id: 2 },
99
+      { name: '90-110㎡', id: 3 },
100
+      { name: '110-130㎡', id: 4 },
101
+      { name: '130-150㎡', id: 5 },
102
+      { name: '150-200㎡', id: 6 },
103
+      { name: '200㎡以上', id: 7 }
104
+    ]
105
+  },
106
+  {
107
+    question: '你更喜欢的朝向?',
108
+    key: 'orientation',
109
+    type: 'checkbox',
110
+    result: '',
111
+    resultId: null,
112
+    options: [
113
+      { name: '朝东', id: 1 },
114
+      { name: '朝南', id: 2 },
115
+      { name: '朝西', id: 3 },
116
+      { name: '朝北', id: 4 },
117
+      { name: '南北通透', id: 5 }
118
+    ]
119
+  },
120
+  {
121
+    question: '你想住高楼层还是低楼层?',
122
+    key: 'isHigh',
123
+    type: 'checkbox',
124
+    result: '',
125
+    resultId: null,
126
+    options: [
127
+      { name: '低楼层', id: 1 },
128
+      { name: '中楼层', id: 2 },
129
+      { name: '高楼层', id: 3 },
130
+      { name: '低层', id: 4 },
131
+      { name: '顶层', id: 5 }
132
+    ]
133
+  },
134
+  {
135
+    question: '你对楼龄的要求是?',
136
+    key: 'buildingAge',
137
+    type: 'checkbox',
138
+    result: '',
139
+    resultId: null,
140
+    options: [
141
+      { name: '5年以内', id: 1 },
142
+      { name: '10年以内', id: 2 },
143
+      { name: '15年以内', id: 3 },
144
+      { name: '20年以内', id: 4 },
145
+      { name: '20年以上', id: 5 }
146
+    ]
147
+  },
148
+  {
149
+    question: '你还有其他要求吗?',
150
+    key: 'remark',
151
+    type: 'textarea',
152
+    result: '',
153
+    resultId: null
154
+  },
155
+]
156
+
157
+export default questions

+ 92
- 107
src/pages/index/helpToFindHouse/components/BuyHouse/index.jsx Целия файл

@@ -1,137 +1,65 @@
1 1
 import React, { useState, useEffect } from 'react'
2 2
 import './index.scss'
3 3
 import '../../../../../assets/css/iconfont.css'
4
-import { Image, Input, Slider, Textarea } from '@tarojs/components'
4
+import { Image, Slider, Textarea } from '@tarojs/components'
5 5
 import SubmitBuyHouseResult from '../SubmitBuyHouseResult/index'
6
+import questions from './formData'
6 7
 
7 8
 export default function BuyHouse (props) {
8
-  const { change = () => { } } = props
9
+  const { change = () => { }, toSubmit = () => {} } = props
9 10
 
10
-  const [SingleList] = useState([
11
-    { name: '首套', id: 1 },
12
-    { name: '二套', id: 2 }
13
-  ])
14
-  const [CurrnetSingleId, setCurrnetSingleId] = useState(null)
15
-
16
-  const [NewOldList] = useState([
17
-    { name: '新房', id: 1 },
18
-    { name: '二手房', id: 2 }
19
-  ])
20
-  const [CurrnetNewOldId, setCurrnetNewOldId] = useState(null)
21
-
22
-  const [HouseTypeList] = useState([
23
-    { name: '一室一厅', id: 1 },
24
-    { name: '二室一厅', id: 2 },
25
-    { name: '二室二厅', id: 3 },
26
-    { name: '三室一厅', id: 4 },
27
-    { name: '三室二厅', id: 5 },
28
-    { name: '四室一厅', id: 6 },
29
-    { name: '四室二厅', id: 7 },
30
-    { name: '五室及以上', id: 8 }
31
-  ])
32
-  const [CurrnetHouseTypeId, setCurrnetHouseTypeId] = useState(null)
33
-
34
-  const [AreaList] = useState([
35
-    { name: '60㎡以下', id: 1 },
36
-    { name: '60-90㎡', id: 2 },
37
-    { name: '90-110㎡', id: 3 },
38
-    { name: '110-130㎡', id: 4 },
39
-    { name: '130-150㎡', id: 5 },
40
-    { name: '150-200㎡', id: 6 },
41
-    { name: '200㎡以上', id: 7 }
42
-  ])
43
-  const [CurrnetAreaId, setCurrnetAreaId] = useState(null)
44
-
45
-  const [PreferenceList] = useState([
46
-    { name: '南北通透', id: 1 },
47
-    { name: '朝南', id: 2 },
48
-    { name: '低楼层', id: 3 },
49
-    { name: '高楼层', id: 4 },
50
-    { name: '精装修', id: 5 },
51
-    { name: '电梯房', id: 6 },
52
-    { name: '近地铁', id: 7 },
53
-    { name: '满五年', id: 8 },
54
-    { name: '满两年', id: 9 },
55
-    { name: '楼龄5年内', id: 10 },
56
-    { name: '楼龄10年内', id: 11 }
57
-  ])
58
-  const [CurrnetPreferenceId, setCurrnetPreferenceId] = useState(null)
59
-
60
-  const [GoalList] = useState([
61
-    { name: '刚需', id: 1 },
62
-    { name: '结婚', id: 2 },
63
-    { name: '养老', id: 3 },
64
-    { name: '改善', id: 4 },
65
-    { name: '教育', id: 5 },
66
-    { name: '投资', id: 6 }
67
-  ])
68
-  const [CurrnetGoalId, setCurrnetGoalId] = useState(null)
69
-
70
-  const [LongTimeList] = useState([
71
-    { name: '1月内', id: 1 },
72
-    { name: '6个月', id: 2 },
73
-    { name: '1年内', id: 3 },
74
-    { name: '1年后', id: 4 }
75
-  ])
76
-  const [CurrnetLongTimeId, setCurrnetLongTimeId] = useState(null)
11
+  const [FormData, setFormData] = useState(questions)
77 12
 
78 13
   const [StepId, setStepId] = useState(1)
14
+  const [StepRange, setStepRange] = useState([0, 4])
79 15
 
80 16
   const [ShowPopup, setShowPopup] = useState(false)
81 17
 
82 18
   useEffect(() => {
19
+    if(StepId === 1) {
20
+      setStepRange([0, 4])
21
+    } else if(StepId === 2) {
22
+      setStepRange([4, 7])
23
+    } else if(StepId === 3) {
24
+      setStepRange([7, 10])
25
+    } else if(StepId === 4) {
26
+      setStepRange([10, 12])
27
+    }
83 28
     change(StepId)
84 29
   }, [StepId])
85 30
 
86
-  const CutSingleId = (id) => {
31
+  const CutCheckbox = (item, index) => {
87 32
     return () => {
88
-      setCurrnetSingleId(id === CurrnetSingleId ? null : id)
33
+      let newFormData = [...FormData]
34
+      newFormData[index].resultId = item.id
35
+      newFormData[index].result = item.name
36
+      setFormData([...newFormData])
89 37
     }
90 38
   }
91 39
 
92
-  const CutNewOldId = (id) => {
93
-    return () => {
94
-      setCurrnetNewOldId(id === CurrnetNewOldId ? null : id)
95
-    }
40
+  const Rangehange = (e, index) => {
41
+    let newFormData = [...FormData]
42
+    newFormData[index].result = e.detail.value
43
+    setFormData([...newFormData])
96 44
   }
97 45
 
98
-  const CutHouseTypeId = (id) => {
99
-    return () => {
100
-      setCurrnetHouseTypeId(id === CurrnetHouseTypeId ? null : id)
101
-    }
46
+  const remarkInput = (e, index) => {
47
+    let newFormData = [...FormData]
48
+    newFormData[index].remark = e.detail.value
49
+    setFormData([...newFormData])
102 50
   }
103 51
 
104
-  const CutAreaId = (id) => {
105
-    return () => {
106
-      setCurrnetAreaId(id === CurrnetAreaId ? null : id)
107
-    }
108
-  }
109
-
110
-  const CutPreferenceId = (id) => {
111
-    return () => {
112
-      setCurrnetPreferenceId(id === CurrnetPreferenceId ? null : id)
113
-    }
114
-  }
115
-
116
-  const CutGoalId = (id) => {
117
-    return () => {
118
-      setCurrnetGoalId(id === CurrnetGoalId ? null : id)
119
-    }
120
-  }
121
-
122
-  const CutLongTimeId = (id) => {
123
-    return () => {
124
-      setCurrnetLongTimeId(id === CurrnetLongTimeId ? null : id)
125
-    }
126
-  }
127
-
128
-  const PriceRangehange = (e) => {
129
-    console.log(e)
52
+  const textareaInput = (e, index) => {
53
+    let newFormData = [...FormData]
54
+    newFormData[index].result = e.detail.value
55
+    setFormData([...newFormData])
130 56
   }
131 57
 
132 58
   const NextStep = () => {
133 59
     if (StepId < 4) {
134 60
       setStepId(StepId + 1)
61
+    } else {
62
+      toSubmit(FormData)
135 63
     }
136 64
   }
137 65
 
@@ -144,10 +72,67 @@ export default function BuyHouse (props) {
144 72
   return (
145 73
     <view className='components BuyHouse'>
146 74
       {
147
-        ShowPopup && 
75
+        ShowPopup &&
148 76
         <SubmitBuyHouseResult></SubmitBuyHouseResult>
149 77
       }
150 78
       {
79
+        FormData.map((item, index) => (
80
+          <view className='Step' key={`Form-${index}`}>
81
+            {
82
+              index >= StepRange[0] && index < StepRange[1] &&
83
+              <view>
84
+                <text>{item.question}</text>
85
+                {
86
+                  item.type === 'checkbox' &&
87
+                  <view className='CheckList'>
88
+                    {
89
+                      item.options.map((subItem, subIndex) => (
90
+                        <view key={`${item.key}-${subIndex}`} className={item.resultId === subItem.id ? 'active' : ''} onClick={CutCheckbox(subItem, index)}>
91
+                          {subItem.name}
92
+                          <Image mode='heightFix' src={require('../../../../../assets/findHouse-icon1.png')}></Image>
93
+                        </view>
94
+                      ))
95
+                    }
96
+                  </view>
97
+                }
98
+                {
99
+                  item.type === 'checkbox' && item.remark !== undefined &&
100
+                  <view className='Textarea'>
101
+                    <Textarea placeholder="请说出您的其他需求,让我们更好的为您服务!" onInput={(e) => {remarkInput(e, index)}} />
102
+                  </view>
103
+                }
104
+                {
105
+                  item.type === 'range' &&
106
+                  <view className='RangeList'>
107
+                    <Slider activeColor="#193C83" block-color="#193C83" onChange={(e) => { Rangehange(e, index) }} min={item.options[0]} max={item.options[1]} show-value />
108
+                  </view>
109
+                }
110
+                {
111
+                  item.type === 'select' &&
112
+                  <view className='Area'>
113
+                    <view className='flex-h'>
114
+                      {
115
+                        item.key === 'district' &&
116
+                        <text className='iconfont icon-dingwei'></text>
117
+                      }
118
+                      <text>不限</text>
119
+                      <view className='flex-item'></view>
120
+                      <text className='iconfont icon-jiantoudown'></text>
121
+                    </view>
122
+                  </view>
123
+                }
124
+                {
125
+                  item.type === 'textarea' &&
126
+                  <view className='Textarea'>
127
+                    <Textarea placeholder="请说出您的其他需求,让我们更好的为您服务!" onInput={(e) => {textareaInput(e, index)}} />
128
+                  </view>
129
+                }
130
+              </view>
131
+            }
132
+          </view>
133
+        ))
134
+      }
135
+      {/* {
151 136
         StepId === 1 &&
152 137
         <view className='Step'>
153 138
           <view>
@@ -308,7 +293,7 @@ export default function BuyHouse (props) {
308 293
             </view>
309 294
           </view>
310 295
         </view>
311
-      }
296
+      } */}
312 297
 
313 298
       <view className='Btn'>
314 299
         <text className='active' onClick={NextStep}>下一步</text>

+ 15
- 10
src/pages/index/helpToFindHouse/index.jsx Целия файл

@@ -7,7 +7,7 @@ import BuyHouse from './components/BuyHouse/index'
7 7
 import RentingHouse from './components/RentingHouse/index'
8 8
 import HousePurchasing from './components/HousePurchasing/index'
9 9
 import { fetch } from '@/utils/request'
10
-import { API_HELP_FIND_HOUSE_QUESTION } from '@/constants/api'
10
+import { API_HELP_FIND_HOUSE_SUBMIT } from '@/constants/api'
11 11
 
12 12
 export default withLayout((props) => {
13 13
 
@@ -17,15 +17,9 @@ export default withLayout((props) => {
17 17
     { name: '我要租房', id: 2, icon: '', spell: 'ZU FANG' },
18 18
     { name: '海外置业', id: 3, icon: '', spell: 'ZHI YE' }
19 19
   ])
20
-  const [CurrentDemandId, setCurrentDemandId] = useState(2)
20
+  const [CurrentDemandId, setCurrentDemandId] = useState(1)
21 21
   const [ShowDemand, setShowDemand] = useState(true)
22 22
 
23
-  useEffect(() => {
24
-    fetch({url: API_HELP_FIND_HOUSE_QUESTION}).then(() => {
25
-      
26
-    })
27
-  }, [])
28
-
29 23
   const CutDemandId = (id) => {
30 24
     return () => {
31 25
       setCurrentDemandId(id)
@@ -36,6 +30,17 @@ export default withLayout((props) => {
36 30
     setShowDemand(id === 1)
37 31
   }
38 32
 
33
+  const submitForm = (data) => {
34
+    data = data || []
35
+    let params = {}
36
+    data.map((item) => {
37
+      params[item.key] = item.result
38
+    })
39
+    fetch({url: API_HELP_FIND_HOUSE_SUBMIT, method: 'post', payload: params}).then(() => {
40
+      
41
+    })
42
+  }
43
+
39 44
   return (
40 45
     <view className='Page helpToFindHouse'>
41 46
 
@@ -46,7 +51,7 @@ export default withLayout((props) => {
46 51
             ShowDemand &&
47 52
             <view>
48 53
               <text>选择您的需求</text>
49
-              <view className='Demand flex-h'>
54
+              <view className='Demand flex-h' style='margin-top: 10px;'>
50 55
                 {
51 56
                   DemandList.map((item, index) => (
52 57
                     <view key={`DemandItem-${index}`} className={CurrentDemandId === item.id ? 'flex-item active' : 'flex-item'} onClick={CutDemandId(item.id)}>
@@ -63,7 +68,7 @@ export default withLayout((props) => {
63 68
           {/* 买房 */}
64 69
           {
65 70
             CurrentDemandId === 1 &&
66
-            <BuyHouse change={StepChange}></BuyHouse>
71
+            <BuyHouse change={StepChange} toSubmit={submitForm}></BuyHouse>
67 72
           }
68 73
 
69 74
           {/* 租房 */}

+ 0
- 1
src/pages/index/helpToFindHouse/index.scss Целия файл

@@ -25,7 +25,6 @@
25 25
           padding: 0 30px;
26 26
           position: relative;
27 27
           overflow: hidden;
28
-          margin-top: 20px;
29 28
         }
30 29
         > .Demand {
31 30
           align-items: center;

+ 26
- 4
src/pages/index/index.jsx Целия файл

@@ -10,16 +10,38 @@ import ColumnTitle from './components/ColumnTitle/index'
10 10
 import ProjectListItem from '../../components/ProjectListItem/index'
11 11
 import { ScrollView } from '@tarojs/components'
12 12
 import Taro from '@tarojs/taro'
13
-import { connect } from 'react-redux'
13
+import { useSelector } from 'react-redux'
14
+import { fetch } from '@/utils/request'
15
+import { API_BANNER_LIST, API_INDEX_PROJECTS } from '@/constants/api'
14 16
 
15 17
 export default withLayout((props) => {
16 18
 
17
-  // const [PageProps] = useState(props)
18
-  const [BannerList, setBannerList] = useState(['', '', ''])
19
-  const [ProjectList, setProjectList] = useState(['', '', ''])
19
+  const city = useSelector(state => state.city)
20
+  const [PageProps] = useState(props)
21
+  const [BannerList, setBannerList] = useState([])
22
+  const [ProjectList, setProjectList] = useState([])
20 23
   const [IsPull, setPull] = useState(false)
21 24
   const [PullTimer, setPullTimer] = useState(null)
22 25
 
26
+  useEffect(() => {
27
+    if(city.curCity.name) {
28
+      GetBanner()
29
+      GetProjectList()
30
+    }
31
+  }, [city])
32
+
33
+  const GetBanner = () => { // 获取banner
34
+    fetch({url: `${API_BANNER_LIST}/banner`, method: 'get', payload: {cityId: city.curCity.id, showPosition: 'index'}}).then((res) => {
35
+      setBannerList(res || [])
36
+    })
37
+  }
38
+
39
+  const GetProjectList = () => { // 获取项目列表
40
+    fetch({url: API_INDEX_PROJECTS, method: 'get', payload: {cityId: city.curCity.id, pageNum: 1, pageSize: 10}}).then((res) => {
41
+      setProjectList(res.records || [])
42
+    })
43
+  }
44
+
23 45
   const PageRefresh = () => { // 页面下拉刷新回调
24 46
     setPull(true)
25 47
   }