yee 7 år sedan
förälder
incheckning
30d6d2a9c9

+ 19 - 3
js/component/manageCenter/userManage/content.jsx

@@ -12,14 +12,14 @@ class Content extends Component {
             component: <div />,
         };
     }
-    componentWillMount() {
+    componentWillMount () {
         if (window.location.hash) {
             this.getKey(window.location.hash.substr(1));
         } else {
             this.getKey(window.showCustomer ? 'customerList' : 'userList');
         };
     }
-    getKey(key) {
+    getKey (key) {
         switch (key) {
             case 'userList':
                 require.ensure([], () => {
@@ -45,6 +45,22 @@ class Content extends Component {
                     });
                 });
                 break;
+            case 'levelSet':
+                require.ensure([], () => {
+                    const LevelSet = require('./levelSet').default;
+                    this.setState({
+                        component: <LevelSet />,
+                    });
+                });
+                break;
+            case 'orderList':
+                require.ensure([], () => {
+                    const OrderList = require('./orderList').default;
+                    this.setState({
+                        component: <OrderList />,
+                    });
+                });
+                break;
             case 'customerSearch':
                 require.ensure([], () => {
                     const CustomerSearch = require('./customerSearch').default;
@@ -64,7 +80,7 @@ class Content extends Component {
         };
         window.location.hash = key;
     }
-    render() {
+    render () {
         return (
             <div className="manage-content">
                 <LeftTab handlekey={this.getKey.bind(this)} />

+ 6 - 0
js/component/manageCenter/userManage/leftTab.jsx

@@ -37,6 +37,12 @@ const LeftTab = React.createClass({
                 <Menu.Item style={{ display: window.showCustomer ? 'block' : 'none' }} key="customerList">
                     我的客户列表
                 </Menu.Item>
+                <Menu.Item style={{ display: window.showCustomer ? 'block' : 'none' }} key="levelSet">
+                    会员等级设置
+                </Menu.Item>
+                <Menu.Item style={{ display: window.showCustomer ? 'block' : 'none' }} key="orderList">
+                    会员订单列表
+                </Menu.Item>
                 <Menu.Item style={{ display: window.showCustomer ? 'block' : 'none' }} key="customerSearch">
                     客户查询
                 </Menu.Item>

+ 324 - 0
js/component/manageCenter/userManage/levelSet.jsx

@@ -0,0 +1,324 @@
+import React from 'react';
+import { Icon, Button, Input, Spin, Table, message, Modal, Tabs, InputNumber, Checkbox } from 'antd';
+import ajax from 'jquery/src/ajax/xhr.js';
+import $ from 'jquery/src/ajax';
+import './userList.less';
+
+const ListAdd = React.createClass({
+    getInitialState () {
+        return {
+            visible: false,
+            loading: false
+        };
+    },
+    showModal () {
+        this.setState({
+            visible: true,
+        });
+    },
+    handleCancel (e) {
+        this.setState({
+            visible: false,
+        });
+    },
+    handleOk () {
+        this.setState({
+            loading: true,
+            visible: false
+        });
+    },
+    render () {
+        return (
+            <div className="patent-desc" style={{ float: 'right', marginRight: '20px' }}>
+                <Button type="primary" onClick={this.showModal}>添加新等级</Button>
+                <Modal maskClosable={false}
+                    title="新增用户等级"
+                    visible={this.state.visible}
+                    onCancel={this.handleCancel}
+                    width='400px'
+                    footer={[
+                        <Button key="submit" type="primary" loading={this.state.loading} onClick={this.handleOk}>提交</Button>,
+                        <Button key="back" onClick={this.handleCancel}>返回</Button>
+                    ]}
+                    className="admin-desc-content">
+                    <div className='orgAdd-input'>
+                        <span>会员等级名称:</span>
+                        <Input value={this.state.lvlName} style={{ width: '200px' }}
+                            onChange={(e) => { this.setState({ lvlName: e.target.value }); }} />
+                    </div>
+                </Modal>
+            </div>
+        );
+    }
+});
+
+const ListDelete = React.createClass({
+    getInitialState () {
+        return {
+            visible: false,
+            loading: false
+        };
+    },
+    showModal () {
+        this.setState({
+            visible: true,
+        });
+    },
+    handleCancel (e) {
+        this.setState({
+            visible: false,
+        });
+    },
+    handleOk () {
+        this.setState({
+            loading: true
+        });
+    },
+    render () {
+        return (
+            <div className="patent-desc" style={{ float: 'right', marginRight: '20px' }}>
+                <Button type="ghost" onClick={this.showModal}>删除</Button>
+                <Modal maskClosable={false}
+                    title="删除用户等级"
+                    visible={this.state.visible}
+                    onCancel={this.handleCancel}
+                    width='400px'
+                    footer={[
+                        <Button key="submit" type="primary" loading={this.state.loading} onClick={this.handleOk}>提交</Button>,
+                        <Button key="back" onClick={this.handleCancel}>返回</Button>
+                    ]} >
+                    <div className="level-tabs-modal">
+                        <p>
+                            <Icon type="exclamation-circle-o" />
+                            <span> 确认要删除该用户等级吗?删除以后不可恢复!</span>
+                        </p>
+                    </div>
+                </Modal>
+            </div>
+        );
+    }
+});
+
+const SetContent = React.createClass({
+    getInitialState () {
+        return {
+            visible: false,
+            columns: [
+                {
+                    title: '会员时长',
+                    dataIndex: 'time',
+                    key: 'time',
+                    render: (text, record, index) => {
+                        return <div>
+                            <Input style={{ width: '80px' }}
+                                value={record.time}
+                                onChange={(e) => {
+                                    record.time = e.target.value;
+                                    this.setState({ dataSource: this.state.dataSource });
+                                }} />
+                            <span style={{ marginLeft: '10px' }}>个月</span>
+                        </div>
+                    }
+                }, {
+                    title: '金额',
+                    dataIndex: 'money',
+                    key: 'money',
+                    render: (text, record, index) => {
+                        return <div>
+                            <InputNumber step={0.01} min={0}
+                                value={record.money}
+                                onChange={(e) => {
+                                    record.money = e;
+                                    this.setState({ dataSource: this.state.dataSource });
+                                }} />
+                            <span style={{ marginLeft: '10px' }}>元</span>
+                        </div>
+                    }
+                }
+            ],
+            dataSource: [],
+            selectedRowKeys: []
+        };
+    },
+    remove () {
+        this.state.selectedRowKeys.sort((a, b) => { return b - a });
+        let theArr = this.state.dataSource.concat();
+        for (let idx = 0; idx < this.state.selectedRowKeys.length; idx++) {
+            let dataIndex = this.state.selectedRowKeys[idx];
+            theArr.map((item, index) => {
+                if (item.key === dataIndex) {
+                    theArr.splice(index, 1);
+                }
+            })
+        };
+        this.state.dataSource = [];
+        for (let i = 0; i < theArr.length; i++) {
+            let item = theArr[i];
+            this.state.dataSource.push({
+                key: i,
+                time: item.time,
+                money: item.money
+            })
+        };
+        this.setState({
+            dataSource: this.state.dataSource,
+            selectedRowKeys: []
+        });
+    },
+
+    addNew () {
+        this.state.dataSource.push({
+            key: this.state.dataSource.length,
+            time: '',
+            money: ''
+        });
+        this.setState({
+            dataSource: this.state.dataSource
+        })
+    },
+    render () {
+        const rowSelection = {
+            type: 'checkbox',
+            selectedRowKeys: this.state.selectedRowKeys,
+            onChange: (selectedRowKeys, selectedRows) => {
+                this.setState({
+                    selectedRows: selectedRows,
+                    selectedRowKeys: selectedRowKeys
+                });
+            }
+        };
+        const hasSelected = this.state.selectedRowKeys.length > 0;
+        return (
+            <div className="level-tabs">
+                <div className="level-tabs-title">
+                    <span>会员等级费用设置</span>
+                    <Button style={{ background: "#ea0862", border: "none", color: "#fff" }}
+                        onClick={this.addNew}>添加<Icon type="plus" /></Button>
+                    <Button style={{ background: "#3fcf9e", border: "none", color: "#fff" }}
+                        disabled={!hasSelected}
+                        onClick={this.remove}>删除<Icon type="minus" /></Button>
+                </div>
+                <Table className="level-tabs-table no-all-select"
+                    columns={this.state.columns}
+                    dataSource={this.state.dataSource}
+                    pagination={false}
+                    rowSelection={rowSelection} />
+                <div className="level-tabs-title">
+                    <span>会员等级增值服务设置</span>
+                </div>
+                <div>
+                    <div className="level-checkbox">
+                        <Checkbox checked={this.state.checked}
+                            onChange={(e) => { this.setState({ checked: e.target.checked }) }}>
+                            科技成果,专家信息定点推送
+                        </Checkbox>
+                    </div>
+                    <div className="level-checkbox">
+                        <Checkbox checked={this.state.checked}
+                            onChange={(e) => { this.setState({ checked: e.target.checked }) }}>
+                            查看专家的联系方式
+                        </Checkbox>
+                    </div>
+                    <div className="level-checkbox">
+                        <Checkbox checked={this.state.checked}
+                            onChange={(e) => { this.setState({ checked: e.target.checked }) }}>
+                            任何业务申请,付费业享受会员专属折扣
+                        </Checkbox>
+                    </div>
+                    <div className="level-checkbox">
+                        <Checkbox checked={this.state.checked}
+                            onChange={(e) => { this.setState({ checked: e.target.checked }) }}>
+                            一对一的技术经纪人服务,进行技术成果媒合服务
+                        </Checkbox>
+                    </div>
+                    <div className="level-checkbox">
+                        <Checkbox checked={this.state.checked}
+                            onChange={(e) => { this.setState({ checked: e.target.checked }) }}>
+                            一对一的科技咨询师服务
+                        </Checkbox>
+                    </div>
+                    <div className="level-checkbox">
+                        <Checkbox checked={this.state.checked}
+                            onChange={(e) => { this.setState({ checked: e.target.checked }) }}>
+                            一对一的专业技术顾问,搜集技术情报,提供研发高参
+                        </Checkbox>
+                    </div>
+                    <div className="level-checkbox">
+                        <Checkbox checked={this.state.checked}
+                            onChange={(e) => { this.setState({ checked: e.target.checked }) }}>
+                            免费参加现场业务培训会
+                        </Checkbox>
+                    </div>
+                    <div className="level-checkbox">
+                        <Checkbox checked={this.state.checked}
+                            onChange={(e) => { this.setState({ checked: e.target.checked }) }}>
+                            免前期费用做科技类扶持资金项目申报
+                        </Checkbox>
+                    </div>
+                </div>
+                <div className="level-tabs-save">
+                    <Button type="primary" onClick={this.search}>保存</Button>
+                    <ListDelete />
+                </div>
+            </div>
+        );
+    }
+});
+
+
+const CustomerList = React.createClass({
+    loadData (pageNo) {
+        this.setState({
+            loading: true
+        });
+        $.ajax({
+            method: "get",
+            dataType: "json",
+            crossDomain: false,
+            url: globalConfig.context + "/api/admin/customer",
+            data: {
+            },
+            success: function (data) {
+                if (data.error && data.error.length) {
+                    message.warning(data.error[0].message);
+                }
+            }.bind(this),
+        }).always(function () {
+            this.setState({
+                loading: false
+            });
+        }.bind(this));
+    },
+    getInitialState () {
+        return {
+            data: [],
+            loading: false
+        };
+    },
+    componentWillMount () {
+        this.loadData();
+    },
+    tabChange () { },
+    render () {
+        return (
+            <div className="user-content" >
+                <div className="content-title clearfix">
+                    <span>会员等级管理</span>
+                    <ListAdd />
+                </div>
+                <div>
+                    <Tabs defaultActiveKey="1" onChange={this.tabChange}>
+                        <Tabs.TabPane tab="黄金会员" key="1">
+                            <SetContent />
+                        </Tabs.TabPane>
+                        <Tabs.TabPane tab="钻石会员" key="2">
+                            <SetContent />
+                        </Tabs.TabPane>
+                    </Tabs>
+                </div>
+            </div >
+        );
+    }
+});
+
+export default CustomerList;

+ 162 - 0
js/component/manageCenter/userManage/orderList.jsx

@@ -0,0 +1,162 @@
+import React from 'react';
+import { Icon, Button, Input, Select, Spin, Table, message, DatePicker, Modal } from 'antd';
+import ajax from 'jquery/src/ajax/xhr.js';
+import $ from 'jquery/src/ajax';
+import './userList.less';
+
+
+const OrderList = React.createClass({
+    loadData (pageNo) {
+        this.state.data = [];
+        this.setState({
+            loading: true
+        });
+        $.ajax({
+            method: "post",
+            dataType: "json",
+            crossDomain: false,
+            url: globalConfig.context + "/api/admin/orgList",
+            data: {
+                pageNo: pageNo || 1,
+                pageSize: this.state.pagination.pageSize
+            },
+            success: function (data) {
+                if (!data.data || !data.data.list) {
+                    if (data.error && data.error.length) {
+                        message.warning(data.error[0].message);
+                    };
+                } else {
+                    for (let i = 0; i < data.data.list.length; i++) {
+                        let thisdata = data.data.list[i];
+                        this.state.data.push({
+                            key: i,
+                            id: thisdata.id,
+                            mobile: thisdata.mobile,
+                            email: thisdata.email,
+                            createTime: thisdata.createTime,
+                            aftUsername: thisdata.aftUsername,
+                            managerName: thisdata.managerName,
+                            number: thisdata.number,
+                            orgAuditStatus: thisdata.orgAuditStatus,
+                            createTimeFormattedDate: thisdata.createTimeFormattedDate,
+                            adminName: thisdata.adminName,
+                            unitName: thisdata.unitName
+                        });
+                    };
+                    this.state.pagination.current = data.data.pageNo;
+                    this.state.pagination.total = data.data.totalCount;
+                };
+                this.setState({
+                    dataSource: this.state.data,
+                    pagination: this.state.pagination
+                });
+            }.bind(this),
+        }).always(function () {
+            this.setState({
+                loading: false
+            });
+        }.bind(this));
+    },
+    getInitialState () {
+        return {
+            searchMore: true,
+            data: [],
+            searchTime: [],
+            loading: false,
+            pagination: {
+                defaultCurrent: 1,
+                defaultPageSize: 10,
+                showQuickJumper: true,
+                pageSize: 10,
+                onChange: function (page) {
+                    this.loadData(page);
+                }.bind(this),
+                showTotal: function (total) {
+                    return '共' + total + '条数据';
+                }
+            },
+            columns: [
+                {
+                    title: '订单编号',
+                    dataIndex: 'number',
+                    key: 'number',
+                }, {
+                    title: '账号',
+                    dataIndex: 'mobile',
+                    key: 'mobile',
+                }, {
+                    title: '认证名称',
+                    dataIndex: 'unitName',
+                    key: 'unitName',
+                }, {
+                    title: '订单状态',
+                    dataIndex: 'orderStatus',
+                    key: 'orderStatus',
+                }, {
+                    title: '生成时间',
+                    dataIndex: 'createTimeFormattedDate',
+                    key: 'createTimeFormattedDate',
+                }
+            ],
+            dataSource: []
+        };
+    },
+    componentWillMount () {
+        this.loadData();
+    },
+    search () {
+        this.loadData();
+    },
+    reset () {
+        this.state.searchOrderNumber = undefined;
+        this.state.searchAftNumber = undefined;
+        this.state.searchOrderStatus = undefined;
+        this.state.searchName = undefined;
+        this.state.searchTime = [];
+        this.loadData();
+    },
+    render () {
+        const { RangePicker } = DatePicker;
+        const Option = Select.Option;
+        return (
+            <div className="user-content" >
+                <div className="content-title">
+                    <span>用户订单列表</span>
+                </div>
+                <div className="user-search">
+                    <Input placeholder="订单编号" value={this.state.searchOrderNumber}
+                        onChange={(e) => { this.setState({ searchOrderNumber: e.target.value }); }} />
+                    <Input placeholder="用户账号" value={this.state.searchAftNumber}
+                        onChange={(e) => { this.setState({ searchAftNumber: e.target.value }); }} />
+                    <Input placeholder="认证名称" value={this.state.searchName}
+                        onChange={(e) => { this.setState({ searchName: e.target.value }); }} />
+                    <Select placeholder="订单状态" value={this.state.searchOrderStatus} style={{ width: 120 }}
+                        onChange={(e) => { this.setState({ searchOrderStatus: e }) }}>
+                        <Option value="0">未付款</Option>
+                        <Option value="1">已付款</Option>
+                    </Select>
+                    <div className="search-div">
+                        <span>订单生成时间:</span>
+                        <RangePicker
+                            allowClear={false}
+                            value={[this.state.searchTime[0] ? moment(this.state.searchTime[0]) : null,
+                            this.state.searchTime[1] ? moment(this.state.searchTime[1]) : null]}
+                            onChange={(data, dataString) => { this.setState({ searchTime: dataString }); }} />
+                    </div>
+                    <Button type="primary" onClick={this.search}>搜索</Button>
+                    <Button onClick={this.reset}>重置</Button>
+                </div>
+                <div className="patent-table">
+                    <Spin spinning={this.state.loading}>
+                        <Table columns={this.state.columns}
+                            dataSource={this.state.dataSource}
+                            pagination={this.state.pagination}
+                            onRowClick={this.tableRowClick} />
+                    </Spin>
+                </div>
+            </div >
+        );
+    }
+});
+
+export default OrderList;

+ 54 - 3
js/component/manageCenter/userManage/userList.less

@@ -13,6 +13,7 @@
         >input,
         >button,
         .ant-select {
+            margin-top:10px;
             margin-right: 10px;
         }
         .ant-switch {
@@ -21,6 +22,33 @@
         .search-more {
             margin: 10px 0;
         }
+        .search-div {
+            display: inline-block;
+            margin-top:10px;
+            margin-right: 10px; 
+        }
+    }
+    .level-tabs {
+        padding: 0 20px;
+        .level-tabs-title {
+            >span {
+                font-size: 14px;
+            }
+            >button {
+                margin-left: 20px;
+            }
+        }
+        .level-tabs-table {
+            width: 600px;
+            margin: 20px 0;
+        }
+        .level-checkbox {
+            margin-top: 20px;
+        }
+        .level-tabs-save {
+            margin-top: 20px;
+            width: 600px;
+        }
     }
 }
 
@@ -36,9 +64,9 @@
         margin-right: 20px;
     }
     .idcard-imgbox {
-            height: 200px;
-            padding-top: 200px;
-            position: relative;
+        height: 200px;
+        padding-top: 200px;
+        position: relative;
         >img {
             position: absolute;
             top: 0;
@@ -68,4 +96,27 @@
             line-height: 28px;
         }
     }
+}
+
+.level-tabs-modal {
+    p {
+        line-height: 36px;
+        text-align: center;
+        i {
+            vertical-align: middle;
+            font-size: 20px;
+            color: #E85050
+        }
+        span {
+            margin-left: 10px;
+        }
+    }
+}
+
+.no-all-select {
+    .ant-table-selection {
+        .ant-checkbox {
+            display: none;
+        }
+    }
 }

+ 2 - 2
webpack.config.js

@@ -230,8 +230,8 @@ module.exports = (function () {
             }
         }));
     }
-    //let staticHost = 'http://afts.hnzhiming.com';
-    let staticHost = 'http://127.0.0.1';
+    let staticHost = 'http://afts.hnzhiming.com';
+    //let staticHost = 'http://127.0.0.1';
     switch (argv.env.deploy) {
         case 'stage':
             staticHost = 'http://aftts.hnzhiming.com';