Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
scrm-micro-content
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit b83dd441
authored
Aug 24, 2023
by
杨明
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fixed
1 parent
bcbc2f1a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
122 additions
and
1 deletions
package-lock.json
package.json
src/views/material/addMaterial.vue
src/views/material/components/MaterialView.vue
package-lock.json
View file @
b83dd44
This diff is collapsed.
Click to expand it.
package.json
View file @
b83dd44
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
"lint"
:
"vue-cli-service lint"
"lint"
:
"vue-cli-service lint"
},
},
"dependencies"
:
{
"dependencies"
:
{
"axios"
:
"^
0.18
.0"
,
"axios"
:
"^
1.4
.0"
,
"core-js"
:
"^3.4.4"
,
"core-js"
:
"^3.4.4"
,
"dayjs"
:
"^1.10.7"
,
"dayjs"
:
"^1.10.7"
,
"el-tree-transfer"
:
"^2.2.6"
,
"el-tree-transfer"
:
"^2.2.6"
,
...
...
src/views/material/addMaterial.vue
View file @
b83dd44
This diff is collapsed.
Click to expand it.
src/views/material/components/MaterialView.vue
0 → 100644
View file @
b83dd44
<
template
>
<div
class=
"material-view"
>
<div
class=
"material-view-container"
>
<el-carousel
:height=
"height + 'px'"
interval=
"100000"
@
change=
"handleChange"
v-if=
"fileList.length"
>
<el-carousel-item
v-for=
"item in fileList"
:key=
"item"
>
<div
class=
"carousel-item"
>
<img
:src=
"item.url"
class=
"carousel-img"
/>
<img
src=
"@/assets/material/videoIcon.png"
class=
"play"
v-if=
"item.type == 'video'"
/>
</div>
</el-carousel-item>
</el-carousel>
<div
class=
"material-text"
v-html=
"textBoxContent"
></div>
</div>
</div>
</
template
>
<
script
>
export
default
{
data
()
{
return
{
height
:
200
,
fileList
:
[]
}
},
watch
:
{
materialAddForm
:
{
async
handler
(
val
)
{
const
fileList
=
val
.
imageUrlList
.
map
(
item
=>
{
return
{
type
:
'img'
,
url
:
item
}
})
this
.
fileList
=
val
.
videoUrl
?
fileList
.
concat
({
url
:
val
.
coverUrl
,
type
:
'video'
})
:
fileList
if
(
this
.
fileList
.
length
)
{
for
(
let
i
in
this
.
fileList
)
{
this
.
$set
(
this
.
fileList
[
i
],
'height'
,
await
this
.
getHeight
(
this
.
fileList
[
i
].
url
))
}
this
.
height
=
this
.
fileList
[
0
].
height
}
},
deep
:
true
,
immediate
:
true
}
},
props
:
{
materialAddForm
:
{
type
:
Object
,
default
:
()
=>
{}
},
textBoxContent
:
{
type
:
String
}
},
methods
:
{
getHeight
(
url
)
{
return
new
Promise
(
resolve
=>
{
const
img
=
new
Image
()
img
.
src
=
url
img
.
onload
=
res
=>
{
console
.
log
(
img
.
width
,
img
.
height
)
resolve
((
img
.
width
/
img
.
height
)
*
250
)
}
})
},
handleChange
(
e
)
{
this
.
height
=
this
.
fileList
[
e
].
height
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.material-view
{
width
:
289.47px
;
height
:
566px
;
background
:
url('../../../assets/phone.png')
;
background-size
:
100%
100%
;
position
:
relative
;
overflow
:
hidden
;
.material-view-container
{
position
:
absolute
;
top
:
56px
;
left
:
20px
;
width
:
calc
(
100%
-
40px
);
height
:
calc
(
100%
-
112px
);
overflow-y
:
auto
;
/deep/
.el-carousel__button
{
width
:
8px
;
}
.carousel-item
{
position
:
relative
;
height
:
100%
;
width
:
100%
;
.carousel-img
{
width
:
100%
;
height
:
100%
;
}
.play
{
position
:
absolute
;
width
:
30px
;
height
:
30px
;
top
:
50%
;
left
:
50%
;
transform
:
translate
(
-50%
,
-50%
);
}
}
.material-text
{
word-wrap
:
break-word
;
img
{
width
:
100%
!important
;
}
}
}
}
</
style
>
<
style
>
.material-text
img
{
width
:
100%
!important
;
}
</
style
>
Write
Preview
Markdown
is supported
Attach a file
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 post a comment