Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
www.fudou6.com
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liaili
www.fudou6.com
Commits
32d13b8e
Commit
32d13b8e
authored
Aug 01, 2016
by
superman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
project submit
parent
7dd48629
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
122 additions
and
73 deletions
+122
-73
project.js
public/javascripts/project.js
+43
-23
project.js.map
public/javascripts/project.js.map
+1
-1
project.jsx
public/javascripts/project.jsx
+55
-42
project.min.js
public/javascripts/project.min.js
+1
-1
project.css
public/stylesheets/project.css
+1
-1
project.less
public/stylesheets/project.less
+1
-1
style.css
public/stylesheets/style.css
+10
-0
style.less
public/stylesheets/style.less
+9
-3
project.hbs
views/project.hbs
+1
-1
No files found.
public/javascripts/project.js
View file @
32d13b8e
...
@@ -5,52 +5,72 @@
...
@@ -5,52 +5,72 @@
*/
*/
(
function
()
{
(
function
()
{
var
$form
=
$
(
'#container .introducer'
);
var
$form
=
$
(
'#container .introducer'
);
var
$submit
=
$
(
'input[type="submit"]'
,
$form
);
var
$introducerMobile
=
$
(
'#introducerMobile'
,
$form
);
var
$introducerMobile
=
$
(
'#introducerMobile'
,
$form
);
var
$projectDescription
=
$
(
'#projectDescription'
,
$form
);
var
$projectDescription
=
$
(
'#projectDescription'
,
$form
);
var
$errorPhone
=
$
(
'.error-phone'
,
$form
);
var
$errorPhone
=
$
(
'.error-phone'
,
$form
);
var
$errorDescription
=
$
(
'.error-description'
,
$form
);
var
$errorDescription
=
$
(
'.error-description'
,
$form
);
var
$successDialog
=
$
(
'.modal-box-success'
);
var
filterMobileInput
=
function
filterMobileInput
(
$mobile
)
{
var
filterMobileInput
=
function
filterMobileInput
(
$mobile
)
{
$mobile
.
val
((
$mobile
.
val
()
+
''
).
replace
(
/
[^\d]
/g
,
''
));
$mobile
.
val
((
$mobile
.
val
()
+
''
).
replace
(
/
[^\d]
/g
,
''
));
};
};
var
validateMobile
=
function
validateMobile
(
mobile
)
{
var
validateMobile
=
function
validateMobile
()
{
return
(
/^
[\d]{11}
$/g
.
test
(
mobile
)
var
mobile
=
$
.
trim
(
$introducerMobile
.
val
()
+
''
);
);
if
(
/^
[\d]{11}
$/g
.
test
(
mobile
))
{
$errorPhone
.
empty
();
return
mobile
;
}
else
{
$errorPhone
.
html
(
'手机号输入错误!'
);
return
false
;
}
};
};
var
validateRequire
=
function
validateRequire
(
value
)
{
var
validateDescription
=
function
validateDescription
()
{
return
value
.
length
;
var
description
=
$
.
trim
(
$projectDescription
.
val
()
+
''
);
if
(
description
.
length
)
{
$errorDescription
.
empty
();
return
description
;
}
else
{
$errorDescription
.
html
(
'请输入项目描述内容!'
);
return
false
;
}
};
};
$introducerMobile
.
on
(
'keyup'
,
function
(
e
)
{
$introducerMobile
.
on
(
'keyup'
,
function
(
e
)
{
filterMobileInput
(
$introducerMobile
);
filterMobileInput
(
$introducerMobile
);
}).
on
(
'change blur'
,
function
(
e
)
{
}).
on
(
'change blur'
,
function
(
e
)
{
validateMobile
(
$
.
trim
(
$introducerMobile
.
val
()
+
''
))
?
$errorPhone
.
empty
()
:
$errorPhone
.
html
(
'手机号输入错误!'
);
validateMobile
();
}).
on
(
'focus'
,
function
(
e
)
{
$errorPhone
.
empty
();
});
});
$projectDescription
.
on
(
'change blur'
,
function
(
e
)
{
$projectDescription
.
on
(
'change blur'
,
function
(
e
)
{
validateRequire
(
$
.
trim
(
$projectDescription
.
val
()
+
''
))
?
$errorDescription
.
empty
()
:
$errorDescription
.
html
(
'请输入项目描述内容!'
);
validateDescription
();
}).
on
(
'focus'
,
function
(
e
)
{
$errorDescription
.
empty
();
});
$successDialog
.
on
(
'click'
,
'modal-dialog-close'
,
function
(
e
)
{
$successDialog
.
fadeOut
(
300
);
});
});
$form
.
on
(
'submit'
,
function
(
e
)
{
$form
.
on
(
'submit'
,
function
(
e
)
{
var
mobile
=
$
.
trim
(
$introducerMobile
.
val
()
+
''
);
e
.
preventDefault
();
var
desc
=
$
.
trim
(
$projectDescription
.
val
()
+
''
);
var
mobile
=
validateMobile
();
if
(
validateMobile
(
mobile
))
{
var
description
=
validateDescription
();
$errorPhone
.
empty
();
if
(
mobile
&&
description
)
{
}
else
{
request
(
'/api/1.0/proj/add.json'
,
{
$errorPhone
.
html
(
'手机号输入错误!'
);
mobile
:
mobile
,
return
;
description
:
description
}
},
'POST'
).
then
(
function
()
{
if
(
validateRequire
(
desc
))
{
$successDialog
.
fadeIn
(
300
);
$errorDescription
.
empty
();
alert
(
'提交成功!'
);
}
else
{
}).
catch
(
function
()
{
$errorDescription
.
html
(
'请输入项目描述内容!'
);
alert
(
'提交失败, 请稍后再试!'
);
return
;
}
request
(
''
,
{},
'POST'
).
then
(
function
(
result
)
{
console
.
log
(
result
);
});
});
}
});
});
})();
})();
...
...
public/javascripts/project.js.map
View file @
32d13b8e
This diff is collapsed.
Click to expand it.
public/javascripts/project.jsx
View file @
32d13b8e
/**
/**
* Created by Administrator on 2016/7/27.
* Created by Administrator on 2016/7/27.
*/
*/
(()
=>
{
(()
=>
{
const
$form
=
$
(
'#container .introducer'
);
const
$form
=
$
(
'#container .introducer'
);
const
$submit
=
$
(
'input[type="submit"]'
,
$form
);
const
$introducerMobile
=
$
(
'#introducerMobile'
,
$form
);
const
$introducerMobile
=
$
(
'#introducerMobile'
,
$form
);
const
$projectDescription
=
$
(
'#projectDescription'
,
$form
);
const
$projectDescription
=
$
(
'#projectDescription'
,
$form
);
const
$errorPhone
=
$
(
'.error-phone'
,
$form
);
const
$errorPhone
=
$
(
'.error-phone'
,
$form
);
const
$errorDescription
=
$
(
'.error-description'
,
$form
);
const
$errorDescription
=
$
(
'.error-description'
,
$form
);
const
$successDialog
=
$
(
'.modal-box-success'
);
const
filterMobileInput
=
(
$mobile
)
=>
{
const
filterMobileInput
=
(
$mobile
)
=>
{
$mobile
.
val
((
$mobile
.
val
()
+
''
).
replace
(
/
[^\d]
/g
,
''
));
$mobile
.
val
((
$mobile
.
val
()
+
''
).
replace
(
/
[^\d]
/g
,
''
));
};
};
const
validateMobile
=
(
mobile
)
=>
{
const
validateMobile
=
()
=>
{
return
/^
[\d]{11}
$/g
.
test
(
mobile
);
let
mobile
=
$
.
trim
(
$introducerMobile
.
val
()
+
''
);
if
(
/^
[\d]{11}
$/g
.
test
(
mobile
))
{
$errorPhone
.
empty
();
return
mobile
;
}
else
{
$errorPhone
.
html
(
'手机号输入错误!'
);
return
false
;
}
};
};
const
validateRequire
=
(
value
)
=>
{
const
validateDescription
=
()
=>
{
return
value
.
length
;
let
description
=
$
.
trim
(
$projectDescription
.
val
()
+
''
);
if
(
description
.
length
)
{
$errorDescription
.
empty
();
return
description
;
}
else
{
$errorDescription
.
html
(
'请输入项目描述内容!'
);
return
false
;
}
};
};
$introducerMobile
.
on
(
'keyup'
,
(
e
)
=>
{
$introducerMobile
.
on
(
'keyup'
,
(
e
)
=>
{
filterMobileInput
(
$introducerMobile
);
filterMobileInput
(
$introducerMobile
);
}).
on
(
'change blur'
,
(
e
)
=>
{
}).
on
(
'change blur'
,
(
e
)
=>
{
validateMobile
(
$
.
trim
(
$introducerMobile
.
val
()
+
''
))
?
validateMobile
(
);
$errorPhone
.
empty
()
:
}).
on
(
'focus'
,
(
e
)
=>
{
$errorPhone
.
html
(
'手机号输入错误!'
);
$errorPhone
.
empty
(
);
});
});
$projectDescription
.
on
(
'change blur'
,
(
e
)
=>
{
$projectDescription
.
on
(
'change blur'
,
(
e
)
=>
{
validate
Require
(
$
.
trim
(
$projectDescription
.
val
()
+
''
))
?
validate
Description
();
$errorDescription
.
empty
()
:
}).
on
(
'focus'
,
(
e
)
=>
{
$errorDescription
.
html
(
'请输入项目描述内容!'
);
$errorDescription
.
empty
(
);
});
});
$form
.
on
(
'submit'
,
(
e
)
=>
{
let
mobile
=
$
.
trim
(
$introducerMobile
.
val
()
+
''
);
$successDialog
.
on
(
'click'
,
'modal-dialog-close'
,
(
e
)
=>
{
let
desc
=
$
.
trim
(
$projectDescription
.
val
()
+
''
);
$successDialog
.
fadeOut
(
300
);
if
(
validateMobile
(
mobile
)){
$errorPhone
.
empty
()
}
else
{
$errorPhone
.
html
(
'手机号输入错误!'
);
return
;
}
if
(
validateRequire
(
desc
)){
$errorDescription
.
empty
()
}
else
{
$errorDescription
.
html
(
'请输入项目描述内容!'
);
return
;
}
request
(
''
,
{},
'POST'
).
then
((
result
)
=>
{
console
.
log
(
result
);
});
});
$form
.
on
(
'submit'
,
(
e
)
=>
{
e
.
preventDefault
();
let
mobile
=
validateMobile
();
let
description
=
validateDescription
();
if
(
mobile
&&
description
)
{
request
(
'/api/1.0/proj/add.json'
,
{
mobile
,
description
},
'POST'
).
then
(()
=>
{
$successDialog
.
fadeIn
(
300
);
alert
(
'提交成功!'
);
}).
catch
(()
=>
{
alert
(
'提交失败, 请稍后再试!'
);
});
}
});
});
})();
})();
(()
=>
{
(()
=>
{
const
$modalBox
=
$
(
'.modal-box'
);
const
$modalBox
=
$
(
'.modal-box'
);
$
(
'.hot-project-address'
).
on
(
'click'
,
'a'
,(
e
)
=>
{
$
(
'.hot-project-address'
).
on
(
'click'
,
'a'
,
(
e
)
=>
{
e
.
preventDefault
();
e
.
preventDefault
();
$modalBox
.
fadeIn
(
300
);
$modalBox
.
fadeIn
(
300
);
});
});
$modalBox
.
on
(
'click'
,
'.modal-dialog-close'
,
(
e
)
=>
{
$modalBox
.
on
(
'click'
,
'.modal-dialog-close'
,
(
e
)
=>
{
e
.
preventDefault
();
e
.
preventDefault
();
$modalBox
.
fadeOut
(
300
);
$modalBox
.
fadeOut
(
300
);
});
});
})();
})();
// (function () {
// (function () {
//
//
//
//
...
...
public/javascripts/project.min.js
View file @
32d13b8e
"use strict"
;(
function
(){
var
$form
=
$
(
"#container .introducer"
);
var
$introducerMobile
=
$
(
"#introducerMobile"
,
$form
);
var
$projectDescription
=
$
(
"#projectDescription"
,
$form
);
var
$errorPhone
=
$
(
".error-phone"
,
$form
);
var
$errorDescription
=
$
(
".error-description"
,
$form
);
var
filterMobileInput
=
function
filterMobileInput
(
$mobile
){
$mobile
.
val
((
$mobile
.
val
()
+
""
).
replace
(
/
[^\d]
/g
,
""
))};
var
validateMobile
=
function
validateMobile
(
mobile
){
return
/^
[\d]{11}
$/g
.
test
(
mobile
)};
var
validateRequire
=
function
validateRequire
(
value
){
return
value
.
length
};
$introducerMobile
.
on
(
"keyup"
,
function
(
e
){
filterMobileInput
(
$introducerMobile
)}).
on
(
"change blur"
,
function
(
e
){
validateMobile
(
$
.
trim
(
$introducerMobile
.
val
()
+
""
))?
$errorPhone
.
empty
():
$errorPhone
.
html
(
"手机号输入错误!"
)});
$projectDescription
.
on
(
"change blur"
,
function
(
e
){
validateRequire
(
$
.
trim
(
$projectDescription
.
val
()
+
""
))?
$errorDescription
.
empty
():
$errorDescription
.
html
(
"请输入项目描述内容!"
)});
$form
.
on
(
"submit"
,
function
(
e
){
var
mobile
=
$
.
trim
(
$introducerMobile
.
val
()
+
""
);
var
desc
=
$
.
trim
(
$projectDescription
.
val
()
+
""
);
if
(
validateMobile
(
mobile
)){
$errorPhone
.
empty
()}
else
{
$errorPhone
.
html
(
"手机号输入错误!"
);
return
}
if
(
validateRequire
(
desc
)){
$errorDescription
.
empty
()}
else
{
$errorDescription
.
html
(
"请输入项目描述内容!"
);
return
}
request
(
""
,{},
"POST"
).
then
(
function
(
result
){
console
.
log
(
result
)})})})();(
function
(){
var
$modalBoxProject
=
$
(
".modal-box-project"
);
var
$modalBoxSuccess
=
$
(
".modal-box-success"
);
$
(
".hot-project-address a"
).
click
(
function
(
e
){
e
.
preventDefault
();
$modalBox
.
fadeIn
(
300
)});
$
(
"#modalBoxHidden"
).
click
(
function
(
e
){
e
.
preventDefault
();
$modalBox
.
fadeOut
(
300
)});
$submit
.
on
(
"click"
,
function
(
e
){
e
.
preventDefault
();
$modalBoxSuccess
.
fadeIn
(
300
)});
$
(
".modal-box-success a"
).
on
(
"click"
,
function
(
e
){
e
.
preventDefault
();
$modalBoxSuccess
.
fadeOut
(
300
)})})();
"use strict"
;(
function
(){
var
$form
=
$
(
"#container .introducer"
);
var
$submit
=
$
(
'input[type="submit"]'
,
$form
);
var
$introducerMobile
=
$
(
"#introducerMobile"
,
$form
);
var
$projectDescription
=
$
(
"#projectDescription"
,
$form
);
var
$errorPhone
=
$
(
".error-phone"
,
$form
);
var
$errorDescription
=
$
(
".error-description"
,
$form
);
var
$successDialog
=
$
(
".modal-box-success"
);
var
filterMobileInput
=
function
filterMobileInput
(
$mobile
){
$mobile
.
val
((
$mobile
.
val
()
+
""
).
replace
(
/
[^\d]
/g
,
""
))};
var
validateMobile
=
function
validateMobile
(){
var
mobile
=
$
.
trim
(
$introducerMobile
.
val
()
+
""
);
if
(
/^
[\d]{11}
$/g
.
test
(
mobile
)){
$errorPhone
.
empty
();
return
mobile
}
else
{
$errorPhone
.
html
(
"手机号输入错误!"
);
return
false
}};
var
validateDescription
=
function
validateDescription
(){
var
description
=
$
.
trim
(
$projectDescription
.
val
()
+
""
);
if
(
description
.
length
){
$errorDescription
.
empty
();
return
description
}
else
{
$errorDescription
.
html
(
"请输入项目描述内容!"
);
return
false
}};
$introducerMobile
.
on
(
"keyup"
,
function
(
e
){
filterMobileInput
(
$introducerMobile
)}).
on
(
"change blur"
,
function
(
e
){
validateMobile
()}).
on
(
"focus"
,
function
(
e
){
$errorPhone
.
empty
()});
$projectDescription
.
on
(
"change blur"
,
function
(
e
){
validateDescription
()}).
on
(
"focus"
,
function
(
e
){
$errorDescription
.
empty
()});
$successDialog
.
on
(
"click"
,
"modal-dialog-close"
,
function
(
e
){
$successDialog
.
fadeOut
(
300
)});
$form
.
on
(
"submit"
,
function
(
e
){
e
.
preventDefault
();
var
mobile
=
validateMobile
();
var
description
=
validateDescription
();
if
(
mobile
&&
description
){
request
(
"/api/1.0/proj/add.json"
,{
mobile
:
mobile
,
description
:
description
},
"POST"
).
then
(
function
(){
$successDialog
.
fadeIn
(
300
);
alert
(
"提交成功!"
)}).
catch
(
function
(){
alert
(
"提交失败, 请稍后再试!"
)})}})})();(
function
(){
var
$modalBox
=
$
(
".modal-box"
);
$
(
".hot-project-address"
).
on
(
"click"
,
"a"
,
function
(
e
){
e
.
preventDefault
();
$modalBox
.
fadeIn
(
300
)});
$modalBox
.
on
(
"click"
,
".modal-dialog-close"
,
function
(
e
){
e
.
preventDefault
();
$modalBox
.
fadeOut
(
300
)})})();
\ No newline at end of file
\ No newline at end of file
public/stylesheets/project.css
View file @
32d13b8e
...
@@ -118,7 +118,7 @@
...
@@ -118,7 +118,7 @@
border
:
none
;
border
:
none
;
font-size
:
24px
;
font-size
:
24px
;
color
:
#fff
;
color
:
#fff
;
background
:
#
868686
;
background
:
#
ff4a4b
;
border-radius
:
10px
;
border-radius
:
10px
;
text-align
:
center
;
text-align
:
center
;
}
}
...
...
public/stylesheets/project.less
View file @
32d13b8e
...
@@ -192,7 +192,7 @@
...
@@ -192,7 +192,7 @@
border: none;
border: none;
font-size: 24px;
font-size: 24px;
color: #fff;
color: #fff;
background: #
868686
;
background: #
ff4a4b
;
border-radius: 10px;
border-radius: 10px;
text-align: center;
text-align: center;
}
}
...
...
public/stylesheets/style.css
View file @
32d13b8e
...
@@ -436,6 +436,16 @@ a {
...
@@ -436,6 +436,16 @@ a {
content
:
''
;
content
:
''
;
display
:
table
;
display
:
table
;
}
}
input
:active
,
textarea
:active
,
select
:active
,
a
:active
,
input
:focus
,
textarea
:focus
,
select
:focus
,
a
:focus
{
outline
:
none
;
}
hr
.line-separate
{
hr
.line-separate
{
position
:
relative
;
position
:
relative
;
width
:
80%
;
width
:
80%
;
...
...
public/stylesheets/style.less
View file @
32d13b8e
...
@@ -35,6 +35,13 @@ a {
...
@@ -35,6 +35,13 @@ a {
}
}
}
}
input, textarea, select, a {
&:active,
&:focus {
outline: none;
}
}
hr.line-separate {
hr.line-separate {
position: relative;
position: relative;
width: 80%;
width: 80%;
...
@@ -67,7 +74,7 @@ hr.line-separate {
...
@@ -67,7 +74,7 @@ hr.line-separate {
z-index: 999;
z-index: 999;
}
}
nav {
nav {
padding-left:@container-width / 4;
padding-left:
@container-width / 4;
font-size: 16px;
font-size: 16px;
span {
span {
float: left;
float: left;
...
@@ -149,7 +156,6 @@ hr.line-separate {
...
@@ -149,7 +156,6 @@ hr.line-separate {
}
}
}
}
/*.banner end*/
/*.banner end*/
.screen() {
.screen() {
...
@@ -180,6 +186,6 @@ hr.line-separate {
...
@@ -180,6 +186,6 @@ hr.line-separate {
}
}
}
}
body{
body
{
.screen();
.screen();
}
}
\ No newline at end of file
views/project.hbs
View file @
32d13b8e
...
@@ -40,7 +40,7 @@
...
@@ -40,7 +40,7 @@
placeholder=
"详细写明您的项目需求 例如:项目时间、内容、合作意向。"
></textarea>
placeholder=
"详细写明您的项目需求 例如:项目时间、内容、合作意向。"
></textarea>
<p
class=
"error-description"
></p>
<p
class=
"error-description"
></p>
</div>
</div>
<div><input
type=
"submit"
value=
"立即提交"
disabled
id=
"submit"
/></div>
<div><input
type=
"submit"
value=
"立即提交"
/></div>
</form>
</form>
</div>
</div>
<div
class=
"hot-project-address"
>
<div
class=
"hot-project-address"
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment