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
bd105657
Commit
bd105657
authored
Oct 30, 2019
by
xuzhenghua
Browse files
Options
Browse Files
Download
Plain Diff
toapp
parents
e4a85ed8
a2ea4a2f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
139 additions
and
0 deletions
+139
-0
src/components/blessingPreheat/toAppDemo.js
+135
-0
src/router/router-config.js
+4
-0
No files found.
src/components/blessingPreheat/toAppDemo.js
0 → 100644
View file @
bd105657
import
React
,
{
Component
}
from
'react'
import
{
SendMessageToApp
}
from
'@/utils'
import
{
Button
,
Toast
,
WhiteSpace
}
from
'antd-mobile'
import
cookie
from
'js-cookie'
import
{
addDays
}
from
"date-fns"
class
ToAppDemo
extends
Component
{
state
=
{
userInfoList
:
[],
}
componentDidMount
()
{
this
.
getData
()
// 获取App登录信息
window
[
'loginInfo'
]
=
result
=>
{
this
.
loginInfo
(
result
)
}
}
getData
=
()
=>
{
Toast
.
info
(
'获取福气值'
,
2
)
}
// 获取app登录数据
loginInfo
=
(
result
)
=>
{
this
.
setState
({
userInfoList
:
result
})
if
(
this
.
state
.
userInfoList
.
length
!==
0
)
{
this
.
appLogin
()
}
}
// 保存cookie
appLogin
=
()
=>
{
let
expires
=
addDays
(
new
Date
(),
90
)
this
.
state
.
userInfoList
.
map
((
item
,
index
)
=>
{
Toast
.
info
(
item
.
version
,
3
)
cookie
.
set
(
"token"
,
item
.
token
,
{
expires
,
path
:
'/'
,
domain
:
'julyedu.com'
});
cookie
.
set
(
"plat"
,
item
.
plat
,
{
expires
,
path
:
'/'
,
domain
:
'julyedu.com'
});
cookie
.
set
(
"uid"
,
item
.
uid
,
{
expires
,
path
:
'/'
,
domain
:
'julyedu.com'
});
cookie
.
set
(
"uname"
,
item
.
uname
,
{
expires
,
path
:
'/'
,
domain
:
'julyedu.com'
});
cookie
.
set
(
"avatar_file"
,
item
.
avatar_file
,
{
expires
,
path
:
'/'
,
domain
:
'julyedu.com'
});
});
}
// 跳转App登录
toLogin
=
()
=>
{
SendMessageToApp
(
"toLogin"
);
}
// 立即付定金
earnestMoney
=
(
courseId
)
=>
{
SendMessageToApp
(
"earnestMoney"
,
courseId
);
}
// 去课程详情页
toCourse
=
(
courseId
,
type
)
=>
{
let
data
=
{
courseId
:
courseId
,
type
:
type
// 正常跳课程详情页type:0,积福气浏览课程详情页-没有浏览过type:1 已浏览过type:2
}
SendMessageToApp
(
"toCourse"
,
data
);
}
// 人工咨询
toQQ
=
()
=>
{
SendMessageToApp
(
"toQQ"
,
'https://q.url.cn/AB8aue?_type=wpa&qidian=true'
)
}
// 直播间
toLiveRoom
=
(
toLiveRoom
)
=>
{
SendMessageToApp
(
"toLiveRoom"
,
toLiveRoom
)
}
// QQ分享
QQshare
=
()
=>
{
// 内容需要和产品确认
let
data
=
{
title
:
'11.11-11.13 AI充电节,预热来袭!重磅好课1折秒,超10万元奖品来就送-七月在线'
,
// 标题
desc
:
'11.11-11.13 AI充电节,预热来袭!重磅好课1折秒,超10万元奖品来就送-七月在线'
,
// 描述
imgUrl
:
'https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/active19_717/m/717/shareimg.png'
,
// 图片地址
link
:
'https://m.julyedu.com/blessingPreheat'
// url
}
SendMessageToApp
(
"QQshare"
,
data
)
}
// 微信分享
WXshare
=
()
=>
{
// 内容需要和产品确认
let
data
=
{
title
:
'11.11-11.13 AI充电节,预热来袭!重磅好课1折秒,超10万元奖品来就送-七月在线'
,
// 标题
desc
:
'11.11-11.13 AI充电节,预热来袭!重磅好课1折秒,超10万元奖品来就送-七月在线'
,
// 描述
imgUrl
:
'https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/active19_717/m/717/shareimg.png'
,
// 图片地址
link
:
'https://m.julyedu.com/blessingPreheat'
// url
}
SendMessageToApp
(
"WXshare"
,
data
)
}
// 邀请好友注册
toShare
=
()
=>
{
let
data
=
{
title
:
'11.11-11.13 AI充电节,预热来袭!重磅好课1折秒,超10万元奖品来就送-七月在线'
,
// 标题
desc
:
'11.11-11.13 AI充电节,预热来袭!重磅好课1折秒,超10万元奖品来就送-七月在线'
,
// 描述
imgUrl
:
'https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/active19_717/m/717/shareimg.png'
,
// 图片地址
link
:
'https://m.julyedu.com/blessingPreheat'
// url
}
SendMessageToApp
(
"toShare"
,
data
)
}
render
()
{
return
(
<
div
>
<
p
>
登录
<
/p
>
<
Button
type
=
{
'primary'
}
onClick
=
{()
=>
this
.
toLogin
()}
>
跳
App
登录
<
/Button><WhiteSpace/
>
<
p
>
去课程详情页
<
/p
>
<
Button
type
=
{
'primary'
}
onClick
=
{()
=>
this
.
toCourse
(
165
,
0
)}
>
课程详情页
<
/Button><WhiteSpace/
>
<
p
>
积福气
<
/p
>
<
Button
type
=
{
'primary'
}
onClick
=
{()
=>
this
.
toCourse
(
165
,
1
)}
>
浏览课程详情页
<
/Button><WhiteSpace/
>
<
Button
type
=
{
'primary'
}
onClick
=
{()
=>
this
.
QQshare
()}
>
分享(
QQ
)
<
/Button><WhiteSpace/
>
<
Button
type
=
{
'primary'
}
onClick
=
{()
=>
this
.
WXshare
()}
>
分享(微信)
<
/Button><WhiteSpace/
>
<
Button
type
=
{
'primary'
}
onClick
=
{()
=>
this
.
toShare
()}
>
邀请好友注册
<
/Button><WhiteSpace/
>
<
p
>
定金相关
<
/p
>
<
Button
type
=
{
'primary'
}
onClick
=
{()
=>
this
.
earnestMoney
(
165
)}
>
立即付定金
<
/Button><WhiteSpace/
>
<
Button
type
=
{
'primary'
}
onClick
=
{()
=>
this
.
toCourse
(
165
,
0
)}
>
去学习(跳课程详情页)
<
/Button><WhiteSpace/
>
<
p
>
精品特惠
<
/p
>
<
Button
type
=
{
'primary'
}
onClick
=
{()
=>
this
.
toQQ
()}
>
立抢超低团购价
(
跳人工咨询
)
<
/Button><WhiteSpace/
>
<
Button
type
=
{
'primary'
}
onClick
=
{()
=>
this
.
toCourse
(
165
,
0
)}
>
开始使用(跳课程详情页)
<
/Button><WhiteSpace/
>
<
Button
type
=
{
'primary'
}
onClick
=
{()
=>
this
.
toCourse
(
165
,
0
)}
>
一分钱开团(跳课程详情页)
<
/Button><WhiteSpace/
>
<
p
>
大咖直播
<
/p
>
<
Button
type
=
{
'primary'
}
onClick
=
{()
=>
this
.
toLiveRoom
(
100
)}
>
正在直播
<
/Button><WhiteSpace/
>
<
/div
>
)
}
}
export
default
ToAppDemo
src/router/router-config.js
View file @
bd105657
...
@@ -208,4 +208,8 @@ export default [
...
@@ -208,4 +208,8 @@ export default [
path
:
'/expand/index'
,
path
:
'/expand/index'
,
component
:
ExpandShare
component
:
ExpandShare
},
},
{
path
:
'/toAppDemo'
,
component
:
loadable
(()
=>
import
(
/* webpackChunkName: 'aist-share'*/
'@/components/blessingPreheat/toAppDemo'
))
}
]
]
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