Your Name 3 years ago
parent
commit
381ef56f8b

+ 1
- 1
config/prod.js View File

@@ -10,7 +10,7 @@ module.exports = {
10 10
     OSS_PATH: '"https://xlk-assets.oss-accelerate.aliyuncs.com/"',
11 11
     OSS_FAST_PATH: '"https://xlk-assets.oss-accelerate.aliyuncs.com/"',
12 12
     ICON_FONT: '"https://yz-websit.oss-cn-hangzhou.aliyuncs.com/xlk/css/iconfont.ttf"',
13
-    Version: '"V0.0.51-20210813"'
13
+    Version: '"V0.0.53-20210813"'
14 14
   },
15 15
   mini: {},
16 16
   h5: {

+ 5
- 2
src/pages/index/buildingDetail/components/DetailBottom/index.jsx View File

@@ -3,12 +3,14 @@ import Taro from '@tarojs/taro'
3 3
 import { useSelector } from 'react-redux'
4 4
 import { Image } from '@tarojs/components'
5 5
 import { queryActivityList } from '@/services/activity'
6
+import { ROLE_CODE } from '@/constants/user'
6 7
 import './index.scss'
7 8
 
8 9
 export default function DetailBottom (props) {
9 10
   const { Info = {}, onPoster } = props
10 11
 
11 12
   const user = useSelector(state => state.user)
13
+  const { personType } = user.userInfo.person
12 14
 
13 15
   // 当前推荐置业
14 16
   const { consultant } = useSelector(s => s.system)
@@ -39,11 +41,12 @@ export default function DetailBottom (props) {
39 41
   }
40 42
 
41 43
   const handleRecommender = () => {
42
-    if (user.userInfo.person.personType === 'Realty Consultant') {
44
+
45
+    if (personType === ROLE_CODE.CUSTOMER) {
43 46
       const params = `buildingId=${Info?.buildingId}&buildingName=${Info?.buildingName}`
44 47
 
45 48
       Taro.navigateTo({
46
-        url: `/pages/mine/addCustomer/index?type=consultant&${params}`
49
+        url: `/pages/mine/addCustomer/index?type=${personType}&${params}`
47 50
       })
48 51
     } else {
49 52
       Taro.showToast({ title: '该功能暂不能为您提供服务', icon: 'none', duration: 2000 })

+ 2
- 1
src/pages/mine/addCustomer/components/BuildingPicker.jsx View File

@@ -2,6 +2,7 @@ import { useEffect, useState } from 'react'
2 2
 import Picker from '@/components/Picker'
3 3
 import { fetch } from '@/utils/request'
4 4
 import { API_GET_AGENT_BUILDINGS, API_ITEMS_LIST } from '@/constants/api'
5
+import { ROLE_CODE } from '@/constants/user'
5 6
 
6 7
 export default (props) => {
7 8
 
@@ -9,7 +10,7 @@ export default (props) => {
9 10
   const [dicts, setDicts] = useState([])
10 11
 
11 12
   useEffect(() => {
12
-    if (type === 'customer') {
13
+    if (type === ROLE_CODE.CUSTOMER) {
13 14
       fetch({ url: API_ITEMS_LIST, payload: { pageNumber: 1, pageSize: 1000 } }).then((res) => {
14 15
         setDicts(res.records || [])
15 16
       })

+ 7
- 6
src/pages/mine/addCustomer/index.jsx View File

@@ -21,8 +21,8 @@ const sexDicts = [
21 21
 
22 22
 export default withLayout((props) => {
23 23
   const { router, person } = props
24
-  const { type } = router.params
25 24
   const { personId, personType } = person
25
+  const { buildingId : originBuiding } = router.params
26 26
 
27 27
   const [loading, setLoading] = useState(false)
28 28
   const [buildingId, setBuildingId] = useState(null)
@@ -40,10 +40,11 @@ export default withLayout((props) => {
40 40
   const postSubmit = getSubmitor(person)
41 41
 
42 42
   useEffect(() => {
43
-    if(buildingId) {
44
-
43
+    console.log('------originBuiding------>', originBuiding)
44
+    if(originBuiding) {
45
+      setBuildingId(originBuiding)
45 46
     }
46
-  }, [buildingId])
47
+  }, [originBuiding])
47 48
 
48 49
   const preSubmit = (payload) => {
49 50
     if (payload.name === '') {
@@ -142,12 +143,12 @@ export default withLayout((props) => {
142 143
           </view>
143 144
 
144 145
           {
145
-            type !== 'consultant' &&
146
+            personType !== ROLE_CODE.CONSULTANT &&
146 147
             <Block>
147 148
               <text>意向楼盘</text>
148 149
               <view className='FormLine flex-h'>
149 150
                 <view className='flex-item'>
150
-                  <BuildingPicker change={BuildingChange} value={buildingId} type={type} />
151
+                  <BuildingPicker change={BuildingChange} value={buildingId} type={personType} />
151 152
                 </view>
152 153
               </view>
153 154