소스 검색

Merge branch 'main' of http://git.ycjcjy.com/marketing/miniapp into main

Your Name 3 년 전
부모
커밋
6ae60aa161

+ 5
- 0
src/constants/api.js 파일 보기

@@ -12,6 +12,8 @@ export const pathname = '/api/wx'
12 12
 
13 13
 export const resolvePath = api => `${host + pathname}/${api}`
14 14
 
15
+export const API_CITY_AREA = resolvePath('tdCityList/tdAreaCity') // 城市下区域查询
16
+
15 17
 // 课程
16 18
 export const API_COURSE_LIST = resolvePath('curriculum') // 课程列表
17 19
 export const API_MY_COLLECT_COURSE_LIST = resolvePath('curriculum/save') // 我收藏的课程列表
@@ -116,6 +118,9 @@ export const API_RECOMENT_CLIENT = resolvePath('customer/new')
116 118
 export const API_CLIENT_PROGRESS = resolvePath('customer')
117 119
 export const API_TYPE_DATA = resolvePath('awesome/dict/recommendcustomer')
118 120
 
121
+// channel
122
+export const API_CHANNEL_REPORT = resolvePath('channel/report')
123
+
119 124
 // report
120 125
 export const API_REPORT_LIST = resolvePath('myReport')
121 126
 export const API_REPORT_CLIENT = resolvePath('customer/report')

+ 1
- 1
src/pages/index/activityList/index.jsx 파일 보기

@@ -42,7 +42,7 @@ export default function MyCollectForActivity () {
42 42
   const GetPageList = () => {
43 43
     setHasNextPage(false)
44 44
     fetch({ url: API_ACTIVITY_LIST, method: 'get', payload: { city: city?.curCity?.id, buildingId, type, pageNumber, pageSize: 10 } }).then((res) => {
45
-      setPageList(pageNumber === 1 ? res.list || [] : PageList.concat(res.list || []))
45
+      setPageList(pageNumber === 1 ? res.records || [] : PageList.concat(res.records || []))
46 46
       setHasNextPage(res.current < res.pages)
47 47
       setPull(false)
48 48
     })

+ 3
- 2
src/pages/index/buildingDetail/components/Periphery/index.jsx 파일 보기

@@ -1,5 +1,5 @@
1 1
 
2
-import { useCallback, useContext, useEffect, useMemo, useState } from 'react'
2
+import { useCallback, useEffect, useMemo, useState } from 'react'
3 3
 import Taro from '@tarojs/taro'
4 4
 import { Map, CoverView } from '@tarojs/components'
5 5
 import '@/assets/css/iconfont.css'
@@ -101,7 +101,8 @@ export default function Periphery (props) {
101 101
           poiTypes.map((item) => (
102 102
             <view className='flex-item' key={item.value} onClick={CutTab(item.value)}>
103 103
               <text className={item.class}></text>
104
-              <text>{item.label}({countLen(item.value)})</text>
104
+              <text>{item.label}</text>
105
+              <text>({countLen(item.value)})</text>
105 106
             </view>
106 107
           ))
107 108
         }

+ 4
- 0
src/pages/index/buildingDetail/components/Periphery/index.scss 파일 보기

@@ -56,6 +56,10 @@
56 56
           margin-top: 0;
57 57
           line-height: 1;
58 58
         }
59
+        &:last-child {
60
+          margin-top: 0;
61
+          font-size: 28px;
62
+        }
59 63
       }
60 64
     }
61 65
   }

+ 2
- 3
src/pages/index/buildingDynamic/index.jsx 파일 보기

@@ -1,5 +1,4 @@
1 1
 import { useState, useEffect } from 'react'
2
-import Taro from '@tarojs/taro'
3 2
 import withLayout from '@/layout'
4 3
 import { fetch } from '@/utils/request'
5 4
 import { API_ITEMS_DETAIL } from '@/constants/api'
@@ -24,11 +23,11 @@ export default withLayout((props) => {
24 23
       <ScrollView scroll-y>
25 24
         <view className='Content'>
26 25
 
27
-          <view className='Top'>
26
+          {/* <view className='Top'>
28 27
             <text className='iconfont icon-shengming'></text>
29 28
             <text>楼盘资讯</text>
30 29
             <text className='active' onClick={() => {Taro.navigateTo({url: '/pages/index/disclaimer/index'})}}>免责声明》</text>
31
-          </view>
30
+          </view> */}
32 31
 
33 32
           <view className='List'>
34 33
             {

+ 47
- 0
src/pages/index/buildingList/components/FilterForCityArea/index.jsx 파일 보기

@@ -0,0 +1,47 @@
1
+import { useState } from 'react'
2
+import { Image } from '@tarojs/components'
3
+import './index.scss'
4
+
5
+export default function FilterForCityArea (props) {
6
+
7
+  const { change = () => { }, Cancel = () => { }, defaultValue = '-', List = [] } = props
8
+  const [CurrentId, setCurrentId] = useState(defaultValue)
9
+
10
+  const CutArea = (id) => {
11
+    return () => {
12
+      setCurrentId(id)
13
+    }
14
+  }
15
+
16
+  const Sure = () => {
17
+    change({ name: 'buildingArea', value: CurrentId })
18
+  }
19
+
20
+  return (
21
+    <view className='components FilterForCityArea'>
22
+      {
23
+        List.map((item, index) => (
24
+          <view className='ListItem' key={`ListItem${index}`} onClick={CutArea(item.id)}>
25
+            <view>
26
+              <view>
27
+                <text>{item.name}</text>
28
+                {
29
+                  CurrentId === item.id &&
30
+                  <Image mode='heightFix' src={require('@/assets/findHouse-icon1.png')}></Image>
31
+                }
32
+              </view>
33
+            </view>
34
+          </view>
35
+        ))
36
+      }
37
+      <view className='Btn flex-h'>
38
+        <view className='flex-item'>
39
+          <text onClick={Cancel}>取消</text>
40
+        </view>
41
+        <view className='flex-item'>
42
+          <text onClick={Sure}>保存</text>
43
+        </view>
44
+      </view>
45
+    </view>
46
+  )
47
+}

+ 65
- 0
src/pages/index/buildingList/components/FilterForCityArea/index.scss 파일 보기

@@ -0,0 +1,65 @@
1
+.components.FilterForCityArea {
2
+  padding: 0 6px 30px 40px;
3
+  background: #fff;
4
+  position: relative;
5
+  overflow: hidden;
6
+  font-size: 0;
7
+  > .ListItem {
8
+    display: inline-block;
9
+    min-width: 33.33%;
10
+    vertical-align: middle;
11
+    margin-top: 28px;
12
+    > view {
13
+      padding-right: 24px;
14
+      position: relative;
15
+      overflow: hidden;
16
+      > view {
17
+        border: 2px solid #193c83;
18
+        border-radius: 4px;
19
+        box-sizing: border-box;
20
+        text-align: center;
21
+        position: relative;
22
+        overflow: hidden;
23
+        > text {
24
+          font-size: 30px;
25
+          font-weight: bold;
26
+          line-height: 80px;
27
+        }
28
+        > image {
29
+          display: block;
30
+          position: absolute;
31
+          right: -2px;
32
+          bottom: 0;
33
+          height: 36px;
34
+        }
35
+      }
36
+    }
37
+  }
38
+  > .Btn {
39
+    margin-top: 40px;
40
+    align-items: center;
41
+    padding: 0 94px 0 60px;
42
+    > view {
43
+      margin-left: 80px;
44
+      &:first-child {
45
+        margin-left: 0;
46
+        > text {
47
+          background: #fff;
48
+          color: #193c83;
49
+        }
50
+      }
51
+      > text {
52
+        display: block;
53
+        font-size: 30px;
54
+        line-height: 80px;
55
+        box-sizing: border-box;
56
+        border: 2px solid #193c83;
57
+        border-radius: 80px;
58
+        text-align: center;
59
+        color: #fff;
60
+        font-weight: bold;
61
+        background: #193c83;
62
+      }
63
+    }
64
+  }
65
+}

+ 54
- 0
src/pages/index/buildingList/components/FilterForHouseSort/index.jsx 파일 보기

@@ -0,0 +1,54 @@
1
+import { useState } from 'react'
2
+import { Image } from '@tarojs/components'
3
+import './index.scss'
4
+
5
+export default function FilterForHouseSort (props) {
6
+
7
+  const { change = () => {}, Cancel = () => { }, defaultValue = '-' } = props
8
+  const [CityAreaList] = useState([
9
+    {name: '不限', id: '-'},
10
+    {name: '价格由低到高', id: 'price-asc'},
11
+    {name: '价格由高到低', id: 'price-desc'},
12
+    {name: '开盘由近到远', id: 'openingDate-asc'},
13
+    {name: '开盘由远到近', id: 'openingDate-desc'},
14
+  ])
15
+  const [CurrentId, setCurrentId] = useState(defaultValue)
16
+
17
+  const CutArea = (id) => {
18
+    return () => {
19
+      setCurrentId(id)
20
+    }
21
+  }
22
+
23
+  const Sure = () => {
24
+    change({name: 'orderBy', value: CurrentId})
25
+  }
26
+
27
+  return (
28
+    <view className='components FilterForHouseSort'>
29
+      {
30
+        CityAreaList.map((item, index) => (
31
+          <view className='ListItem' key={`ListItem${index}`} onClick={CutArea(item.id)}>
32
+            <view>
33
+              <view>
34
+                <text>{item.name}</text>
35
+                {
36
+                  CurrentId === item.id &&
37
+                  <Image mode='heightFix' src={require('@/assets/findHouse-icon1.png')}></Image>
38
+                }
39
+              </view>
40
+            </view>
41
+          </view>
42
+        ))
43
+      }
44
+      <view className='Btn flex-h'>
45
+        <view className='flex-item'>
46
+          <text onClick={Cancel}>取消</text>
47
+        </view>
48
+        <view className='flex-item'>
49
+          <text onClick={Sure}>保存</text>
50
+        </view>
51
+      </view>
52
+    </view>
53
+  )
54
+}

+ 65
- 0
src/pages/index/buildingList/components/FilterForHouseSort/index.scss 파일 보기

@@ -0,0 +1,65 @@
1
+.components.FilterForHouseSort {
2
+  padding: 0 6px 30px 40px;
3
+  background: #fff;
4
+  position: relative;
5
+  overflow: hidden;
6
+  font-size: 0;
7
+  > .ListItem {
8
+    display: inline-block;
9
+    min-width: 33.33%;
10
+    vertical-align: middle;
11
+    margin-top: 28px;
12
+    > view {
13
+      padding-right: 24px;
14
+      position: relative;
15
+      overflow: hidden;
16
+      > view {
17
+        border: 2px solid #193c83;
18
+        border-radius: 4px;
19
+        box-sizing: border-box;
20
+        text-align: center;
21
+        position: relative;
22
+        overflow: hidden;
23
+        > text {
24
+          font-size: 30px;
25
+          font-weight: bold;
26
+          line-height: 80px;
27
+        }
28
+        > image {
29
+          display: block;
30
+          position: absolute;
31
+          right: -2px;
32
+          bottom: 0;
33
+          height: 36px;
34
+        }
35
+      }
36
+    }
37
+  }
38
+  > .Btn {
39
+    margin-top: 40px;
40
+    align-items: center;
41
+    padding: 0 94px 0 60px;
42
+    > view {
43
+      margin-left: 80px;
44
+      &:first-child {
45
+        margin-left: 0;
46
+        > text {
47
+          background: #fff;
48
+          color: #193c83;
49
+        }
50
+      }
51
+      > text {
52
+        display: block;
53
+        font-size: 30px;
54
+        line-height: 80px;
55
+        box-sizing: border-box;
56
+        border: 2px solid #193c83;
57
+        border-radius: 80px;
58
+        text-align: center;
59
+        color: #fff;
60
+        font-weight: bold;
61
+        background: #193c83;
62
+      }
63
+    }
64
+  }
65
+}

+ 26
- 11
src/pages/index/buildingList/components/FilterForHouseType/index.jsx 파일 보기

@@ -1,10 +1,11 @@
1 1
 import { useState } from 'react'
2
+import { Image } from '@tarojs/components'
2 3
 import './index.scss'
3 4
 
4 5
 export default function FilterForHouseType (props) {
5 6
 
6
-  const { change = () => {}, defaultValue = '-' } = props
7
-  const [HouseTypeList] = useState([
7
+  const { change = () => {}, Cancel = () => { }, defaultValue = '-' } = props
8
+  const [CityAreaList] = useState([
8 9
     {name: '不限', id: '-'},
9 10
     {name: '一室', id: 1},
10 11
     {name: '两室', id: 2},
@@ -17,24 +18,38 @@ export default function FilterForHouseType (props) {
17 18
   const CutArea = (id) => {
18 19
     return () => {
19 20
       setCurrentId(id)
20
-      change({name: 'houseType', value: id})
21 21
     }
22 22
   }
23 23
 
24
+  const Sure = () => {
25
+    change({name: 'houseType', value: CurrentId})
26
+  }
27
+
24 28
   return (
25 29
     <view className='components FilterForHouseType'>
26 30
       {
27
-        HouseTypeList.map((item, index) => (
28
-          <view key={`ListItem${index}`} className={CurrentId === item.id ? 'flex-h active' : 'flex-h'} onClick={CutArea(item.id)}>
29
-            <text>{item.name}</text>
30
-            <view className='flex-item'></view>
31
-            {
32
-              CurrentId === item.id &&
33
-              <text className='iconfont icon-gou1'></text>
34
-            }
31
+        CityAreaList.map((item, index) => (
32
+          <view className='ListItem' key={`ListItem${index}`} onClick={CutArea(item.id)}>
33
+            <view>
34
+              <view>
35
+                <text>{item.name}</text>
36
+                {
37
+                  CurrentId === item.id &&
38
+                  <Image mode='heightFix' src={require('@/assets/findHouse-icon1.png')}></Image>
39
+                }
40
+              </view>
41
+            </view>
35 42
           </view>
36 43
         ))
37 44
       }
45
+      <view className='Btn flex-h'>
46
+        <view className='flex-item'>
47
+          <text onClick={Cancel}>取消</text>
48
+        </view>
49
+        <view className='flex-item'>
50
+          <text onClick={Sure}>保存</text>
51
+        </view>
52
+      </view>
38 53
     </view>
39 54
   )
40 55
 }

+ 54
- 14
src/pages/index/buildingList/components/FilterForHouseType/index.scss 파일 보기

@@ -1,25 +1,65 @@
1 1
 .components.FilterForHouseType {
2
-  padding: 0 30px;
2
+  padding: 0 6px 30px 40px;
3 3
   background: #fff;
4 4
   position: relative;
5 5
   overflow: hidden;
6
-  >view {
7
-    padding: 0 30px;
8
-    position: relative;
9
-    overflow: hidden;
10
-    border-bottom: 2px solid rgba(0, 0, 0, 0.08);
11
-    align-items: center;
12
-    &.active {
13
-      >text {
14
-        color: #193C83;
15
-        &:first-child {
6
+  font-size: 0;
7
+  > .ListItem {
8
+    display: inline-block;
9
+    min-width: 33.33%;
10
+    vertical-align: middle;
11
+    margin-top: 28px;
12
+    > view {
13
+      padding-right: 24px;
14
+      position: relative;
15
+      overflow: hidden;
16
+      > view {
17
+        border: 2px solid #193c83;
18
+        border-radius: 4px;
19
+        box-sizing: border-box;
20
+        text-align: center;
21
+        position: relative;
22
+        overflow: hidden;
23
+        > text {
24
+          font-size: 30px;
16 25
           font-weight: bold;
26
+          line-height: 80px;
27
+        }
28
+        > image {
29
+          display: block;
30
+          position: absolute;
31
+          right: -2px;
32
+          bottom: 0;
33
+          height: 36px;
17 34
         }
18 35
       }
19 36
     }
20
-    >text {
21
-      font-size: 28px;
22
-      line-height: 80px;
37
+  }
38
+  > .Btn {
39
+    margin-top: 40px;
40
+    align-items: center;
41
+    padding: 0 94px 0 60px;
42
+    > view {
43
+      margin-left: 80px;
44
+      &:first-child {
45
+        margin-left: 0;
46
+        > text {
47
+          background: #fff;
48
+          color: #193c83;
49
+        }
50
+      }
51
+      > text {
52
+        display: block;
53
+        font-size: 30px;
54
+        line-height: 80px;
55
+        box-sizing: border-box;
56
+        border: 2px solid #193c83;
57
+        border-radius: 80px;
58
+        text-align: center;
59
+        color: #fff;
60
+        font-weight: bold;
61
+        background: #193c83;
62
+      }
23 63
     }
24 64
   }
25 65
 }

+ 92
- 19
src/pages/index/buildingList/components/FilterForMore/index.jsx 파일 보기

@@ -1,37 +1,110 @@
1 1
 import { useState } from 'react'
2
+import { ScrollView, Image } from '@tarojs/components'
2 3
 import './index.scss'
3 4
 
4 5
 export default function FilterForMore (props) {
5 6
 
6
-  const { change = () => {}, defaultValue = '-' } = props
7
-  const [BuildingTypeList] = useState([
8
-    {name: '不限', id: '-'},
9
-    {name: '别墅', id: '1'},
10
-    {name: '高层', id: '2'}
7
+  const { change = () => { }, defaultValue = ['-', '-', '-'], Cancel = () => { }, BuildingTypeList = [] } = props
8
+
9
+  const [AreaList] = useState([
10
+    { name: '不限', id: '-' },
11
+    { name: '60㎡以下', id: '0-60' },
12
+    { name: '60-90㎡', id: '60-90' },
13
+    { name: '90-110㎡', id: '90-110' },
14
+    { name: '110-200㎡', id: '110-200' },
15
+    { name: '200㎡以上', id: '200-' }
16
+  ])
17
+  const [CurrentAreaId, setCurrentAreaId] = useState(defaultValue[0])
18
+
19
+  const [CurrentBuildingTypeId, setCurrentBuildingTypeId] = useState(defaultValue[1])
20
+
21
+  const [StatusList] = useState([
22
+    { name: '不限', id: '-' },
23
+    { name: '在售', id: '在售' },
24
+    { name: '未开盘', id: '未开盘' },
25
+    { name: '售罄', id: '售罄' }
11 26
   ])
12
-  const [CurrentId, setCurrentId] = useState(defaultValue)
27
+  const [CurrentStatusId, setCurrentStatusId] = useState(defaultValue[2])
13 28
 
14 29
   const CutArea = (id) => {
15 30
     return () => {
16
-      setCurrentId(id)
17
-      change({name: 'buildingType', value: id})
31
+      setCurrentAreaId(id)
32
+    }
33
+  }
34
+
35
+  const CutBuildingType = (id) => {
36
+    return () => {
37
+      setCurrentBuildingTypeId(id)
18 38
     }
19 39
   }
20 40
 
41
+  const CutStatus = (id) => {
42
+    return () => {
43
+      setCurrentStatusId(id)
44
+    }
45
+  }
46
+
47
+  const Sure = () => {
48
+    change([
49
+      { name: 'buildingType', value: CurrentBuildingTypeId },
50
+      { name: 'area', value: CurrentAreaId },
51
+      { name: 'marketStatus', value: CurrentStatusId },
52
+    ])
53
+  }
54
+
21 55
   return (
22 56
     <view className='components FilterForMore'>
23
-      {
24
-        BuildingTypeList.map((item, index) => (
25
-          <view key={`ListItem${index}`} className={CurrentId === item.id ? 'flex-h active' : 'flex-h'} onClick={CutArea(item.id)}>
26
-            <text>{item.name}</text>
27
-            <view className='flex-item'></view>
28
-            {
29
-              CurrentId === item.id &&
30
-              <text className='iconfont icon-gou1'></text>
31
-            }
57
+      <ScrollView scroll-y>
58
+        <view className='FilterContent'>
59
+          <text>面积</text>
60
+          {
61
+            AreaList.map((item, index) => (
62
+              <view className='ListItem' key={`AreaListItem${index}`} onClick={CutArea(item.id)}>
63
+                <view>
64
+                  <view>
65
+                    <text>{item.name}</text>
66
+                    <Image mode='heightFix' className={CurrentAreaId === item.id ? 'active' : ''} src={require('@/assets/findHouse-icon1.png')}></Image>
67
+                  </view>
68
+                </view>
69
+              </view>
70
+            ))
71
+          }
72
+          <text>类型</text>
73
+          {
74
+            BuildingTypeList.map((item, index) => (
75
+              <view className='ListItem' key={`BuildingTypeListItem${index}`} onClick={CutBuildingType(item.id)}>
76
+                <view>
77
+                  <view>
78
+                    <text>{item.name}</text>
79
+                    <Image mode='heightFix' className={CurrentBuildingTypeId === item.id ? 'active' : ''} src={require('@/assets/findHouse-icon1.png')}></Image>
80
+                  </view>
81
+                </view>
82
+              </view>
83
+            ))
84
+          }
85
+          <text>售卖状态</text>
86
+          {
87
+            StatusList.map((item, index) => (
88
+              <view className='ListItem' key={`StatusListItem${index}`} onClick={CutStatus(item.id)}>
89
+                <view>
90
+                  <view>
91
+                    <text>{item.name}</text>
92
+                    <Image mode='heightFix' className={CurrentStatusId === item.id ? 'active' : ''} src={require('@/assets/findHouse-icon1.png')}></Image>
93
+                  </view>
94
+                </view>
95
+              </view>
96
+            ))
97
+          }
98
+          <view className='Btn flex-h'>
99
+            <view className='flex-item'>
100
+              <text onClick={Cancel}>取消</text>
101
+            </view>
102
+            <view className='flex-item'>
103
+              <text onClick={Sure}>保存</text>
104
+            </view>
32 105
           </view>
33
-        ))
34
-      }
106
+        </view>
107
+      </ScrollView>
35 108
     </view>
36 109
   )
37 110
 }

+ 79
- 16
src/pages/index/buildingList/components/FilterForMore/index.scss 파일 보기

@@ -1,25 +1,88 @@
1 1
 .components.FilterForMore {
2
-  padding: 0 30px;
2
+  width: 100%;
3
+  height: 100%;
3 4
   background: #fff;
4 5
   position: relative;
5 6
   overflow: hidden;
6
-  >view {
7
-    padding: 0 30px;
7
+  > scroll-view {
8
+    width: 100%;
9
+    height: 100%;
8 10
     position: relative;
9
-    overflow: hidden;
10
-    border-bottom: 2px solid rgba(0, 0, 0, 0.08);
11
-    align-items: center;
12
-    &.active {
13
-      >text {
14
-        color: #193C83;
15
-        &:first-child {
16
-          font-weight: bold;
11
+    .FilterContent {
12
+      padding: 0 6px 30px 40px;
13
+      background: #fff;
14
+      position: relative;
15
+      overflow: hidden;
16
+      font-size: 0;
17
+      > text {
18
+        font-size: 34px;
19
+        font-weight: bold;
20
+        display: block;
21
+        line-height: 1.1;
22
+        margin-top: 50px;
23
+      }
24
+      > .ListItem {
25
+        display: inline-block;
26
+        min-width: 33.33%;
27
+        vertical-align: middle;
28
+        margin-top: 28px;
29
+        > view {
30
+          padding-right: 24px;
31
+          position: relative;
32
+          overflow: hidden;
33
+          > view {
34
+            border: 2px solid #193c83;
35
+            border-radius: 4px;
36
+            box-sizing: border-box;
37
+            text-align: center;
38
+            position: relative;
39
+            overflow: hidden;
40
+            > text {
41
+              font-size: 30px;
42
+              font-weight: bold;
43
+              line-height: 80px;
44
+            }
45
+            > image {
46
+              display: block;
47
+              position: absolute;
48
+              right: -2px;
49
+              bottom: 0;
50
+              height: 36px;
51
+              opacity: 0;
52
+              &.active {
53
+                opacity: 1;
54
+              }
55
+            }
56
+          }
57
+        }
58
+      }
59
+      > .Btn {
60
+        margin-top: 40px;
61
+        align-items: center;
62
+        padding: 0 94px 0 60px;
63
+        > view {
64
+          margin-left: 80px;
65
+          &:first-child {
66
+            margin-left: 0;
67
+            > text {
68
+              background: #fff;
69
+              color: #193c83;
70
+            }
71
+          }
72
+          > text {
73
+            display: block;
74
+            font-size: 30px;
75
+            line-height: 80px;
76
+            box-sizing: border-box;
77
+            border: 2px solid #193c83;
78
+            border-radius: 80px;
79
+            text-align: center;
80
+            color: #fff;
81
+            font-weight: bold;
82
+            background: #193c83;
83
+          }
17 84
         }
18 85
       }
19
-    }
20
-    >text {
21
-      font-size: 28px;
22
-      line-height: 80px;
23 86
     }
24 87
   }
25
-}
88
+}

+ 66
- 16
src/pages/index/buildingList/index.jsx 파일 보기

@@ -1,16 +1,17 @@
1 1
 import { useState, useEffect } from 'react'
2 2
 import withLayout from '@/layout'
3
-import { ScrollView } from '@tarojs/components'
3
+import { ScrollView, Input } from '@tarojs/components'
4 4
 import '@/assets/css/iconfont.css'
5 5
 import { useSelector } from 'react-redux'
6 6
 import { fetch } from '@/utils/request'
7
-import { API_INDEX_PROJECTS } from '@/constants/api'
7
+import { API_ITEMS_LIST, API_CITY_AREA, API_ITEMS_TYPE } from '@/constants/api'
8 8
 import ProjectListItem from '@/components/ProjectListItem/index'
9 9
 import './index.scss'
10
-import FilterForArea from './components/FilterForArea/index'
10
+import FilterForCityArea from './components/FilterForCityArea/index'
11 11
 import FilterForPrice from './components/FilterForPrice/index'
12 12
 import FilterForHouseType from './components/FilterForHouseType/index'
13 13
 import FilterForMore from './components/FilterForMore/index'
14
+import FilterForHouseSort from './components/FilterForHouseSort/index'
14 15
 
15 16
 export default withLayout(() => {
16 17
 
@@ -20,42 +21,73 @@ export default withLayout(() => {
20 21
   const [pageSize] = useState(10)
21 22
   const [IsPull, setPull] = useState(false)
22 23
   const [HasNextPage, setHasNextPage] = useState(true)
24
+  const [CityAreaList, setCityAreaList] = useState([])
25
+  const [BuildingTypeList, setBuildingTypeList] = useState([])
23 26
   const [FilterMenus] = useState([
24
-    { name: '面积', id: 1 },
27
+    { name: '区域', id: 1 },
25 28
     { name: '价格', id: 2 },
26 29
     { name: '户型', id: 3 },
27 30
     { name: '更多', id: 4 }
28 31
   ])
29 32
   const [CurrentFilter, setCurrentFilter] = useState(null)
30 33
   const [FilterData, setFilterData] = useState({
34
+    buildingArea: '-',
31 35
     area: '-',
32 36
     price: '-',
33 37
     priceType: null,
34 38
     houseType: '-',
35
-    buildingType: '-'
39
+    buildingType: '-',
40
+    orderBy: '-',
41
+    marketStatus: '-',
42
+    name: '-'
36 43
   })
37 44
 
38 45
   useEffect(() => {
39 46
     if (city.curCity.name) {
40
-      GetProjectList()
47
+      CityArea()
48
+      GetBuildingTypeList()
41 49
     }
42 50
   }, [pageNumber, city])
43 51
 
44 52
   useEffect(() => {
45
-    if(pageNumber === 1) {
53
+    if (pageNumber === 1) {
46 54
       GetProjectList()
47 55
     } else {
48 56
       setPageNumber(1)
49 57
     }
50 58
   }, [FilterData])
51 59
 
60
+  useEffect(() => {
61
+    if (CityAreaList.length) {
62
+      GetProjectList()
63
+    }
64
+  }, [CityAreaList])
65
+
66
+  const CityArea = () => {
67
+    fetch({ url: API_CITY_AREA, method: 'get', payload: { cityId: city.curCity.id, leveltype: 3 } }).then((res) => {
68
+      setCityAreaList([{ id: '-', name: '不限' }].concat(res || []))
69
+    })
70
+  }
71
+
72
+  const GetBuildingTypeList = () => {
73
+    fetch({ url: API_ITEMS_TYPE, method: 'get' }).then((res) => {
74
+      const ResData = res.records || []
75
+      let Arr = ResData.map((item) => {
76
+        return { name: item.buildingTypeName, id: item.buildingTypeId }
77
+      })
78
+      setBuildingTypeList([{ id: '-', name: '不限' }].concat(Arr))
79
+    })
80
+  }
81
+
52 82
   const GetProjectList = () => { // 获取项目列表
53 83
     setHasNextPage(false)
54
-    let Data = {...FilterData}
55
-    for(let key in Data) {
56
-      Data[key] = Data[key] === '-' ? null : Data[key]
84
+    let Data = {}
85
+    for (let key in FilterData) {
86
+      if (FilterData[key] !== '-' && FilterData[key] !== null) {
87
+        Data[key] = FilterData[key]
88
+      }
57 89
     }
58
-    fetch({ url: API_INDEX_PROJECTS, method: 'get', payload: { cityId: city.curCity.id, pageNumber, pageSize, ...Data } }).then((res) => {
90
+    fetch({ url: API_ITEMS_LIST, method: 'get', payload: { cityId: city.curCity.id, pageNumber, pageSize, ...Data } }).then((res) => {
59 91
       setPageList(pageNumber === 1 ? res.records || [] : PageList.concat(res.records || []))
60 92
       setHasNextPage(res.current < res.pages)
61 93
       setPull(false)
@@ -86,6 +118,14 @@ export default withLayout(() => {
86 118
     setFilterData(Data)
87 119
   }
88 120
 
121
+  const FiltersChange = (e) => {
122
+    let Data = { ...FilterData }
123
+    e.map((item) => {
124
+      Data[item.name] = item.value
125
+    })
126
+    setFilterData(Data)
127
+  }
128
+
89 129
   const PriceChange = (e) => {
90 130
     let Data = { ...FilterData }
91 131
     for (let key in e) {
@@ -94,6 +134,10 @@ export default withLayout(() => {
94 134
     setFilterData(Data)
95 135
   }
96 136
 
137
+  const SearchConfirm = (e) => {
138
+    setFilterData({ ...FilterData, name: e.detail.value })
139
+  }
140
+
97 141
   useEffect(() => { // 下拉刷新触发
98 142
     if (IsPull) {
99 143
       if (pageNumber === 1) {
@@ -110,7 +154,7 @@ export default withLayout(() => {
110 154
       <view className='Search'>
111 155
         <view>
112 156
           <text className='iconfont icon-sousuo'></text>
113
-          <text>输入项目名称或直播标题</text>
157
+          <Input confirm-type='search' placeholder='输入项目名称' onConfirm={SearchConfirm}></Input>
114 158
         </view>
115 159
       </view>
116 160
 
@@ -124,17 +168,17 @@ export default withLayout(() => {
124 168
               </view>
125 169
             ))
126 170
           }
127
-          <text className='iconfont icon-paixu Sort'></text>
171
+          <text className='iconfont icon-paixu Sort' onClick={() => { setCurrentFilter(CurrentFilter === 5 ? null : 5) }}></text>
128 172
         </view>
129 173
       </view>
130 174
 
131 175
       <view className='flex-item'>
132 176
         <view className='FilterContainer' style={{ display: !!CurrentFilter ? 'block' : 'none' }}>
133 177
 
134
-          {/* 面积 */}
178
+          {/* 区域 */}
135 179
           {
136 180
             CurrentFilter === 1 &&
137
-            <FilterForArea change={FilterChange} defaultValue={FilterData.area}></FilterForArea>
181
+            <FilterForCityArea change={FilterChange} defaultValue={FilterData.buildingArea} List={CityAreaList} Cancel={() => { setCurrentFilter(null) }}></FilterForCityArea>
138 182
           }
139 183
 
140 184
           {/* 价格 */}
@@ -152,7 +196,13 @@ export default withLayout(() => {
152 196
           {/* 更多 */}
153 197
           {
154 198
             CurrentFilter === 4 &&
155
-            <FilterForMore change={FilterChange} defaultValue={FilterData.buildingType}></FilterForMore>
199
+            <FilterForMore change={FiltersChange} defaultValue={[FilterData.area, FilterData.buildingType, FilterData.marketStatus]} BuildingTypeList={BuildingTypeList}></FilterForMore>
200
+          }
201
+
202
+          {/* 排序 */}
203
+          {
204
+            CurrentFilter === 5 &&
205
+            <FilterForHouseSort change={FilterChange} defaultValue={FilterData.orderBy}></FilterForHouseSort>
156 206
           }
157 207
 
158 208
         </view>

+ 10
- 9
src/pages/index/buildingList/index.scss 파일 보기

@@ -13,17 +13,18 @@
13 13
       >text {
14 14
         display: inline-block;
15 15
         vertical-align: middle;
16
+        font-size: 24px;
17
+        color: #666;
18
+        line-height: 78px;
19
+      }
20
+      >input {
21
+        display: inline-block;
22
+        vertical-align: middle;
23
+        width: 150px;
16 24
         font-size: 20px;
17
-        color: #999;
18 25
         margin-left: 10px;
19
-        line-height: 78px;
20
-        &:first-child {
21
-          margin-left: 0;
22
-        }
23
-        &.iconfont {
24
-          font-size: 24px;
25
-          color: #666;
26
-        }
26
+        height: 78px;
27
+        text-align: left;
27 28
       }
28 29
     }
29 30
   }

+ 3
- 3
src/pages/index/components/Location/index.jsx 파일 보기

@@ -1,10 +1,10 @@
1
-import React, { useState, useEffect } from 'react'
2
-import './index.scss'
1
+
3 2
 import '@/assets/css/iconfont.css'
4 3
 import Taro from '@tarojs/taro'
5 4
 import { useSelector } from 'react-redux'
5
+import './index.scss'
6 6
 
7
-export default function Location (props) {
7
+export default function Location () {
8 8
 
9 9
   const city = useSelector(state => state.city)
10 10
 

+ 1
- 16
src/pages/index/index.jsx 파일 보기

@@ -21,8 +21,6 @@ export default withLayout(() => {
21 21
   const city = useSelector(state => state.city)
22 22
   const [BannerList, setBannerList] = useState([])
23 23
   const [ProjectList, setProjectList] = useState([])
24
-  const [IsPull, setPull] = useState(false)
25
-  const [PullTimer, setPullTimer] = useState(null)
26 24
   const [ShowHotRecommend, setShowHotRecommend] = useState(false)
27 25
   const [ShowLive, setShowLive] = useState(false)
28 26
 
@@ -45,10 +43,6 @@ export default withLayout(() => {
45 43
     })
46 44
   }
47 45
 
48
-  const PageRefresh = () => { // 页面下拉刷新回调
49
-    setPull(true)
50
-  }
51
-
52 46
   const HotRecommendChange = (e) => {
53 47
     setShowHotRecommend(e)
54 48
   }
@@ -57,19 +51,10 @@ export default withLayout(() => {
57 51
     setShowLive(e)
58 52
   }
59 53
 
60
-  useEffect(() => { // 下拉刷新触发
61
-    if (IsPull) {
62
-      clearTimeout(PullTimer)
63
-      setPullTimer(setTimeout(() => {
64
-        setPull(false)
65
-      }, 2000))
66
-    }
67
-  }, [IsPull])
68
-
69 54
   return (
70 55
     <view className='Page Index'>
71 56
 
72
-      <ScrollView scroll-y refresher-enabled refresher-triggered={IsPull} onrefresherrefresh={PageRefresh} refresher-background='#fff'>
57
+      <ScrollView scroll-y>
73 58
         <view className='PageContent'>
74 59
 
75 60
           {/* 定位 */}

+ 29
- 20
src/pages/mine/addCustomer/index.jsx 파일 보기

@@ -4,14 +4,15 @@ import { ScrollView, Input, Image, Picker } from '@tarojs/components'
4 4
 import '@/assets/css/iconfont.css'
5 5
 import { useSelector } from 'react-redux'
6 6
 import { fetch } from '@/utils/request'
7
-import { API_ITEMS_LIST, API_CARDS_LIST, API_RECOMENT_CLIENT } from '@/constants/api'
7
+import { API_ITEMS_LIST, API_CARDS_LIST, API_REPORT_CLIENT, API_RECOMENT_CLIENT, API_CHANNEL_REPORT } from '@/constants/api'
8 8
 import Taro from '@tarojs/taro'
9 9
 import './index.scss'
10 10
 
11 11
 const defaultSpecialImage = 'https://yz-websit.oss-cn-hangzhou.aliyuncs.com/xlk/index-icon19.jpg'
12 12
 
13
-export default withLayout(() => {
13
+export default withLayout((props) => {
14 14
 
15
+  const { type } = props
15 16
   const user = useSelector(state => state.user)
16 17
   const [PersonId, setPersonId] = useState(null)
17 18
   const [BuildingName, setBuildingName] = useState(null)
@@ -35,20 +36,28 @@ export default withLayout(() => {
35 36
     realtyConsultant: '', // 置业顾问
36 37
     describe: '', // 描述
37 38
   })
38
-  
39
+
39 40
 
40 41
   useEffect(() => {
41 42
     if (PersonId !== user.userInfo.person.personId) {
42 43
       setPersonId(user.userInfo.person.personId)
43 44
     }
44 45
   }, [user])
45
-  
46
+
46 47
   useEffect(() => {
47 48
     if (CanSubmit) {
48
-      const params = {...FormData, sex: SexId, intention: BuildingId, realtyConsultant: CardId}
49
-      fetch({ url: API_RECOMENT_CLIENT, method: 'post', payload: params }).then(() => {
50
-        Taro.showToast({title: '添加成功', icon: 'none'})
51
-        Taro.navigateBack({delta: 1})
49
+      let url = null
50
+      if(type === 'consultant') { // 置业顾问
51
+        url = API_REPORT_CLIENT
52
+      } else if(type === 'customer') { // 普通客户
53
+        url = API_RECOMENT_CLIENT
54
+      } else { // 经纪人
55
+        url = API_CHANNEL_REPORT
56
+      }
57
+      const params = { ...FormData, sex: SexId, intention: BuildingId, realtyConsultant: CardId }
58
+      fetch({ url, method: 'post', payload: params }).then(() => {
59
+        Taro.showToast({ title: '添加成功', icon: 'none' })
60
+        Taro.navigateBack({ delta: 1 })
52 61
         setCanSubmit(false)
53 62
       }).catch(() => {
54 63
         setCanSubmit(false)
@@ -98,33 +107,33 @@ export default withLayout(() => {
98 107
   }
99 108
 
100 109
   const FormInput = (e) => {
101
-    let Data = {...FormData}
110
+    let Data = { ...FormData }
102 111
     Data[e.currentTarget.dataset.type] = e.detail.value
103 112
     setFormData(Data)
104 113
   }
105 114
 
106 115
   const ToSubmit = () => {
107
-    if(FormData.name === '') {
108
-      Taro.showToast({title: '请填写客户姓名', icon: 'none'})
116
+    if (FormData.name === '') {
117
+      Taro.showToast({ title: '请填写客户姓名', icon: 'none' })
109 118
       return false
110 119
     }
111
-    if(SexId === null) {
112
-      Taro.showToast({title: '请选择客户性别', icon: 'none'})
120
+    if (SexId === null) {
121
+      Taro.showToast({ title: '请选择客户性别', icon: 'none' })
113 122
       return false
114 123
     }
115
-    if(FormData.phone === '') {
116
-      Taro.showToast({title: '请填写客户电话', icon: 'none'})
124
+    if (FormData.phone === '') {
125
+      Taro.showToast({ title: '请填写客户电话', icon: 'none' })
117 126
       return false
118 127
     }
119
-    if(!(/^1[3|4|5|6|7|8|9][0-9]\d{4,8}$/.test(FormData.phone)) || FormData.phone.length != 11) {
120
-      Taro.showToast({title: '请填写正确的客户电话', icon: 'none'})
128
+    if (!(/^1[3|4|5|6|7|8|9][0-9]\d{4,8}$/.test(FormData.phone)) || FormData.phone.length != 11) {
129
+      Taro.showToast({ title: '请填写正确的客户电话', icon: 'none' })
121 130
       return false
122 131
     }
123
-    if(BuildingId === null) {
124
-      Taro.showToast({title: '请选择客户的意向楼盘', icon: 'none'})
132
+    if (BuildingId === null) {
133
+      Taro.showToast({ title: '请选择客户的意向楼盘', icon: 'none' })
125 134
       return false
126 135
     }
127
-    if(!CanSubmit) {
136
+    if (!CanSubmit) {
128 137
       setCanSubmit(true)
129 138
     }
130 139
   }

+ 4
- 4
src/pages/mine/tabData.js 파일 보기

@@ -1,7 +1,7 @@
1 1
 const MineMenuList = {
2 2
   User: [ // 普通用户
3 3
     [
4
-      { name: '推荐客户', icon: require('../../assets/mine-icon8.png'), router: '/pages/mine/recommendUser/index' }
4
+      { name: '推荐客户', icon: require('../../assets/mine-icon8.png'), router: '/pages/mine/addCustomer/index?type=customer' }
5 5
     ],
6 6
     [
7 7
       { name: '我的分享', icon: require('../../assets/mine-icon9.png'), router: '/pages/mine/myShare/index' },
@@ -38,7 +38,7 @@ const MineMenuList = {
38 38
   ],
39 39
   Adviser: [ // 置业顾问
40 40
     [
41
-      { name: '添加客户', icon: require('../../assets/mine-icon7.png'), router: '/pages/mine/addCustomer/index' },
41
+      { name: '添加客户', icon: require('../../assets/mine-icon7.png'), router: '/pages/mine/addCustomer/index?type=consultant' },
42 42
       { name: '我的主页', icon: require('../../assets/mine-icon15.png'), router: '/pages/mine/myHomepage/index' },
43 43
       { name: '我的推广码', icon: require('../../assets/mine-icon14.png'), router: '' },
44 44
       { name: '客户分析', icon: require('../../assets/mine-icon5.png'), router: '/pages/mine/customerAnalyse/index' },
@@ -58,11 +58,11 @@ const MineMenuList = {
58 58
   ],
59 59
   Resident: [ // 驻场管理
60 60
     [
61
-      { name: '推荐客户', icon: require('../../assets/mine-icon8.png'), router: '/pages/mine/recommendUser/index' },
61
+      // { name: '推荐客户', icon: require('../../assets/mine-icon8.png'), router: '/pages/mine/addCustomer/index?type=manager' },
62 62
       { name: '驻场管理', icon: require('../../assets/mine-icon17.png'), router: '/pages/mine/residentManager/index' }
63 63
     ],
64 64
     [
65
-      { name: '我的客户', icon: require('../../assets/mine-icon11.png'), router: '/pages/mine/myCustomer/index' },
65
+      // { name: '我的客户', icon: require('../../assets/mine-icon11.png'), router: '/pages/mine/myCustomer/index' },
66 66
       { name: '我的分享', icon: require('../../assets/mine-icon9.png'), router: '/pages/mine/myShare/index' },
67 67
       { name: '我的活动', icon: require('../../assets/mine-icon10.png'), router: '/pages/mine/myActivity/index' },
68 68
       { name: '我的收藏', icon: require('../../assets/mine-icon13.png'), router: '/pages/mine/myCollect/index' }