傅行帆 vor 5 Jahren
Ursprung
Commit
776e895644

+ 16
- 0
src/pages/channel/newCustomer/index.jsx Datei anzeigen

53
     const toVisitNum = (record) => {
53
     const toVisitNum = (record) => {
54
         router.push({
54
         router.push({
55
             pathname: '/channel/newCustomer/visitNum',
55
             pathname: '/channel/newCustomer/visitNum',
56
+            query: {
57
+                channelId: record.channelId,
58
+                targetName: record.targetName,
59
+                targetId: record.targetId,
60
+                targetType: record.targetType,
61
+                buildingId: record.buildingId,
62
+                visitNum: record.visitNum,
63
+              },
56
         });
64
         });
57
     }
65
     }
58
 
66
 
59
     const toPersonNum = (record) => {
67
     const toPersonNum = (record) => {
60
         router.push({
68
         router.push({
61
             pathname: '/channel/newCustomer/personNum',
69
             pathname: '/channel/newCustomer/personNum',
70
+            query: {
71
+                channelId: record.channelId,
72
+                targetName: record.targetName,
73
+                targetId: record.targetId,
74
+                targetType: record.targetType,
75
+                buildingId: record.buildingId,
76
+                visitPersons: record.visitPersons,
77
+              },
62
         });
78
         });
63
     }
79
     }
64
 
80
 

+ 11
- 14
src/pages/channel/newCustomer/personNum.jsx Datei anzeigen

16
 ]
16
 ]
17
 
17
 
18
 const dataRecord = props => {
18
 const dataRecord = props => {
19
-    //   const [data, setData] = useState({})
20
-    //   const activityId = props.id
21
-    //   const activityType = props.type
19
+      const [data, setData] = useState({})
20
+      const { targetId, targetType, channelId, targetName, buildingId, visitPersons } = props.location.query
22
 
21
 
23
     useEffect(() => {
22
     useEffect(() => {
24
         getList({ pageNum: 1, pageSize: 10 })
23
         getList({ pageNum: 1, pageSize: 10 })
26
     }, [])
25
     }, [])
27
 
26
 
28
     const getList = params => {
27
     const getList = params => {
29
-        // console.log(params)
30
-        // request({ ...apis.activityDataStatis.activityAddRegist, params: { ...params, activityId: activityId, activityType: activityType, ...date } }).then(data => {
31
-        //   console.log(data)
32
-        //   props.getData()
33
-        //   setData(data)
34
-        // }).catch(e => {
35
-        //   console.log(e)
36
-        // })
28
+        console.log(params)
29
+        request({ ...apis.channelList.personNumList, params: { ...params, targetId: targetId,targetType: targetType,channelId: channelId,buildingId: buildingId} }).then(data => {
30
+          setData(data)
31
+        }).catch(e => {
32
+          console.log(e)
33
+        })
37
     }
34
     }
38
 
35
 
39
     const columns = [
36
     const columns = [
97
     return <>
94
     return <>
98
         <div>
95
         <div>
99
             <div>
96
             <div>
100
-                <span>内容{}</span>
97
+                <span>内容{targetName}</span>
101
                 <Button style={{ float: 'right', zIndex: 1 }} onClick={() => router.go(-1)}>
98
                 <Button style={{ float: 'right', zIndex: 1 }} onClick={() => router.go(-1)}>
102
                     返回
99
                     返回
103
                </Button>
100
                </Button>
104
             </div>
101
             </div>
105
             <div style={{ marginTop: '20px'  }}>
102
             <div style={{ marginTop: '20px'  }}>
106
-                <span>访问人数{}</span>
103
+                <span>访问人数:{visitPersons}</span>
107
                 <Button type="primary" style={{ float: 'right', marginBottom: '20px', zIndex: 1 }} onClick={exportActivityStats}>导出</Button>
104
                 <Button type="primary" style={{ float: 'right', marginBottom: '20px', zIndex: 1 }} onClick={exportActivityStats}>导出</Button>
108
             </div>
105
             </div>
109
-            <Table style={{ marginTop: '30px' }} dataSource={data} columns={columns} pagination={false} rowKey="activityList" />
106
+            <Table style={{ marginTop: '30px' }} dataSource={data.records || []} columns={columns} pagination={false} rowKey="activityList" />
110
             {/* <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
107
             {/* <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
111
         <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current} />
108
         <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current} />
112
       </div> */}
109
       </div> */}

+ 15
- 17
src/pages/channel/newCustomer/visitNum.jsx Datei anzeigen

16
 ]
16
 ]
17
 
17
 
18
 const dataRecord = props => {
18
 const dataRecord = props => {
19
-    //   const [data, setData] = useState({})
20
-    //   const activityId = props.id
21
-    //   const activityType = props.type
19
+    const [data, setData] = useState({})
20
+    const { targetId, targetType, channelId, targetName, buildingId, visitNum } = props.location.query
22
 
21
 
23
     useEffect(() => {
22
     useEffect(() => {
24
         getList({ pageNum: 1, pageSize: 10 })
23
         getList({ pageNum: 1, pageSize: 10 })
26
     }, [])
25
     }, [])
27
 
26
 
28
     const getList = params => {
27
     const getList = params => {
29
-        // console.log(params)
30
-        // request({ ...apis.activityDataStatis.activityAddRegist, params: { ...params, activityId: activityId, activityType: activityType, ...date } }).then(data => {
31
-        //   console.log(data)
32
-        //   props.getData()
33
-        //   setData(data)
34
-        // }).catch(e => {
35
-        //   console.log(e)
36
-        // })
28
+        console.log(params)
29
+        request({ ...apis.channelList.visitNumList, params: { ...params, targetId: targetId,targetType: targetType,channelId: channelId,buildingId: buildingId } }).then(data => {
30
+          console.log(data)
31
+          setData(data)
32
+        }).catch(e => {
33
+          console.log(e)
34
+        })
37
     }
35
     }
38
 
36
 
39
     const columns = [
37
     const columns = [
62
             align: 'center',
60
             align: 'center',
63
         },
61
         },
64
         {
62
         {
65
-            title: '访问次数',
66
-            dataIndex: 'personFrom',
67
-            key: 'personFrom',
63
+            title: '访问时间',
64
+            dataIndex: 'visitDate',
65
+            key: 'visitDate',
68
             align: 'center',
66
             align: 'center',
69
         },
67
         },
70
 
68
 
97
     return <>
95
     return <>
98
         <div>
96
         <div>
99
             <div>
97
             <div>
100
-                <span>内容{}</span>
98
+                <span>内容:{targetName}</span>
101
                 <Button style={{ float: 'right', zIndex: 1 }} onClick={() => router.go(-1)}>
99
                 <Button style={{ float: 'right', zIndex: 1 }} onClick={() => router.go(-1)}>
102
                     返回
100
                     返回
103
                </Button>
101
                </Button>
104
             </div>
102
             </div>
105
             <div style={{ marginTop: '20px'  }}>
103
             <div style={{ marginTop: '20px'  }}>
106
-                <span>访问人数{}</span>
104
+                <span>访问人数:{visitNum}</span>
107
                 <Button type="primary" style={{ float: 'right', marginBottom: '20px', zIndex: 1 }} onClick={exportActivityStats}>导出</Button>
105
                 <Button type="primary" style={{ float: 'right', marginBottom: '20px', zIndex: 1 }} onClick={exportActivityStats}>导出</Button>
108
             </div>
106
             </div>
109
-            <Table style={{ marginTop: '30px' }} dataSource={data} columns={columns} pagination={false} rowKey="activityList" />
107
+            <Table style={{ marginTop: '30px' }} dataSource={data.records || []} columns={columns} pagination={false} rowKey="activityList" />
110
             {/* <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
108
             {/* <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
111
         <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current} />
109
         <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current} />
112
       </div> */}
110
       </div> */}

+ 10
- 0
src/services/apis.js Datei anzeigen

893
       method: 'GET',
893
       method: 'GET',
894
       action: 'admin.channel.introductionList.newuserList.get',
894
       action: 'admin.channel.introductionList.newuserList.get',
895
     },
895
     },
896
+    visitNumList: {
897
+      url: `${prefix}/channel/introduction/visitNumList`,
898
+      method: 'GET',
899
+      action: 'admin.channel.introductionList.visitNumList.get',
900
+    },
901
+    personNumList: {
902
+      url: `${prefix}/channel/introduction/personNumList`,
903
+      method: 'GET',
904
+      action: 'admin.channel.introductionList.personNumList.get',
905
+    }
896
   },
906
   },
897
   role: {
907
   role: {
898
     getRoleList: {
908
     getRoleList: {