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
c007c73a
Commit
c007c73a
authored
Apr 13, 2020
by
wangxuelai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
'消息推送功能'
parent
85c724c2
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
286 additions
and
7 deletions
+286
-7
index.html
index.html
+2
-2
api.js
src/common/api.js
+5
-0
menuconfig.js
src/common/menuconfig.js
+19
-5
index.js
src/models/index.js
+2
-0
pushsetting.js
src/models/pushsetting.js
+113
-0
webapp.js
src/models/webapp.js
+16
-0
index.js
src/pages/pushsetting/index.js
+86
-0
index.less
src/pages/pushsetting/index.less
+7
-0
router.js
src/router.js
+6
-0
pushsetting.js
src/services/pushsetting.js
+30
-0
No files found.
index.html
View file @
c007c73a
...
...
@@ -13,10 +13,10 @@
<script
charset=
"utf-8"
src=
"https://map.qq.com/api/js?v=2.exp&key=XSZBZ-5LHCV-5I2P7-UQHPW-6456F-JBB3B"
></script>
<script
src=
"/js/ueeditor/ueditor.config.js?20200107"
charset=
"utf-8"
></script><script
src=
"/js/ueeditor/ueditor.all.js?20200107"
charset=
"utf-8"
></script>
<script
src=
"
https://cdn.img.shangjiadao.cn/qingxiao/biz/js/console-polyfill.js?20200107"
charset=
"utf-8"
></script><script
src=
"https://cdn.img.shangjiadao.cn/qingxiao/biz/js/es6-shim.min.js?20200107"
charset=
"utf-8"
></script><script
src=
"https://cdn.img.shangjiadao.cn/qingxiao/biz/js/es5-shim.js?20200107"
charset=
"utf-8"
></script><script
src=
"https://cdn.img.shangjiadao.cn/qingxiao/biz/js/es5-sham.min.js?20200107"
charset=
"utf-8"
></script><script
src=
"https://cdn.img.shangjiadao.cn/qingxiao/biz/js/json3.min.js?20200107"
charset=
"utf-8"
></script><script
src=
"https://cdn.img.shangjiadao.cn/qingxiao/biz/js/html5shiv.min.js?20200107"
charset=
"utf-8"
></script><script
src=
"https://cdn.img.shangjiadao.cn/qingxiao/biz/js/polyfill.js?20200107"
charset=
"utf-8"
></script><script
src=
"https://cdn.img.shangjiadao.cn/qingxiao/biz/
lib/vendor.dll.js?20200107"
charset=
"utf-8"
></script>
<script
src=
"
js/console-polyfill.js?20200107"
charset=
"utf-8"
></script><script
src=
"js/es6-shim.min.js?20200107"
charset=
"utf-8"
></script><script
src=
"js/es5-shim.js?20200107"
charset=
"utf-8"
></script><script
src=
"js/es5-sham.min.js?20200107"
charset=
"utf-8"
></script><script
src=
"js/json3.min.js?20200107"
charset=
"utf-8"
></script><script
src=
"js/html5shiv.min.js?20200107"
charset=
"utf-8"
></script><script
src=
"js/polyfill.js?20200107"
charset=
"utf-8"
></script><script
src=
"
lib/vendor.dll.js?20200107"
charset=
"utf-8"
></script>
</head>
</head>
<body>
<div
id=
"root"
></div>
<script
type=
"text/javascript"
src=
"
https://cdn.img.shangjiadao.cn/qingxiao/biz/dist/main.8f5119
.js"
></script></body>
<script
type=
"text/javascript"
src=
"
/dist/main.5f823f
.js"
></script></body>
</html>
\ No newline at end of file
src/common/api.js
View file @
c007c73a
...
...
@@ -41,6 +41,11 @@ export default {
fileTransForm
:
`
${
dakaapi
}
member/file_convert/create`
,
fileConvertQuery
:
`
${
dakaapi
}
member/file_convert/query`
,
editorUpload
:
`
${
dakaapi
}
common/editor_upload`
,
bindWx
:
{
getPreAuthorizationUrl
:
`
${
dakaapi
}
member/wechat/open/get_pre_authorization_url`
,
getOfficialAccount
:
`
${
dakaapi
}
member/wechat/open/get_official_account`
,
bindToOpenPlatform
:
`
${
dakaapi
}
member/wechat/open/bind_to_open_platform`
,
},
newLogin
:
{
loginPost
:
`
${
dakaapi
}
common/business_login`
,
},
...
...
src/common/menuconfig.js
View file @
c007c73a
...
...
@@ -210,10 +210,24 @@ export default {
},
],
},
// {
// id: '70',
// name: '直播课堂',
// key: 70,
// isFather: false,
// style: {
// width: '20px',
// height: '20px',
// },
// activeurl: `${__IMGCDN__}menu/live.png?v=1`,
// notactiveurl: `${__IMGCDN__}menu/liveactive.png`,
// path: '/sjd/liveClass',
// relativePath: ['/sjd/liveClass', '/sjd/addLive', '/sjd/editLive/:id'],
// },
{
id
:
'
7
0'
,
name
:
'
直播课堂
'
,
key
:
7
0
,
id
:
'
8
0'
,
name
:
'
公众号消息推送配置
'
,
key
:
8
0
,
isFather
:
false
,
style
:
{
width
:
'20px'
,
...
...
@@ -221,8 +235,8 @@ export default {
},
activeurl
:
`
${
__IMGCDN__
}
menu/live.png?v=1`
,
notactiveurl
:
`
${
__IMGCDN__
}
menu/liveactive.png`
,
path
:
'/sjd/
liveClass
'
,
relativePath
:
[
'/sjd/
liveClass'
,
'/sjd/addLive'
,
'/sjd/editLive/:id
'
],
path
:
'/sjd/
pushsetting
'
,
relativePath
:
[
'/sjd/
pushsetting
'
],
},
],
};
src/models/index.js
View file @
c007c73a
...
...
@@ -61,6 +61,7 @@ import createmarke from './createmarke';
import
newthemelist
from
'./newthemelist'
;
import
clockmember
from
'./clockmember'
;
import
common
from
'./common'
;
import
pushsetting
from
'./pushsetting'
;
export
default
{
loginModel
,
indexstaicModel
,
...
...
@@ -116,4 +117,5 @@ export default {
newthemelist
,
clockmember
,
common
,
pushsetting
,
};
src/models/pushsetting.js
0 → 100644
View file @
c007c73a
import
{
routerRedux
}
from
'dva/router'
;
import
{
message
}
from
'antd'
;
import
{
delay
}
from
'redux-saga'
;
import
{
LocalStorage
,
SessionStorage
,
isExpired
,
getRandomString
,
}
from
'../utils/index'
;
import
errorcode
from
'../common/errorcode'
;
import
*
as
pushSettingAjax
from
'../services/pushsetting'
;
export
default
{
namespace
:
'pushsetting'
,
state
:
{
isEmpty
:
true
,
wxInfo
:
{
title
:
''
,
created_at
:
''
,
logo
:
''
,
},
},
subscriptions
:
{
setup
({
dispatch
,
history
})
{
// eslint-disable-line
},
},
effects
:
{
*
gobindwx
({
payload
},
{
call
,
put
,
select
})
{
const
{
sid
}
=
yield
select
(
state
=>
state
.
webapp
);
const
data
=
yield
call
(
pushSettingAjax
.
getPreAuthorizationUrl
,
{
school_id
:
sid
,
});
if
(
data
.
code
==
200
)
{
window
.
open
(
data
.
data
);
}
else
{
yield
put
({
type
:
'webapp/errorrequestresolve'
,
payload
:
{
data
,
},
});
}
},
*
queryinfo
({
payload
},
{
call
,
put
,
select
})
{
const
{
sid
,
locationQuery
}
=
yield
select
(
state
=>
state
.
webapp
);
const
{
auth_code
}
=
locationQuery
;
if
(
auth_code
)
{
yield
put
(
routerRedux
.
replace
({
pathname
:
'/sjd/pushsetting'
,
}));
const
bindToOpenPlatformData
=
yield
call
(
pushSettingAjax
.
bindToOpenPlatform
,
{
auth_code
,
school_id
:
sid
,
});
if
(
bindToOpenPlatformData
.
code
==
200
)
{
yield
put
(
routerRedux
.
replace
({
pathname
:
'/sjd/pushsetting'
,
}));
}
else
{
yield
put
({
type
:
'webapp/errorrequestresolve'
,
payload
:
{
data
:
bindToOpenPlatformData
,
},
});
}
return
;
}
const
data
=
yield
call
(
pushSettingAjax
.
getOfficialAccount
,
{
school_id
:
sid
,
});
if
(
data
.
code
==
200
)
{
yield
put
({
type
:
'updateState'
,
payload
:
{
isEmpty
:
false
,
wxInfo
:
{
title
:
data
.
data
.
title
,
created_at
:
data
.
data
.
created_at
,
logo
:
''
,
},
},
});
}
else
if
(
data
.
code
==
40000
)
{
yield
put
({
type
:
'updateState'
,
payload
:
{
isEmpty
:
true
,
},
});
}
else
{
yield
put
({
type
:
'webapp/errorrequestresolve'
,
payload
:
{
data
,
},
});
}
},
},
reducers
:
{
save
(
state
,
action
)
{
return
{
...
state
,
...
action
.
payload
};
},
updateState
(
state
,
action
)
{
return
{
...
state
,
...
action
.
payload
};
},
},
};
src/models/webapp.js
View file @
c007c73a
...
...
@@ -1423,6 +1423,22 @@ export default {
},
});
}
if
(
pathname
===
'/sjd/pushsetting'
)
{
dispatch
({
type
:
'pushsetting/queryinfo'
,
});
dispatch
({
type
:
'updateState'
,
payload
:
{
breadcrumbList
:
[
{
path
:
pathname
,
name
:
'公众号消息推送配置'
,
},
],
},
});
}
const
editLiveclass
=
pathToRegexp
(
'/sjd/editLive/:id'
).
exec
(
pathname
);
if
(
editLiveclass
)
{
dispatch
({
...
...
src/pages/pushsetting/index.js
0 → 100644
View file @
c007c73a
import
React
from
'react'
;
import
{
connect
}
from
'dva'
;
import
qs
from
'qs'
;
import
{
List
,
Avatar
,
Empty
,
Button
}
from
'antd'
;
import
pageStyles
from
'./index.less'
;
import
disData
from
'../../common/dis.data'
;
import
{
LocalStorage
,
SessionStorage
,
pageIn
}
from
'../../utils/index'
;
class
PushSetting
extends
React
.
Component
{
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
};
}
componentDidMount
()
{
pageIn
(
'轻校-公众号消息推送配置'
);
}
componentWillUnmount
()
{
}
goBindWx
=
()
=>
{
const
{
dispatch
}
=
this
.
props
;
dispatch
({
type
:
'pushsetting/gobindwx'
,
});
}
render
()
{
const
{
isEmpty
,
wxInfo
,
}
=
this
.
props
;
const
data
=
[
{
title
:
'Ant Design Title 1'
,
},
];
return
(
<
div
className
=
{
pageStyles
.
container
}
>
{
!
isEmpty
&&
<
List
itemLayout
=
"horizontal"
dataSource
=
{[
wxInfo
]}
renderItem
=
{
item
=>
(
<
List
.
Item
>
<
List
.
Item
.
Meta
avatar
=
{
<
Avatar
src
=
"https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png"
/>
}
title
=
{
<
span
>
{
item
.
title
}
<
/span>
}
description
=
{
`
${
item
.
created_at
}
绑定`
}
/
>
<
/List.Item
>
)}
/
>
}
{
isEmpty
&&
<
Empty
image
=
"https://gw.alipayobjects.com/zos/antfincdn/ZHrcdLPrvN/empty.svg"
imageStyle
=
{{
height
:
60
,
}}
description
=
{
<
span
>
该校区暂未绑定自己的公众号,绑定之后可以使用自己的公众号推送
<
/span
>
}
>
<
Button
type
=
"primary"
onClick
=
{
this
.
goBindWx
}
>
绑定公众号
<
/Button
>
<
/Empty
>
}
<
/div
>
);
}
}
PushSetting
.
propTypes
=
{
};
function
mapStateToProps
(
state
)
{
const
{
isEmpty
,
wxInfo
,
}
=
state
.
pushsetting
;
const
{
locationQuery
}
=
state
.
webapp
;
return
{
isEmpty
,
wxInfo
,
};
}
export
default
connect
(
mapStateToProps
)(
PushSetting
);
src/pages/pushsetting/index.less
0 → 100644
View file @
c007c73a
@import '../../less/variables.less';
@images: '@{imagesroot}/login/';
.container {
background-color: #fff;
border-radius: 2px;
padding: 20px;
}
\ No newline at end of file
src/router.js
View file @
c007c73a
...
...
@@ -301,6 +301,11 @@ const ClockMember = props => (
{
ClockMember
=>
(
<
ClockMember
{...
props
}
/>
)
}
<
/Bundle
>
);
const
PushSetting
=
props
=>
(
<
Bundle
load
=
{()
=>
import
(
/* webpackChunkName:"PushSetting" */
'./pages/pushsetting/index'
)}
>
{
PushSetting
=>
(
<
PushSetting
{...
props
}
/>
)
}
<
/Bundle
>
);
function
RouterConfig
({
history
})
{
return
(
<
ConfigProvider
locale
=
{
zhCN
}
>
...
...
@@ -361,6 +366,7 @@ function RouterConfig({ history }) {
<
Route
path
=
"/sjd/editLive/:id"
exact
component
=
{
AddLive
}
/
>
<
Route
path
=
"/sjd/clockList"
exact
component
=
{
ClockList
}
/
>
<
Route
path
=
"/sjd/member/:type/:id"
exact
component
=
{
ClockMember
}
/
>
<
Route
path
=
"/sjd/pushsetting"
exact
component
=
{
PushSetting
}
/
>
<
Route
component
=
{
Errorpage
}
/
>
<
/Switch
>
<
/SjdIndex
>
...
...
src/services/pushsetting.js
0 → 100644
View file @
c007c73a
import
qs
from
'qs'
;
import
request
from
'../utils/request'
;
import
api
from
'../common/api'
;
// common: `${dakaapi}member/erp/classes`,
// changeClassStatus: `${dakaapi}member/erp/class/status`,
// addClassStudents: `${dakaapi}member/erp/class/student/add`,
export
function
getPreAuthorizationUrl
(
params
)
{
const
data
=
qs
.
stringify
(
params
);
return
request
({
url
:
`
${
api
.
bindWx
.
getPreAuthorizationUrl
}
?
${
data
}
`
,
method
:
'GET'
,
data
,
});
}
export
function
getOfficialAccount
(
params
)
{
const
data
=
qs
.
stringify
(
params
);
return
request
({
url
:
`
${
api
.
bindWx
.
getOfficialAccount
}
?
${
data
}
`
,
method
:
'GET'
,
data
,
});
}
export
function
bindToOpenPlatform
(
params
)
{
const
data
=
qs
.
stringify
(
params
);
return
request
({
url
:
`
${
api
.
bindWx
.
bindToOpenPlatform
}
?
${
data
}
`
,
method
:
'POST'
,
data
,
});
}
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