Kaynağa Gözat

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

Your Name 3 yıl önce
ebeveyn
işleme
718665acdc

+ 31
- 0
src/components/Adv/index.jsx Dosyayı Görüntüle

@@ -0,0 +1,31 @@
1
+import { useState, useEffect } from 'react'
2
+import { Image } from '@tarojs/components'
3
+import './style.scss'
4
+
5
+export default (props) => {
6
+
7
+  const { show = false } = props
8
+
9
+  const [ShowAdv, setShowAdv] = useState(show)
10
+
11
+  const ImgClick = () => {
12
+
13
+  }
14
+
15
+  const Close = () => {
16
+    setShowAdv(false)
17
+  }
18
+
19
+  return (
20
+    <view className='components Adv' style={{display: ShowAdv ? 'block' : 'none'}}>
21
+      <view className='centerLabel'>
22
+        <view>
23
+          <view className='Img' onClick={ImgClick}>
24
+            <Image mode='scaleToFill' src={null}></Image>
25
+          </view>
26
+          <text className='iconfont icon-guanbi' onClick={Close}></text>
27
+        </view>
28
+      </view>
29
+    </view>
30
+  )
31
+}

+ 36
- 0
src/components/Adv/style.scss Dosyayı Görüntüle

@@ -0,0 +1,36 @@
1
+.components.Adv {
2
+  width: 100%;
3
+  position: fixed;
4
+  top: 0;
5
+  left: 0;
6
+  bottom: 0;
7
+  z-index: 1000;
8
+  background: rgba(0, 0, 0, 0.6);
9
+  >view {
10
+    width: 100%;
11
+    >view {
12
+      padding: 0 134px;
13
+      position: relative;
14
+      overflow: hidden;
15
+      text-align: center;
16
+      >.Img {
17
+        width: 100%;
18
+        position: relative;
19
+        overflow: hidden;
20
+        padding-bottom: 150%;
21
+        background: #eee;
22
+        border-radius: 24px;
23
+        >image {
24
+          width: 100%;
25
+          height: 100%;
26
+        }
27
+      }
28
+      >text {
29
+        display: inline-block;
30
+        font-size: 60px;
31
+        color: #fff;
32
+        margin-top: 30px;
33
+      }
34
+    }
35
+  }
36
+}

+ 2
- 0
src/constants/api.js Dosyayı Görüntüle

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

+ 3
- 0
src/pages/index/index.jsx Dosyayı Görüntüle

@@ -4,6 +4,7 @@ import Taro from '@tarojs/taro'
4 4
 import { ScrollView } from '@tarojs/components'
5 5
 import withLayout from '@/layout'
6 6
 import ProjectListItem from '@/components/ProjectListItem/index'
7
+import Adv from '@/components/Adv/index'
7 8
 import { fetch } from '@/utils/request'
8 9
 import { API_BANNER_LIST, API_INDEX_PROJECTS } from '@/constants/api'
9 10
 
@@ -54,6 +55,8 @@ export default withLayout(() => {
54 55
   return (
55 56
     <view className='Page Index'>
56 57
 
58
+      <Adv show></Adv>
59
+
57 60
       <ScrollView scroll-y>
58 61
         <view className='PageContent'>
59 62
 

+ 2
- 2
src/pages/mine/components/ResidentListItem/index.jsx Dosyayı Görüntüle

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

+ 44
- 9
src/pages/mine/residentManager/index.jsx Dosyayı Görüntüle

@@ -4,7 +4,7 @@ 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_MANAGE_CUSTOMER_LIST } from '@/constants/api'
7
+import { API_MANAGE_CUSTOMER_LIST, API_MY_BUILDINGIDS } from '@/constants/api'
8 8
 import './index.scss'
9 9
 import ResidentListItem from '../components/ResidentListItem/index'
10 10
 
@@ -27,11 +27,14 @@ export default withLayout(() => {
27 27
   // }
28 28
 
29 29
   const user = useSelector(state => state.user)
30
+  const [BuildingIds, setBuildingIds] = useState([])
30 31
   const [PageList, setPageList] = useState([])
31 32
   const [IsPull, setPull] = useState(false)
32 33
   const [PersonId, setPersonId] = useState(null)
33 34
   const [pageNumber, setPageNumber] = useState(1)
34 35
   const [HasNextPage, setHasNextPage] = useState(true)
36
+  const [CurrentBuildingId, setCurrentBuildingId] = useState(null)
37
+  const [CurrentBuildingName, setCurrentBuildingName] = useState(null)
35 38
   const [FilterData, setFilterData] = useState({})
36 39
 
37 40
   useEffect(() => {
@@ -42,20 +45,43 @@ export default withLayout(() => {
42 45
 
43 46
   useEffect(() => {
44 47
     if (PersonId) {
45
-      GetPageList()
48
+      GetMyBuildingIds()
46 49
     }
47
-  }, [pageNumber, PersonId])
50
+  }, [PersonId])
48 51
 
49 52
   useEffect(() => {
50
-    if(FilterData.keywords) {
51
-      if(pageNumber === 1) {
53
+    if (FilterData.keywords) {
54
+      if (pageNumber === 1) {
52 55
         GetPageList()
53 56
       } else {
54
-        setPageNumber(2)
57
+        setPageNumber(1)
55 58
       }
56 59
     }
57 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 85
   // useEffect(() => {
60 86
   //   if(CurrentFilterMenuId) {
61 87
   //     if(pageNumber === 1) {
@@ -72,7 +98,7 @@ export default withLayout(() => {
72 98
 
73 99
   const GetPageList = () => {
74 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 102
       setPageList(pageNumber === 1 ? res.records || [] : PageList.concat(res.records || []))
77 103
       setHasNextPage(res.current < res.pages)
78 104
       setPull(false)
@@ -95,6 +121,11 @@ export default withLayout(() => {
95 121
     }
96 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 129
   const SearchConfirm = (e) => {
99 130
     setFilterData({ ...FilterData, keywords: e.detail.value })
100 131
   }
@@ -102,11 +133,15 @@ export default withLayout(() => {
102 133
   return (
103 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 138
           <text className='iconfont icon-sousuo'></text>
108 139
           <Input confirm-type='search' placeholder='请输入关键字搜索' onConfirm={SearchConfirm} onscrolltolower={PageLoadMore}></Input>
109 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 145
       </view>
111 146
 
112 147
       <view className='flex-item'>

+ 17
- 1
src/pages/mine/residentManager/index.scss Dosyayı Görüntüle

@@ -3,10 +3,11 @@
3 3
   position: relative;
4 4
   overflow: hidden;
5 5
   >.Search {
6
-    padding: 0 50px 20px;
6
+    padding: 0 30px 20px;
7 7
     position: relative;
8 8
     overflow: hidden;
9 9
     margin-top: 20px;
10
+    align-items: center;
10 11
     >view {
11 12
       position: relative;
12 13
       overflow: hidden;
@@ -32,6 +33,21 @@
32 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 52
   > .flex-item {
37 53
     position: relative;

+ 2
- 2
src/pages/mine/tabData.js Dosyayı Görüntüle

@@ -2,7 +2,6 @@ const MineMenuList = {
2 2
   User: [ // 普通用户
3 3
     [
4 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 7
       { name: '我的分享', icon: require('../../assets/mine-icon9.png'), router: '/pages/mine/myShare/index' },
@@ -15,6 +14,7 @@ const MineMenuList = {
15 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 18
       { name: '成为置业顾问', icon: require('../../assets/mine-icon4.png'), router: 'propertyConsultant' },
19 19
       { name: '成为专业经纪人', icon: require('../../assets/mine-icon2.png'), router: null }
20 20
     ]
@@ -60,7 +60,7 @@ const MineMenuList = {
60 60
   ],
61 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 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 Dosyayı Görüntüle

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