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
a688575e
Commit
a688575e
authored
Apr 15, 2020
by
wangxuelai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
'ss'
parent
037ccb09
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
77 additions
and
22 deletions
+77
-22
api.js
src/common/api.js
+1
-0
pushsetting.js
src/models/pushsetting.js
+50
-20
index.js
src/pages/pushsetting/index.js
+19
-2
common.js
src/services/common.js
+7
-0
No files found.
src/common/api.js
View file @
a688575e
...
...
@@ -41,6 +41,7 @@ export default {
fileTransForm
:
`
${
dakaapi
}
member/file_convert/create`
,
fileConvertQuery
:
`
${
dakaapi
}
member/file_convert/query`
,
editorUpload
:
`
${
dakaapi
}
common/editor_upload`
,
getfeatures
:
`
${
dakaapi
}
member/features`
,
bindWx
:
{
getPreAuthorizationUrl
:
`
${
dakaapi
}
member/wechat/open/get_pre_authorization_url`
,
getOfficialAccount
:
`
${
dakaapi
}
member/wechat/open/get_official_account`
,
...
...
src/models/pushsetting.js
View file @
a688575e
...
...
@@ -10,6 +10,7 @@ import {
}
from
'../utils/index'
;
import
errorcode
from
'../common/errorcode'
;
import
*
as
pushSettingAjax
from
'../services/pushsetting'
;
import
*
as
commomAjax
from
'../services/common'
;
export
default
{
...
...
@@ -21,6 +22,7 @@ export default {
created_at
:
''
,
logo
:
''
,
},
hasPushAuth
:
false
,
},
subscriptions
:
{
setup
({
dispatch
,
history
})
{
// eslint-disable-line
...
...
@@ -69,33 +71,61 @@ export default {
}
return
;
}
const
data
=
yield
call
(
pushSettingAjax
.
getOfficialAccount
,
{
const
getfeaturesData
=
yield
call
(
commomAjax
.
getfeatures
,
{
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
:
''
,
if
(
getfeaturesData
.
code
==
200
)
{
const
status
=
getfeaturesData
.
data
.
list
.
find
(
ele
=>
ele
.
type
==
1
);
if
(
!
status
)
{
yield
put
({
type
:
'updateState'
,
payload
:
{
hasPushAuth
:
false
,
},
},
});
}
else
if
(
data
.
code
==
40000
)
{
yield
put
({
type
:
'updateState'
,
payload
:
{
isEmpty
:
true
,
},
});
});
}
else
{
yield
put
({
type
:
'updateState'
,
payload
:
{
hasPushAuth
:
true
,
},
});
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
,
},
});
}
}
}
else
{
yield
put
({
type
:
'webapp/errorrequestresolve'
,
payload
:
{
data
,
data
:
getfeaturesData
,
},
});
}
...
...
src/pages/pushsetting/index.js
View file @
a688575e
...
...
@@ -32,6 +32,7 @@ class PushSetting extends React.Component {
isEmpty
,
wxInfo
,
sid
,
hasPushAuth
,
}
=
this
.
props
;
const
data
=
[
{
...
...
@@ -40,7 +41,7 @@ class PushSetting extends React.Component {
];
return
(
<
div
className
=
{
pageStyles
.
container
}
>
{
!
isEmpty
&&
{
!
isEmpty
&&
hasPushAuth
&&
<
List
itemLayout
=
"horizontal"
dataSource
=
{[
wxInfo
]}
...
...
@@ -61,7 +62,7 @@ class PushSetting extends React.Component {
)}
/
>
}
{
isEmpty
&&
{
isEmpty
&&
hasPushAuth
&&
<
Empty
image
=
"https://gw.alipayobjects.com/zos/antfincdn/ZHrcdLPrvN/empty.svg"
imageStyle
=
{{
...
...
@@ -76,6 +77,20 @@ class PushSetting extends React.Component {
<
Button
type
=
"primary"
onClick
=
{
this
.
goBindWx
}
>
绑定公众号
<
/Button
>
<
/Empty
>
}
{
!
hasPushAuth
&&
<
Empty
image
=
"https://gw.alipayobjects.com/zos/antfincdn/ZHrcdLPrvN/empty.svg"
imageStyle
=
{{
height
:
60
,
}}
description
=
{
<
span
>
该校区暂未开启自定义公众号推送功能,请联系轻校客服
<
/span
>
}
>
<
/Empty
>
}
<
/div
>
);
}
...
...
@@ -88,9 +103,11 @@ function mapStateToProps(state) {
const
{
isEmpty
,
wxInfo
,
hasPushAuth
,
}
=
state
.
pushsetting
;
const
{
locationQuery
,
sid
}
=
state
.
webapp
;
return
{
hasPushAuth
,
isEmpty
,
wxInfo
,
sid
,
...
...
src/services/common.js
View file @
a688575e
...
...
@@ -111,3 +111,10 @@ export function getschooluuid(params) {
method
:
'GET'
,
});
}
export
function
getfeatures
(
params
)
{
const
data
=
qs
.
stringify
(
params
);
return
request
({
url
:
`
${
api
.
getfeatures
}
?
${
data
}
`
,
method
:
'GET'
,
});
}
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