Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
shuniu-admin-react
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
superman
shuniu-admin-react
Commits
58b5bdd4
Commit
58b5bdd4
authored
Aug 01, 2016
by
superman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改BUG
parent
282b4461
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
220 additions
and
70 deletions
+220
-70
index.css
dist/index.css
+1
-1
index.js
dist/index.js
+33
-33
ContactForm.jsx
src/components/ProductForm/ContactForm.jsx
+4
-2
DateTimeStatusForm.jsx
src/components/ProductForm/DateTimeStatusForm.jsx
+4
-3
ElementForm.jsx
src/components/ProductForm/ElementForm.jsx
+33
-12
ShouyiYongjingForm.jsx
src/components/ProductForm/ShouyiYongjingForm.jsx
+1
-1
AddItem.jsx
src/containers/Announcement/AddItem.jsx
+1
-1
App.less
src/containers/App/App.less
+10
-0
Item.jsx
src/containers/Trade/Item.jsx
+30
-7
List.jsx
src/containers/Trade/List.jsx
+0
-1
index.less
src/entries/index.less
+23
-1
trade.js
src/reducers/trade.js
+12
-1
trade.js
src/sagas/trade.js
+29
-1
trade.js
src/services/trade.js
+10
-6
utils.js
src/utils.js
+29
-0
No files found.
dist/index.css
View file @
58b5bdd4
This diff is collapsed.
Click to expand it.
dist/index.js
View file @
58b5bdd4
This diff is collapsed.
Click to expand it.
src/components/ProductForm/ContactForm.jsx
View file @
58b5bdd4
...
...
@@ -146,10 +146,11 @@ export default class ContactForm extends Component {
:
this
.
state
.
staffs
.
length
?
<
table
>
<
Form
.
Item
>
<
table
className=
"data-grid"
>
<
thead
>
<
tr
>
<
th
>
姓名
</
th
>
<
th
width=
"100"
>
姓名
</
th
>
<
th
>
电话
</
th
>
</
tr
>
</
thead
>
...
...
@@ -164,6 +165,7 @@ export default class ContactForm extends Component {
}
</
tbody
>
</
table
>
</
Form
.
Item
>
:
<
Form
.
Item
{
...
footerFormSubmitLayout
}
>
还没有设置过任何一位服务经理及其联系电话
...
...
src/components/ProductForm/DateTimeStatusForm.jsx
View file @
58b5bdd4
...
...
@@ -56,7 +56,7 @@ export default class DateTimeSatausForm extends Component {
data
.
fundRaisedStartTime
=
formatDateTime
(
formData
.
fundRaisedStartTime
[
0
]);
}
if
(
formData
.
fundRaisedStartTime
[
1
])
{
data
.
fundRaisedEndTime
=
formatDateTime
(
formData
.
fundRaisedStartTime
[
0
])
data
.
fundRaisedEndTime
=
formatDateTime
(
formData
.
fundRaisedStartTime
[
1
])
}
if
(
formData
.
remittanceEndTime
)
{
data
.
remittanceEndTime
=
formatDateTime
(
formData
.
remittanceEndTime
);
...
...
@@ -83,6 +83,7 @@ export default class DateTimeSatausForm extends Component {
const
{
product
,
loading
,
form
:{
getFieldProps
},
isCreate
,
isEdit
}
=
this
.
props
;
const
{
fundReservationStartTime
,
fundRaisedStartTime
,
fundRaisedEndTime
,
remittanceEndTime
,
fundEstablishedTime
,
...
...
@@ -133,13 +134,13 @@ export default class DateTimeSatausForm extends Component {
<
DatePicker
.
RangePicker
showTime
format=
"yyyy-MM-dd HH:mm:ss"
{
...
getFieldProps
('
fundRaisedStartTime
',
{
initialValue
:
[
fundR
eservationStartTime
?
formatDateTime
(
fundReservation
StartTime
)
:
'',
fundR
aisedStartTime
?
formatDateTime
(
fundRaised
StartTime
)
:
'',
fundRaisedEndTime
?
formatDateTime
(
fundRaisedEndTime
)
:
''
]
})}
/>
:
((
fundR
eservationStartTime
?
formatDateTime
(
fundReservation
StartTime
)
:
NULL
)
((
fundR
aisedStartTime
?
formatDateTime
(
fundRaised
StartTime
)
:
NULL
)
+
' 、'
+
(
fundRaisedEndTime
?
formatDateTime
(
fundRaisedEndTime
)
:
NULL
))
...
...
src/components/ProductForm/ElementForm.jsx
View file @
58b5bdd4
...
...
@@ -19,7 +19,15 @@ import {
Table
,
Spin
}
from
'antd'
;
import
{
arrayRemoveIndex
,
NULL
,
UUID
,
formItemLayout
,
smallFormItemLayout
,
footerFormSubmitLayout
}
from
'../../utils'
;
import
{
arrayRemoveIndex
,
NULL
,
UUID
,
formItemLayout
,
smallFormItemLayout
,
footerFormSubmitLayout
,
innerHTML
}
from
'../../utils'
;
export
function
CreateBaseElement
()
{
...
...
@@ -107,8 +115,10 @@ export default class ElementForm extends Component {
}
render
()
{
const
{
form
:{
getFieldProps
},
loading
,
isEdit
}
=
this
.
props
;
console
.
log
(
this
.
state
.
elements
);
return
(
<
Spin
spinning=
{
loading
}
>
<
Form
horizontal
onSubmit=
{
this
.
handleSubmit
.
bind
(
this
)
}
>
...
...
@@ -152,20 +162,31 @@ export default class ElementForm extends Component {
</
div
>
:
this
.
state
.
elements
.
length
?
<
table
>
<
tbody
>
{
this
.
state
.
elements
.
map
(
item
=>
{
<
Form
.
Item
>
<
table
className=
"data-grid"
>
<
colgroup
>
<
col
width=
"150px"
/>
<
col
/>
</
colgroup
>
<
thead
>
<
tr
>
<
th
>
元素标题
</
th
>
<
th
>
元素内容
</
th
>
</
tr
>
</
thead
>
<
tbody
>
{
this
.
state
.
elements
.
map
(
item
=>
item
.
title
&&
item
.
content
&&
<
tr
>
<
tr
key=
{
item
.
key
}
>
<
th
>
{
item
.
title
}
</
th
>
<
td
>
{
item
.
content
}
</
td
>
<
td
{
...
innerHTML
(
item
.
content
,
true
)}
>
</
td
>
</
tr
>
}
)
}
</
t
body
>
</
table
>
)
}
</
tbody
>
</
t
able
>
</
Form
.
Item
>
:
<
Form
.
Item
{
...
footerFormSubmitLayout
}
>
还没有设置过任何基本要素
...
...
src/components/ProductForm/ShouyiYongjingForm.jsx
View file @
58b5bdd4
...
...
@@ -192,7 +192,7 @@ componentWillReceiveProps(nextProps) {
:
(
this
.
state
.
yongjing
.
length
?
<
table
>
<
table
className=
"data-grid tac"
>
<
thead
>
<
tr
>
<
th
className=
"tac"
>
最小投资额
</
th
>
...
...
src/containers/Announcement/AddItem.jsx
View file @
58b5bdd4
...
...
@@ -47,7 +47,7 @@ export default class AddItem extends Component {
componentWillReceiveProps
(
nextProps
)
{
const
{
item
}
=
nextProps
;
if
(
item
&&
item
.
id
)
{
this
.
props
.
history
.
push
(
'/announcement/'
+
item
.
id
);
this
.
props
.
history
.
replace
(
'/announcement/'
+
item
.
id
);
this
.
props
.
dispatch
({
type
:
'INIT_ANNOUNCEMENT'
});
...
...
src/containers/App/App.less
View file @
58b5bdd4
...
...
@@ -75,6 +75,16 @@
}
}
.ant-menu-inline .ant-menu-item,
.ant-menu-vertical .ant-menu-item{
border-right: 0;
margin-left: 0;
left: 0;
}
.ant-menu-inline .ant-menu-item-selected,
.ant-menu-inline .ant-menu-selected{
border-right: 0;
}
}
}
...
...
src/containers/Trade/Item.jsx
View file @
58b5bdd4
import
React
,
{
Component
,
PropTypes
}
from
'react'
;
import
{
connect
}
from
'react-redux'
;
import
{
Link
}
from
'react-router'
;
import
{
Form
,
Input
,
Button
,
Checkbox
,
message
,
Row
,
Col
,
Spin
,
Icon
}
from
'antd'
;
import
{
Form
,
Input
,
Button
,
Popconfirm
,
Checkbox
,
message
,
Row
,
Col
,
Spin
,
Icon
}
from
'antd'
;
import
{
formatDateTime
,
tradeStatusToString
,
...
...
@@ -25,6 +25,12 @@ export default class Item extends Component {
});
};
handleEstablish
(
id
)
{
this
.
props
.
dispatch
({
type
:
'ESTABLISH_TRADE_ITEM'
,
id
});
}
render
()
{
...
...
@@ -106,8 +112,8 @@ export default class Item extends Component {
<
span
>
{
'收益 '
+
item
.
realReturn
.
sy
}
</
span
>
}
{
item
.
realReturn
&&
item
.
commission
&&
<
span
>
{
'佣金 '
+
item
.
commission
}
</
span
>
item
.
commission
&&
<
span
>
{
'佣金 '
+
item
.
commission
+
'元'
}
</
span
>
}
</
Col
>
</
Row
>
...
...
@@ -126,11 +132,28 @@ export default class Item extends Component {
</
div
>
<
p
>
{
(
item
.
status
==
11
||
item
.
status
==
21
)
&&
(
!
item
.
commissionId
)
&&
<
Link
to=
{
'/trades/commission/'
+
item
.
id
}
><
Button
>
发放佣金
</
Button
></
Link
>
item
.
status
==
11
&&
<
Popconfirm
title=
"确定这个订单要成立了吗?"
onConfirm=
{
this
.
handleEstablish
.
bind
(
this
,
item
.
id
)
}
>
<
Button
type=
"primary"
style=
{
{
marginRignt
:
'1em'
}
}
>
<
Icon
type=
"like"
/>
订单成立
</
Button
>
</
Popconfirm
>
}
{
(
item
.
status
==
11
||
item
.
status
==
21
)
&&
(
!
item
.
commissionId
)
&&
<
Link
to=
{
'/trades/commission/'
+
item
.
id
}
>
<
Button
type=
"ghost"
>
<
Icon
type=
"pay-circle-o"
/>
发放佣金
</
Button
>
</
Link
>
}
<
Link
to=
{
'/trades/contract/'
+
item
.
id
}
><
Button
>
邮寄合同
</
Button
></
Link
>
<
Button
onClick=
{
e
=>
{
e
.
preventDefault
();
this
.
props
.
history
.
goBack
();}
}
<
Link
to=
{
'/trades/contract/'
+
item
.
id
}
>
<
Button
type=
"ghost"
>
<
Icon
type=
"exception"
/>
邮寄合同
</
Button
>
</
Link
>
<
Button
type=
"ghost"
onClick=
{
e
=>
{
e
.
preventDefault
();
this
.
props
.
history
.
goBack
();}
}
style=
{
{
marginLeft
:
'1em'
}
}
>
<
Icon
type=
"rollback"
/>
返回
</
Button
>
...
...
src/containers/Trade/List.jsx
View file @
58b5bdd4
...
...
@@ -71,7 +71,6 @@ const columns = [
<
Link
to=
{
'/trades/commission/'
+
record
.
id
}
onClick=
{
e
=>
e
.
stopPropagation
()
}
>
佣金
</
Link
>
</
span
>
}
</
span
>
)
}
...
...
src/entries/index.less
View file @
58b5bdd4
...
...
@@ -148,7 +148,7 @@
}
body {
.ant-modal-mask{
.ant-modal-mask
{
animation-duration: 300ms !important;
}
.img-priview-dialog {
...
...
@@ -189,4 +189,26 @@
}
}
.data-grid {
border-spacing: 0;
width:100%;
thead{
th{
background-color: #f8f8f8;
}
}
td, th {
border-bottom: 1px solid #e9e9e9;
padding: 5px 5px;
text-align: left;
vertical-align: top;
}
&.tac{
td, th{
text-align: center;
}
}
}
}
src/reducers/trade.js
View file @
58b5bdd4
...
...
@@ -41,11 +41,22 @@ const trade = handleActions({
return
{...
state
,
loading
:
true
};
},
[
'SETTLEMENT_TRADE_ITEM_SUCCESS'
](
state
,
action
){
return
{...
state
,
loading
:
false
,
item
:{...
state
.
item
,
...
action
.
item
}};
return
{...
state
,
loading
:
false
,
item
:
{...
state
.
item
,
...
action
.
item
}};
},
[
'SETTLEMENT_TRADE_ITEM_FAILED'
](
state
,
action
){
return
{...
state
,
err
:
action
.
err
,
loading
:
false
};
},
[
'ESTABLISH_TRADE_ITEM'
](
state
){
return
{...
state
,
loading
:
true
};
},
[
'ESTABLISH_TRADE_ITEM_SUCCESS'
](
state
,
action
){
return
{...
state
,
loading
:
false
,
item
:
{...
state
.
item
,
...
action
.
item
}};
},
[
'ESTABLISH_TRADE_ITEM_FAILED'
](
state
,
action
){
return
{...
state
,
err
:
action
.
err
,
loading
:
false
};
}
},
initState
);
export
default
trade
;
src/sagas/trade.js
View file @
58b5bdd4
import
{
takeLatest
}
from
'redux-saga'
;
import
{
take
,
call
,
put
,
fork
,
cancel
,
select
}
from
'redux-saga/effects'
;
import
{
fetchList
,
fetchItem
,
createItem
,
settlementItem
}
from
'../services/trade'
;
import
{
fetchList
,
fetchItem
,
createItem
,
settlementItem
,
establish
}
from
'../services/trade'
;
import
{
message
}
from
'antd'
;
function
*
getList
(
query
)
{
...
...
@@ -102,10 +102,38 @@ function* watchSettlement() {
}
}
function
*
establishItem
(
id
)
{
try
{
yield
call
(
establish
,
id
);
message
.
success
(
'^.^ 喜大普奔,订单成立了!'
);
yield
put
({
type
:
'ESTABLISH_TRADE_ITEM_SUCCESS'
,
item
:
{
status
:
21
}
});
}
catch
(
err
)
{
console
.
log
(
err
);
message
.
error
(
err
);
yield
put
({
type
:
'ESTABLISH_TRADE_ITEM_FAILED'
,
err
});
}
}
function
*
watchEstablishItem
()
{
while
(
true
)
{
const
{
id
}
=
yield
take
(
'ESTABLISH_TRADE_ITEM'
);
yield
fork
(
establishItem
,
id
);
}
}
export
default
function
*
()
{
yield
fork
(
watchTradeList
);
yield
fork
(
watchTradeItem
);
yield
fork
(
watchAdd
);
yield
fork
(
watchSettlement
);
yield
fork
(
watchEstablishItem
);
}
src/services/trade.js
View file @
58b5bdd4
...
...
@@ -2,19 +2,23 @@ import xFetch from './xFetch';
import
{
serialize
}
from
'../utils'
;
export
async
function
fetchList
(
query
)
{
return
xFetch
(
'/api/trades'
+
'?'
+
serialize
(
query
));
return
xFetch
(
'/api/trades'
+
'?'
+
serialize
(
query
));
}
export
async
function
fetchItem
(
id
)
{
return
xFetch
(
'/api/trades/'
+
id
);
return
xFetch
(
'/api/trades/'
+
id
);
}
export
async
function
createItem
(
data
){
export
async
function
createItem
(
data
)
{
return
xFetch
(
'/api/trades'
,
{
method
:
'POST'
,
method
:
'POST'
,
body
:
serialize
(
data
)
});
}
export
async
function
settlementItem
(
id
){
return
xFetch
(
'/api/trade/commission/settlement/'
+
id
);
export
async
function
settlementItem
(
id
)
{
return
xFetch
(
'/api/trade/commission/settlement/'
+
id
);
}
export
async
function
establish
(
id
)
{
return
xFetch
(
'/api/trade/success/'
+
id
);
}
src/utils.js
View file @
58b5bdd4
...
...
@@ -225,3 +225,32 @@ export function remittanceAuditStatusToString(status) {
export
function
mobileSecrecy
(
mobile
){
return
(
mobile
+
''
).
replace
(
/^
(\d{3})(\d{4})(\d{4})
$/g
,
(
b
,
c
,
d
,
e
)
=>
(
c
+
'****'
+
e
));
}
export
function
innerHTML
(
html
,
safe
){
return
{
dangerouslySetInnerHTML
:
{
__html
:
safe
?
cr2br
(
htmlEncode
(
html
))
:
html
}
}
}
export
function
htmlEncode
(
text
){
return
(
text
+
''
).
replace
(
/
[\<\>\&]
/gi
,
(
m
)
=>
{
switch
(
m
){
case
'<'
:
return
'<'
;
case
'>'
:
return
'>'
;
case
'&'
:
return
'&'
;
default
:
return
m
;
}
});
}
export
function
cr2br
(
text
){
return
(
text
+
''
).
replace
(
/
\n
/g
,
'<br/>'
);
}
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