Explorar el Código

update v1.0.42

yee hace 7 años
padre
commit
54bcfea481

BIN
image/level_2.png


BIN
image/level_3.png


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

@@ -9,6 +9,12 @@
                 font-size: 18px;
                 color: @a-color;
             }
+            img {
+                vertical-align: top;
+                margin-left: 10px;
+                width: 22px;
+                height: 22px;
+            }
         }
         .index-userdata {
             background: #fff;

+ 50 - 10
js/component/account/index/normal.jsx

@@ -1,5 +1,5 @@
 import React from 'react';
-import { Spin, Button, Tabs, message } from 'antd';
+import { Spin, Button, Tabs, message, Modal } from 'antd';
 import ajax from 'jquery/src/ajax/xhr.js'
 import $ from 'jquery/src/ajax';
 
@@ -12,15 +12,18 @@ import weixin from '../../../../image/weixin-w.png';
 import qq from '../../../../image/qq-w.png';
 import weibo from '../../../../image/weibo-w.png';
 
-const TabPane = Tabs.TabPane;
+import level2 from '../../../../image/level_2.png';
+import level3 from '../../../../image/level_3.png';
+
 
 const Content = React.createClass({
-    getInitialState() {
+    getInitialState () {
         return {
-            loading: false
+            loading: false,
+            visible: false
         };
     },
-    getData() {
+    getData () {
         this.setState({
             loading: false
         });
@@ -46,7 +49,8 @@ const Content = React.createClass({
                     personPortraitUrl: data.data.personPortraitUrl,
                     techProjectNum: data.data.techProjectNum,
                     type: data.data.type,
-                    uid: data.data.uid
+                    uid: data.data.uid,
+                    visible: !data.data.lvl || data.data.lvl == 0 ? true : false
                 })
             }
         }.bind(this)).always(function () {
@@ -55,18 +59,34 @@ const Content = React.createClass({
             });
         }.bind(this));
     },
-    componentWillMount() {
+    componentWillMount () {
         this.getData();
     },
-    tabChange(key) {
+    tabChange (key) {
 
     },
-    render() {
+    render () {
+        const TabPane = Tabs.TabPane;
         return (
             <Spin spinning={this.state.loading} className='spin-box'>
                 <div className="index-content">
                     <div className="index-userdata clearfix">
-                        <p className="acc-title">欢迎, <span>{this.state.nickname || ('No.' + this.state.number)}</span>     </p>
+                        <p className="acc-title">
+                            欢迎,
+                            <span>{this.state.nickname || ('No.' + this.state.number)}</span>
+                            <img src={(() => {
+                                switch (this.state.level) {
+                                    case 1:
+                                        return "";
+                                    case 2:
+                                        return level2;
+                                    case 3:
+                                        return level3;
+                                    default:
+                                        return ""
+                                }
+                            })()} alt="" />
+                        </p>
                         <div className="userdata-img">
                             {this.state.personPortraitUrl || this.state.logoUrl ?
                                 <img src={globalConfig.avatarHost + "/upload" + (this.state.type == 0 ? this.state.personPortraitUrl : this.state.logoUrl)} alt="" />
@@ -108,6 +128,26 @@ const Content = React.createClass({
                         <Collection />
                     </div>
                 </div>
+                <Modal maskClosable={false}
+                    title="实名认证提示"
+                    visible={this.state.visible}
+                    onCancel={() => {
+                        this.setState({
+                            visible: false,
+                        });
+                    }}
+                    width='400px'
+                    footer={[]} >
+                    <p style={{ textAlign: 'center' }}>
+                        <span>您还未进行实名认证,请完成实名认证,为您提供更多服务</span>
+                    </p>
+                    <div style={{ marginTop: '20px', textAlign: 'center' }}>
+                        <Button type="primary"
+                            onClick={() => {
+                                window.open(this.state.type == 1 ? globalConfig.context + "/user/groupCertify.html" : globalConfig.context + "/user/certify.html")
+                            }}>马上去</Button>
+                    </div>
+                </Modal>
             </Spin>
         )
     }

+ 16 - 16
js/component/account/set/edu.jsx

@@ -21,20 +21,20 @@ class Avatar extends React.Component {
             propsbool: true,
         }
     }
-    handleChange(info) {
+    handleChange (info) {
         if (info.file.status === 'done') {
             // Get this url from response in real world.
             getBase64(info.file.originFileObj, imageUrl => this.setState({ imageUrl }));
             this.props.urlData(info.file.response.data);
         }
     }
-    componentWillReceiveProps(nextProps) {
+    componentWillReceiveProps (nextProps) {
         if (nextProps.picUrl && this.state.propsbool) {
-            this.state.imageUrl = globalConfig.avatarHost + "/upload" + nextProps.picUrl;
+            this.state.imageUrl = globalConfig.context + "/open/downLoadPicture?path=" + nextProps.picUrl;
             this.state.propsbool = false;
         }
     }
-    render() {
+    render () {
         const imageUrl = this.state.imageUrl;
         return (
             <Upload
@@ -57,7 +57,7 @@ class Avatar extends React.Component {
 };
 
 const EduFrom = Form.create()(React.createClass({
-    getData() {
+    getData () {
         this.props.spinState(true);
         $.ajax({
             method: "get",
@@ -86,7 +86,7 @@ const EduFrom = Form.create()(React.createClass({
             this.props.spinState(false);
         }.bind(this));
     },
-    getInitialState() {
+    getInitialState () {
         return {
             loading: false,
             xueweiPicUrl: '',
@@ -94,10 +94,10 @@ const EduFrom = Form.create()(React.createClass({
             eduPfs: []
         };
     },
-    componentDidMount() {
+    componentDidMount () {
         this.getData();
     },
-    handleSubmit(e) {
+    handleSubmit (e) {
         e.preventDefault();
         this.props.form.validateFields((err, values) => {
             if (!err) {
@@ -131,19 +131,19 @@ const EduFrom = Form.create()(React.createClass({
             }
         });
     },
-    downloadPic(type) {
+    downloadPic (type) {
         window.open(globalConfig.context + "/open/downLoadPicture?path=" + type)
     },
-    handleyear(e) {
+    handleyear (e) {
         this.state.graduationTimeYear = e;
     },
-    xueliPicUrl(e) {
+    xueliPicUrl (e) {
         this.state.xueliPicUrl = e;
     },
-    xueweiPicUrl(e) {
+    xueweiPicUrl (e) {
         this.state.xueweiPicUrl = e;
     },
-    render() {
+    render () {
         const { getFieldDecorator } = this.props.form;
         const formItemLayout = {
             labelCol: { span: 4 },
@@ -250,17 +250,17 @@ const EduFrom = Form.create()(React.createClass({
 }));
 
 const Person = React.createClass({
-    getInitialState() {
+    getInitialState () {
         return {
             loading: false
         };
     },
-    spinChange(e) {
+    spinChange (e) {
         this.setState({
             loading: e
         });
     },
-    render() {
+    render () {
         return (
             <Spin spinning={this.state.loading} className='spin-box'>
                 <div className="set-edu">

+ 21 - 21
js/component/manageCenter/idea/activity/activity.jsx

@@ -8,24 +8,24 @@ import $ from 'jquery/src/ajax';
 
 
 const Avatar = React.createClass({
-    getInitialState() {
+    getInitialState () {
         return {
             imageUrl: ''
         }
     },
-    handleChange(info) {
+    handleChange (info) {
         if (info.file.status === 'done') {
             // Get this url from response in real world.
             getBase64(info.file.originFileObj, imageUrl => this.setState({ imageUrl }));
             this.props.urlData(info.file.response.data);
         }
     },
-    componentWillReceiveProps(nextProps) {
+    componentWillReceiveProps (nextProps) {
         if (this.props.visible && !nextProps.visible) {
             this.state.imageUrl = null;
         };
     },
-    render() {
+    render () {
         const imageUrl = this.state.imageUrl;
         return (
             <Upload
@@ -47,31 +47,31 @@ const Avatar = React.createClass({
 });
 
 const PicturesWall = React.createClass({
-    getInitialState() {
+    getInitialState () {
         return {
             previewVisible: false,
             previewImage: '',
             fileList: [],
         }
     },
-    handleCancel() {
+    handleCancel () {
         this.setState({ previewVisible: false })
     },
-    handlePreview(file) {
+    handlePreview (file) {
         this.setState({
             previewImage: file.url || file.thumbUrl,
             previewVisible: true,
         });
     },
-    handleChange(info) {
+    handleChange (info) {
         let fileList = info.fileList;
         this.setState({ fileList });
         this.props.fileList(fileList);
     },
-    componentWillReceiveProps(nextProps) {
+    componentWillReceiveProps (nextProps) {
         this.state.fileList = nextProps.pictureUrl;
     },
-    render() {
+    render () {
         const { previewVisible, previewImage, fileList } = this.state;
         const uploadButton = (
             <div>
@@ -99,7 +99,7 @@ const PicturesWall = React.createClass({
 });
 
 const Activity = React.createClass({
-    loadData(pageNo) {
+    loadData (pageNo) {
         this.setState({
             loading: true
         });
@@ -156,7 +156,7 @@ const Activity = React.createClass({
             });
         }.bind(this));
     },
-    loadDetailData() {
+    loadDetailData () {
         this.setState({
             loading: true
         });
@@ -190,7 +190,7 @@ const Activity = React.createClass({
             });
         }.bind(this));
     },
-    getInitialState() {
+    getInitialState () {
         return {
             loading: false,
             visible: false,
@@ -244,14 +244,14 @@ const Activity = React.createClass({
             tableData: []
         };
     },
-    tableRowClick(record, index) {
+    tableRowClick (record, index) {
         this.state.RowData = record;
         this.loadDetailData();
         this.setState({
             visible: true
         });
     },
-    componentWillMount() {
+    componentWillMount () {
         this.loadData();
         let theTypeOption = [], theFormOption = [];
         activityType.map((item) => {
@@ -267,7 +267,7 @@ const Activity = React.createClass({
         this.state.activityTypeOption = theTypeOption;
         this.state.activityFormOption = theFormOption;
     },
-    submit() {
+    submit () {
         if (!this.state.RowData.name) {
             message.warning('必须填写一个标题!');
             return;
@@ -289,7 +289,7 @@ const Activity = React.createClass({
             return;
         };
         let imgUrls = null;
-        if (this.state.RowData.imgUrls.length) {
+        if (this.state.RowData.imgUrls && this.state.RowData.imgUrls.length) {
             let picArr = [];
             this.state.RowData.imgUrls.map(function (item) {
                 picArr.push(item.response.data);
@@ -336,7 +336,7 @@ const Activity = React.createClass({
             });
         }.bind(this));
     },
-    cleanCache(sign) {
+    cleanCache (sign) {
         this.setState({
             loading: true
         });
@@ -361,7 +361,7 @@ const Activity = React.createClass({
             });
         }.bind(this));
     },
-    delectRow() {
+    delectRow () {
         let deletedIds = [];
         for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
             let rowItem = this.state.selectedRows[idx];
@@ -393,7 +393,7 @@ const Activity = React.createClass({
             this.loadData();
         }.bind(this));
     },
-    reset() {
+    reset () {
         this.state.startDate = undefined;
         this.state.endDate = undefined;
         this.state.searchName = undefined;
@@ -402,7 +402,7 @@ const Activity = React.createClass({
         this.state.searchForm = undefined;
         this.loadData();
     },
-    render() {
+    render () {
         const rowSelection = {
             selectedRowKeys: this.state.selectedRowKeys,
             onChange: (selectedRowKeys, selectedRows) => {

+ 221 - 79
js/component/manageCenter/userManage/levelSet.jsx

@@ -1,5 +1,5 @@
 import React from 'react';
-import { Icon, Button, Input, Spin, Table, message, Modal, Tabs, InputNumber, Checkbox } from 'antd';
+import { Icon, Button, Input, Spin, Table, message, Modal, Tabs, InputNumber, Checkbox, Select } from 'antd';
 import ajax from 'jquery/src/ajax/xhr.js';
 import $ from 'jquery/src/ajax';
 import './userList.less';
@@ -23,11 +23,33 @@ const ListAdd = React.createClass({
     },
     handleOk () {
         this.setState({
-            loading: true,
-            visible: false
+            loading: true
+        });
+        $.ajax({
+            method: "get",
+            dataType: "json",
+            crossDomain: false,
+            url: globalConfig.context + "/api/admin/member/addGradeName",
+            data: {
+                gradeName: this.state.lvlName,
+                memberRank: this.state.level
+            },
+            success: function (data) {
+                if (data.error && data.error.length) {
+                    message.warning(data.error[0].message);
+                } else {
+                    message.success("添加成功!");
+                    this.state.visible = false;
+                    this.props.refresh(this.state.level);
+                }
+                this.setState({
+                    loading: false
+                })
+            }.bind(this),
         });
     },
     render () {
+        const Option = Select.Option;
         return (
             <div className="patent-desc" style={{ float: 'right', marginRight: '20px' }}>
                 <Button type="primary" onClick={this.showModal}>添加新等级</Button>
@@ -35,6 +57,7 @@ const ListAdd = React.createClass({
                     title="新增用户等级"
                     visible={this.state.visible}
                     onCancel={this.handleCancel}
+                    afterClose={() => { this.state.lvlName = undefined; this.state.level = undefined }}
                     width='400px'
                     footer={[
                         <Button key="submit" type="primary" loading={this.state.loading} onClick={this.handleOk}>提交</Button>,
@@ -46,6 +69,17 @@ const ListAdd = React.createClass({
                         <Input value={this.state.lvlName} style={{ width: '200px' }}
                             onChange={(e) => { this.setState({ lvlName: e.target.value }); }} />
                     </div>
+                    <div className='orgAdd-input'>
+                        <span>会员等级:</span>
+                        <Select value={this.state.level} style={{ width: 120 }}
+                            onChange={(e) => { this.setState({ level: e }) }}>
+                            <Option value="1">1</Option>
+                            <Option value="2">2</Option>
+                            <Option value="3">3</Option>
+                            <Option value="4">4</Option>
+                            <Option value="5">5</Option>
+                        </Select>
+                    </div>
                 </Modal>
             </div>
         );
@@ -73,6 +107,27 @@ const ListDelete = React.createClass({
         this.setState({
             loading: true
         });
+        $.ajax({
+            method: "get",
+            dataType: "json",
+            crossDomain: false,
+            url: globalConfig.context + "/api/admin/member/delGrade",
+            data: {
+                id: this.props.rid
+            },
+            success: function (data) {
+                if (data.error && data.error.length) {
+                    message.warning(data.error[0].message);
+                } else {
+                    message.success("删除成功!");
+                    this.state.visible = false;
+                    this.props.refreshForDel();
+                }
+                this.setState({
+                    loading: false
+                })
+            }.bind(this),
+        });
     },
     render () {
         return (
@@ -103,6 +158,7 @@ const SetContent = React.createClass({
     getInitialState () {
         return {
             visible: false,
+            loading: false,
             columns: [
                 {
                     title: '会员时长',
@@ -140,6 +196,23 @@ const SetContent = React.createClass({
             selectedRowKeys: []
         };
     },
+    componentWillMount () {
+        this.state.checked01 = this.props.business.checked01;
+        this.state.checked02 = this.props.business.checked02;
+        this.state.checked03 = this.props.business.checked03;
+        this.state.checked04 = this.props.business.checked04;
+        this.state.checked05 = this.props.business.checked05;
+        this.state.checked06 = this.props.business.checked06;
+        this.state.checked07 = this.props.business.checked07;
+        this.state.checked08 = this.props.business.checked08;
+        for (let item in this.props.cost) {
+            this.state.dataSource.push({
+                key: this.state.dataSource.length,
+                time: item,
+                money: this.props.cost[item]
+            })
+        }
+    },
     remove () {
         this.state.selectedRowKeys.sort((a, b) => { return b - a });
         let theArr = this.state.dataSource.concat();
@@ -165,7 +238,6 @@ const SetContent = React.createClass({
             selectedRowKeys: []
         });
     },
-
     addNew () {
         this.state.dataSource.push({
             key: this.state.dataSource.length,
@@ -176,6 +248,48 @@ const SetContent = React.createClass({
             dataSource: this.state.dataSource
         })
     },
+    submit () {
+        this.setState({ loading: true });
+        let theCost = {};
+        if (this.state.dataSource.length) {
+            for (let i = 0; i < this.state.dataSource.length; i++) {
+                let theMoney = this.state.dataSource[i].money;
+                let theTime = this.state.dataSource[i].time;
+                theCost[theTime] = theMoney;
+            }
+        };
+        $.ajax({
+            method: "get",
+            dataType: "json",
+            crossDomain: false,
+            url: globalConfig.context + "/api/admin/member/addBusinessAndCost",
+            data: {
+                id: this.props.rid,
+                business: JSON.stringify({
+                    "1008": this.state.checked08 ? "1" : "0",
+                    "1007": this.state.checked07 ? "1" : "0",
+                    "1006": this.state.checked06 ? "1" : "0",
+                    "1005": this.state.checked05 ? "1" : "0",
+                    "1004": this.state.checked04 ? "1" : "0",
+                    "1003": this.state.checked03 ? "1" : "0",
+                    "1002": this.state.checked02 ? "1" : "0",
+                    "1001": this.state.checked01 ? "1" : "0",
+                }),
+                cost: JSON.stringify(theCost)
+            },
+            success: function (data) {
+                if (data.error && data.error.length) {
+                    message.warning(data.error[0].message);
+                } else {
+                    message.success("保存成功!");
+                    this.state.visible = false
+                }
+                this.setState({
+                    loading: false
+                })
+            }.bind(this),
+        });
+    },
     render () {
         const rowSelection = {
             type: 'checkbox',
@@ -189,84 +303,86 @@ const SetContent = React.createClass({
         };
         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>
+            <Spin spinning={this.state.loading}>
+                <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>
-                    <div className="level-checkbox">
-                        <Checkbox checked={this.state.checked}
-                            onChange={(e) => { this.setState({ checked: e.target.checked }) }}>
-                            查看专家的联系方式
-                        </Checkbox>
+                    <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 className="level-checkbox">
-                        <Checkbox checked={this.state.checked}
-                            onChange={(e) => { this.setState({ checked: e.target.checked }) }}>
-                            任何业务申请,付费业享受会员专属折扣
+                    <div>
+                        <div className="level-checkbox">
+                            <Checkbox checked={this.state.checked01}
+                                onChange={(e) => { this.setState({ checked01: e.target.checked }) }}>
+                                科技成果,专家信息定点推送
                         </Checkbox>
-                    </div>
-                    <div className="level-checkbox">
-                        <Checkbox checked={this.state.checked}
-                            onChange={(e) => { this.setState({ checked: e.target.checked }) }}>
-                            一对一的技术经纪人服务,进行技术成果媒合服务
+                        </div>
+                        <div className="level-checkbox">
+                            <Checkbox checked={this.state.checked02}
+                                onChange={(e) => { this.setState({ checked02: e.target.checked }) }}>
+                                查看专家的联系方式
                         </Checkbox>
-                    </div>
-                    <div className="level-checkbox">
-                        <Checkbox checked={this.state.checked}
-                            onChange={(e) => { this.setState({ checked: e.target.checked }) }}>
-                            一对一的科技咨询师服务
+                        </div>
+                        <div className="level-checkbox">
+                            <Checkbox checked={this.state.checked03}
+                                onChange={(e) => { this.setState({ checked03: e.target.checked }) }}>
+                                任何业务申请,付费业享受会员专属折扣
                         </Checkbox>
-                    </div>
-                    <div className="level-checkbox">
-                        <Checkbox checked={this.state.checked}
-                            onChange={(e) => { this.setState({ checked: e.target.checked }) }}>
-                            一对一的专业技术顾问,搜集技术情报,提供研发高参
+                        </div>
+                        <div className="level-checkbox">
+                            <Checkbox checked={this.state.checked04}
+                                onChange={(e) => { this.setState({ checked04: e.target.checked }) }}>
+                                一对一的技术经纪人服务,进行技术成果媒合服务
                         </Checkbox>
-                    </div>
-                    <div className="level-checkbox">
-                        <Checkbox checked={this.state.checked}
-                            onChange={(e) => { this.setState({ checked: e.target.checked }) }}>
-                            免费参加现场业务培训会
+                        </div>
+                        <div className="level-checkbox">
+                            <Checkbox checked={this.state.checked05}
+                                onChange={(e) => { this.setState({ checked05: e.target.checked }) }}>
+                                一对一的科技咨询师服务
                         </Checkbox>
-                    </div>
-                    <div className="level-checkbox">
-                        <Checkbox checked={this.state.checked}
-                            onChange={(e) => { this.setState({ checked: e.target.checked }) }}>
-                            免前期费用做科技类扶持资金项目申报
+                        </div>
+                        <div className="level-checkbox">
+                            <Checkbox checked={this.state.checked06}
+                                onChange={(e) => { this.setState({ checked06: e.target.checked }) }}>
+                                一对一的专业技术顾问,搜集技术情报,提供研发高参
                         </Checkbox>
+                        </div>
+                        <div className="level-checkbox">
+                            <Checkbox checked={this.state.checked07}
+                                onChange={(e) => { this.setState({ checked07: e.target.checked }) }}>
+                                免费参加现场业务培训会
+                        </Checkbox>
+                        </div>
+                        <div className="level-checkbox">
+                            <Checkbox checked={this.state.checked08}
+                                onChange={(e) => { this.setState({ checked08: e.target.checked }) }}>
+                                免前期费用做科技类扶持资金项目申报
+                        </Checkbox>
+                        </div>
+                    </div>
+                    <div className="level-tabs-save">
+                        <Button type="primary" onClick={this.submit}>保存</Button>
+                        <ListDelete rid={this.props.rid} refreshForDel={this.props.refreshForDel} />
                     </div>
                 </div>
-                <div className="level-tabs-save">
-                    <Button type="primary" onClick={this.search}>保存</Button>
-                    <ListDelete />
-                </div>
-            </div>
+            </Spin>
         );
     }
 });
 
 
-const CustomerList = React.createClass({
+const LevelSet = React.createClass({
     loadData (pageNo) {
         this.setState({
             loading: true
@@ -275,12 +391,32 @@ const CustomerList = React.createClass({
             method: "get",
             dataType: "json",
             crossDomain: false,
-            url: globalConfig.context + "/api/admin/customer",
+            url: globalConfig.context + "/api/admin/member/selectMemberGrade",
             data: {
             },
             success: function (data) {
+                let theArr = [];
                 if (data.error && data.error.length) {
                     message.warning(data.error[0].message);
+                } else {
+                    for (let i = 0; i < data.data.length; i++) {
+                        let item = data.data[i];
+                        let theBusiness = {};
+                        theBusiness['checked01'] = (item.business && item.business['1001'] == 1 ? true : false);
+                        theBusiness['checked02'] = (item.business && item.business['1002'] == 1 ? true : false);
+                        theBusiness['checked03'] = (item.business && item.business['1003'] == 1 ? true : false);
+                        theBusiness['checked04'] = (item.business && item.business['1004'] == 1 ? true : false);
+                        theBusiness['checked05'] = (item.business && item.business['1005'] == 1 ? true : false);
+                        theBusiness['checked06'] = (item.business && item.business['1006'] == 1 ? true : false);
+                        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}>
+                                <SetContent business={theBusiness} cost={item.cost || []} rid={item.id} refreshForDel={this.refreshForDel} />
+                            </Tabs.TabPane>
+                        )
+                    };
+                    this.setState({ tabPane: theArr })
                 }
             }.bind(this),
         }).always(function () {
@@ -291,29 +427,35 @@ const CustomerList = React.createClass({
     },
     getInitialState () {
         return {
-            data: [],
+            tabPane: [],
+            activeKey: '1',
             loading: false
         };
     },
     componentWillMount () {
         this.loadData();
     },
-    tabChange () { },
+    refresh (e) {
+        this.state.activeKey = e;
+        this.loadData()
+    },
+    refreshForDel () {
+        this.state.activeKey = '1';
+        this.loadData();
+    },
+    tabChange (e) {
+        this.setState({ activeKey: e });
+    },
     render () {
         return (
             <div className="user-content" >
                 <div className="content-title clearfix">
                     <span>会员等级管理</span>
-                    <ListAdd />
+                    <ListAdd refresh={this.refresh} />
                 </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 activeKey={this.state.activeKey} onChange={this.tabChange}>
+                        {this.state.tabPane}
                     </Tabs>
                 </div>
             </div >
@@ -321,4 +463,4 @@ const CustomerList = React.createClass({
     }
 });
 
-export default CustomerList;
+export default LevelSet;

+ 1 - 1
package.json

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