Browse Source

信息修改

1002884655 3 years ago
parent
commit
050be770b5

+ 4
- 2
src/pages/mine/customerDetail/index.jsx View File

@@ -85,7 +85,9 @@ export default withLayout((props) => {
85 85
     if (CustomerId) {
86 86
       UpdateCustomerInfo()
87 87
 
88
-      getCustomerDetail(CustomerId).then((res) => setCustBaseInfo(res || {}))
88
+      getCustomerDetail(CustomerId).then((res) => {
89
+        setCustBaseInfo(res || {})
90
+      })
89 91
     }
90 92
   }, [CustomerId])
91 93
 
@@ -148,7 +150,7 @@ export default withLayout((props) => {
148 150
           {/* 基本信息 */}
149 151
           {
150 152
             CurrentMenuId === 1 &&
151
-            <UserDetailBasicInfo CustomerId={CustomerId} CustomerInfo={CustomerInfo} AddFollow={AddFollow} Update={UpdateCustomerInfo}></UserDetailBasicInfo>
153
+            <UserDetailBasicInfo CustomerId={CustomerId} CustomerInfo={{...CustomerInfo, ...custBaseInfo}} AddFollow={AddFollow} Update={UpdateCustomerInfo}></UserDetailBasicInfo>
152 154
           }
153 155
 
154 156
           {/* 访问记录 */}

+ 9
- 8
src/subpackages/pages/consultant/customerAnalyse/index.jsx View File

@@ -2,9 +2,8 @@ import { useState, useEffect } from 'react'
2 2
 import withLayout from '@/layout'
3 3
 import '@/assets/css/iconfont.css'
4 4
 import { ScrollView } from '@tarojs/components'
5
-import { useSelector } from 'react-redux'
6 5
 import { fetch } from '@/utils/request'
7
-import { API_SEX_INFO, API_ECHERTS_DAILY } from '@/constants/api'
6
+import { API_SEX_INFO, API_ECHERTS_DAILY, API_ECHERTS_MONTH } from '@/constants/api'
8 7
 import LineChart from './components/LineChart'
9 8
 // import dayjs from 'dayjs'
10 9
 import './index.scss'
@@ -33,13 +32,15 @@ export default withLayout((props) => {
33 32
   const [source, setSource] = useState([])
34 33
 
35 34
   useEffect(() => {
36
-    setChartList([])
37
-    GetSexInfo()
38
-    GetChartInfo()
39
-  }, [CurrentMenuId])
35
+    if (CurrentChartMenuId && CurrentMenuId) {
36
+      setChartList([])
37
+      GetSexInfo()
38
+      GetChartInfo()
39
+    }
40
+  }, [CurrentChartMenuId, CurrentMenuId])
40 41
 
41 42
   useEffect(() => {
42
-    if(!ChartList.length) {
43
+    if (!ChartList.length) {
43 44
       GetChartInfo()
44 45
     } else {
45 46
       // const chart = echarts.init(canvas, null, { width: '100%', height: '100%' })
@@ -61,7 +62,7 @@ export default withLayout((props) => {
61 62
   }
62 63
 
63 64
   const GetChartInfo = () => {
64
-    fetch({ url: `${API_ECHERTS_DAILY}/${CurrentMenuId === 1 ? 'new' : CurrentMenuId === 2 ? 'follow' : 'visite'}`, method: 'get' }).then((res) => {
65
+    fetch({ url: `${CurrentChartMenuId === 1 ? API_ECHERTS_DAILY : API_ECHERTS_MONTH}/${CurrentMenuId === 1 ? 'new' : CurrentMenuId === 2 ? 'follow' : 'visite'}`, method: 'get' }).then((res) => {
65 66
       const Arr = (res || []).reverse()
66 67
       setChartList(Arr.map(x => ({ name: x.day, value: x.customerNum })))
67 68
       setSource(Arr)