yee 7 years ago
parent
commit
5703b4c719

BIN
image/logo-2.png


BIN
image/logo.png


+ 14 - 8
js/component/account/achievement/techAchievementDesc.jsx

@@ -114,6 +114,7 @@ const PicturesWall = React.createClass({
         return (
             <div className="clearfix">
                 <Upload
+                    beforeUpload={beforeUploadFile}
                     action={globalConfig.context + "/api/user/achievement/uploadPicture"}
                     data={{ 'sign': this.props.pictureSign }}
                     listType="picture-card"
@@ -349,6 +350,7 @@ const AchievementDetailShow = Form.create()(React.createClass({
                         label="技术图片" >
                         <div className="clearfix">
                             <Upload className="demandDetailShow-upload"
+                                beforeUpload={beforeUploadFile}
                                 listType="picture-card"
                                 fileList={this.state.technicalPictureUrl}
                                 onPreview={(file) => {
@@ -432,7 +434,7 @@ const AchievementDetailShow = Form.create()(React.createClass({
                         label="成熟度证明材料(文本)" >
                         <p>{theData.maturityTextFileUrl ?
                             <span className="download-file">
-                                <a onClick={() => { window.open(globalConfig.context + '/api/user/achievement/download?id=' + this.props.data.id + '&sign=achievement_maturity_text_file') }}>成熟度证明材料(文本文件)</a>
+                                <a onClick={() => { window.open(globalConfig.context + '/api/user/achievement/download?id=' + this.props.data.id + '&sign=achievement_maturity_text_file') }}>{theData.maturityTextFileDownloadFileName}</a>
                             </span>
                             : <span><Icon type="exclamation-circle" style={{ color: '#ffbf00', marginRight: '6px' }} />未上传!</span>}</p>
                     </FormItem>
@@ -591,7 +593,7 @@ const AchievementDetailShow = Form.create()(React.createClass({
                         label="技术方案" >
                         <p>{theData.techPlanUrl ?
                             <span className="download-file">
-                                <a onClick={() => { window.open(globalConfig.context + '/api/user/achievement/download?id=' + this.props.data.id + '&sign=achievement_tech_plan') }}>技术方案</a>
+                                <a onClick={() => { window.open(globalConfig.context + '/api/user/achievement/download?id=' + this.props.data.id + '&sign=achievement_tech_plan') }}>{theData.techPlanDownloadFileName}</a>
                             </span>
                             : <span><Icon type="exclamation-circle" style={{ color: '#ffbf00', marginRight: '6px' }} />未上传!</span>}</p>
                     </FormItem>
@@ -601,7 +603,7 @@ const AchievementDetailShow = Form.create()(React.createClass({
                         label="商业计划书" >
                         <p>{theData.businessPlanUrl ?
                             <span className="download-file">
-                                <a onClick={() => { window.open(globalConfig.context + '/api/user/achievement/download?id=' + this.props.data.id + '&sign=achievement_business_plan') }}>商业计划书</a>
+                                <a onClick={() => { window.open(globalConfig.context + '/api/user/achievement/download?id=' + this.props.data.id + '&sign=achievement_business_plan') }}>{theData.businessPlanDownloadFileName}</a>
                             </span>
                             : <span><Icon type="exclamation-circle" style={{ color: '#ffbf00', marginRight: '6px' }} />未上传!</span>}</p>
                     </FormItem>
@@ -685,7 +687,9 @@ const AchievementDetailForm = Form.create()(React.createClass({
             if (this.state.technicalPictureUrl.length) {
                 let picArr = [];
                 this.state.technicalPictureUrl.map(function (item) {
-                    picArr.push(item.response.data);
+                    if ( item.response && item.response.data && item.response.data.length ){
+                        picArr.push(item.response.data);
+                    }
                 });
                 theTechnicalPictureUrl = picArr.join(",");
             };
@@ -693,7 +697,9 @@ const AchievementDetailForm = Form.create()(React.createClass({
             if (this.state.maturityPictureUrl.length) {
                 let picArr = [];
                 this.state.maturityPictureUrl.map(function (item) {
-                    picArr.push(item.response.data);
+                    if ( item.response && item.response.data && item.response.data.length ){
+                        picArr.push(item.response.data);
+                    }
                 });
                 theMaturityPictureUrl = picArr.join(",");
             };
@@ -1009,7 +1015,7 @@ const AchievementDetailForm = Form.create()(React.createClass({
                         </Upload>
                         <p style={{ marginTop: '10px' }}>{theData.maturityTextFileUrl ?
                             <span className="download-file">
-                                <a onClick={() => { window.open(globalConfig.context + '/api/user/achievement/download?id=' + this.props.data.id + '&sign=achievement_maturity_text_file') }}>成熟度证明材料(文本文件)</a>
+                                <a onClick={() => { window.open(globalConfig.context + '/api/user/achievement/download?id=' + this.props.data.id + '&sign=achievement_maturity_text_file') }}>{theData.maturityTextFileDownloadFileName}</a>
                             </span>
                             : <span><Icon type="exclamation-circle" style={{ color: '#ffbf00', marginRight: '6px' }} />未上传!</span>}</p>
                     </FormItem>
@@ -1166,7 +1172,7 @@ const AchievementDetailForm = Form.create()(React.createClass({
                         </Upload>
                         <p style={{ marginTop: '10px' }}>{theData.techPlanUrl ?
                             <span className="download-file">
-                                <a onClick={() => { window.open(globalConfig.context + '/api/user/achievement/download?id=' + this.props.data.id + '&sign=achievement_tech_plan') }}>技术方案</a>
+                                <a onClick={() => { window.open(globalConfig.context + '/api/user/achievement/download?id=' + this.props.data.id + '&sign=achievement_tech_plan') }}>{theData.techPlanDownloadFileName}</a>
                             </span>
                             : <span><Icon type="exclamation-circle" style={{ color: '#ffbf00', marginRight: '6px' }} />未上传!</span>}</p>
                     </FormItem>
@@ -1201,7 +1207,7 @@ const AchievementDetailForm = Form.create()(React.createClass({
                         </Upload>
                         <p style={{ marginTop: '10px' }}>{theData.businessPlanUrl ?
                             <span className="download-file">
-                                <a onClick={() => { window.open(globalConfig.context + '/api/user/achievement/download?id=' + this.props.data.id + '&sign=achievement_business_plan') }}>商业计划书</a>
+                                <a onClick={() => { window.open(globalConfig.context + '/api/user/achievement/download?id=' + this.props.data.id + '&sign=achievement_business_plan') }}>{theData.businessPlanDownloadFileName}</a>
                             </span>
                             : <span><Icon type="exclamation-circle" style={{ color: '#ffbf00', marginRight: '6px' }} />未上传!</span>}</p>
                     </FormItem>

+ 3 - 1
js/component/account/demand/techDemandDesc.jsx

@@ -523,7 +523,9 @@ const DemandDetailForm = Form.create()(React.createClass({
             if (this.state.pictureUrl.length) {
                 let picArr = [];
                 this.state.pictureUrl.map(function (item) {
-                    picArr.push(item.response.data);
+                    if ( item.response && item.response.data && item.response.data.length ){
+                        picArr.push(item.response.data);
+                    }
                 });
                 thePictureUrl = picArr.join(",");
             };

+ 3 - 1
js/component/account/set/company.jsx

@@ -189,7 +189,9 @@ const PersonFrom = Form.create()(React.createClass({
             if (this.state.companyLifePicObj.length) {
                 let leftPicArr = [];
                 this.state.companyLifePicObj.map(function (item) {
-                    leftPicArr.push(item.response.data);
+                    if ( item.response && item.response.data && item.response.data.length ){
+                        leftPicArr.push(item.response.data);
+                    }
                 });
                 lifePhotoUrl = leftPicArr.join(",");
             };

+ 3 - 1
js/component/account/set/person.jsx

@@ -155,7 +155,9 @@ const PersonFrom = Form.create()(React.createClass({
             //lifePhotoUrl
             let livePicArr = [];
             this.state.lifePhotoList.map(function (item) {
-                livePicArr.push(item.response.data);
+                if ( item.response && item.response.data && item.response.data.length ){
+                    livePicArr.push(item.response.data);
+                }
             });
             let lifePhotoUrl = livePicArr.join(",");
             if (!err) {

+ 26 - 1
js/component/account/topTab.jsx

@@ -22,11 +22,36 @@ const TopTab = React.createClass({
             window.location.href = globalConfig.context + "/portal/index.html"
         });
     },
+    componentWillMount () {
+        this.getData();
+    },
+    getData () {
+        this.setState({
+            loading: false
+        });
+        $.ajax({
+            method: "get",
+            dataType: "json",
+            url: globalConfig.context + "/api/user/nickname"
+        }).done(function (data) {
+            if (data.error && data.error.length) {
+                message.warning(data.error[0].message);
+            } else {
+                this.setState({
+                    nickname: data.data,
+                })
+            }
+        }.bind(this)).always(function () {
+            this.setState({
+                loading: false
+            });
+        }.bind(this));
+    },
     render() {
         return (
             <div className="account-top" >
                 <div className="acc-top-user">
-                    <span className="acc-top-user-name">欢迎您, {userData.nickname || userData.number || this.state.username} <a onClick={this.logOut}>[ 退出 ]</a></span>
+                    <span className="acc-top-user-name">欢迎您, {this.state.nickname || userData.nickname || userData.number } <a onClick={this.logOut}>[ 退出 ]</a></span>
                     <span className="acc-top-user-toindex"><a href={globalConfig.context + "/portal/index.html"}>返回首页</a></span>
                 </div>
                 <div className="acc-index">

+ 0 - 3
js/component/certify/top.jsx

@@ -16,9 +16,6 @@ const LoginTop = React.createClass({
                             <a href={globalConfig.context + "/portal/index.html"}>返回首页</a>
                             <a href="./account/index">尊敬的{userData.nickname || userData.number }</a>
                             <a href="./login.html">退出</a>
-                            <a href="./index.html">交易管理中心</a>
-                            <a href="./index.html">消息</a>
-                            <a href="./index.html">帮助中心</a>
                         </span>
                     </div>
                 </div>

+ 9 - 3
js/component/manageCenter/achievement/techAchievementDesc.jsx

@@ -969,7 +969,9 @@ const AchievementDetailForm = Form.create()(React.createClass({
             if (this.state.technicalPictureUrl.length) {
                 let picArr = [];
                 this.state.technicalPictureUrl.map(function (item) {
-                    picArr.push(item.response.data);
+                    if ( item.response && item.response.data && item.response.data.length ){
+                        picArr.push(item.response.data);
+                    }
                 });
                 theTechnicalPictureUrl = picArr.join(",");
             };
@@ -977,7 +979,9 @@ const AchievementDetailForm = Form.create()(React.createClass({
             if (this.state.coverImg.length) {
                 let picArr = [];
                 this.state.coverImg.map(function (item) {
-                    picArr.push(item.response.data);
+                    if ( item.response && item.response.data && item.response.data.length ){
+                        picArr.push(item.response.data);
+                    }
                 });
                 thecoverImg = picArr.join(",");
             };
@@ -985,7 +989,9 @@ const AchievementDetailForm = Form.create()(React.createClass({
             if (this.state.maturityPictureUrl.length) {
                 let picArr = [];
                 this.state.maturityPictureUrl.map(function (item) {
-                    picArr.push(item.response.data);
+                    if ( item.response && item.response.data && item.response.data.length ){
+                        picArr.push(item.response.data);
+                    }
                 });
                 theMaturityPictureUrl = picArr.join(",");
             };

+ 6 - 2
js/component/manageCenter/customer/customerData/companyCustomer.jsx

@@ -1069,7 +1069,9 @@ const PublicCustomer = Form.create()(React.createClass({
 			if(this.state.orgCodeUrl.length) {
 				let picArr = [];
 				this.state.orgCodeUrl.map(function(item) {
-					picArr.push(item.response.data);
+					if ( item.response && item.response.data && item.response.data.length ){
+						picArr.push(item.response.data);
+					}
 				});
 				theorgCodeUrl = picArr.join(",");
 			};
@@ -1077,7 +1079,9 @@ const PublicCustomer = Form.create()(React.createClass({
 			if(this.state.companyLogoUrl.length) {
 				let picArr = [];
 				this.state.companyLogoUrl.map(function(item) {
-					picArr.push(item.response.data);
+					if ( item.response && item.response.data && item.response.data.length ){
+						picArr.push(item.response.data);
+					}
 				});
 				thecompanyLogoUrl = picArr.join(",");
 			};

+ 6 - 2
js/component/manageCenter/customer/customerData/myClient.jsx

@@ -1006,7 +1006,9 @@ const MyClient = Form.create()(React.createClass({
 			if(this.state.orgCodeUrl.length) {
 				let picArr = [];
 				this.state.orgCodeUrl.map(function(item) {
-					picArr.push(item.response.data);
+					if ( item.response && item.response.data && item.response.data.length ){
+						picArr.push(item.response.data);
+					}
 				});
 				theorgCodeUrl = picArr.join(",");
 			};
@@ -1014,7 +1016,9 @@ const MyClient = Form.create()(React.createClass({
 			if(this.state.companyLogoUrl.length) {
 				let picArr = [];
 				this.state.companyLogoUrl.map(function(item) {
-					picArr.push(item.response.data);
+					if ( item.response && item.response.data && item.response.data.length ){
+						picArr.push(item.response.data);
+					}
 				});
 				thecompanyLogoUrl = picArr.join(",");
 			};

+ 9 - 3
js/component/manageCenter/customer/individualCustomer/individualCustomer.jsx

@@ -1054,7 +1054,9 @@ const IndividualCustomer = Form.create()(React.createClass({
 			if(this.state.headPortraitUrl.length) {
 				let picArr = [];
 				this.state.headPortraitUrl.map(function(item) {
-					picArr.push(item.response.data);
+					if ( item.response && item.response.data && item.response.data.length ){
+						picArr.push(item.response.data);
+					}
 				});
 				theorgCodeUrl = picArr.join(",");
 			};
@@ -1062,7 +1064,9 @@ const IndividualCustomer = Form.create()(React.createClass({
 			if(this.state.positiveIdUrl.length) {
 				let picArr = [];
 				this.state.positiveIdUrl.map(function(item) {
-					picArr.push(item.response.data);
+					if ( item.response && item.response.data && item.response.data.length ){
+						picArr.push(item.response.data);
+					}
 				});
 				thecompanyLogoUrl = picArr.join(",");
 			};
@@ -1070,7 +1074,9 @@ const IndividualCustomer = Form.create()(React.createClass({
 			if(this.state.oppositeIdUrl.length) {
 				let picArr = [];
 				this.state.oppositeIdUrl.map(function(item) {
-					picArr.push(item.response.data);
+					if ( item.response && item.response.data && item.response.data.length ){
+						picArr.push(item.response.data);
+					}
 				});
 				thecompanyLogoUrls = picArr.join(",");
 			};

+ 9 - 3
js/component/manageCenter/customer/individualCustomer/queryCustomer.jsx

@@ -984,7 +984,9 @@ const QueryCustomer = Form.create()(React.createClass({
 			if(this.state.headPortraitUrl.length) {
 				let picArr = [];
 				this.state.headPortraitUrl.map(function(item) {
-					picArr.push(item.response.data);
+					if ( item.response && item.response.data && item.response.data.length ){
+						picArr.push(item.response.data);
+					}
 				});
 				theorgCodeUrl = picArr.join(",");
 			};
@@ -992,7 +994,9 @@ const QueryCustomer = Form.create()(React.createClass({
 			if(this.state.positiveIdUrl.length) {
 				let picArr = [];
 				this.state.positiveIdUrl.map(function(item) {
-					picArr.push(item.response.data);
+					if ( item.response && item.response.data && item.response.data.length ){
+						picArr.push(item.response.data);
+					}
 				});
 				thecompanyLogoUrl = picArr.join(",");
 			};
@@ -1000,7 +1004,9 @@ const QueryCustomer = Form.create()(React.createClass({
 			if(this.state.oppositeIdUrl.length) {
 				let picArr = [];
 				this.state.oppositeIdUrl.map(function(item) {
-					picArr.push(item.response.data);
+					if ( item.response && item.response.data && item.response.data.length ){
+						picArr.push(item.response.data);
+					}
 				});
 				thecompanyLogoUrls = picArr.join(",");
 			};

+ 6 - 2
js/component/manageCenter/demand/techDemandDesc.jsx

@@ -835,7 +835,9 @@ const DemandDetailForm = Form.create()(React.createClass({
             if (this.state.pictureUrl.length) {
                 let picArr = [];
                 this.state.pictureUrl.map(function (item) {
-                    picArr.push(item.response.data);
+                    if ( item.response && item.response.data && item.response.data.length ){
+                        picArr.push(item.response.data);
+                    }
                 });
                 thePictureUrl = picArr.join(",");
             };
@@ -843,7 +845,9 @@ const DemandDetailForm = Form.create()(React.createClass({
             if (this.state.coverImg.length) {
                 let picArr = [];
                 this.state.coverImg.map(function (item) {
-                    picArr.push(item.response.data);
+                    if ( item.response && item.response.data && item.response.data.length ){
+                        picArr.push(item.response.data);
+                    }
                 });
                 thecoverImg = picArr.join(",");
             };

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

@@ -292,7 +292,9 @@ const Activity = React.createClass({
         if (this.state.RowData.imgUrls && this.state.RowData.imgUrls.length) {
             let picArr = [];
             this.state.RowData.imgUrls.map(function (item) {
-                picArr.push(item.response.data);
+                if ( item.response && item.response.data && item.response.data.length ){
+                    picArr.push(item.response.data);
+                }
             });
             imgUrls = picArr.join(",");
         };

+ 6 - 2
js/component/manageCenter/set/business/businessProject.jsx

@@ -387,7 +387,9 @@ const BusinessProject=Form.create()(React.createClass({
 			if(this.state.orgCodeUrl.length) {
 				let picArr = [];
 				this.state.orgCodeUrl.map(function(item) {
-					picArr.push(item.response.data);
+					if ( item.response && item.response.data && item.response.data.length ){
+						picArr.push(item.response.data);
+					}
 				});
 				theorgCodeUrl = picArr.join(",");
 			};
@@ -395,7 +397,9 @@ const BusinessProject=Form.create()(React.createClass({
 			if(this.state.companyLogoUrl.length) {
 				let picArr = [];
 				this.state.companyLogoUrl.map(function(item) {
-					picArr.push(item.response.data);
+					if ( item.response && item.response.data && item.response.data.length ){
+						picArr.push(item.response.data);
+					}
 				});
 				thecompanyLogoUrl = picArr.join(",");
 			};

+ 3 - 1
js/component/manageCenter/set/userManagementS/newUser.jsx

@@ -102,7 +102,9 @@ const Newuser = Form.create()(React.createClass({
         if (this.state.orgCodeUrl.length) {
             let picArr = [];
             this.state.orgCodeUrl.map(function (item) {
-                picArr.push(item.response.data);
+				if ( item.response && item.response.data && item.response.data.length ){
+					picArr.push(item.response.data);
+				}
             });
             theorgCodeUrl = picArr.join(",");
         };

+ 5 - 10
js/component/tools.js

@@ -85,16 +85,11 @@ module.exports = {
         reader.readAsDataURL(img);
     },
     beforeUpload: function (file) {
-        // debugger
-        // const isJPG = file.type === 'image/jpeg/document';
-        // if (!isJPG) {
-        //     message.error('You can only upload JPG file!');
-        // }
-        // const isLt2M = file.size / 1024 / 1024 < 2;
-        // if (!isLt2M) {
-        //     message.error('Image must smaller than 2MB!');
-        // }
-        // return isJPG && isLt2M;
+        const isLt2M = file.size / 1024 / 1024 < 2;
+        if (!isLt2M) {
+            message.error('图片小大必须小于2MB!');
+        }
+        return isLt2M;
     },
     beforeUploadFile: function (file) {
         // debugger

+ 7 - 7
js/user/index.js

@@ -1,9 +1,9 @@
-import React from 'react';
-import ReactDOM from 'react-dom';
+import React from 'react'
+import ReactDOM from 'react-dom'
 
 ReactDOM.render(
-    <div>
-        <span>this is user-index</span>
-    </div>,
-    document.getElementById('root')
-)
+  <div>
+    <span>this is user-index</span>
+  </div>,
+  document.getElementById('root')
+)