Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
H
h5-base
Project
Project
Details
Activity
Releases
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
new-sing
h5-base
Commits
5e3446e0
Commit
5e3446e0
authored
Sep 25, 2019
by
IvyXia123
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交
parent
046ffc09
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
66 deletions
+13
-66
index.vue
src/components/index.vue
+1
-0
share.vue
src/components/newLesson/share.vue
+12
-66
No files found.
src/components/index.vue
View file @
5e3446e0
...
...
@@ -542,6 +542,7 @@ export default {
this
.
$refs
.
audioPage
.
onPlay
();
},
goLink
(
link
,
word
)
{
console
.
log
(
link
)
if
(
word
==
"qm"
)
{
this
.
$sa
.
quick
(
"trackHeatMap"
,
this
.
$refs
.
qmitem
);
if
(
this
.
userCourse
.
is_free_course
==
1
)
{
...
...
src/components/newLesson/share.vue
View file @
5e3446e0
...
...
@@ -33,8 +33,7 @@
</div>
<div
class=
"text1"
>
已在唱唱学习
</div>
<div
class=
"text2"
>
<span>
{{
dataSession
.
total_day
}}
</span>
<br
/>
天
<span>
{{
dataSession
.
total_day
}}
</span>
天
</div>
</div>
<div
class=
"item"
>
...
...
@@ -43,8 +42,7 @@
</div>
<div
class=
"text1"
>
今天学习了
</div>
<div
class=
"text2"
>
<span>
{{
minute
}}
</span>
<br
/>
分钟
<span>
{{
minute
}}
</span>
分钟
</div>
</div>
<div
class=
"item"
>
...
...
@@ -103,7 +101,6 @@
</div>
-->
</div>
</div>
<canvas
id=
"canvas"
></canvas>
<img
class=
"canvasImg"
@
touchstart=
"touchStart"
@
touchend=
"touchEnd"
:src=
"canvasData"
alt
/>
<!-- @touchstart="touchStart" -->
<div
class=
"test"
></div>
<div
class=
"white-pannel"
>
...
...
@@ -151,8 +148,6 @@
import
share_code_bg
from
"../../assets/newLesson/share-code-bg.png"
;
import
img_logo
from
"../../assets/newLesson/logo@2x.png"
;
import
share_tips
from
"../../assets/Bitmap@2x.png"
;
import
canvas_bg_1
from
"@/assets/share/canvas_bg_1.png"
;
import
canvas_bg_2
from
"@/assets/share/canvas_bg_2.png"
;
export
default
{
name
:
"share"
,
...
...
@@ -197,8 +192,7 @@
starNum
:
0
,
avatarActive
:
''
,
nicknameActive
:
''
,
dataSession
:
{},
shareConBg
:
''
dataSession
:
{}
};
},
props
:
[
"route"
,
"totalStarNum"
],
...
...
@@ -236,9 +230,9 @@
let
query
=
JSON
.
parse
(
sessionStorage
.
getItem
(
"classQuery"
));
this
.
timeout
=
setTimeout
(()
=>
{
// minute
/*
postErrorLogApi({'routes_url':new Date().toString(),'result_text':this.userDetail.user_id}).then((res)=>{
postErrorLogApi
({
'routes_url'
:
new
Date
().
toString
(),
'result_text'
:
this
.
userDetail
.
user_id
}).
then
((
res
)
=>
{
console
.
log
(
res
)
})
*/
})
this
.
$sa
.
track
(
"watchClick"
,
{
dayModule
:
JSON
.
parse
(
localStorage
.
getItem
(
"lessonDetail"
)
...
...
@@ -350,12 +344,11 @@
// debugger
this
.
lesson
=
JSON
.
parse
(
localStorage
.
getItem
(
"lessonDetail"
));
this
.
lesson
.
domTitle
=
this
.
lesson
.
domTitle
.
substring
(
0
,
9
);
//
console.log(this.watchDetail, 170);
//
console.log(this.lesson);
console
.
log
(
this
.
watchDetail
,
170
);
console
.
log
(
this
.
lesson
);
this
.
lastTime
=
Date
.
parse
(
new
Date
());
clearInterval
(
this
.
$store
.
state
.
timeout
);
this
.
userDetail
=
JSON
.
parse
(
localStorage
.
getItem
(
"userDesc"
));
console
.
log
(
this
.
userDetail
,
2323
)
this
.
nickname
=
this
.
userDetail
.
nickname
;
if
(
this
.
nickname
.
length
>=
6
)
{
this
.
nickname
=
this
.
nickname
.
slice
(
0
,
4
)
+
"..."
;
...
...
@@ -378,7 +371,7 @@
this
.
imgPoint
=
great
;
}
else
{
this
.
$store
.
dispatch
(
"setLookStatus"
,
2
);
//
console.log(Math.floor(39 * Math.random()));
console
.
log
(
Math
.
floor
(
39
*
Math
.
random
()));
this
.
percent
=
96
+
Math
.
floor
(
39
*
Math
.
random
())
/
10
;
this
.
imgPoint
=
perfect
;
}
...
...
@@ -397,7 +390,7 @@
// 'https://wechat.changchangenglish.com/' +
// "#/shareGoods?info=" +
// encodeURIComponent(JSON.stringify(obj));
//
console.log(URL);
console
.
log
(
URL
);
this
.
onShare
(
URL
);
this
.
toDataURLBase64
(
this
.
userDetail
.
avatar
.
replace
(
"http://"
,
"https://"
),
...
...
@@ -417,7 +410,7 @@
setTimeout
(()
=>
{
this
.
oimgPoint
=
true
;
},
900
);
/*
setTimeout(() => {
setTimeout
(()
=>
{
that
.
$nextTick
(()
=>
{
if
(
document
.
getElementById
(
"capture"
))
{
html2canvas
(
document
.
getElementById
(
"capture"
),
{
...
...
@@ -441,51 +434,7 @@
});
}
});
}, 1200);*/
setTimeout
(()
=>
{
this
.
animationBg
=
true
;
this
.
canvasImg
();
},
3000
);
},
canvasImg
()
{
const
canvas
=
document
.
getElementById
(
'canvas'
);
const
ctx
=
canvas
.
getContext
(
'2d'
);
const
canvasImage
=
new
Image
();
if
(
this
.
totalStarNum
==
3
)
{
canvasImage
.
src
=
canvas_bg_1
;
}
else
{
canvasImage
.
src
=
canvas_bg_2
;
}
let
that
=
this
;
canvasImage
.
onload
=
function
()
{
canvas
.
width
=
this
.
width
;
canvas
.
height
=
this
.
height
;
ctx
.
drawImage
(
this
,
0
,
0
,
canvas
.
width
,
canvas
.
height
);
that
.
fillTextFn
(
ctx
,
"7vw Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Arial, sans-serif"
,
"#fff"
,
`
${
that
.
nicknameActive
}
家宝宝`
,
360
,
265
);
that
.
fillTextFn
(
ctx
,
"bold 11vw Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Arial, sans-serif"
,
"#ec7e1f"
,
that
.
dataSession
.
total_day
,
150
,
540
);
that
.
fillTextFn
(
ctx
,
"bold 11vw Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Arial, sans-serif"
,
"#ec7e1f"
,
that
.
minute
,
360
,
540
);
that
.
fillTextFn
(
ctx
,
"bold 11vw Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Arial, sans-serif"
,
"#ec7e1f"
,
`
${
that
.
percent
}
%`
,
580
,
540
);
that
.
fillTextFn
(
ctx
,
"bold 11vw Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Arial, sans-serif"
,
"#1d6588"
,
that
.
lesson
.
title
,
360
,
840
);
that
.
fillTextFn
(
ctx
,
"9vw Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Arial, sans-serif"
,
"#1d6588"
,
that
.
lesson
.
domTitle
,
360
,
900
);
const
avatarImage
=
new
Image
();
avatarImage
.
setAttribute
(
"crossOrigin"
,
'Anonymous'
);
avatarImage
.
src
=
that
.
avatarActive
;
avatarImage
.
onload
=
function
()
{
ctx
.
arc
(
357
,
173
,
60
,
0
,
2
*
Math
.
PI
);
ctx
.
clip
();
ctx
.
drawImage
(
this
,
297
,
113
,
120
,
120
);
let
dataURL
=
canvas
.
toDataURL
(
"image/jpg"
,
1.0
);
that
.
canvasData
=
dataURL
;
};
};
},
fillTextFn
(
ctx
,
font
,
color
,
title
,
x
,
y
)
{
ctx
.
font
=
font
;
ctx
.
textAlign
=
"center"
;
ctx
.
fillStyle
=
color
;
ctx
.
fillText
(
title
,
x
,
y
);
},
1200
);
},
enableShare
:
function
(
option
)
{
let
query
=
JSON
.
parse
(
sessionStorage
.
getItem
(
"classQuery"
));
...
...
@@ -720,7 +669,7 @@
});
},
onShare
(
URL
)
{
//
console.log(451);
console
.
log
(
451
);
if
(
this
.
watchDetail
&&
this
.
watchDetail
.
total_day
)
{
this
.
enableShare
({
product_title
:
`我家宝宝正在【唱唱启蒙英语】唱学英语,已坚持
${
this
.
watchDetail
.
total_day
}
天`
,
// 分享标题
...
...
@@ -918,9 +867,6 @@
width: 100%;
z-index: 1300;
}
#canvas {
display: none;
}
.white-pannel {
position: absolute;
z-index: 1301;
...
...
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