Browse Source

sharetable

xujing 5 years ago
parent
commit
88bf5fabb8
2 changed files with 60 additions and 17 deletions
  1. 54
    16
      src/pages/statistical/consultant/sharetable.jsx
  2. 6
    1
      src/services/apis.js

+ 54
- 16
src/pages/statistical/consultant/sharetable.jsx View File

@@ -5,6 +5,50 @@ import moment from 'moment';
5 5
 import apis from '../../../services/apis';
6 6
 import request from '../../../utils/request'
7 7
 
8
+const typeList = [
9
+    {
10
+        label: '报名活动',
11
+        value: 'activity'
12
+    },
13
+    {
14
+        label: '助力活动',
15
+        value: 'help'
16
+    },
17
+    {
18
+        label: '拼团活动',
19
+        value: 'group'
20
+    },
21
+    {
22
+        label: 'H5活动',
23
+        value: 'h5'
24
+    },
25
+    {
26
+        label: '直播活动',
27
+        value: 'live'
28
+    },
29
+    {
30
+        label: '房源列表',
31
+        value: 'house'
32
+    },
33
+    {
34
+        label: '项目',
35
+        value: ' project'
36
+    },
37
+    {
38
+        label: '资讯',
39
+        value: 'news'
40
+    },
41
+    {
42
+        label: '首页',
43
+        value: 'mian'
44
+    },
45
+]
46
+
47
+
48
+function getType(type) {
49
+    return typeList.filter(t => t.value === type)[0].label
50
+}
51
+
8 52
 /**
9 53
   @param {*} props
10 54
   @returns
@@ -28,7 +72,7 @@ function record(props) {
28 72
 
29 73
     // 查询列表
30 74
     const getList = (params) => {
31
-        request({ ...apis.stats.totalPersons, params: { ...params }, }).then((data) => {
75
+        request({ ...apis.stats.shareNum, params: { ...params }, }).then((data) => {
32 76
             setData(data)
33 77
         })
34 78
     }
@@ -43,17 +87,16 @@ function record(props) {
43 87
         e.preventDefault();
44 88
         props.form.validateFields((err, values) => {
45 89
             if (!err) {
46
-                console.log('提交数据: ', values)
47
-
90
+                console.log('提交数据: ', values, { ...formData, ...values })
91
+                getList({ ...formData, ...values });
48 92
             }
49 93
         });
50
-        // getList(formData);
51 94
     }
52 95
     // 更新页码
53 96
     const changePageNum = (pageNumber) => {
54 97
         props.form.validateFields((err, values) => {
55 98
             if (!err) {
56
-                getList({ ...formData, pageNum: pageNumber });
99
+                getList({ ...formData, pageNum: pageNumber, ...values });
57 100
             }
58 101
         });
59 102
     }
@@ -67,6 +110,7 @@ function record(props) {
67 110
             dataIndex: 'intention',
68 111
             key: 'intention',
69 112
             align: 'center',
113
+            render: (_, record) => <><span>{() => getType(record.targetType)}{record.targetName}</span></>
70 114
         },
71 115
         {
72 116
             title: '分享时间',
@@ -86,22 +130,16 @@ function record(props) {
86 130
             <Form layout="inline">
87 131
                 <div style={{ display: 'flex', alignItems: 'center' }}>
88 132
                     <Form.Item>
89
-                        {getFieldDecorator('eventType')(
133
+                        {getFieldDecorator('targetType')(
90 134
                             <Select placeholder="分享类型" style={{ width: 150 }}>
91
-                                <Option value="activity_share">报名活动</Option>
92
-                                <Option value="help_share">助力活动</Option>
93
-                                <Option value="group_share">拼团活动</Option>
94
-                                <Option value="h5_share">H5活动</Option>
95
-                                <Option value="live_share">直播活动</Option>
96
-                                <Option value="house_share">房源列表</Option>
97
-                                <Option value="building_share">项目</Option>
98
-                                <Option value="news_share">资讯</Option>
99
-                                <Option value="index_share">首页</Option>
135
+                                {typeList.map((item, index) => (
136
+                                    <Option key={index} value={item.value}>{item.label}</Option>
137
+                                ))}
100 138
                             </Select>
101 139
                         )}
102 140
                     </Form.Item>
103 141
                     <Form.Item>
104
-                        {getFieldDecorator('activityName')(
142
+                        {getFieldDecorator('targetName')(
105 143
                             <Input
106 144
                                 prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
107 145
                                 placeholder="分享标题"

+ 6
- 1
src/services/apis.js View File

@@ -1622,7 +1622,7 @@ export default {
1622 1622
       url: `${prefix}/stats/consultant/kpi`,
1623 1623
       action: 'admin.contract.list.post',
1624 1624
     },
1625
-    totalPersons: { // 客户总计
1625
+    totalPersons: { // 客户总计 //新增用户
1626 1626
       method: 'GET',
1627 1627
       url: `${prefix}/stats/consultant/customer`,
1628 1628
       action: 'admin.contract.list.get',
@@ -1647,6 +1647,11 @@ export default {
1647 1647
       url: `${prefix}/stats/consultant/chat/persons`,
1648 1648
       action: 'admin.contract.list.get',
1649 1649
     },
1650
+    shareNum: { // 分享次数
1651
+      method: 'GET',
1652
+      url: `${prefix}/stats/consultant/share/targets`,
1653
+      action: 'admin.contract.list.get',
1654
+    },
1650 1655
 
1651 1656
     buildingExport: {
1652 1657
       method: 'GET',