Przeglądaj źródła

Merge branch 'master' of http://git.ycjcjy.com/zhiyuxing/estateagents-admin-manager

傅行帆 5 lat temu
rodzic
commit
b429732ace

+ 5
- 0
config/config.js Wyświetl plik

@@ -265,6 +265,11 @@ export default {
265 265
                   name: '资讯列表',
266 266
                   component: './news/list/NewsList',
267 267
                 },
268
+                {
269
+                  path: '/news/list/editNewsList',
270
+                  name: '',
271
+                  component: './news/list/editNewsList',
272
+                },
268 273
               ],
269 274
             },
270 275
             {

+ 4
- 4
src/components/EchartsTest/index.jsx Wyświetl plik

@@ -3,15 +3,15 @@ import React, { Component } from 'react';
3 3
 // 引入 ECharts 主模块
4 4
 import echarts from 'echarts/lib/echarts';
5 5
 // 引入柱状图
6
-import  'echarts/lib/chart/bar';
6
+import 'echarts/lib/chart/bar';
7 7
 // 引入提示框和标题组件
8 8
 import 'echarts/lib/component/tooltip';
9 9
 import 'echarts/lib/component/title';
10 10
 class Chart extends Component {
11 11
 
12
-  render() { 
13
-    return ( <div></div> );
12
+  render() {
13
+    return (<div></div>);
14 14
   }
15 15
 }
16
- 
16
+
17 17
 export default Chart;

+ 40
- 0
src/components/SelectButton/NewTypeSelect.jsx Wyświetl plik

@@ -0,0 +1,40 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Select } from 'antd';
3
+
4
+import request from '../../utils/request'
5
+
6
+const { Option } = Select;
7
+
8
+/**
9
+ *
10
+ *
11
+ * @param {*} props
12
+ * @returns
13
+ */
14
+const NewsTypeSelect = (props) => {
15
+  const [ data, setData ] = useState([])
16
+
17
+  useEffect(() => {
18
+    getCityList();
19
+  },[])
20
+
21
+  const getCityList = (e) => {
22
+    request({
23
+        url: '/api/admin/taNewsType',
24
+        method: 'GET',
25
+        params: {pageNum: 1,pageSize: 999},
26
+    }).then((data) => {
27
+        setData(data.records)
28
+    })
29
+  }
30
+
31
+  return (
32
+      <Select value={props.value} style={{ width: '180px' }} placeholder="请选择类型" onChange={props.onChange}>
33
+          {data.map(type => (
34
+            <Option key={type.newsTypeId}>{type.newsTypeName}</Option>
35
+          ))}
36
+      </Select>
37
+  )
38
+}
39
+export default NewsTypeSelect
40
+

+ 10
- 0
src/global.less Wyświetl plik

@@ -110,4 +110,14 @@ ol {
110 110
 }
111 111
 .ant-table{
112 112
   line-height: 3;
113
+}
114
+.ant-modal-header{
115
+  border-bottom: none;
116
+  .ant-modal-title{
117
+    font-size: 24px;
118
+    line-height: 50px;
119
+  }
120
+}
121
+.ant-modal-footer{
122
+  border-top:none;
113 123
 }

+ 0
- 16
src/pages/channel/brokerList.jsx Wyświetl plik

@@ -27,22 +27,6 @@ const menu = (
27 27
     </Menu.Item>
28 28
   </Menu>
29 29
 );
30
-// const dataSource = [
31
-//   {
32
-//     key: '1',
33
-//     img: 'http://img0.imgtn.bdimg.com/it/u=4246326797,2657995307&fm=26&gp=0.jpg',
34
-//     name: '123',
35
-//     age: 32,
36
-//     address: '西湖区湖底公园1号',
37
-//   },
38
-//   {
39
-//     key: '2',
40
-//     img: '',
41
-//     age: 42,
42
-//     address: '西湖区湖底公园1号',
43
-//   },
44
-// ];
45
-
46 30
 const columns = [
47 31
   {
48 32
     title: '头像',

+ 0
- 1
src/pages/channel/channelList.jsx Wyświetl plik

@@ -74,7 +74,6 @@ const columns = [
74 74
     dataIndex: 'agentsInvite',
75 75
     key: 'agentsInvite',
76 76
     align: 'center',
77
-    // render: () => <a>Delete</a>,
78 77
   },
79 78
   {
80 79
     title: '操作',

+ 135
- 3
src/pages/customer/independentList/index.jsx Wyświetl plik

@@ -1,5 +1,5 @@
1 1
 import React, { useState, useEffect } from 'react';
2
-import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, Table, Avatar } from 'antd';
2
+import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, Table, Avatar, Modal } from 'antd';
3 3
 import moment from 'moment';
4 4
 import request from '../../../utils/request';
5 5
 import apis from '../../../services/apis';
@@ -11,6 +11,132 @@ const { Option } = Select;
11 11
 // eslint-disable-next-line @typescript-eslint/no-unused-vars
12 12
 const { Meta } = Card;
13 13
 
14
+class ModalTable extends React.Component {
15
+  constructor(props) {
16
+    super(props);
17
+    this.state = {
18
+       dataSource: { records: [] },
19
+       visibleData: { visible: false, customerId: '', realtyConsultant: '' },
20
+    }
21
+  }
22
+
23
+  // 挂载之后
24
+  componentDidMount() {
25
+    this.getList({ pageNumber: 1, pageSize: 5 })
26
+  }
27
+
28
+  componentDidUpdate(preProps, preState) {
29
+    if (this.props.visibleData.customerId !== preState.visibleData.customerId) {
30
+      this.getList({ pageNumber: 1, pageSize: 5 })
31
+      this.setState({ visibleData: this.props.visibleData });
32
+    }
33
+  }
34
+
35
+  // 弹框确定按钮
36
+  // eslint-disable-next-line react/sort-comp
37
+  handleOk() {
38
+    this.setState({ visibleData: { visible: false, customerId: '', realtyConsultant: '' } })
39
+  }
40
+
41
+  // 弹框取消按钮
42
+  handleCancel() {
43
+    this.setState({ visibleData: { visible: false, customerId: '', realtyConsultant: '' } })
44
+  }
45
+
46
+  getList(params) {
47
+    console.log('this.state.visibleData', this.state.visibleData)
48
+    const { customerId } = this.state.visibleData
49
+    if (customerId === '' || customerId === undefined) {
50
+      return
51
+    }
52
+    // 网路请求
53
+    const { url, method } = apis.customer.recommend
54
+    const tempUrl = url.substring(0, url.lastIndexOf('id')).concat(customerId)
55
+    // 网路请求
56
+    request({ url: tempUrl, method, params: { ...params } }).then(res => {
57
+      this.setState({ dataSource: res })
58
+    }).catch(err => {
59
+      // eslint-disable-next-line no-unused-expressions
60
+      <Alert
61
+        style={{
62
+          marginBottom: 24,
63
+        }}
64
+        message={err}
65
+        type="error"
66
+        showIcon
67
+      />
68
+    })
69
+  }
70
+
71
+   // 分页
72
+  onChange(pageNum) {
73
+    this.getList({ pageNumber: pageNum, pageSize: 5 })
74
+  }
75
+
76
+  render() {
77
+    const columns = [
78
+      {
79
+        title: '头像',
80
+        // eslint-disable-next-line jsx-a11y/alt-text
81
+        render: (text, records) => <img src={records.picture } width={50} height={50} />,
82
+      },
83
+      {
84
+        title: '用户名',
85
+        dataIndex: 'name',
86
+        key: 'name',
87
+      },
88
+      {
89
+        title: '电话',
90
+        dataIndex: 'phone',
91
+        key: 'phone',
92
+      },
93
+      {
94
+        title: '性别',
95
+        dataIndex: 'sex',
96
+        key: 'sex',
97
+        render: (text, records) => <span>{ records.sex === 1 ? '男' : '女' }</span>,
98
+      },
99
+      {
100
+        title: '意向项目',
101
+        dataIndex: 'intention',
102
+        key: 'intention',
103
+      },
104
+      {
105
+        title: '推荐时间',
106
+        dataIndex: 'createDate',
107
+        key: 'createDate',
108
+      },
109
+      {
110
+        title: '状态',
111
+        // eslint-disable-next-line consistent-return
112
+        render: (text, records) => {
113
+                                    if (records.status === 1) { return '报备' }
114
+                                    if (records.status === 2) { return '到访' }
115
+                                    if (records.status === 3) { return '认购' }
116
+                                    if (records.status === 4) { return '签约' }
117
+                                    if (records.verifyStatus === 1) { return '待审核' }
118
+                                    if (records.verifyStatus === 2) { return '审核同意' }
119
+                                    if (records.verifyStatus === 3) { return '签约' }
120
+                                  },
121
+      },
122
+    ]
123
+    return (
124
+      <>
125
+        <Modal
126
+            title="推荐客户"
127
+            destroyOnClose="true"
128
+            width={900}
129
+            footer={null}
130
+            visible={this.state.visibleData.visible}
131
+            // onOk={() => this.handleOk()}
132
+            onCancel={(e) => this.handleCancel(e)}
133
+          >
134
+            <Table dataSource={this.state.dataSource.records} columns={columns} pagination={{ total: this.state.dataSource.total, onChange: e => this.onChange(e) }} />
135
+          </Modal>
136
+      </>
137
+    );
138
+  }
139
+}
14 140
 /**
15 141
  *
16 142
  *
@@ -54,12 +180,16 @@ function body(props) {
54 180
       }
55 181
     });
56 182
   }
57
-
183
+  // eslint-disable-next-line react-hooks/rules-of-hooks
184
+  const [gVisibleData, setGVisibleData] = useState({ visible: false, customerId: '', realtyConsultant: '' })
58 185
   // Change 事件
59 186
   function handleSelectChange(e) {
60 187
     // eslint-disable-next-line no-console
61 188
     console.log(e)
62 189
   }
190
+  function gM(row) {
191
+    setGVisibleData({ visible: true, customerId: row.personId, realtyConsultant: row.realtyConsultant })
192
+  }
63 193
 
64 194
   // 分页
65 195
   function onChange(pageNum) {
@@ -123,7 +253,7 @@ function body(props) {
123 253
               &nbsp;&nbsp;&nbsp;&nbsp;
124 254
               <sapn style={{ color: 'rgba(239,39,58,1)' }}>邀请经纪人</sapn>
125 255
               &nbsp;&nbsp;&nbsp;&nbsp;
126
-              <sapn style={{ color: 'rgba(239,39,58,1)' }}>推荐客户</sapn>
256
+              <sapn style={{ color: 'rgba(239,39,58,1)' }} onClick={() => gM(record)}>推荐客户</sapn>
127 257
             </>
128 258
           }
129 259
         </>
@@ -158,6 +288,8 @@ function body(props) {
158 288
       </Form>
159 289
 
160 290
       <Table dataSource={dataSource.records} columns={columns} pagination={{ total: dataSource.total, onChange }} />
291
+            {/* 调整归属 */}
292
+        <ModalTable visibleData={gVisibleData} />
161 293
     </>
162 294
   );
163 295
 }

+ 74
- 9
src/pages/integralMall/writeOff.jsx Wyświetl plik

@@ -1,5 +1,5 @@
1 1
 import React, { useState, useEffect } from 'react';
2
-import { Form, Input, Button, Icon, Tabs, Row, Col, message } from 'antd';
2
+import { Form, Input, Button, Icon, Tabs, Row, Col, Modal, message } from 'antd';
3 3
 import { FormattedMessage } from 'umi-plugin-react/locale';
4 4
 import styles from '../style/GoodsList.less';
5 5
 import router from 'umi/router';
@@ -13,20 +13,67 @@ function callback(key) {
13 13
 }
14 14
 
15 15
 /**
16
- *
17
- *
18 16
  * @param {*} props
19 17
  * @returns
20 18
  */
19
+class Dialog extends React.Component {
20
+  state = {
21
+    visible: false,
22
+  };
23
+
24
+  showModal = () => {
25
+    this.setState({ visible: true, });
26
+  };
27
+
28
+  handleCancel = () => {
29
+    this.setState({ visible: false });
30
+  };
31
+
32
+  onKeyDown = (e) => {
33
+
34
+    if (e.keyCode == 13) {
35
+      this.setState({ visible: false });
36
+      this.props.onEnter();
37
+    }
38
+  }
39
+
40
+  render() {
41
+    const { visible, loading } = this.state;
42
+    return (
43
+      <div>
44
+        <Button type="primary" onClick={this.showModal} style={{ margin: '80px auto', display: 'block', padding: '6px 46px', backgroundColor: '#EA2323', border: 'none' }}>立即核销</Button>
45
+        <Modal
46
+          style={{ marginTop: '20vh' }}
47
+          visible={visible}
48
+          title="核销数据"
49
+          onCancel={this.handleCancel}
50
+          footer={[]}
51
+        >
52
+          <p>扫描二维码数据</p>
53
+          <Input placeholder="请用扫描枪扫描二维码" onKeyDown={this.onKeyDown} onChange={this.props.onChange} />
54
+        </Modal>
55
+      </div>
56
+    );
57
+  }
58
+}
59
+
21 60
 
22 61
 function header(props) {
23 62
   const [telValue, setTelValue] = useState('')
63
+
24 64
   const changeTel = (e) => {
25 65
     setTelValue(e.target.value)
26 66
   }
27 67
 
28
-  const verifyTel = () =>{
29
-    if(telValue === ""){
68
+  const [codeValue, setCodeValue] = useState('')
69
+  const changeCode = (e) => {
70
+
71
+    setCodeValue(e.target.value)
72
+
73
+  }
74
+
75
+  const verifyTel = () => {
76
+    if (telValue === "") {
30 77
       message.error("请输入手机号");
31 78
       return;
32 79
     }
@@ -38,6 +85,22 @@ function header(props) {
38 85
     });
39 86
   }
40 87
 
88
+
89
+  const handleEnter = (e) => {
90
+    if (codeValue === "") {
91
+      message.error("无二维码数据");
92
+      return;
93
+    } else {
94
+
95
+      router.push({
96
+        pathname: '/integralMall/verifyList',
97
+        query: {
98
+          codeValue
99
+        },
100
+      });
101
+    }
102
+  }
103
+
41 104
   const { getFieldDecorator } = props.form
42 105
   return (
43 106
     <>
@@ -62,7 +125,7 @@ function header(props) {
62 125
               <p style={{ margin: '44px auto' }}>根据提示进行核销操作</p>
63 126
             </Col>
64 127
           </Row>
65
-          <Button type="primary" style={{ margin: '80px auto', display: 'block', padding: '6px 46px', backgroundColor: '#EA2323', border: 'none' }}>立即核销</Button>
128
+          <Dialog onEnter={handleEnter} onChange={changeCode} />
66 129
         </TabPane>
67 130
         <TabPane tab="手机号核销" key="2">
68 131
           <Row>
@@ -77,15 +140,17 @@ function header(props) {
77 140
               <p>点击“立即核销”按钮</p>
78 141
             </Col>
79 142
           </Row>
80
-          <div style={{ margin: '110px auto', display: 'block',textAlign:'center' }}>
81
-            <Input placeholder="请输入手机号" style={{width:'200px'}} onChange={changeTel}/>
82
-            <Button type="primary" style={{marginLeft:'10px', padding: '6px 46px', backgroundColor: '#EA2323', border: 'none' }} onClick={verifyTel}>立即核销</Button>
143
+          <div style={{ margin: '110px auto', display: 'block', textAlign: 'center' }}>
144
+            <Input placeholder="请输入手机号" style={{ width: '200px' }} onChange={changeTel} />
145
+            <Button type="primary" style={{ marginLeft: '10px', padding: '6px 46px', backgroundColor: '#EA2323', border: 'none' }} onClick={verifyTel}>立即核销</Button>
83 146
           </div>
84 147
         </TabPane>
85 148
       </Tabs>,
86 149
     </>
87 150
   )
88 151
 }
152
+
89 153
 const WrappedHeader = Form.create({ name: 'header' })(header);
90 154
 
155
+
91 156
 export default WrappedHeader

+ 68
- 10
src/pages/news/list/NewsList.jsx Wyświetl plik

@@ -1,9 +1,11 @@
1 1
 import React, { useState, useEffect } from 'react';
2
-import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert } from 'antd';
2
+import { Form, Icon, Input, Button, DatePicker, Select, Modal, message, Card, Row, Col, Pagination, Alert } from 'antd';
3 3
 import moment from 'moment';
4
+import router from 'umi/router';
4 5
 import request from '../../../utils/request';
5 6
 import apis from '../../../services/apis';
6 7
 import Styles from './style.less';
8
+import NewsTypeSelect from '../../../components/SelectButton/NewTypeSelect'
7 9
 
8 10
 
9 11
 const { Option } = Select;
@@ -19,7 +21,53 @@ const tempDate = [{ code: 's101' }]
19 21
  */
20 22
 function CartBody(props) {
21 23
   const { data } = props
22
-  console.log(props);
24
+
25
+  const cancelPage = () =>{
26
+    router.push({
27
+      pathname: '/news/list/NewsList',
28
+    });
29
+  }
30
+
31
+  // 查询列表
32
+  const getList = (params) => {
33
+    request({
34
+        url: '/api/admin/taNews',
35
+        method: 'GET',
36
+        params: { ...params },
37
+    }).then((data) => {
38
+        cancelPage();
39
+    })
40
+  }
41
+
42
+  //删除资讯
43
+  const changeNewsListStatus = (newsId) => () => {
44
+    Modal.confirm({
45
+      title: '确认删除该资讯?',
46
+      okText: '确认',
47
+      cancelText: '取消',
48
+      onOk() {
49
+        request({
50
+          url: '/api/admin/taNews/' + newsId,
51
+          method: 'DELETE',
52
+          // data: { ...row },
53
+        }).then((data) => {
54
+          message.info('操作成功!')
55
+          getList({ pageNum: 1, pageSize: 10 });
56
+        })
57
+      }
58
+    });
59
+  }
60
+
61
+  // 跳转到编辑资讯列表
62
+  const toEditList = (newsId) => ()  => {
63
+    router.push({
64
+      pathname: '/news/list/editNewsList',
65
+      query: {
66
+        newsId
67
+      },
68
+    });
69
+  }
70
+
23 71
   return (
24 72
           <Card
25 73
             hoverable
@@ -30,14 +78,14 @@ function CartBody(props) {
30 78
             <p className={Styles.cardText}>
31 79
               <span className={Styles.title}>资讯类型</span>
32 80
               <span >:{ data.newsType.newsTypeName }</span>
33
-              <span className={Styles.ediText}>
81
+              <span className={Styles.ediText} onClick={toEditList(data.newsId)}>
34 82
                 编辑
35 83
                 <Icon type="form" style={{ color: '#C0C4CC', marginLeft: '10px' }} />
36 84
               </span>
37 85
             </p>
38 86
             <p className={Styles.cardText}>
39 87
               <span className={Styles.title}>状态</span>
40
-              <span >:{ data.status == 0 ? "已发布" : "未发布" }</span>
88
+              <span >:{ data.newsStatus == 0 ? "已发布" : "未发布" }</span>
41 89
             </p>
42 90
             <p className={Styles.cardItem}>
43 91
               <span className={Styles.title}>阅读数量</span>
@@ -45,7 +93,7 @@ function CartBody(props) {
45 93
             </p>
46 94
             <p className={Styles.cardItem}>
47 95
               <span className={Styles.title}>转发数量</span>
48
-              <span className={ Styles.address }>:{ data.shareNum }</span>
96
+              <span>:{ data.shareNum }</span>
49 97
             </p>
50 98
             <p className={Styles.cardItem}>
51 99
               <span className={Styles.title}>点赞数量</span>     
@@ -66,7 +114,7 @@ function CartBody(props) {
66 114
               </span>
67 115
               <span style={{
68 116
                 color: '#FF4A4A', position: 'absolute', right: '0',
69
-              }} >
117
+              }} onClick={changeNewsListStatus(data.newsId)}>
70 118
                 删除
71 119
                 <Icon type="rest" style={{ color: '#C0C4CC', marginLeft: '8px' }} />
72 120
               </span>
@@ -122,6 +170,17 @@ function body(props) {
122 170
     });
123 171
   }
124 172
 
173
+  // 跳转到编辑资讯列表
174
+  const toEditList = (id) => ()  => {
175
+    router.push({
176
+      pathname: '/news/list/editNewsList',
177
+      query: {
178
+        id
179
+      },
180
+    });
181
+  }
182
+
183
+
125 184
   // Change 事件
126 185
   function handleSelectChange(e) {
127 186
     // eslint-disable-next-line no-console
@@ -165,9 +224,8 @@ function body(props) {
165 224
           )}
166 225
         </Form.Item>
167 226
         <Form.Item>
168
-          {getFieldDecorator('type')(
169
-            <Select style={{ width: '180px' }} placeholder="咨询类型" onChange={handleSelectChange}>
170
-            </Select>,
227
+          {getFieldDecorator('buildingId')(
228
+            <NewsTypeSelect />,
171 229
           )}
172 230
         </Form.Item>       
173 231
         <Form.Item>
@@ -184,7 +242,7 @@ function body(props) {
184 242
           </Button>
185 243
         </Form.Item>
186 244
       </Form>
187
-      <Button type="primary" className={Styles.addButton}>
245
+      <Button type="primary" className={Styles.addButton} onClick={toEditList()}>
188 246
         新增
189 247
       </Button>
190 248
 

+ 148
- 0
src/pages/news/list/editNewsList.jsx Wyświetl plik

@@ -0,0 +1,148 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Input, Button, Icon, Select, Tabs, Radio, DatePicker,message } from 'antd';
3
+import { FormattedMessage } from 'umi-plugin-react/locale';
4
+import styles from '../../style/GoodsList.less';
5
+import moment from 'moment';
6
+import router from 'umi/router';
7
+import BuildSelect from '../../../components/SelectButton/BuildSelect'
8
+import NewsTypeSelect from '../../../components/SelectButton/NewTypeSelect'
9
+import XForm, { FieldTypes } from '../../../components/XForm';
10
+import Wangedit from '../../../components/Wangedit/Wangedit'
11
+import request from '../../../utils/request'
12
+
13
+const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
14
+/**
15
+ *
16
+ *
17
+ * @param {*} props
18
+ * @returns
19
+ */
20
+ const Edit = (props) => {
21
+  const [ tab, changeTab ] = useState('basic')
22
+  const newsId = props.location.query.newsId
23
+  const [ dynamicData, setDynamicData ] = useState({})
24
+  if(newsId){
25
+    useEffect(() => {
26
+      getDynamicData(newsId);
27
+    },[])
28
+
29
+  // 查询列表
30
+  const getDynamicData = (newsId) => {
31
+    request({
32
+        url: '/api/admin/taNews/' + newsId,
33
+        method: 'GET',
34
+        params: { newsId },
35
+    }).then((data) => {
36
+        console.log(data)
37
+        setDynamicData(data)
38
+    })
39
+  }
40
+  }
41
+
42
+  const cancelPage = () =>{
43
+    router.push({
44
+      pathname: '/news/list/NewsList',
45
+    });
46
+  }
47
+
48
+  const Basic = (props) => {
49
+    const fields = [
50
+      {
51
+        label: '意向项目',
52
+        name: 'buildingId',
53
+        render: <BuildSelect />,
54
+        value: dynamicData.buildingId,
55
+        rules: [
56
+          {required: true, message: '请选择所属项目'},
57
+        ]
58
+      },
59
+      {
60
+        label: '资讯图片',
61
+        name: 'newsImg',
62
+        type: FieldTypes.ImageUploader,
63
+        value: dynamicData.newsImg,
64
+      },
65
+      {
66
+        label: '资讯标题',
67
+        name: 'newsName',
68
+        type: FieldTypes.Text,
69
+        value: dynamicData.newsName,
70
+        rules: [
71
+          {required: true, message: '请输入资讯标题'},
72
+        ]
73
+      },
74
+      {
75
+        label: '资讯类型',
76
+        name: 'newsTypeId',
77
+        render: <NewsTypeSelect />,
78
+        value: dynamicData.newsTypeId,
79
+        rules: [
80
+          {required: true, message: '请选择资讯类型'},
81
+        ]
82
+      },
83
+      {
84
+        label: '资讯详情',
85
+        name: 'desc',
86
+        render: <Wangedit />,
87
+        value: dynamicData.desc,
88
+      },
89
+    ]
90
+  
91
+    const handleSubmit = val => { 
92
+      let {...submitValue} = val
93
+      if(dynamicId){
94
+        submitValue.dynamicId = dynamicId
95
+        request({
96
+          url: '/api/admin/buildingDynamic/update',
97
+          method: 'PUT',
98
+          data: submitValue,
99
+        }).then((data) => {
100
+          cancelPage()
101
+        }).catch((err) => {
102
+          message.info(err.msg || err.message)
103
+        })
104
+      }else{
105
+        request({
106
+          url: '/api/admin/taNews',
107
+          method: 'POST',
108
+          data: submitValue,
109
+        }).then((data) => {
110
+          cancelPage()
111
+        }).catch((err) => {
112
+          message.info(err.msg || err.message)
113
+        })
114
+      }
115
+    }
116
+    
117
+    return <XForm onSubmit={handleSubmit} onCancel={cancelPage} fields={fields}></XForm>
118
+  }
119
+  
120
+  const Poster = (props) => {
121
+   return <div>Poster</div>
122
+  }
123
+ 
124
+  const Share = (props) => {
125
+    return <div>Share</div>
126
+  }
127
+
128
+  return (
129
+    <div>
130
+      <div>
131
+        <Radio.Group value={tab} buttonStyle="solid" onChange={e => changeTab(e.target.value)}>
132
+          <Radio.Button value="basic">基本信息</Radio.Button>
133
+          <Radio.Button value="poster">海报图片</Radio.Button>
134
+          <Radio.Button value="share">分享设置</Radio.Button>
135
+        </Radio.Group>
136
+      </div>
137
+      <div>
138
+        { tab === 'basic' && <Basic /> }
139
+        { tab === 'poster' && <Poster /> }
140
+        { tab === 'share' && <Share /> }
141
+      </div>
142
+    </div>
143
+  );
144
+ }
145
+
146
+
147
+
148
+export default Edit

+ 1
- 1
src/pages/news/type/NewsType.jsx Wyświetl plik

@@ -45,7 +45,7 @@ function header(props) {
45 45
   }
46 46
 
47 47
 
48
-  // 跳转到编辑咨询
48
+  // 跳转到编辑资讯
49 49
   const toEditNews = (id) => () => {
50 50
     router.push({
51 51
       pathname: '/news/type/editNews',

+ 4
- 0
src/services/apis.js Wyświetl plik

@@ -92,5 +92,9 @@ export default {
92 92
       method: 'GET',
93 93
       url: `${prefix}/mine/taPointsRecords/id`,
94 94
     },
95
+    recommend: {
96
+      method: 'GET',
97
+      url: `${prefix}/customer/recommend/id`,
98
+    },
95 99
   },
96 100
 }