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
1918be5a
Commit
1918be5a
authored
Jul 08, 2019
by
wangxuelai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
''
parent
05463a43
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
33 deletions
+41
-33
index.html
index.html
+1
-1
officialweb.js
src/models/officialweb.js
+30
-27
OrgdescEditor.js
src/pages/officialweb/pagecomponent/OrgdescEditor.js
+9
-4
OrgdescEditor.less
src/pages/officialweb/pagecomponent/OrgdescEditor.less
+1
-1
No files found.
index.html
View file @
1918be5a
<!DOCTYPE html>
<html
lang=
"en"
><head><meta
charset=
"UTF-8"
><title>
商家岛PC后台
</title><link
rel=
"shortcut icon"
href=
"http://biz.shangjiadao.com/images/webapp/sjd_logo_a.png"
><meta
name=
"viewport"
content=
"width=device-width,initial-scale=1"
><meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge"
>
<!-- Polyfills --><!--[if lt IE 10]>
<script src="js/console-polyfill.js"></script>
<![endif]-->
<script
src=
"js/console-polyfill.js"
></script><script
src=
"js/es6-shim.min.js"
></script><script
src=
"js/es5-shim.js"
></script><script
src=
"js/es5-sham.min.js"
></script><script
src=
"js/json3.min.js"
></script><script
src=
"js/html5shiv.min.js"
></script><script
src=
"js/polyfill.js"
></script><script
charset=
"utf-8"
src=
"https://map.qq.com/api/js?v=2.exp&key=XSZBZ-5LHCV-5I2P7-UQHPW-6456F-JBB3B"
></script><link
href=
"dist/index.css?1562308853703"
rel=
"stylesheet"
><script
src=
"lib/vendor.dll.js?3"
charset=
"utf-8"
></script></head><body><div
id=
"root"
></div><script
src=
"dist/index.js?1562308853704"
charset=
"utf-8"
></script></body></html>
\ No newline at end of file
<![endif]-->
<script
src=
"js/console-polyfill.js"
></script><script
src=
"js/es6-shim.min.js"
></script><script
src=
"js/es5-shim.js"
></script><script
src=
"js/es5-sham.min.js"
></script><script
src=
"js/json3.min.js"
></script><script
src=
"js/html5shiv.min.js"
></script><script
src=
"js/polyfill.js"
></script><script
charset=
"utf-8"
src=
"https://map.qq.com/api/js?v=2.exp&key=XSZBZ-5LHCV-5I2P7-UQHPW-6456F-JBB3B"
></script><link
href=
"dist/index.css?1562548602921"
rel=
"stylesheet"
><script
src=
"lib/vendor.dll.js?3"
charset=
"utf-8"
></script></head><body><div
id=
"root"
></div><script
src=
"dist/index.js?1562548602922"
charset=
"utf-8"
></script></body></html>
\ No newline at end of file
src/models/officialweb.js
View file @
1918be5a
...
...
@@ -26,8 +26,9 @@ export default {
bannerVideo
:
[],
orgdescs
:
[],
schoolInfoPostStatus
:
false
,
// 机构信息保存中状态
bannerPostStatus
:
false
,
// 机构信息保存中状态
coursePostStatus
:
false
,
// 机构信息保存中状态
bannerPostStatus
:
false
,
// banner保存中状态
coursePostStatus
:
false
,
// 体验课保存中状态
orgPostStatus
:
false
,
// 机构介绍保存中状态
course
:
{
school_id
:
0
,
title
:
''
,
...
...
@@ -688,47 +689,49 @@ export default {
}
},
*
saveorgdesc
({
payload
},
{
call
,
put
,
select
})
{
const
{
orgdescs
,
pageInfo
,
sid
}
=
yield
select
(
state
=>
state
.
officialweb
);
const
schoolIntroAjax
=
[];
const
{
orgdescs
,
pageInfo
,
sid
,
orgPostStatus
,
}
=
yield
select
(
state
=>
state
.
officialweb
);
if
(
orgPostStatus
)
{
return
;
}
yield
put
({
type
:
'updateState'
,
payload
:
{
orgPostStatus
:
true
,
},
});
const
{
values
}
=
payload
;
let
schoolIntroAjax
;
const
newpageInfo
=
JSON
.
parse
(
JSON
.
stringify
(
pageInfo
));
for
(
let
i
=
0
,
Length
=
orgdescs
.
length
;
i
<
Length
;
i
++
)
{
if
(
orgdescs
[
i
].
id
==
0
)
{
schoolIntroAjax
.
push
(
officialwebajax
.
schoolIntroAdd
({
id
:
orgdescs
[
i
].
id
,
school_id
:
orgdescs
[
i
].
school_id
,
title
:
values
.
title
[
i
],
type
:
orgdescs
[
i
].
type
,
content
:
JSON
.
stringify
(
orgdescs
[
i
].
content
),
}));
}
else
{
schoolIntroAjax
.
push
(
officialwebajax
.
schoolIntroUpdate
({
id
:
orgdescs
[
i
].
id
,
school_id
:
orgdescs
[
i
].
school_id
,
title
:
values
.
title
[
i
],
type
:
orgdescs
[
i
].
type
,
content
:
JSON
.
stringify
(
orgdescs
[
i
].
content
),
}));
}
const
Length
=
orgdescs
.
length
;
let
i
=
0
;
while
(
i
<
Length
)
{
schoolIntroAjax
=
yield
call
(
officialwebajax
.
schoolIntroAdd
,
{
id
:
orgdescs
[
i
].
id
,
school_id
:
orgdescs
[
i
].
school_id
,
title
:
values
.
title
[
i
],
type
:
orgdescs
[
i
].
type
,
content
:
JSON
.
stringify
(
orgdescs
[
i
].
content
),
});
i
++
;
}
Promise
.
all
(
schoolIntroAjax
).
then
((
res
)
=>
{
});
yield
delay
(
2000
);
const
schoolIntro
=
yield
call
(
officialwebajax
.
schoolIntroGet
,
{
school_id
:
sid
});
schoolIntro
.
data
.
data
.
list
.
forEach
((
ele
)
=>
{
schoolIntro
.
data
.
list
.
forEach
((
ele
)
=>
{
const
Ele
=
ele
;
Ele
.
content
=
JSON
.
parse
(
Ele
.
content
);
});
newpageInfo
.
forEach
((
ele
)
=>
{
const
element
=
ele
;
if
(
element
.
type
==
'orgdesc'
)
{
element
.
data
=
schoolIntro
.
data
.
data
.
list
;
element
.
data
=
schoolIntro
.
data
.
list
;
}
});
yield
put
({
type
:
'updateState'
,
payload
:
{
pageInfo
:
newpageInfo
,
orgPostStatus
:
false
,
},
});
},
...
...
src/pages/officialweb/pagecomponent/OrgdescEditor.js
View file @
1918be5a
...
...
@@ -90,8 +90,12 @@ class OrgdescEditorForm extends React.Component {
}
handleSubmit
=
(
e
)
=>
{
e
.
preventDefault
();
const
{
dispatch
}
=
this
.
props
;
const
{
dispatch
,
handleSubmit
}
=
this
.
props
;
if
(
handleSubmit
)
{
return
;
}
this
.
props
.
form
.
validateFields
((
err
,
values
)
=>
{
console
.
log
(
values
,
'valuesvaluesvaluesvalues'
);
if
(
!
err
)
{
const
{
dispatch
}
=
this
.
props
;
dispatch
({
...
...
@@ -127,7 +131,7 @@ class OrgdescEditorForm extends React.Component {
render
()
{
const
{
orgdescs
}
=
this
.
props
;
const
{
currentIndex
}
=
this
.
state
;
const
{
getFieldDecorator
,
getFieldValue
}
=
this
.
props
.
form
;
const
{
getFieldDecorator
,
getFieldValue
,
orgPostStatus
}
=
this
.
props
.
form
;
const
menuItemStyle
=
{
fontSize
:
'16px'
,
};
...
...
@@ -265,7 +269,7 @@ class OrgdescEditorForm extends React.Component {
<
/div
>
<
div
className
=
{
PageStyle
.
divideLine
}
/
>
<
div
className
=
{
PageStyle
.
btnbox
}
>
<
Button
type
=
"primary"
className
=
{
PageStyle
.
SubmitBtn
}
htmlType
=
"submit"
>
保存
<
/Button
>
<
Button
type
=
"primary"
className
=
{
PageStyle
.
SubmitBtn
}
htmlType
=
"submit"
loading
=
{
orgPostStatus
}
>
{
orgPostStatus
?
'保存中...'
:
'保存'
}
<
/Button
>
<
/div
>
<
/Form
>
<
/div
>
...
...
@@ -278,10 +282,11 @@ OrgdescEditor.propTypes = {
};
function
mapStateToProps
(
state
)
{
const
{
orgdescs
,
orgdescs
,
orgPostStatus
,
}
=
state
.
officialweb
;
return
{
orgdescs
,
orgPostStatus
,
};
}
export
default
connect
(
mapStateToProps
)(
OrgdescEditor
);
src/pages/officialweb/pagecomponent/OrgdescEditor.less
View file @
1918be5a
...
...
@@ -34,7 +34,7 @@
}
.SubmitBtn {
// background-color: #ECECEC;
width: 70px;
//
width: 70px;
height: 34px;
line-height: 34px;
}
...
...
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