浏览代码

信息修改

1002884655 3 年前
父节点
当前提交
050be770b5
共有 2 个文件被更改,包括 13 次插入10 次删除
  1. 4
    2
      src/pages/mine/customerDetail/index.jsx
  2. 9
    8
      src/subpackages/pages/consultant/customerAnalyse/index.jsx

+ 4
- 2
src/pages/mine/customerDetail/index.jsx 查看文件

85
     if (CustomerId) {
85
     if (CustomerId) {
86
       UpdateCustomerInfo()
86
       UpdateCustomerInfo()
87
 
87
 
88
-      getCustomerDetail(CustomerId).then((res) => setCustBaseInfo(res || {}))
88
+      getCustomerDetail(CustomerId).then((res) => {
89
+        setCustBaseInfo(res || {})
90
+      })
89
     }
91
     }
90
   }, [CustomerId])
92
   }, [CustomerId])
91
 
93
 
148
           {/* 基本信息 */}
150
           {/* 基本信息 */}
149
           {
151
           {
150
             CurrentMenuId === 1 &&
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 查看文件

2
 import withLayout from '@/layout'
2
 import withLayout from '@/layout'
3
 import '@/assets/css/iconfont.css'
3
 import '@/assets/css/iconfont.css'
4
 import { ScrollView } from '@tarojs/components'
4
 import { ScrollView } from '@tarojs/components'
5
-import { useSelector } from 'react-redux'
6
 import { fetch } from '@/utils/request'
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
 import LineChart from './components/LineChart'
7
 import LineChart from './components/LineChart'
9
 // import dayjs from 'dayjs'
8
 // import dayjs from 'dayjs'
10
 import './index.scss'
9
 import './index.scss'
33
   const [source, setSource] = useState([])
32
   const [source, setSource] = useState([])
34
 
33
 
35
   useEffect(() => {
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
   useEffect(() => {
42
   useEffect(() => {
42
-    if(!ChartList.length) {
43
+    if (!ChartList.length) {
43
       GetChartInfo()
44
       GetChartInfo()
44
     } else {
45
     } else {
45
       // const chart = echarts.init(canvas, null, { width: '100%', height: '100%' })
46
       // const chart = echarts.init(canvas, null, { width: '100%', height: '100%' })
61
   }
62
   }
62
 
63
 
63
   const GetChartInfo = () => {
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
       const Arr = (res || []).reverse()
66
       const Arr = (res || []).reverse()
66
       setChartList(Arr.map(x => ({ name: x.day, value: x.customerNum })))
67
       setChartList(Arr.map(x => ({ name: x.day, value: x.customerNum })))
67
       setSource(Arr)
68
       setSource(Arr)