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
b5c6bd00
Commit
b5c6bd00
authored
Dec 17, 2019
by
zhanghaozhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
安卓二维码添加保存按钮
parent
87e0d8cc
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
6 deletions
+41
-6
src/components/activity/newyear-2019/landing/index.js
+30
-3
src/components/activity/newyear-2019/landing/landing.scss
+11
-3
No files found.
src/components/activity/newyear-2019/landing/index.js
View file @
b5c6bd00
...
...
@@ -10,7 +10,6 @@ import { browser, getParam, http, wxShare, SendMessageToApp } from "@/utils"
import
{
Link
}
from
"react-router-dom"
import
QRCode
from
"qrcode"
import
YearCourse
from
'../preheat/YearCourse'
import
jsCookie
from
"js-cookie"
class
Landing
extends
Component
{
...
...
@@ -245,13 +244,26 @@ class Landing extends Component {
})
}
// 安卓手机保存二维码
saveImage
=
url
=>
{
let
version
=
getParam
(
'version'
)
version
=
typeof
version
===
'string'
?
version
.
replace
(
'.'
,
''
).
replace
(
'.'
,
''
).
slice
(
0
,
3
)
:
''
if
(
version
&&
parseInt
(
version
)
<
451
)
{
Toast
.
info
(
'当前不支持此功能,升级到最新版本app可以点击保存二维码!'
,
3
,
null
,
false
)
}
else
{
SendMessageToApp
(
'generateQRCode'
,
url
)
}
}
remind
=
(
type
=
'create'
,
treasure_code
,
origin
=
1
)
=>
{
const
{
user
}
=
this
.
props
http
.
get
(
`
${
API
[
"base-api"
]}
/wx/user_temporary_qrcode/
${
user
.
data
.
uid
}
`
)
.
then
(
res
=>
{
const
{
data
}
=
res
.
data
return
data
.
url
})
}).
then
(
text
=>
{
//todo 使用线上二维码
QRCode
.
toDataURL
(
'http://m.julyedu.com'
)
.
then
(
url
=>
{
Popup
({
...
...
@@ -261,6 +273,10 @@ class Landing extends Component {
content
:
<
div
>
<
div
className
=
"des"
>
{
type
===
'create'
?
'有好友加入队伍后第一时间通知我~'
:
'获得宝箱时第一时间通知我~'
}
<
/div
>
<
img
src
=
{
url
}
alt
=
""
/>
{
browser
.
isAndroidApp
?
<
div
>
//todo 使用线上二维码
<
button
className
=
{
'android-qr-code-btn'
}
onClick
=
{
this
.
saveImage
.
bind
(
this
,
'http://m.julyedu.com'
)}
>
保存二维码
<
/button
>
<
/div> : null
}
<
div
className
=
"des"
>
长按识别
/
扫码
关注【七月在线】服务号即可预约
<
/div
>
<
/div>
,
close
:
()
=>
{
...
...
@@ -272,6 +288,8 @@ class Landing extends Component {
}
})
})
})
}
showShareTip
=
()
=>
{
...
...
@@ -341,6 +359,15 @@ class Landing extends Component {
}
}
toSquare
=
()
=>
{
const
{
history
}
=
this
.
props
if
(
!
getParam
(
'version'
))
{
history
.
push
(
'/year/yearindex'
)
}
else
{
history
.
push
(
'/year/yearindex?version='
+
getParam
(
'version'
))
}
}
render
()
{
const
{
...
...
@@ -367,7 +394,7 @@ class Landing extends Component {
return
(
<
div
id
=
{
'landing'
}
>
<
div
id
=
"to-square"
>
<
Link
to
=
'/year/yearindex'
>
前往活动会场,享更多福利!
>><
/Link
>
<
a
href
=
'javascript:'
onClick
=
{
this
.
toSquare
}
>
前往活动会场,享更多福利!
>><
/a
>
<
/div
>
<
BoxContainer
>
<
i
className
=
"snow-deco"
/>
...
...
src/components/activity/newyear-2019/landing/landing.scss
View file @
b5c6bd00
...
...
@@ -338,7 +338,7 @@
}
img
{
margin
:
1
8
px
0
16px
;
margin
:
1
5
px
0
16px
;
width
:
137px
;
height
:
137px
;
}
...
...
@@ -349,7 +349,15 @@
}
button
{
width
:
270px
;
height
:
44px
;
background
:
rgba
(
255
,
227
,
25
,
1
);
border
:
1px
solid
rgba
(
9
,
9
,
9
,
1
);
border-radius
:
5px
;
font-size
:
16px
;
font-weight
:
normal
;
color
:
rgba
(
9
,
9
,
9
,
1
);
margin-bottom
:
15px
;
}
}
...
...
@@ -392,6 +400,6 @@
}
}
.year19-index
{
.year19-index
{
display
:
none
;
}
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