Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
educationStu
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
向伟
educationStu
Commits
0530d966
Commit
0530d966
authored
Jan 11, 2022
by
罗超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2
parent
88d819cd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
9 deletions
+5
-9
Pronunciation.vue
src/components/word/Pronunciation.vue
+1
-1
index.vue
src/pages/index/index.vue
+4
-7
index.js
src/utils/index.js
+0
-1
No files found.
src/components/word/Pronunciation.vue
View file @
0530d966
<
template
>
<view
class=
"wordPronItem"
>
<view
class=
"num"
>
{{
cur
}}
/
{{
total
}}
<text
style=
"margin-left: 6rpx;"
>
{{
type
==
0
?
''
:
"复习"
}}
</text>
{{
cur
}}
/
{{
total
}}
<text
style=
"margin-left: 6rpx;
font-size: 20rpxs;
"
>
{{
type
==
0
?
''
:
"复习"
}}
</text>
</view>
<view
class=
"meaning"
>
{{
item
.
ChineseMean
}}
...
...
src/pages/index/index.vue
View file @
0530d966
...
...
@@ -116,7 +116,7 @@
<view
class=
"gardenCon"
v-for=
"(item1,index1) in item.List"
:key=
"index1"
id=
"img"
>
<image
:src=
"item1.Img"
mode=
"aspectFill"
style=
"width: 100%;height:100%;border-radius: 24rpx 24rpx 0 0;"
></image>
<view
class=
"gardenTextBox"
:style=
"
{'background':`linear-gradient(to bottom,
rgb(255,255,255,0) 0% ,${item1.bgcolor} , ${item1.bgcolor2})
` }">
<view
class=
"gardenTextBox"
:style=
"
{'background':`linear-gradient(to bottom,
${item1.bgcolor},${item1.bgcolor1} , ${item1.bgcolor2})
` }">
<view
class=
"gardenTitle one_line"
>
{{
item1
.
Title
}}
</view>
...
...
@@ -124,7 +124,6 @@
{{
item1
.
Digest
}}
</view>
</view>
</view>
</view>
...
...
@@ -196,9 +195,8 @@
if
(
x
.
List
.
length
>
0
){
x
.
List
.
forEach
((
item
,
index
)
=>
{
this
.
getColor
(
item
.
Img
,
index
,
y
).
then
(
v
=>
{
console
.
log
(
v
)
// item.bgcolor = v;
data
.
pageData
.
LearningGardenList
[
v
.
y
].
List
[
v
.
index
].
bgcolor
=
v
.
formatres
;
data
.
pageData
.
LearningGardenList
[
v
.
y
].
List
[
v
.
index
].
bgcolor1
=
v
.
formatres1
;
data
.
pageData
.
LearningGardenList
[
v
.
y
].
List
[
v
.
index
].
bgcolor2
=
v
.
formatres2
;
})
...
...
@@ -208,15 +206,14 @@
}
})
},
async
getColor
(
src
,
index
,
y
)
{
let
res
=
await
getImageColor
(
'myCanvas'
,
'img'
,
src
)
let
obj
=
{}
obj
.
formatres
=
`rgba(
${
res
.
r
}
,
${
res
.
g
}
,
${
res
.
b
}
,0.4)`
obj
.
formatres
=
`rgba(
${
res
.
r
}
,
${
res
.
g
}
,
${
res
.
b
}
,0.01)`
obj
.
formatres1
=
`rgba(
${
res
.
r
}
,
${
res
.
g
}
,
${
res
.
b
}
,0.6)`
obj
.
formatres2
=
`rgba(
${
res
.
r
}
,
${
res
.
g
}
,
${
res
.
b
}
,1)`
obj
.
index
=
index
obj
.
y
=
y
// console.log(168, formatres)
return
obj
},
againdata
()
{
...
...
src/utils/index.js
View file @
0530d966
...
...
@@ -265,7 +265,6 @@ export let getImageColor = async (canvasID, imgID, imgSrc) => {
// 取所有像素的平均值
for
(
var
row
=
0
;
row
<
imgHeight
;
row
++
)
{
for
(
var
col
=
0
;
col
<
imgWidth
;
col
++
)
{
// console.log(data[((img.width * row) + col) * 4])
if
(
row
==
0
)
{
r
+=
data
[((
imgWidth
*
row
)
+
col
)];
g
+=
data
[((
imgWidth
*
row
)
+
col
)
+
1
];
...
...
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