yee 7 роки тому
батько
коміт
ae15328848

+ 14 - 6
js/component/account/index/content.jsx

@@ -10,14 +10,14 @@ class Content extends Component {
             component: 'div'
         };
     }
-    componentWillMount() {
+    componentWillMount () {
         if (window.location.hash) {
             this.getKey(window.location.hash.substr(1));
         } else {
             this.getKey("normal");
         };
     }
-    getKey(key) {
+    getKey (key) {
         switch (key) {
             case 'normal':
                 require.ensure([], () => {
@@ -35,18 +35,26 @@ class Content extends Component {
                     });
                 });
                 break;
-            case 'orderList':
+            case 'techList':
                 require.ensure([], () => {
-                    const OrderList = require('./orderList').default;
+                    const TechList = require('./techList').default;
                     this.setState({
-                        component: OrderList
+                        component: TechList
+                    });
+                });
+                break;
+            case 'serviceList':
+                require.ensure([], () => {
+                    const ServiceList = require('./serviceList').default;
+                    this.setState({
+                        component: ServiceList
                     });
                 });
                 break;
         };
         window.location.hash = key;
     }
-    render() {
+    render () {
         return (
             <div className="acc-content">
                 <LeftTab handlekey={this.getKey.bind(this)} />

+ 21 - 0
js/component/account/index/content.less

@@ -148,4 +148,25 @@
                 width: auto;
             }
         }
+        .content-title {
+            color: #333;
+            font-size: 16px;
+        }
+        .user-search {
+            margin: 10px 0;
+            >input {
+                width: 140px;
+            }
+            >input,
+            >button,
+            .ant-select {
+                margin-top: 10px;
+                margin-right: 10px;
+            }
+            .search-div {
+                display: inline-block;
+                margin-top: 10px;
+                margin-right: 10px;
+            }
+        }
     }

+ 5 - 2
js/component/account/index/leftTab.jsx

@@ -34,8 +34,11 @@ const LeftTab = React.createClass({
                 <Menu.Item key="collection">
                     我感兴趣
                 </Menu.Item>
-                <Menu.Item key="orderList">
-                    我的订单
+                <Menu.Item key="techList">
+                    科技订单
+                </Menu.Item>
+                <Menu.Item key="serviceList">
+                    服务订单
                 </Menu.Item>
             </Menu>
         );

+ 211 - 0
js/component/account/index/serviceList.jsx

@@ -0,0 +1,211 @@
+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 './content.less';
+
+
+const OrderList = React.createClass({
+    loadData (pageNo) {
+        this.state.data = [];
+        this.setState({
+            loading: true
+        });
+        $.ajax({
+            method: "get",
+            dataType: "json",
+            crossDomain: false,
+            url: globalConfig.context + "/api/user/member/selectMemberOrder",
+            data: {
+                pageNo: pageNo || 1,
+                pageSize: this.state.pagination.pageSize,
+                id:this.state.searchOrderNumber,
+                orderState: this.state.searchOrderStatus,
+                startTime: this.state.searchTime[0],
+                endTime: this.state.searchTime[1]
+            },
+            success: function (data) {
+                if (!data.data || !data.data.lsit) {
+                    if (data.error && data.error.length) {
+                        message.warning(data.error[0].message);
+                    };
+                } else {
+                    for (let i = 0; i < data.data.lsit.length; i++) {
+                        let thisdata = data.data.lsit[i];
+                        this.state.data.push({
+                            key: i,
+                            formattedOrderTime: thisdata.formattedOrderTime,
+                            formattedPaymentTime: thisdata.formattedPaymentTime,
+                            formattedValidTime: thisdata.formattedValidTime,
+                            gradeName: thisdata.gradeName,
+                            id: thisdata.id,
+                            menberType: thisdata.menberType,
+                            orderState: thisdata.orderState,
+                            orderTime: thisdata.orderTime,
+                            paymentId: thisdata.paymentId,
+                            paymentTime: thisdata.paymentTime,
+                            paymentType: thisdata.paymentType,
+                            paymentValue: thisdata.paymentValue,
+                            price: thisdata.price,
+                            userId: thisdata.userId,
+                            validMonth: thisdata.validMonth,
+                            validTime: thisdata.validTime
+                        });
+                    };
+                    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: 'id',
+                    key: 'id',
+                }, {
+                    title: '会员类型',
+                    dataIndex: 'gradeName',
+                    key: 'gradeName',
+                }, {
+                    title: '订单状态',
+                    dataIndex: 'orderState',
+                    key: 'orderState',
+                    render: (text, record) => {
+                        if (text == 1) {
+                            return '已完成'
+                        } else {
+                            let now = new Date();
+                            let endTime = new Date(record.orderTime + 24 * 60 * 60 * 1000 * 15)
+                            if (now > endTime) {
+                                return '已失效'
+                            } else {
+                                return '未支付'
+                            }
+                        }
+                    }
+                }, {
+                    title: '生成时间',
+                    dataIndex: 'formattedOrderTime',
+                    key: 'formattedOrderTime',
+                }, {
+                    title: '支付内容',
+                    dataIndex: 'payText',
+                    key: 'payText',
+                    render: (text, record) => {
+                        return record.price + '元 / ' + record.validMonth + '月'
+                    }
+                }, {
+                    title: '支付时间',
+                    dataIndex: 'payTimeFormattedDate',
+                    key: 'payTimeFormattedDate',
+                }, {
+                    title: '有效时间',
+                    dataIndex: 'validTime',
+                    key: 'validTime',
+                    render: (index, record) => {
+                        if (record.formattedPaymentTime && record.formattedValidTime) {
+                            return record.formattedPaymentTime + ' -- ' + record.formattedValidTime
+                        }
+                    }
+                }, {
+                    title: '操作',
+                    dataIndex: 'action',
+                    key: 'action',
+                    render: (text, record) => {
+                        let now = new Date();
+                        let endTime = new Date(record.orderTime + 24 * 60 * 60 * 1000 * 15)
+                        if (record.orderState == 0 && now < endTime) {
+                            return <Button type="primary" onClick={() => { }}>支付</Button>
+                        } else { return <div></div> }
+                    }
+                }
+            ],
+            dataSource: []
+        };
+    },
+    componentWillMount () {
+        this.loadData();
+    },
+    search () {
+        this.loadData();
+    },
+    reset () {
+        this.state.searchOrderNumber = undefined;
+        this.state.searchOrderStatus = undefined;
+        this.state.searchOrderType = undefined;
+        this.state.searchTime = [];
+        this.loadData();
+    },
+    render () {
+        const { RangePicker } = DatePicker;
+        const Option = Select.Option;
+        return (
+            <div className="collection" >
+                <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 }); }} />
+                    <Select placeholder="订单类型" value={this.state.searchOrderType} style={{ width: 120 }}
+                        onChange={(e) => { this.setState({ searchOrderType: e }) }}>
+                        <Option value="0">会员服务</Option>
+                        <Option value="1">科技服务</Option>
+                    </Select>
+                    <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;

js/component/account/index/orderList.jsx → js/component/account/index/techList.jsx


+ 1 - 1
js/component/manageCenter/achievement/batchImport.jsx

@@ -93,7 +93,7 @@ const BatchImport = React.createClass({
                 this.state.error = false;
                 return;
             };
-            let theArr = rowsArr[i].split(/\t+/);
+            let theArr = rowsArr[i].split(/\t/);
             if (theArr.length == columnLength) {
                 columnArr.push({
                     dataCategory: _me.getDataCategory(theArr[0], i + 1),

+ 1 - 1
js/component/manageCenter/demand/batchImport.jsx

@@ -67,7 +67,7 @@ const BatchImport = React.createClass({
                 this.state.error = false;
                 return;
             };
-            let theArr = rowsArr[i].split(/\t+/);
+            let theArr = rowsArr[i].split(/\t/);
             if (theArr.length == columnLength) {
                 columnArr.push({
                     dataCategory: _me.getDataCategory(theArr[0], i + 1),

+ 3 - 0
js/component/manageCenter/idea/activity/activity.jsx

@@ -573,6 +573,9 @@ const Activity = React.createClass({
                                     <Input value={this.state.asist} style={{ width: '320px', marginRight: '20px' }}
                                         onChange={(e) => { this.setState({ asist: e.target.value }); }} />
                                     <Button onClick={() => {
+                                        if (!this.state.asist || this.state.asist.length == 0) {
+                                            return;
+                                        }
                                         let _me = this, theArr = this.state.asistArray.concat(), theBool = true;
                                         if (!theArr.length) {
                                             theArr.push(this.state.asist);

+ 1 - 1
js/component/manageCenter/userManage/levelSet.jsx

@@ -411,7 +411,7 @@ const LevelSet = React.createClass({
                         theBusiness['checked07'] = (item.business && item.business['1007'] == 1 ? true : false);
                         theBusiness['checked08'] = (item.business && item.business['1008'] == 1 ? true : false);
                         theArr.push(
-                            <Tabs.TabPane tab={item.gradeName} key={item.memberRank}>
+                            <Tabs.TabPane tab={item.gradeName + '( Lv.' + item.memberRank + ' )'} key={item.memberRank}>
                                 <SetContent business={theBusiness} cost={item.cost || []} rid={item.id} refreshForDel={this.refreshForDel} />
                             </Tabs.TabPane>
                         )

+ 157 - 27
js/component/manageCenter/userManage/orderList.jsx

@@ -1,8 +1,9 @@
 import React from 'react';
-import { Icon, Button, Input, Select, Spin, Table, message, DatePicker, Modal } from 'antd';
+import { Icon, Button, Input, Select, Spin, Table, message, DatePicker, Modal, InputNumber, Radio } from 'antd';
 import ajax from 'jquery/src/ajax/xhr.js';
 import $ from 'jquery/src/ajax';
 import './userList.less';
+import moment from 'moment';
 
 
 const OrderList = React.createClass({
@@ -12,39 +13,52 @@ const OrderList = React.createClass({
             loading: true
         });
         $.ajax({
-            method: "post",
+            method: "get",
             dataType: "json",
             crossDomain: false,
-            url: globalConfig.context + "/api/admin/orgList",
+            url: globalConfig.context + "/api/admin/member/selectMemberOrderBa",
             data: {
                 pageNo: pageNo || 1,
-                pageSize: this.state.pagination.pageSize
+                pageSize: this.state.pagination.pageSize,
+                id: this.state.searchOrderNumber,
+                nickname: this.state.searchName,
+                mobile: this.state.searchAftNumber,
+                orderState: this.state.searchOrderStatus,
+                startTime: this.state.searchTime[0],
+                endTime: this.state.searchTime[1]
             },
             success: function (data) {
-                if (!data.data || !data.data.list) {
+                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];
+                    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,
+                            formattedOrderTime: thisdata.formattedOrderTime,
+                            formattedPaymentTime: thisdata.formattedPaymentTime,
+                            formattedValidTime: thisdata.formattedValidTime,
+                            gradeName: thisdata.gradeName,
+                            menberType: thisdata.menberType,
+                            nickname: thisdata.nickname,
                             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
+                            orderState: thisdata.orderState,
+                            orderTime: thisdata.orderTime,
+                            paymentId: thisdata.paymentId,
+                            paymentTime: thisdata.paymentTime,
+                            paymentType: thisdata.paymentType,
+                            paymentValue: thisdata.paymentValue,
+                            price: thisdata.price,
+                            userId: thisdata.userId,
+                            validMonth: thisdata.validMonth,
+                            validTime: thisdata.validTime,
                         });
                     };
-                    this.state.pagination.current = data.data.pageNo;
-                    this.state.pagination.total = data.data.totalCount;
+                    this.state.pagination.current = data.data.pNo;
+                    this.state.pagination.total = data.data.countWhere;
                 };
                 this.setState({
                     dataSource: this.state.data,
@@ -61,6 +75,8 @@ const OrderList = React.createClass({
         return {
             searchMore: true,
             data: [],
+            RowData: {},
+            visible: false,
             searchTime: [],
             loading: false,
             pagination: {
@@ -78,24 +94,43 @@ const OrderList = React.createClass({
             columns: [
                 {
                     title: '订单编号',
-                    dataIndex: 'number',
-                    key: 'number',
+                    dataIndex: 'id',
+                    key: 'id',
                 }, {
                     title: '账号',
                     dataIndex: 'mobile',
                     key: 'mobile',
                 }, {
                     title: '认证名称',
-                    dataIndex: 'unitName',
-                    key: 'unitName',
+                    dataIndex: 'nickname',
+                    key: 'nickname',
+                }, {
+                    title: '会员类型',
+                    dataIndex: 'gradeName',
+                    key: 'gradeName',
                 }, {
                     title: '订单状态',
-                    dataIndex: 'orderStatus',
-                    key: 'orderStatus',
+                    dataIndex: 'orderState',
+                    key: 'orderState',
+                    render: (text) => {
+                        if (text == 1) {
+                            return '已支付'
+                        } else {
+                            return '未支付'
+                        };
+                    }
                 }, {
                     title: '生成时间',
-                    dataIndex: 'createTimeFormattedDate',
-                    key: 'createTimeFormattedDate',
+                    dataIndex: 'formattedOrderTime',
+                    key: 'formattedOrderTime',
+                }, {
+                    title: '支付时间',
+                    dataIndex: 'formattedPaymentTime',
+                    key: 'formattedPaymentTime',
+                }, {
+                    title: '到期时间',
+                    dataIndex: 'formattedValidTime',
+                    key: 'formattedValidTime',
                 }
             ],
             dataSource: []
@@ -115,13 +150,17 @@ const OrderList = React.createClass({
         this.state.searchTime = [];
         this.loadData();
     },
+    tableRowClick (record, index) {
+        this.state.RowData = record;
+        this.setState({ visible: true });
+    },
     render () {
         const { RangePicker } = DatePicker;
         const Option = Select.Option;
         return (
             <div className="user-content" >
                 <div className="content-title">
-                    <span>用户订单列表</span>
+                    <span>会员订单列表</span>
                 </div>
                 <div className="user-search">
                     <Input placeholder="订单编号" value={this.state.searchOrderNumber}
@@ -130,6 +169,11 @@ const OrderList = React.createClass({
                         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.searchOrderType} style={{ width: 120 }}
+                        onChange={(e) => { this.setState({ searchOrderType: e }) }}>
+                        <Option value="0">会员服务</Option>
+                        <Option value="1">科技服务</Option>
+                    </Select>
                     <Select placeholder="订单状态" value={this.state.searchOrderStatus} style={{ width: 120 }}
                         onChange={(e) => { this.setState({ searchOrderStatus: e }) }}>
                         <Option value="0">未付款</Option>
@@ -154,6 +198,92 @@ const OrderList = React.createClass({
                             onRowClick={this.tableRowClick} />
                     </Spin>
                 </div>
+                <Modal title="订单详情" width={600} className="activity-modal"
+                    visible={this.state.visible}
+                    maskClosable={false}
+                    footer={null}
+                    afterClose={() => { this.state.RowData = {}; this.state.asist = null; this.state.asistArray = []; }}
+                    onCancel={() => { this.setState({ visible: false }) }} >
+                    <Spin spinning={this.state.loading}>
+                        <div className="clearfix">
+                            <div className="modal-box">
+                                <span className="modal-box-title">会员等级</span>
+                                <div className="modal-box-detail">
+                                    <Select placeholder="选择会员等级"
+                                        style={{ width: 120 }}
+                                        value={this.state.RowData.menberType ? this.state.RowData.menberType.toString() : undefined}
+                                        onChange={(e) => {
+                                            this.state.RowData.menberType = e;
+                                            this.setState({ RowData: this.state.RowData });
+                                        }}>
+                                        <Select.Option value="2">Lv.2</Select.Option>
+                                        <Select.Option value="3">Lv.3</Select.Option>
+                                        <Select.Option value="4">Lv.4</Select.Option>
+                                        <Select.Option value="5">Lv.5</Select.Option>
+                                    </Select>
+                                </div>
+                            </div>
+                            <div className="modal-box">
+                                <span className="modal-box-title">会员时长</span>
+                                <div className="modal-box-detail" style={{ width: '160px' }}>
+                                    <InputNumber value={this.state.RowData.validMonth} step={1} onChange={(e) => {
+                                        this.state.RowData.validMonth = e;
+                                        this.setState({ RowData: this.state.RowData });
+                                    }} />
+                                    <span> 月</span>
+                                </div>
+                                <span className="modal-box-title">实际支付金额</span>
+                                <div className="modal-box-detail" style={{ width: '160px' }}>
+                                    <InputNumber value={this.state.RowData.paymentValue} step={0.01} onChange={(e) => {
+                                        this.state.RowData.paymentValue = e;
+                                        this.setState({ RowData: this.state.RowData });
+                                    }} />
+                                    <span> 元</span>
+                                </div>
+                            </div>
+                            <div className="modal-box">
+                                <span className="modal-box-title">支付方式</span>
+                                <div className="modal-box-detail" style={{ width: '260px' }}>
+                                    <Input value={this.state.RowData.paymentType} onChange={(e) => {
+                                        this.state.RowData.paymentType = e.target.value;
+                                        this.setState({ RowData: this.state.RowData });
+                                    }} />
+                                </div>
+                            </div>
+                            <div className="modal-box">
+                                <span className="modal-box-title">支付状态</span>
+                                <div className="modal-box-detail">
+                                    <Radio.Group value={this.state.RowData.orderState}
+                                        onChange={(e) => {
+                                            this.state.RowData.orderState = e.target.value;
+                                            this.setState({ RowData: this.state.RowData });
+                                        }} >
+                                        <Radio value={0}>未支付</Radio>
+                                        <Radio value={1}>已支付</Radio>
+                                    </Radio.Group>
+                                </div>
+                            </div>
+                            <div className="modal-box">
+                                <span className="modal-box-title">支付时间</span>
+                                <div className="modal-box-detail">
+                                    <DatePicker style={{ width: '150px' }}
+                                        showTime
+                                        format="YYYY-MM-DD HH:mm:ss"
+                                        placeholder="选择支付时间"
+                                        value={this.state.RowData.formattedPaymentTime ? moment(this.state.RowData.formattedPaymentTime, "YYYY-MM-DD HH:mm:ss") : undefined}
+                                        onChange={(t, str) => {
+                                            this.state.RowData.formattedPaymentTime = str;
+                                            this.setState({ RowData: this.state.RowData });
+                                        }} />
+                                </div>
+                            </div>
+                        </div>
+                        <div className="modal-box">
+                            <Button type="primary" onClick={this.submit}>提交</Button>
+                            <Button type="ghost" onClick={() => { this.setState({ visible: false }) }}>取消</Button>
+                        </div>
+                    </Spin>
+                </Modal>
             </div >
         );
     }

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

@@ -13,7 +13,7 @@
         >input,
         >button,
         .ant-select {
-            margin-top:10px;
+            margin-top: 10px;
             margin-right: 10px;
         }
         .ant-switch {
@@ -24,8 +24,8 @@
         }
         .search-div {
             display: inline-block;
-            margin-top:10px;
-            margin-right: 10px; 
+            margin-top: 10px;
+            margin-right: 10px;
         }
     }
     .level-tabs {
@@ -74,6 +74,27 @@
             height: 200px;
         }
     }
+    .modal-box {
+        overflow: hidden;
+        line-height: 28px;
+        margin-bottom: 10px;
+        .modal-box-title {
+            float: left;
+            width: 84px;
+            text-align: right;
+            margin-right: 20px;
+        }
+        .modal-box-detail {
+            float: left;
+            width: 400px;
+            >span {
+                margin-right: 6px;
+            }
+        }
+        >button {
+            margin-right: 20px;
+        }
+    }
 }
 
 .admin-desc-content {

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "afanti",
-  "version": "1.0.42",
+  "version": "1.0.41",
   "description": "",
   "main": "index.js",
   "scripts": {