Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
B
biz.qingxiao.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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangxuelai
biz.qingxiao.com
Commits
0ac1c9e6
Commit
0ac1c9e6
authored
Dec 06, 2019
by
baixian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1111111
parent
af02c5e2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
95 additions
and
29 deletions
+95
-29
deployschool.js
src/models/deployschool.js
+88
-0
index.js
src/models/index.js
+2
-0
index.js
src/pages/deployschool/index.js
+5
-29
No files found.
src/models/deployschool.js
0 → 100644
View file @
0ac1c9e6
import
{
routerRedux
}
from
'dva/router'
;
import
{
message
}
from
'antd'
;
import
queryString
from
'qs'
;
import
{
delay
}
from
'redux-saga'
;
import
{
LocalStorage
,
SessionStorage
,
isExpired
,
}
from
'../utils/index'
;
import
errorcode
from
'../common/errorcode'
;
import
*
as
newregister
from
'../services/newregister'
;
import
*
as
schoolajax
from
'../services/schooladd'
;
export
default
{
namespace
:
'deployschool'
,
state
:
{
deployType
:
3
,
// 类型 1-口才 2-美术 3-书法 4-跆拳道 5-通用
},
subscriptions
:
{
setup
({
dispatch
,
history
})
{
// eslint-disable-line
},
},
effects
:
{
*
developSchool
({
payload
},
{
call
,
put
,
select
})
{
const
{
deployType
,
schoolId
}
=
yield
select
(
state
=>
state
.
newregister
);
const
{
sid
}
=
yield
select
(
state
=>
state
.
webapp
);
const
data
=
yield
call
(
newregister
.
deploySchool
,
{
school_id
:
schoolId
||
sid
,
type
:
deployType
,
});
if
(
data
.
code
==
200
)
{
yield
put
({
type
:
'updateState'
,
payload
:
{
deployType
:
3
,
},
});
}
else
{
yield
put
({
type
:
'webapp/errorrequestresolve'
,
payload
:
{
data
,
},
});
}
},
*
developSkip
({
payload
},
{
call
,
put
,
select
})
{
const
{
schoolId
}
=
yield
select
(
state
=>
state
.
newregister
);
const
{
sid
}
=
yield
select
(
state
=>
state
.
webapp
);
const
data
=
yield
call
(
newregister
.
deploySchool
,
{
school_id
:
schoolId
||
sid
,
type
:
6
,
});
if
(
data
.
code
==
200
)
{
yield
put
(
routerRedux
.
push
({
pathname
:
'/sjd/indexstaic'
,
}));
}
else
{
yield
put
({
type
:
'webapp/errorrequestresolve'
,
payload
:
{
data
,
},
});
}
},
*
goHome
({
payload
},
{
put
})
{
yield
put
(
routerRedux
.
push
({
pathname
:
'/sjd/indexstaic'
,
}));
},
*
pageInit
({
payload
},
{
call
,
put
,
select
})
{
yield
put
({
type
:
'updateState'
,
payload
:
{
deployType
:
3
,
},
});
},
},
reducers
:
{
updateState
(
state
,
{
payload
})
{
return
{
...
state
,
...
payload
,
};
},
},
};
src/models/index.js
View file @
0ac1c9e6
...
...
@@ -47,6 +47,7 @@ import uploadcourseware from './uploadcourseware';
import
classrecord
from
'./classrecord'
;
import
newregister
from
'./newregister'
;
import
userguide
from
'./userguide'
;
import
deployschool
from
'./deployschool'
;
export
default
{
loginModel
,
indexstaicModel
,
...
...
@@ -88,4 +89,5 @@ export default {
classrecord
,
newregister
,
userguide
,
deployschool
,
};
src/pages/deployschool/index.js
View file @
0ac1c9e6
...
...
@@ -56,7 +56,7 @@ class DeploySchoolForm extends React.Component {
});
},
45
);
dispatch
({
type
:
'
newregister
/developSchool'
,
type
:
'
deployschool
/developSchool'
,
payload
:
{
},
});
...
...
@@ -69,7 +69,7 @@ class DeploySchoolForm extends React.Component {
handleChooseType
=
(
id
)
=>
{
const
{
dispatch
}
=
this
.
props
;
dispatch
({
type
:
'
newregister
/updateState'
,
type
:
'
deployschool
/updateState'
,
payload
:
{
deployType
:
id
,
},
...
...
@@ -78,7 +78,7 @@ class DeploySchoolForm extends React.Component {
goHome
=
()
=>
{
const
{
dispatch
}
=
this
.
props
;
dispatch
({
type
:
'
newregister
/goHome'
,
type
:
'
deployschool
/goHome'
,
payload
:
{
},
});
...
...
@@ -86,30 +86,16 @@ class DeploySchoolForm extends React.Component {
handleSkip
=
()
=>
{
const
{
dispatch
}
=
this
.
props
;
dispatch
({
type
:
'
newregister
/developSkip'
,
type
:
'
deployschool
/developSkip'
,
payload
:
{
},
});
}
render
()
{
const
{
getFieldDecorator
}
=
this
.
props
.
form
;
const
{
countdown
,
deployType
,
}
=
this
.
props
;
const
{
deployVisible
,
curStep
,
numberPercent
}
=
this
.
state
;
const
tailFormItemLayout
=
{
wrapperCol
:
{
xs
:
{
span
:
24
,
offset
:
0
,
},
sm
:
{
span
:
16
,
offset
:
5
,
},
},
};
const
typeList
=
[
{
id
:
3
,
title
:
'书法练字'
,
img
:
'/developschool/type_icon1.png'
},
{
id
:
2
,
title
:
'美术创意'
,
img
:
'/developschool/type_icon2.png'
},
...
...
@@ -273,21 +259,11 @@ DeploySchool.propTypes = {
};
function
mapStateToProps
(
state
)
{
const
{
gettingVerifyCoding
,
countdown
,
counting
,
registering
,
resolves
,
modalVisible
,
protocolData
,
location_address
,
deployType
,
}
=
state
.
newregister
;
}
=
state
.
deployschool
;
const
{
locationQuery
}
=
state
.
webapp
;
return
{
gettingVerifyCoding
,
countdown
,
counting
,
registering
,
resolves
,
locationQuery
,
modalVisible
,
protocolData
,
location_address
,
deployType
,
};
}
...
...
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