소스 검색

商品积分

傅行帆 5 년 전
부모
커밋
9d3ad684bc
3개의 변경된 파일155개의 추가작업 그리고 4개의 파일을 삭제
  1. 5
    0
      config/config.js
  2. 128
    0
      src/pages/integralMall/verifyList.jsx
  3. 22
    4
      src/pages/integralMall/writeOff.jsx

+ 5
- 0
config/config.js 파일 보기

@@ -201,6 +201,11 @@ export default {
201 201
                   name: '商品核销',
202 202
                   component: './integralMall/writeOff',
203 203
                 },
204
+                {
205
+                  path: '/integralMall/verifyList',
206
+                  name: '',
207
+                  component: './integralMall/verifyList',
208
+                },
204 209
               ],
205 210
             },
206 211
             {

+ 128
- 0
src/pages/integralMall/verifyList.jsx 파일 보기

@@ -0,0 +1,128 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Input, Button, Icon, Select, message, Table, Divider, Tag, Pagination, Modal, DatePicker } from 'antd';
3
+import { FormattedMessage } from 'umi-plugin-react/locale';
4
+import styles from '../style/GoodsList.less';
5
+import router from 'umi/router';
6
+import moment from 'moment';
7
+
8
+import request from '../../utils/request'
9
+
10
+const { Option } = Select;
11
+const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
12
+
13
+const header = (props) => {
14
+  const [ data, setData ] = useState({})
15
+
16
+  useEffect(() => {
17
+    getVerifyList({pageNum: 1,pageSize: 10, phone: props.location.query.telValue });
18
+  },[])
19
+
20
+  // 查询列表
21
+  const getVerifyList = (params) => {
22
+    request({
23
+      url: '/api/admin/taPointsExchange',
24
+      method: 'GET',
25
+      params: { ...params },
26
+    }).then((data) => {
27
+        setData(data)
28
+    })
29
+  }
30
+
31
+  const changePageNum = (pageNumber) => {
32
+    getVerifyList({ pageNum: 1, pageSize: 10, phone: props.location.query.telValue })
33
+  }
34
+
35
+  const toBack = () => {
36
+    router.push({
37
+      pathname: '/integralMall/writeOff',
38
+    });
39
+  }
40
+
41
+  const changeStatus = (row) => () => {
42
+    request({
43
+      url: '/api/admin/taPointsExchange/change',
44
+      method: 'PUT',
45
+      data: row
46
+    }).then((data) => {
47
+        message.info("操作成功")
48
+        getVerifyList({ pageNum: pageNumber, pageSize: 10, phone: props.location.query.telValue })
49
+    })
50
+  }
51
+  
52
+  const columns = [
53
+    {
54
+      title: '用户姓名',
55
+      dataIndex: 'personName',
56
+      key: 'personName',
57
+      align: 'center',
58
+    },
59
+    {
60
+      title: '用户类型',
61
+      dataIndex: 'personType',
62
+      key: 'personType',
63
+      align: 'center',
64
+      render: (personType)=> <><span>{personType === 'Realty Consultant' ? '置业顾问' : personType === 'Sales Executive' ? '销售主管' : personType === 'estate agent' ? '经纪人' : ''}</span></>
65
+    },
66
+    {
67
+      title: '手机号',
68
+      dataIndex: 'phone',
69
+      key: 'phone',
70
+      align: 'center',
71
+    },
72
+    {
73
+      title: '商品图片',
74
+      dataIndex: 'image',
75
+      key: 'image',
76
+      align: 'center',
77
+      render: (text, record) => <img src={record.image} className={styles.touxiang} />,
78
+    },
79
+    {
80
+      title: '商品名称',
81
+      dataIndex: 'targetName',
82
+      key: 'targetName',
83
+      align: 'center',
84
+    },
85
+    {
86
+      title: '兑换时间',
87
+      dataIndex: 'createDate',
88
+      key: 'createDate',
89
+      align: 'center',
90
+      render: (createDate) => <><span>{moment(createDate).format('YYYY-MM-DD HH:mm')}</span></>
91
+    },
92
+    {
93
+      title: '领取时间',
94
+      dataIndex: 'verifyDate',
95
+      key: 'verifyDate',
96
+      align: 'center',
97
+      render: (verifyDate) => <><span>{verifyDate != null ? moment(verifyDate).format('YYYY-MM-DD HH:mm') : ''}</span></>
98
+    },
99
+    {
100
+      title: '状态',
101
+      dataIndex: 'status',
102
+      key: 'status',
103
+      align: 'center',
104
+      render: (status)=> <><span>{status == 1 ? '已领取' : '未领取'}</span></>
105
+    },
106
+    {
107
+      title: '操作',
108
+      dataIndex: 'handle',
109
+      key: 'handle',
110
+      align: 'center',
111
+      render: (x,row) => <span style={{ color: '#1990FF' }} onClick={changeStatus(row)}>{ row.status == 1?'':'核销' }</span>
112
+           
113
+    },
114
+  ];
115
+
116
+  return (
117
+    <>
118
+      <Button type="primary" className={styles.addBtn} onClick={toBack}>返回</Button>
119
+      <Table dataSource={data.records} columns={columns} pagination={false} />
120
+      <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
121
+        <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} />
122
+      </div>
123
+    </>
124
+  )
125
+}
126
+const WrappedHeader = Form.create({ name: 'header' })(header);
127
+
128
+export default WrappedHeader

+ 22
- 4
src/pages/integralMall/writeOff.jsx 파일 보기

@@ -1,5 +1,5 @@
1
-import React from 'react';
2
-import { Form, Input, Button, Icon, Tabs, Row, Col } from 'antd';
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Input, Button, Icon, Tabs, Row, Col, 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';
@@ -20,6 +20,24 @@ function callback(key) {
20 20
  */
21 21
 
22 22
 function header(props) {
23
+  const [telValue, setTelValue] = useState('')
24
+  const changeTel = (e) => {
25
+    setTelValue(e.target.value)
26
+  }
27
+
28
+  const verifyTel = () =>{
29
+    if(telValue === ""){
30
+      message.error("请输入手机号");
31
+      return;
32
+    }
33
+    router.push({
34
+      pathname: '/integralMall/verifyList',
35
+      query: {
36
+        telValue
37
+      },
38
+    });
39
+  }
40
+
23 41
   const { getFieldDecorator } = props.form
24 42
   return (
25 43
     <>
@@ -60,8 +78,8 @@ function header(props) {
60 78
             </Col>
61 79
           </Row>
62 80
           <div style={{ margin: '110px auto', display: 'block',textAlign:'center' }}>
63
-            <Input placeholder="请输入手机号" style={{width:'200px'}} />
64
-            <Button type="primary" style={{marginLeft:'10px', padding: '6px 46px', backgroundColor: '#EA2323', border: 'none' }}>立即核销</Button>
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>
65 83
           </div>
66 84
         </TabPane>
67 85
       </Tabs>,