Browse Source

静态页面

1002884655 3 years ago
parent
commit
382947dbc4

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

124
 // 驻场
124
 // 驻场
125
 export const API_MANAGE_CUSTOMER_LIST = resolvePath('marking/customers')
125
 export const API_MANAGE_CUSTOMER_LIST = resolvePath('marking/customers')
126
 export const API_TOBE_MANAGER = resolvePath('marketing')
126
 export const API_TOBE_MANAGER = resolvePath('marketing')
127
+export const API_MY_BUILDINGIDS = resolvePath('building/mine')
128
+
127
 
129
 
128
 // report
130
 // report
129
 export const API_REPORT_CUETOMER = resolvePath('customer/manualReport ')
131
 export const API_REPORT_CUETOMER = resolvePath('customer/manualReport ')

+ 2
- 2
src/pages/mine/components/ResidentListItem/index.jsx View File

17
       <view className='flex-h'>
17
       <view className='flex-h'>
18
         <text>客户姓名:</text>
18
         <text>客户姓名:</text>
19
         <view className='flex-item'>
19
         <view className='flex-item'>
20
-          <text></text>
20
+          <text>{data.name}</text>
21
         </view>
21
         </view>
22
       </view>
22
       </view>
23
       <view className='flex-h'>
23
       <view className='flex-h'>
24
         <text>手机号码:</text>
24
         <text>手机号码:</text>
25
         <view className='flex-item'>
25
         <view className='flex-item'>
26
-          <text>136****9434</text>
26
+          <text>{data.phone}</text>
27
         </view>
27
         </view>
28
         <Image mode='heightFix' src={require('@/assets/mine-icon27.png')}></Image>
28
         <Image mode='heightFix' src={require('@/assets/mine-icon27.png')}></Image>
29
         <text className='Type'>结佣</text>
29
         <text className='Type'>结佣</text>

+ 44
- 9
src/pages/mine/residentManager/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_MANAGE_CUSTOMER_LIST } from '@/constants/api'
7
+import { API_MANAGE_CUSTOMER_LIST, API_MY_BUILDINGIDS } from '@/constants/api'
8
 import './index.scss'
8
 import './index.scss'
9
 import ResidentListItem from '../components/ResidentListItem/index'
9
 import ResidentListItem from '../components/ResidentListItem/index'
10
 
10
 
27
   // }
27
   // }
28
 
28
 
29
   const user = useSelector(state => state.user)
29
   const user = useSelector(state => state.user)
30
+  const [BuildingIds, setBuildingIds] = useState([])
30
   const [PageList, setPageList] = useState([])
31
   const [PageList, setPageList] = useState([])
31
   const [IsPull, setPull] = useState(false)
32
   const [IsPull, setPull] = useState(false)
32
   const [PersonId, setPersonId] = useState(null)
33
   const [PersonId, setPersonId] = useState(null)
33
   const [pageNumber, setPageNumber] = useState(1)
34
   const [pageNumber, setPageNumber] = useState(1)
34
   const [HasNextPage, setHasNextPage] = useState(true)
35
   const [HasNextPage, setHasNextPage] = useState(true)
36
+  const [CurrentBuildingId, setCurrentBuildingId] = useState(null)
37
+  const [CurrentBuildingName, setCurrentBuildingName] = useState(null)
35
   const [FilterData, setFilterData] = useState({})
38
   const [FilterData, setFilterData] = useState({})
36
 
39
 
37
   useEffect(() => {
40
   useEffect(() => {
42
 
45
 
43
   useEffect(() => {
46
   useEffect(() => {
44
     if (PersonId) {
47
     if (PersonId) {
45
-      GetPageList()
48
+      GetMyBuildingIds()
46
     }
49
     }
47
-  }, [pageNumber, PersonId])
50
+  }, [PersonId])
48
 
51
 
49
   useEffect(() => {
52
   useEffect(() => {
50
-    if(FilterData.keywords) {
51
-      if(pageNumber === 1) {
53
+    if (FilterData.keywords) {
54
+      if (pageNumber === 1) {
52
         GetPageList()
55
         GetPageList()
53
       } else {
56
       } else {
54
-        setPageNumber(2)
57
+        setPageNumber(1)
55
       }
58
       }
56
     }
59
     }
57
   }, [FilterData])
60
   }, [FilterData])
58
 
61
 
62
+  useEffect(() => {
63
+    if (BuildingIds.length) {
64
+      setCurrentBuildingId(BuildingIds[0].buildingId)
65
+      setCurrentBuildingName(BuildingIds[0].name)
66
+    }
67
+  }, [BuildingIds])
68
+
69
+  useEffect(() => {
70
+    if (CurrentBuildingId) {
71
+      if (pageNumber === 1) {
72
+        GetPageList()
73
+      } else {
74
+        setPageNumber(1)
75
+      }
76
+    }
77
+  }, [CurrentBuildingId])
78
+
79
+  const GetMyBuildingIds = () => {
80
+    fetch({ url: API_MY_BUILDINGIDS, method: 'get' }).then((res) => {
81
+      setBuildingIds(res || [])
82
+    })
83
+  }
84
+
59
   // useEffect(() => {
85
   // useEffect(() => {
60
   //   if(CurrentFilterMenuId) {
86
   //   if(CurrentFilterMenuId) {
61
   //     if(pageNumber === 1) {
87
   //     if(pageNumber === 1) {
72
 
98
 
73
   const GetPageList = () => {
99
   const GetPageList = () => {
74
     setHasNextPage(false)
100
     setHasNextPage(false)
75
-    fetch({ url: API_MANAGE_CUSTOMER_LIST, method: 'get', payload: { pageNumber, pageSize: 10, ...FilterData, buildingId: user.userInfo.person.buildingId } }).then((res) => {
101
+    fetch({ url: API_MANAGE_CUSTOMER_LIST, method: 'get', payload: { pageNumber, pageSize: 10, ...FilterData, buildingId: CurrentBuildingId } }).then((res) => {
76
       setPageList(pageNumber === 1 ? res.records || [] : PageList.concat(res.records || []))
102
       setPageList(pageNumber === 1 ? res.records || [] : PageList.concat(res.records || []))
77
       setHasNextPage(res.current < res.pages)
103
       setHasNextPage(res.current < res.pages)
78
       setPull(false)
104
       setPull(false)
95
     }
121
     }
96
   }, [IsPull])
122
   }, [IsPull])
97
 
123
 
124
+  const PickerChange = (e) => {
125
+    setCurrentBuildingId(BuildingIds[e.detail.value - 0].buildingId)
126
+    setCurrentBuildingName(BuildingIds[e.detail.value - 0].name)
127
+  }
128
+
98
   const SearchConfirm = (e) => {
129
   const SearchConfirm = (e) => {
99
     setFilterData({ ...FilterData, keywords: e.detail.value })
130
     setFilterData({ ...FilterData, keywords: e.detail.value })
100
   }
131
   }
102
   return (
133
   return (
103
     <view className='Page residentManager flex-v'>
134
     <view className='Page residentManager flex-v'>
104
 
135
 
105
-      <view className='Search'>
106
-        <view>
136
+      <view className='Search flex-h'>
137
+        <view className='flex-item'>
107
           <text className='iconfont icon-sousuo'></text>
138
           <text className='iconfont icon-sousuo'></text>
108
           <Input confirm-type='search' placeholder='请输入关键字搜索' onConfirm={SearchConfirm} onscrolltolower={PageLoadMore}></Input>
139
           <Input confirm-type='search' placeholder='请输入关键字搜索' onConfirm={SearchConfirm} onscrolltolower={PageLoadMore}></Input>
109
         </view>
140
         </view>
141
+        <text>{CurrentBuildingName}</text>
142
+        <picker value={0} range-key='name' onChange={PickerChange} range={BuildingIds}>
143
+          <view class='picker'>更换</view>
144
+        </picker>
110
       </view>
145
       </view>
111
 
146
 
112
       <view className='flex-item'>
147
       <view className='flex-item'>

+ 17
- 1
src/pages/mine/residentManager/index.scss View File

3
   position: relative;
3
   position: relative;
4
   overflow: hidden;
4
   overflow: hidden;
5
   >.Search {
5
   >.Search {
6
-    padding: 0 50px 20px;
6
+    padding: 0 30px 20px;
7
     position: relative;
7
     position: relative;
8
     overflow: hidden;
8
     overflow: hidden;
9
     margin-top: 20px;
9
     margin-top: 20px;
10
+    align-items: center;
10
     >view {
11
     >view {
11
       position: relative;
12
       position: relative;
12
       overflow: hidden;
13
       overflow: hidden;
32
         text-align: left;
33
         text-align: left;
33
       }
34
       }
34
     }
35
     }
36
+    >text {
37
+      font-size: 28px;
38
+      line-height: 40px;
39
+      max-width: 160px;
40
+      white-space: nowrap;
41
+      overflow: hidden;
42
+      text-overflow: ellipsis;
43
+      margin-left: 20px;
44
+      margin-right: 10px;
45
+    }
46
+    .picker {
47
+      font-size: 28px;
48
+      line-height: 40px;
49
+      color: #193C83;
50
+    }
35
   }
51
   }
36
   > .flex-item {
52
   > .flex-item {
37
     position: relative;
53
     position: relative;

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

2
   User: [ // 普通用户
2
   User: [ // 普通用户
3
     [
3
     [
4
       { name: '推荐客户', icon: require('../../assets/mine-icon8.png'), router: '/pages/mine/addCustomer/index?type=customer' },
4
       { name: '推荐客户', icon: require('../../assets/mine-icon8.png'), router: '/pages/mine/addCustomer/index?type=customer' },
5
-      { name: '成为驻场管理', icon: require('../../assets/mine-icon8.png'), router: '/pages/mine/toBeManager/index' }
6
     ],
5
     ],
7
     [
6
     [
8
       { 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' },
15
       { name: '意见反馈', icon: require('../../assets/mine-icon16.png'), router: '/pages/mine/feedBack/index' }
14
       { name: '意见反馈', icon: require('../../assets/mine-icon16.png'), router: '/pages/mine/feedBack/index' }
16
     ],
15
     ],
17
     [
16
     [
17
+      { name: '成为驻场管理', icon: require('../../assets/mine-icon8.png'), router: '/pages/mine/toBeManager/index' },
18
       { name: '成为置业顾问', icon: require('../../assets/mine-icon4.png'), router: 'propertyConsultant' },
18
       { name: '成为置业顾问', icon: require('../../assets/mine-icon4.png'), router: 'propertyConsultant' },
19
       { name: '成为专业经纪人', icon: require('../../assets/mine-icon2.png'), router: null }
19
       { name: '成为专业经纪人', icon: require('../../assets/mine-icon2.png'), router: null }
20
     ]
20
     ]
60
   ],
60
   ],
61
   Resident: [ // 驻场管理
61
   Resident: [ // 驻场管理
62
     [
62
     [
63
-      // { name: '推荐客户', icon: require('../../assets/mine-icon8.png'), router: '/pages/mine/addCustomer/index?type=manager' },
63
+      { name: '绑定楼盘码', icon: require('../../assets/mine-icon8.png'), router: '/pages/mine/toBeManager/index' },
64
       { name: '驻场管理', icon: require('../../assets/mine-icon17.png'), router: '/pages/mine/residentManager/index' }
64
       { name: '驻场管理', icon: require('../../assets/mine-icon17.png'), router: '/pages/mine/residentManager/index' }
65
     ],
65
     ],
66
     [
66
     [

+ 1
- 3
src/pages/mine/toBeManager/index.jsx View File

4
 import { ScrollView, Input } from '@tarojs/components'
4
 import { ScrollView, Input } from '@tarojs/components'
5
 import { fetch } from '@/utils/request'
5
 import { fetch } from '@/utils/request'
6
 import { API_TOBE_MANAGER } from '@/constants/api'
6
 import { API_TOBE_MANAGER } from '@/constants/api'
7
-import login from '@/utils/login'
8
 import './index.scss'
7
 import './index.scss'
9
 
8
 
10
 export default withLayout(() => {
9
 export default withLayout(() => {
15
     if (Code !== '') {
14
     if (Code !== '') {
16
       fetch({ url: API_TOBE_MANAGER, method: 'post', payload: { marketingCode: Code } }).then((res) => {
15
       fetch({ url: API_TOBE_MANAGER, method: 'post', payload: { marketingCode: Code } }).then((res) => {
17
         Taro.showToast({
16
         Taro.showToast({
18
-          title: '提交成功',
17
+          title: '绑定成功',
19
           icon: 'none'
18
           icon: 'none'
20
         })
19
         })
21
-        login({ path: '', scene: '' })
22
       })
20
       })
23
     } else {
21
     } else {
24
       Taro.showToast({
22
       Taro.showToast({