Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mr-julyedu
Overview
Overview
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
baiguangyao
mr-julyedu
Commits
9d280df3
Commit
9d280df3
authored
Oct 24, 2019
by
wangshuo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
邀请好友新接口添加
parent
18407a8f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
20 deletions
+29
-20
src/components/activity/index.js
+2
-1
src/components/activity/invite.js
+27
-19
No files found.
src/components/activity/index.js
View file @
9d280df3
...
@@ -11,7 +11,8 @@ class Activity extends Component {
...
@@ -11,7 +11,8 @@ class Activity extends Component {
}
}
componentWillMount
()
{
componentWillMount
()
{
jsCookie
.
set
(
'blessing_invite_code'
,
getParam
(
'shareuid'
));
jsCookie
.
set
(
'blessing_invite_uid'
,
getParam
(
'shareuid'
));
jsCookie
.
set
(
'blessing_invite_code'
,
getParam
(
'code'
));
}
}
getGift
=
()
=>
{
getGift
=
()
=>
{
...
...
src/components/activity/invite.js
View file @
9d280df3
...
@@ -24,7 +24,7 @@ class Invite extends Component {
...
@@ -24,7 +24,7 @@ class Invite extends Component {
}
else
{
}
else
{
if
(
getParam
(
'new'
))
{
if
(
getParam
(
'new'
))
{
this
.
props
.
history
.
push
(
`/activity?shareuid=
${
shareuid
}
`
);
this
.
props
.
history
.
push
(
`/activity?shareuid=
${
shareuid
}
&code=
${
inviteCode
}
`
);
}
}
}
}
}
}
...
@@ -74,24 +74,32 @@ class Invite extends Component {
...
@@ -74,24 +74,32 @@ class Invite extends Component {
if
(
this
.
props
.
user
.
hasError
)
{
if
(
this
.
props
.
user
.
hasError
)
{
this
.
props
.
history
.
push
(
'/passport'
);
this
.
props
.
history
.
push
(
'/passport'
);
}
else
{
}
else
{
if
(
is_weixin
())
{
http
.
get
(
`
${
API
.
home
}
/sys/user/invite/link`
).
then
(
res
=>
{
// TODO 这里需要运营确定文案
let
{
code
,
data
,
msg
}
=
res
;
wxShare
({
if
(
code
===
200
)
{
title
:
"哈哈哈哈哈哈哈"
,
let
inviteCode
=
data
.
blessing_invite_code
;
desc
:
"你的老相好在七月在线学习呢你来不来"
,
if
(
is_weixin
())
{
link
:
encodeURI
(
location
.
origin
+
`/invite?shareuid=
${
shareuid
}
new=1`
),
// TODO 这里需要运营确定文案
imgUrl
:
'https://julyedu-img-public.oss-cn-beijing.aliyuncs.com/Public/Image/20a86c1353.jpg'
wxShare
({
});
title
:
"哈哈哈哈哈哈哈"
,
this
.
setState
({
desc
:
"你的老相好在七月在线学习呢你来不来"
,
showTip
:
true
,
link
:
encodeURI
(
location
.
origin
+
`/invite?shareuid=
${
jsCookie
.
get
(
'uid'
)}
&new=1&code=
${
inviteCode
}
`
),
isWeiXin
:
true
,
imgUrl
:
'https://julyedu-img-public.oss-cn-beijing.aliyuncs.com/Public/Image/20a86c1353.jpg'
});
});
}
else
{
this
.
setState
({
history
.
replaceState
(
null
,
null
,
`invite?shareuid=
${
jsCookie
.
get
(
'uid'
)}
&new=1`
)
showTip
:
true
,
this
.
setState
({
isWeiXin
:
true
,
showTip
:
true
,
});
});
}
else
{
}
history
.
replaceState
(
null
,
null
,
`invite?shareuid=
${
jsCookie
.
get
(
'uid'
)}
&new=1&code=
${
inviteCode
}
`
)
this
.
setState
({
showTip
:
true
,
});
}
}
else
{
Toast
.
info
(
msg
,
2
);
}
});
}
}
}
}
...
...
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