Ver código fonte

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

1002884655 3 anos atrás
pai
commit
a2291bcd09

+ 2
- 2
config/dev.js Ver arquivo

3
     NODE_ENV: '"development"'
3
     NODE_ENV: '"development"'
4
   },
4
   },
5
   defineConstants: {
5
   defineConstants: {
6
-    HOST: '"https://xlk.njyz.tech"',
7
-    // HOST: '"http://127.0.0.1:8081"',
6
+    // HOST: '"https://xlk.njyz.tech"',
7
+    HOST: '"http://127.0.0.1:8081"',
8
     WSS_HOST: '"ws://127.0.0.1:8081"',
8
     WSS_HOST: '"ws://127.0.0.1:8081"',
9
     OSS_PATH: '"https://xlk-assets.oss-accelerate.aliyuncs.com/"',
9
     OSS_PATH: '"https://xlk-assets.oss-accelerate.aliyuncs.com/"',
10
     OSS_FAST_PATH: '"https://xlk-assets.oss-accelerate.aliyuncs.com/"',
10
     OSS_FAST_PATH: '"https://xlk-assets.oss-accelerate.aliyuncs.com/"',

+ 6
- 0
src/constants/api.js Ver arquivo

296
 
296
 
297
 // 系统参数
297
 // 系统参数
298
 export const API_SYSTEM_PARAM = resolvePath('sysOrgParams')
298
 export const API_SYSTEM_PARAM = resolvePath('sysOrgParams')
299
+
300
+// 渠道-龙虎榜
301
+export const API_CHANNEL_RANK = resolvePath('ranklist')
302
+
303
+// 获取报备客户详情
304
+export const API_CHANNEL_CUSTOMER_DETAIL = resolvePath('channelCustomer')

+ 1
- 0
src/pages/mine/components/MyActivityListItem/index.jsx Ver arquivo

4
 
4
 
5
 export default function MyActivityListItem (props) {
5
 export default function MyActivityListItem (props) {
6
   const { Data = {} } = props
6
   const { Data = {} } = props
7
+
7
   return (
8
   return (
8
     <view className='components MyActivityListItem' onClick={() => { Taro.navigateTo({ url: `/pages/index/activityDetail/index?id=${Data.id}` }) }}>
9
     <view className='components MyActivityListItem' onClick={() => { Taro.navigateTo({ url: `/pages/index/activityDetail/index?id=${Data.id}` }) }}>
9
       <view className='Img'>
10
       <view className='Img'>

+ 7
- 1
src/pages/mine/components/MyCustomerListItem/index.jsx Ver arquivo

10
   const { expirationDate, customerStatus } = data
10
   const { expirationDate, customerStatus } = data
11
   const expStr = expirationDate && customerStatus === '1' ? `${expirationDate.substring(0, 10)} 回收` : ''
11
   const expStr = expirationDate && customerStatus === '1' ? `${expirationDate.substring(0, 10)} 回收` : ''
12
 
12
 
13
+  const gotoDetail = () => {
14
+    const id = data.channelCustomerId || data.customerId
15
+    const url = `/pages/mine/myCustomerDetail/index?id=${id}`
16
+    Taro.navigateTo({ url })
17
+  }
18
+
13
   return (
19
   return (
14
-    <view className='components MyCustomerListItem flex-h' onClick={() => { Taro.navigateTo({ url: `/pages/mine/myCustomerDetail/index?id=${data.customerId}` }) }}>
20
+    <view className='components MyCustomerListItem flex-h' onClick={gotoDetail}>
15
       <view className='Img'>
21
       <view className='Img'>
16
         <Image mode='scaleToFill' src={data.avatarurl}></Image>
22
         <Image mode='scaleToFill' src={data.avatarurl}></Image>
17
       </view>
23
       </view>

+ 27
- 15
src/pages/mine/customerDetail/index.jsx Ver arquivo

5
 import { Image, Textarea } from '@tarojs/components'
5
 import { Image, Textarea } from '@tarojs/components'
6
 import { fetch } from '@/utils/request'
6
 import { fetch } from '@/utils/request'
7
 import { API_GET_CUSTOMER_INFO, API_FOLLOW_LIST } from '@/constants/api'
7
 import { API_GET_CUSTOMER_INFO, API_FOLLOW_LIST } from '@/constants/api'
8
+import { getCustomerDetail, addFollowRecord } from '@/services/person'
8
 import { getImgURL } from '@/utils/image'
9
 import { getImgURL } from '@/utils/image'
10
+import { BIZ_STATUS } from '@/constants/user'
9
 import './index.scss'
11
 import './index.scss'
10
 import UserDetailBasicInfo from '../components/UserDetailBasicInfo/index'
12
 import UserDetailBasicInfo from '../components/UserDetailBasicInfo/index'
11
 import UserDetailViewRecord from '../components/UserDetailViewRecord/index'
13
 import UserDetailViewRecord from '../components/UserDetailViewRecord/index'
13
 import UserDetailFollowRecord from '../components/UserDetailFollowRecord/index'
15
 import UserDetailFollowRecord from '../components/UserDetailFollowRecord/index'
14
 
16
 
15
 export default withLayout((props) => {
17
 export default withLayout((props) => {
18
+  const { router, person } = props
19
+  const { id : CustomerId,  } = router.params
16
 
20
 
17
-  const { name, sex, phone, avatarurl, status } = props.router.params
18
-  const [CustomerId] = useState(props.router.params.id)
21
+  const [custBaseInfo, setCustBaseInfo] = useState({})
19
   const [CustomerInfo, setCustomerInfo] = useState({})
22
   const [CustomerInfo, setCustomerInfo] = useState({})
20
   const [ShowAddFollow, setShowAddFollow] = useState(false)
23
   const [ShowAddFollow, setShowAddFollow] = useState(false)
21
   const [MenuList] = useState([
24
   const [MenuList] = useState([
28
   const [FollowContent, setFollowContent] = useState('')
31
   const [FollowContent, setFollowContent] = useState('')
29
   const [FollowAddCounts, setFollowAddCounts] = useState(0)
32
   const [FollowAddCounts, setFollowAddCounts] = useState(0)
30
 
33
 
31
-  useEffect(() => {
32
-    if (CustomerId) {
33
-      UpdateCustomerInfo()
34
-    }
35
-  }, [CustomerId])
36
-
37
   const UpdateCustomerInfo = () => {
34
   const UpdateCustomerInfo = () => {
38
     fetch({ url: `${API_GET_CUSTOMER_INFO}${CustomerId}` }).then((res) => {
35
     fetch({ url: `${API_GET_CUSTOMER_INFO}${CustomerId}` }).then((res) => {
39
       if (res) {
36
       if (res) {
57
   }
54
   }
58
 
55
 
59
   const SaveFollow = () => {
56
   const SaveFollow = () => {
60
-    fetch({ url: API_FOLLOW_LIST, method: 'post', payload: { recordType: '添加跟进', recordContent: FollowContent, customerSex: CustomerInfo.sex, customerId: CustomerId } }).then((res) => {
57
+    const payload = {
58
+      recordType: '添加跟进',
59
+      recordContent: FollowContent,
60
+      customerSex: CustomerInfo.sex,
61
+      customerId: CustomerId,
62
+    }
63
+    addFollowRecord(payload).then((res) => {
61
       Taro.showToast({
64
       Taro.showToast({
62
         title: '添加跟进成功',
65
         title: '添加跟进成功',
63
         icon: 'none'
66
         icon: 'none'
80
     setFollowContent('')
83
     setFollowContent('')
81
   }
84
   }
82
 
85
 
86
+  useEffect(() => {
87
+    if (CustomerId) {
88
+      UpdateCustomerInfo()
89
+
90
+      getCustomerDetail(CustomerId).then((res) => setCustBaseInfo(res || {}))
91
+    }
92
+  }, [CustomerId])
93
+
94
+
83
   return (
95
   return (
84
     <view className='Page customerDetail flex-v'>
96
     <view className='Page customerDetail flex-v'>
85
 
97
 
89
             <view className='centerLabel'>
101
             <view className='centerLabel'>
90
               <view className='flex-h'>
102
               <view className='flex-h'>
91
                 <view className='Icon'>
103
                 <view className='Icon'>
92
-                  <Image mode='aspectFill' src={getImgURL(CustomerInfo.avatarurl || avatarurl)}></Image>
104
+                  <Image mode='aspectFill' src={getImgURL(custBaseInfo.avatarurl)}></Image>
93
                 </view>
105
                 </view>
94
                 <view className='flex-item'>
106
                 <view className='flex-item'>
95
                   <view>
107
                   <view>
96
-                    <text>{CustomerInfo.name || name}</text>
97
-                    <text className={CustomerInfo.sex - 0 === 1 || sex - 0 === 1 ? 'iconfont icon-nanxing' : 'iconfont icon-nvxing'}></text>
108
+                    <text>{custBaseInfo.name}</text>
109
+                    <text className={custBaseInfo.sex - 0 === 1 ? 'iconfont icon-nanxing' : 'iconfont icon-nvxing'}></text>
98
                   </view>
110
                   </view>
99
-                  <text>{CustomerInfo.phone || phone}</text>
111
+                  <text>{custBaseInfo.phone}</text>
100
                 </view>
112
                 </view>
101
                 <text className='iconfont icon-liaotian'></text>
113
                 <text className='iconfont icon-liaotian'></text>
102
-                <text className='iconfont icon-dianhua' onClick={() => { Taro.makePhoneCall({ phoneNumber: CustomerInfo.phone || phone }) }}></text>
114
+                <text className='iconfont icon-dianhua' onClick={() => { Taro.makePhoneCall({ phoneNumber: custBaseInfo.phone }) }}></text>
103
               </view>
115
               </view>
104
             </view>
116
             </view>
105
-            <text className='Status'>{status - 0 === 1 || status - 0 === 0 ? '已报备' : status - 0 === 2 ? '已到访' : status - 0 === 3 ? '已认筹' : '已签约'}</text>
117
+            <text className='Status'>{BIZ_STATUS[custBaseInfo.status] || '报备'}</text>
106
             <text className='Tips'>NEW</text>
118
             <text className='Tips'>NEW</text>
107
             <text className='Tips'>NEW</text>
119
             <text className='Tips'>NEW</text>
108
           </view>
120
           </view>

+ 15
- 18
src/pages/mine/myCustomerDetail/index.jsx Ver arquivo

1
 import React, { useState, useEffect } from 'react'
1
 import React, { useState, useEffect } from 'react'
2
 import withLayout from '@/layout'
2
 import withLayout from '@/layout'
3
-import './index.scss'
3
+import { getChannelCustomerDetail } from '@/services/person'
4
 import { ScrollView, Image } from '@tarojs/components'
4
 import { ScrollView, Image } from '@tarojs/components'
5
 import '@/assets/css/iconfont.css'
5
 import '@/assets/css/iconfont.css'
6
+import './index.scss'
7
+import { ROLE_CODE } from '@/constants/user'
6
 
8
 
7
 export default withLayout((props) => {
9
 export default withLayout((props) => {
10
+  const { router, person } = props
11
+  const { id } = router.params
8
 
12
 
9
-  // const [PageProps] = useState(props)
10
-  const [IsPull, setPull] = useState(false)
11
-  const [PullTimer, setPullTimer] = useState(null)
12
-
13
-  const PageRefresh = () => { // 页面下拉刷新回调
14
-    setPull(true)
15
-  }
13
+  const [custBaseInfo, setCustBaseInfo] = useState({})
16
 
14
 
17
-  useEffect(() => { // 下拉刷新触发
18
-    if (IsPull) {
19
-      clearTimeout(PullTimer)
20
-      setPullTimer(setTimeout(() => {
21
-        setPull(false)
22
-      }, 2000))
15
+  useEffect(() => {
16
+    if (id) {
17
+      if (person.personType === ROLE_CODE.CHANNEL_AGENT) {
18
+        getChannelCustomerDetail(id).then((res) => setCustBaseInfo(res || {}))
19
+      }
23
     }
20
     }
24
-  }, [IsPull])
21
+  }, [id, person])
25
 
22
 
26
   return (
23
   return (
27
     <view className='Page myCustomerDetail'>
24
     <view className='Page myCustomerDetail'>
28
 
25
 
29
-      <ScrollView scroll-y={true} refresher-enabled={true} refresher-triggered={IsPull} onrefresherrefresh={PageRefresh} refresher-background='#f8f8f8'>
26
+      <ScrollView scrollY>
30
         <view className='PageContent'>
27
         <view className='PageContent'>
31
 
28
 
32
           {/* 基本信息 */}
29
           {/* 基本信息 */}
40
                   <Image mode='aspectFill' src={null}></Image>
37
                   <Image mode='aspectFill' src={null}></Image>
41
                 </view>
38
                 </view>
42
                 <view className='flex-item'>
39
                 <view className='flex-item'>
43
-                  <text>范丞丞</text>
44
-                  <text>136 1394 9434</text>
40
+                  <text>{custBaseInfo.name}</text>
41
+                  <text>{custBaseInfo.phone}</text>
45
                 </view>
42
                 </view>
46
                 <text className='iconfont icon-jiantouright'></text>
43
                 <text className='iconfont icon-jiantouright'></text>
47
               </view>
44
               </view>

+ 34
- 16
src/pages/mine/partnerChannel/index.jsx Ver arquivo

1
 import React, { useState, useEffect } from 'react'
1
 import React, { useState, useEffect } from 'react'
2
 import withLayout from '@/layout'
2
 import withLayout from '@/layout'
3
-import './index.scss'
4
 import { ScrollView, Image } from '@tarojs/components'
3
 import { ScrollView, Image } from '@tarojs/components'
4
+import { getChannelRank } from '@/services/agent'
5
+import { fetch } from '@/utils/request'
6
+import { API_GET_AGENT_BUILDINGS } from '@/constants/api'
5
 import '@/assets/css/iconfont.css'
7
 import '@/assets/css/iconfont.css'
8
+import './index.scss'
6
 
9
 
7
 export default withLayout((props) => {
10
 export default withLayout((props) => {
8
-
9
-  // const [PageProps] = useState(props)
10
-  const [RankingList, setRankingList] = useState([
11
-    { name: '范丞丞', id: '', icon: '', num: '5', department: '销售部' },
12
-    { name: '范丞丞', id: '', icon: '', num: '6', department: '销售部' },
13
-    { name: '范丞丞', id: '', icon: '', num: '3', department: '销售部' }
14
-  ])
11
+  
12
+  const [buildingId, setBuildingId] = useState()
13
+  const [buildingList, setBuildingList] = useState([])
14
+  const [rankList, setRankList] = useState([])
15
   const [IsPull, setPull] = useState(false)
15
   const [IsPull, setPull] = useState(false)
16
   const [PullTimer, setPullTimer] = useState(null)
16
   const [PullTimer, setPullTimer] = useState(null)
17
 
17
 
28
     }
28
     }
29
   }, [IsPull])
29
   }, [IsPull])
30
 
30
 
31
+  useEffect(() => {
32
+    fetch({ url: API_GET_AGENT_BUILDINGS }).then((res) => {
33
+      const buildings = res || []
34
+      setBuildingList(buildings)
35
+      if (buildings.length) {
36
+        setBuildingId(buildings[0].buildingId)
37
+      }
38
+    })
39
+  }, [])
40
+
41
+  useEffect(() => {
42
+    if (buildingId) {
43
+      getChannelRank({buildingId}).then((res) => {
44
+        setRankList(res || [])
45
+      })
46
+    }
47
+  }, [buildingId])
48
+
31
   return (
49
   return (
32
     <view className='Page partnerChannel'>
50
     <view className='Page partnerChannel'>
33
       <ScrollView scroll-y={true} refresher-enabled={true} refresher-triggered={IsPull} onrefresherrefresh={PageRefresh} refresher-background='#fff'>
51
       <ScrollView scroll-y={true} refresher-enabled={true} refresher-triggered={IsPull} onrefresherrefresh={PageRefresh} refresher-background='#fff'>
37
           <view className='Ranking'>
55
           <view className='Ranking'>
38
             <view className='Top flex-h'>
56
             <view className='Top flex-h'>
39
               <text className='flex-item'>龙虎榜</text>
57
               <text className='flex-item'>龙虎榜</text>
40
-              <Image mode='heightFix' src={require('../../../assets/mine-icon23.png')}></Image>
58
+              <Image mode='heightFix' src={require('@/assets/mine-icon23.png')}></Image>
41
             </view>
59
             </view>
42
             <view className='List flex-h'>
60
             <view className='List flex-h'>
43
               {
61
               {
44
-                RankingList.map((item, index) => (
62
+                rankList.map((item, index) => (
45
                   <view className={index === 1 ? 'flex-item active' : 'flex-item'} key={`ListItem-${index}`}>
63
                   <view className={index === 1 ? 'flex-item active' : 'flex-item'} key={`ListItem-${index}`}>
46
                     {
64
                     {
47
                       index === 0 &&
65
                       index === 0 &&
48
-                      <Image mode='heightFix' src={require('../../../assets/mine-icon21.png')}></Image>
66
+                      <Image mode='heightFix' src={require('@/assets/mine-icon21.png')}></Image>
49
                     }
67
                     }
50
                     {
68
                     {
51
                       index === 1 &&
69
                       index === 1 &&
52
-                      <Image mode='heightFix' src={require('../../../assets/mine-icon20.png')}></Image>
70
+                      <Image mode='heightFix' src={require('@/assets/mine-icon20.png')}></Image>
53
                     }
71
                     }
54
                     {
72
                     {
55
                       index === 2 &&
73
                       index === 2 &&
56
-                      <Image mode='heightFix' src={require('../../../assets/mine-icon22.png')}></Image>
74
+                      <Image mode='heightFix' src={require('@/assets/mine-icon22.png')}></Image>
57
                     }
75
                     }
58
                     <view className='Icon'>
76
                     <view className='Icon'>
59
-                      <Image mode='aspectFill' src={item.icon || null}></Image>
77
+                      <Image mode='aspectFill' src={item.avatarurl || null}></Image>
60
                     </view>
78
                     </view>
61
                     <view className='Index'>
79
                     <view className='Index'>
62
                       <text>{item.name}</text>
80
                       <text>{item.name}</text>
63
                       <text>{index === 0 ? 2 : index === 1 ? 1 : 3}</text>
81
                       <text>{index === 0 ? 2 : index === 1 ? 1 : 3}</text>
64
                     </view>
82
                     </view>
65
                     <view className='Num'>
83
                     <view className='Num'>
66
-                      <text>{item.department}</text>
67
-                      <text>{item.num}</text>
84
+                      <text></text>
85
+                      <text>{item.number}</text>
68
                     </view>
86
                     </view>
69
                   </view>
87
                   </view>
70
                 ))
88
                 ))

+ 4
- 2
src/services/agent.js Ver arquivo

5
   API_REGISTER_AGENT,
5
   API_REGISTER_AGENT,
6
   API_AGENT_CHANNEL,
6
   API_AGENT_CHANNEL,
7
   API_AGENT_CURRENT,
7
   API_AGENT_CURRENT,
8
-  API_EDIT_AGENT
9
-
8
+  API_EDIT_AGENT,
9
+  API_CHANNEL_RANK,
10
 } from '@/constants/api'
10
 } from '@/constants/api'
11
 
11
 
12
 
12
 
41
  */
41
  */
42
 export const editAgent = payload => fetch({ url: `${API_EDIT_AGENT}?name=${payload.name}&&avatar=${payload.avatar}&&phone=${payload.phone}`, method: 'PUT' })
42
 export const editAgent = payload => fetch({ url: `${API_EDIT_AGENT}?name=${payload.name}&&avatar=${payload.avatar}&&phone=${payload.phone}`, method: 'PUT' })
43
 
43
 
44
+
45
+export const getChannelRank = (payload) => fetch({ url: API_CHANNEL_RANK, payload })

+ 7
- 1
src/services/person.js Ver arquivo

14
   API_MORE_ACTIVITY,
14
   API_MORE_ACTIVITY,
15
   API_SHARE_LIST,
15
   API_SHARE_LIST,
16
   API_SHARE_INFOLIST,
16
   API_SHARE_INFOLIST,
17
-  API_BIND_CUSTOMER
17
+  API_BIND_CUSTOMER,
18
+  API_CHANNEL_CUSTOMER_DETAIL,
18
 } from '@/constants/api'
19
 } from '@/constants/api'
19
 
20
 
20
 
21
 
107
  */
108
  */
108
 export const getSharePersonInfoList = (payload) => fetch({ url: API_SHARE_INFOLIST, payload })
109
 export const getSharePersonInfoList = (payload) => fetch({ url: API_SHARE_INFOLIST, payload })
109
 
110
 
111
+/**
112
+ * 获取报备客户详情
113
+ * @param {*} customerId  
114
+ */
115
+export const getChannelCustomerDetail = (id) => fetch({ url: `${API_CHANNEL_CUSTOMER_DETAIL}/${id}` })
110
 
116
 
111
 
117