Browse Source

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

Your Name 3 years ago
parent
commit
6ae60aa161

+ 5
- 0
src/constants/api.js View File

12
 
12
 
13
 export const resolvePath = api => `${host + pathname}/${api}`
13
 export const resolvePath = api => `${host + pathname}/${api}`
14
 
14
 
15
+export const API_CITY_AREA = resolvePath('tdCityList/tdAreaCity') // 城市下区域查询
16
+
15
 // 课程
17
 // 课程
16
 export const API_COURSE_LIST = resolvePath('curriculum') // 课程列表
18
 export const API_COURSE_LIST = resolvePath('curriculum') // 课程列表
17
 export const API_MY_COLLECT_COURSE_LIST = resolvePath('curriculum/save') // 我收藏的课程列表
19
 export const API_MY_COLLECT_COURSE_LIST = resolvePath('curriculum/save') // 我收藏的课程列表
116
 export const API_CLIENT_PROGRESS = resolvePath('customer')
118
 export const API_CLIENT_PROGRESS = resolvePath('customer')
117
 export const API_TYPE_DATA = resolvePath('awesome/dict/recommendcustomer')
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
 // report
124
 // report
120
 export const API_REPORT_LIST = resolvePath('myReport')
125
 export const API_REPORT_LIST = resolvePath('myReport')
121
 export const API_REPORT_CLIENT = resolvePath('customer/report')
126
 export const API_REPORT_CLIENT = resolvePath('customer/report')

+ 1
- 1
src/pages/index/activityList/index.jsx View File

42
   const GetPageList = () => {
42
   const GetPageList = () => {
43
     setHasNextPage(false)
43
     setHasNextPage(false)
44
     fetch({ url: API_ACTIVITY_LIST, method: 'get', payload: { city: city?.curCity?.id, buildingId, type, pageNumber, pageSize: 10 } }).then((res) => {
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
       setHasNextPage(res.current < res.pages)
46
       setHasNextPage(res.current < res.pages)
47
       setPull(false)
47
       setPull(false)
48
     })
48
     })

+ 3
- 2
src/pages/index/buildingDetail/components/Periphery/index.jsx View File

1
 
1
 
2
-import { useCallback, useContext, useEffect, useMemo, useState } from 'react'
2
+import { useCallback, useEffect, useMemo, useState } from 'react'
3
 import Taro from '@tarojs/taro'
3
 import Taro from '@tarojs/taro'
4
 import { Map, CoverView } from '@tarojs/components'
4
 import { Map, CoverView } from '@tarojs/components'
5
 import '@/assets/css/iconfont.css'
5
 import '@/assets/css/iconfont.css'
101
           poiTypes.map((item) => (
101
           poiTypes.map((item) => (
102
             <view className='flex-item' key={item.value} onClick={CutTab(item.value)}>
102
             <view className='flex-item' key={item.value} onClick={CutTab(item.value)}>
103
               <text className={item.class}></text>
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
             </view>
106
             </view>
106
           ))
107
           ))
107
         }
108
         }

+ 4
- 0
src/pages/index/buildingDetail/components/Periphery/index.scss View File

56
           margin-top: 0;
56
           margin-top: 0;
57
           line-height: 1;
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 View File

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

+ 47
- 0
src/pages/index/buildingList/components/FilterForCityArea/index.jsx View File

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 View File

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 View File

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 View File

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 View File

1
 import { useState } from 'react'
1
 import { useState } from 'react'
2
+import { Image } from '@tarojs/components'
2
 import './index.scss'
3
 import './index.scss'
3
 
4
 
4
 export default function FilterForHouseType (props) {
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
     {name: '不限', id: '-'},
9
     {name: '不限', id: '-'},
9
     {name: '一室', id: 1},
10
     {name: '一室', id: 1},
10
     {name: '两室', id: 2},
11
     {name: '两室', id: 2},
17
   const CutArea = (id) => {
18
   const CutArea = (id) => {
18
     return () => {
19
     return () => {
19
       setCurrentId(id)
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
   return (
28
   return (
25
     <view className='components FilterForHouseType'>
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
           </view>
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
     </view>
53
     </view>
39
   )
54
   )
40
 }
55
 }

+ 54
- 14
src/pages/index/buildingList/components/FilterForHouseType/index.scss View File

1
 .components.FilterForHouseType {
1
 .components.FilterForHouseType {
2
-  padding: 0 30px;
2
+  padding: 0 6px 30px 40px;
3
   background: #fff;
3
   background: #fff;
4
   position: relative;
4
   position: relative;
5
   overflow: hidden;
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
           font-weight: bold;
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 View File

1
 import { useState } from 'react'
1
 import { useState } from 'react'
2
+import { ScrollView, Image } from '@tarojs/components'
2
 import './index.scss'
3
 import './index.scss'
3
 
4
 
4
 export default function FilterForMore (props) {
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
   const CutArea = (id) => {
29
   const CutArea = (id) => {
15
     return () => {
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
   return (
55
   return (
22
     <view className='components FilterForMore'>
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
           </view>
105
           </view>
33
-        ))
34
-      }
106
+        </view>
107
+      </ScrollView>
35
     </view>
108
     </view>
36
   )
109
   )
37
 }
110
 }

+ 79
- 16
src/pages/index/buildingList/components/FilterForMore/index.scss View File

1
 .components.FilterForMore {
1
 .components.FilterForMore {
2
-  padding: 0 30px;
2
+  width: 100%;
3
+  height: 100%;
3
   background: #fff;
4
   background: #fff;
4
   position: relative;
5
   position: relative;
5
   overflow: hidden;
6
   overflow: hidden;
6
-  >view {
7
-    padding: 0 30px;
7
+  > scroll-view {
8
+    width: 100%;
9
+    height: 100%;
8
     position: relative;
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 View File

1
 import { useState, useEffect } from 'react'
1
 import { useState, useEffect } from 'react'
2
 import withLayout from '@/layout'
2
 import withLayout from '@/layout'
3
-import { ScrollView } from '@tarojs/components'
3
+import { ScrollView, Input } from '@tarojs/components'
4
 import '@/assets/css/iconfont.css'
4
 import '@/assets/css/iconfont.css'
5
 import { useSelector } from 'react-redux'
5
 import { useSelector } from 'react-redux'
6
 import { fetch } from '@/utils/request'
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
 import ProjectListItem from '@/components/ProjectListItem/index'
8
 import ProjectListItem from '@/components/ProjectListItem/index'
9
 import './index.scss'
9
 import './index.scss'
10
-import FilterForArea from './components/FilterForArea/index'
10
+import FilterForCityArea from './components/FilterForCityArea/index'
11
 import FilterForPrice from './components/FilterForPrice/index'
11
 import FilterForPrice from './components/FilterForPrice/index'
12
 import FilterForHouseType from './components/FilterForHouseType/index'
12
 import FilterForHouseType from './components/FilterForHouseType/index'
13
 import FilterForMore from './components/FilterForMore/index'
13
 import FilterForMore from './components/FilterForMore/index'
14
+import FilterForHouseSort from './components/FilterForHouseSort/index'
14
 
15
 
15
 export default withLayout(() => {
16
 export default withLayout(() => {
16
 
17
 
20
   const [pageSize] = useState(10)
21
   const [pageSize] = useState(10)
21
   const [IsPull, setPull] = useState(false)
22
   const [IsPull, setPull] = useState(false)
22
   const [HasNextPage, setHasNextPage] = useState(true)
23
   const [HasNextPage, setHasNextPage] = useState(true)
24
+  const [CityAreaList, setCityAreaList] = useState([])
25
+  const [BuildingTypeList, setBuildingTypeList] = useState([])
23
   const [FilterMenus] = useState([
26
   const [FilterMenus] = useState([
24
-    { name: '面积', id: 1 },
27
+    { name: '区域', id: 1 },
25
     { name: '价格', id: 2 },
28
     { name: '价格', id: 2 },
26
     { name: '户型', id: 3 },
29
     { name: '户型', id: 3 },
27
     { name: '更多', id: 4 }
30
     { name: '更多', id: 4 }
28
   ])
31
   ])
29
   const [CurrentFilter, setCurrentFilter] = useState(null)
32
   const [CurrentFilter, setCurrentFilter] = useState(null)
30
   const [FilterData, setFilterData] = useState({
33
   const [FilterData, setFilterData] = useState({
34
+    buildingArea: '-',
31
     area: '-',
35
     area: '-',
32
     price: '-',
36
     price: '-',
33
     priceType: null,
37
     priceType: null,
34
     houseType: '-',
38
     houseType: '-',
35
-    buildingType: '-'
39
+    buildingType: '-',
40
+    orderBy: '-',
41
+    marketStatus: '-',
42
+    name: '-'
36
   })
43
   })
37
 
44
 
38
   useEffect(() => {
45
   useEffect(() => {
39
     if (city.curCity.name) {
46
     if (city.curCity.name) {
40
-      GetProjectList()
47
+      CityArea()
48
+      GetBuildingTypeList()
41
     }
49
     }
42
   }, [pageNumber, city])
50
   }, [pageNumber, city])
43
 
51
 
44
   useEffect(() => {
52
   useEffect(() => {
45
-    if(pageNumber === 1) {
53
+    if (pageNumber === 1) {
46
       GetProjectList()
54
       GetProjectList()
47
     } else {
55
     } else {
48
       setPageNumber(1)
56
       setPageNumber(1)
49
     }
57
     }
50
   }, [FilterData])
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
   const GetProjectList = () => { // 获取项目列表
82
   const GetProjectList = () => { // 获取项目列表
53
     setHasNextPage(false)
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
       setPageList(pageNumber === 1 ? res.records || [] : PageList.concat(res.records || []))
91
       setPageList(pageNumber === 1 ? res.records || [] : PageList.concat(res.records || []))
60
       setHasNextPage(res.current < res.pages)
92
       setHasNextPage(res.current < res.pages)
61
       setPull(false)
93
       setPull(false)
86
     setFilterData(Data)
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
   const PriceChange = (e) => {
129
   const PriceChange = (e) => {
90
     let Data = { ...FilterData }
130
     let Data = { ...FilterData }
91
     for (let key in e) {
131
     for (let key in e) {
94
     setFilterData(Data)
134
     setFilterData(Data)
95
   }
135
   }
96
 
136
 
137
+  const SearchConfirm = (e) => {
138
+    setFilterData({ ...FilterData, name: e.detail.value })
139
+  }
140
+
97
   useEffect(() => { // 下拉刷新触发
141
   useEffect(() => { // 下拉刷新触发
98
     if (IsPull) {
142
     if (IsPull) {
99
       if (pageNumber === 1) {
143
       if (pageNumber === 1) {
110
       <view className='Search'>
154
       <view className='Search'>
111
         <view>
155
         <view>
112
           <text className='iconfont icon-sousuo'></text>
156
           <text className='iconfont icon-sousuo'></text>
113
-          <text>输入项目名称或直播标题</text>
157
+          <Input confirm-type='search' placeholder='输入项目名称' onConfirm={SearchConfirm}></Input>
114
         </view>
158
         </view>
115
       </view>
159
       </view>
116
 
160
 
124
               </view>
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
         </view>
172
         </view>
129
       </view>
173
       </view>
130
 
174
 
131
       <view className='flex-item'>
175
       <view className='flex-item'>
132
         <view className='FilterContainer' style={{ display: !!CurrentFilter ? 'block' : 'none' }}>
176
         <view className='FilterContainer' style={{ display: !!CurrentFilter ? 'block' : 'none' }}>
133
 
177
 
134
-          {/* 面积 */}
178
+          {/* 区域 */}
135
           {
179
           {
136
             CurrentFilter === 1 &&
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
           {/* 更多 */}
196
           {/* 更多 */}
153
           {
197
           {
154
             CurrentFilter === 4 &&
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
         </view>
208
         </view>

+ 10
- 9
src/pages/index/buildingList/index.scss View File

13
       >text {
13
       >text {
14
         display: inline-block;
14
         display: inline-block;
15
         vertical-align: middle;
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
         font-size: 20px;
24
         font-size: 20px;
17
-        color: #999;
18
         margin-left: 10px;
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 View File

1
-import React, { useState, useEffect } from 'react'
2
-import './index.scss'
1
+
3
 import '@/assets/css/iconfont.css'
2
 import '@/assets/css/iconfont.css'
4
 import Taro from '@tarojs/taro'
3
 import Taro from '@tarojs/taro'
5
 import { useSelector } from 'react-redux'
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
   const city = useSelector(state => state.city)
9
   const city = useSelector(state => state.city)
10
 
10
 

+ 1
- 16
src/pages/index/index.jsx View File

21
   const city = useSelector(state => state.city)
21
   const city = useSelector(state => state.city)
22
   const [BannerList, setBannerList] = useState([])
22
   const [BannerList, setBannerList] = useState([])
23
   const [ProjectList, setProjectList] = useState([])
23
   const [ProjectList, setProjectList] = useState([])
24
-  const [IsPull, setPull] = useState(false)
25
-  const [PullTimer, setPullTimer] = useState(null)
26
   const [ShowHotRecommend, setShowHotRecommend] = useState(false)
24
   const [ShowHotRecommend, setShowHotRecommend] = useState(false)
27
   const [ShowLive, setShowLive] = useState(false)
25
   const [ShowLive, setShowLive] = useState(false)
28
 
26
 
45
     })
43
     })
46
   }
44
   }
47
 
45
 
48
-  const PageRefresh = () => { // 页面下拉刷新回调
49
-    setPull(true)
50
-  }
51
-
52
   const HotRecommendChange = (e) => {
46
   const HotRecommendChange = (e) => {
53
     setShowHotRecommend(e)
47
     setShowHotRecommend(e)
54
   }
48
   }
57
     setShowLive(e)
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
   return (
54
   return (
70
     <view className='Page Index'>
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
         <view className='PageContent'>
58
         <view className='PageContent'>
74
 
59
 
75
           {/* 定位 */}
60
           {/* 定位 */}

+ 29
- 20
src/pages/mine/addCustomer/index.jsx View File

4
 import '@/assets/css/iconfont.css'
4
 import '@/assets/css/iconfont.css'
5
 import { useSelector } from 'react-redux'
5
 import { useSelector } from 'react-redux'
6
 import { fetch } from '@/utils/request'
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
 import Taro from '@tarojs/taro'
8
 import Taro from '@tarojs/taro'
9
 import './index.scss'
9
 import './index.scss'
10
 
10
 
11
 const defaultSpecialImage = 'https://yz-websit.oss-cn-hangzhou.aliyuncs.com/xlk/index-icon19.jpg'
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
   const user = useSelector(state => state.user)
16
   const user = useSelector(state => state.user)
16
   const [PersonId, setPersonId] = useState(null)
17
   const [PersonId, setPersonId] = useState(null)
17
   const [BuildingName, setBuildingName] = useState(null)
18
   const [BuildingName, setBuildingName] = useState(null)
35
     realtyConsultant: '', // 置业顾问
36
     realtyConsultant: '', // 置业顾问
36
     describe: '', // 描述
37
     describe: '', // 描述
37
   })
38
   })
38
-  
39
+
39
 
40
 
40
   useEffect(() => {
41
   useEffect(() => {
41
     if (PersonId !== user.userInfo.person.personId) {
42
     if (PersonId !== user.userInfo.person.personId) {
42
       setPersonId(user.userInfo.person.personId)
43
       setPersonId(user.userInfo.person.personId)
43
     }
44
     }
44
   }, [user])
45
   }, [user])
45
-  
46
+
46
   useEffect(() => {
47
   useEffect(() => {
47
     if (CanSubmit) {
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
         setCanSubmit(false)
61
         setCanSubmit(false)
53
       }).catch(() => {
62
       }).catch(() => {
54
         setCanSubmit(false)
63
         setCanSubmit(false)
98
   }
107
   }
99
 
108
 
100
   const FormInput = (e) => {
109
   const FormInput = (e) => {
101
-    let Data = {...FormData}
110
+    let Data = { ...FormData }
102
     Data[e.currentTarget.dataset.type] = e.detail.value
111
     Data[e.currentTarget.dataset.type] = e.detail.value
103
     setFormData(Data)
112
     setFormData(Data)
104
   }
113
   }
105
 
114
 
106
   const ToSubmit = () => {
115
   const ToSubmit = () => {
107
-    if(FormData.name === '') {
108
-      Taro.showToast({title: '请填写客户姓名', icon: 'none'})
116
+    if (FormData.name === '') {
117
+      Taro.showToast({ title: '请填写客户姓名', icon: 'none' })
109
       return false
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
       return false
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
       return false
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
       return false
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
       return false
134
       return false
126
     }
135
     }
127
-    if(!CanSubmit) {
136
+    if (!CanSubmit) {
128
       setCanSubmit(true)
137
       setCanSubmit(true)
129
     }
138
     }
130
   }
139
   }

+ 4
- 4
src/pages/mine/tabData.js View File

1
 const MineMenuList = {
1
 const MineMenuList = {
2
   User: [ // 普通用户
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
       { name: '我的分享', icon: require('../../assets/mine-icon9.png'), router: '/pages/mine/myShare/index' },
7
       { name: '我的分享', icon: require('../../assets/mine-icon9.png'), router: '/pages/mine/myShare/index' },
38
   ],
38
   ],
39
   Adviser: [ // 置业顾问
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
       { name: '我的主页', icon: require('../../assets/mine-icon15.png'), router: '/pages/mine/myHomepage/index' },
42
       { name: '我的主页', icon: require('../../assets/mine-icon15.png'), router: '/pages/mine/myHomepage/index' },
43
       { name: '我的推广码', icon: require('../../assets/mine-icon14.png'), router: '' },
43
       { name: '我的推广码', icon: require('../../assets/mine-icon14.png'), router: '' },
44
       { name: '客户分析', icon: require('../../assets/mine-icon5.png'), router: '/pages/mine/customerAnalyse/index' },
44
       { name: '客户分析', icon: require('../../assets/mine-icon5.png'), router: '/pages/mine/customerAnalyse/index' },
58
   ],
58
   ],
59
   Resident: [ // 驻场管理
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
       { name: '驻场管理', icon: require('../../assets/mine-icon17.png'), router: '/pages/mine/residentManager/index' }
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
       { name: '我的分享', icon: require('../../assets/mine-icon9.png'), router: '/pages/mine/myShare/index' },
66
       { name: '我的分享', icon: require('../../assets/mine-icon9.png'), router: '/pages/mine/myShare/index' },
67
       { name: '我的活动', icon: require('../../assets/mine-icon10.png'), router: '/pages/mine/myActivity/index' },
67
       { name: '我的活动', icon: require('../../assets/mine-icon10.png'), router: '/pages/mine/myActivity/index' },
68
       { name: '我的收藏', icon: require('../../assets/mine-icon13.png'), router: '/pages/mine/myCollect/index' }
68
       { name: '我的收藏', icon: require('../../assets/mine-icon13.png'), router: '/pages/mine/myCollect/index' }