Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mallapp
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
viitto
mallapp
Commits
0d71ab10
Commit
0d71ab10
authored
Oct 27, 2021
by
Mac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
793b8f9f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
99 additions
and
20 deletions
+99
-20
picDetail.vue
pages/school/picDetail.vue
+99
-20
No files found.
pages/school/picDetail.vue
View file @
0d71ab10
<
template
>
<view
class=
"box"
>
<view
class=
"nodata"
v-if=
"dataList.length===0"
>
暂无内容
<view>
<view
v-if=
'!isId'
class=
"box"
>
<view
class=
"nodata"
v-if=
"dataList.length===0"
>
暂无内容
</view>
<view
v-for=
"(item,index) in dataList"
:key=
"index"
class=
"img-box"
style=
"position: relative;"
v-if=
"dataList.length>0"
>
<image
:src=
"item.Path"
mode=
"aspectFill"
class=
"img"
v-if=
"item.Type==1"
@
click=
"previewImage(index)"
></image>
<video
:id=
"'myVideo'+index"
:src=
"item.Path"
style=
"width: 215rpx;height: 215rpx;"
:controls=
'controls'
:show-center-play-btn=
'false'
:show-fullscreen-btn=
'false'
@
fullscreenchange=
'videoControl'
v-if=
"item.Type==2"
></video>
<view
@
click=
"enlarge(index)"
style=
"position: absolute;left: 50%;top: 50%;margin-top: -49rpx;margin-left: -49rpx;width: 98rpx;height: 98rpx;border-radius: 20rpx;background-color: rgba(255,255,255,.4);display: flex;align-items: center;justify-content: center;"
v-if=
"item.Type==2"
>
<!-- 播放按钮 -->
<image
src=
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1616471847000_345.png"
style=
"width: 37rpx;height: 44rpx;"
mode=
""
></image>
</view>
</view>
</view>
<view
v-for=
"(item,index) in dataList"
:key=
"index"
class=
"img-box"
style=
"position: relative;"
v-if=
"dataList.length>0"
>
<image
:src=
"item.Path"
mode=
"aspectFill"
class=
"img"
v-if=
"item.Type==1"
@
click=
"previewImage(index)"
></image>
<video
:id=
"'myVideo'+index"
:src=
"item.Path"
style=
"width: 215rpx;height: 215rpx;"
:controls=
'controls'
:show-center-play-btn=
'false'
:show-fullscreen-btn=
'false'
@
fullscreenchange=
'videoControl'
v-if=
"item.Type==2"
></video>
<view
@
click=
"enlarge(index)"
style=
"position: absolute;left: 50%;top: 50%;margin-top: -49rpx;margin-left: -49rpx;width: 98rpx;height: 98rpx;border-radius: 20rpx;background-color: rgba(255,255,255,.4);display: flex;align-items: center;justify-content: center;"
v-if=
"item.Type==2"
>
<!-- 播放按钮 -->
<image
src=
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1616471847000_345.png"
style=
"width: 37rpx;height: 44rpx;"
mode=
""
></image>
<view
v-if=
"isId"
class=
"box"
>
<view
style=
"width: 100%;height: 30px;line-height: 30px;"
>
图片
</view>
<view
class=
"nodata"
v-if=
"imgList.length===0"
>
暂无内容
</view>
<view
v-for=
"(item,index) in imgList"
:key=
"index"
class=
"img-box"
style=
"position: relative;"
v-if=
"imgList.length>0"
>
<image
:src=
"item.Path"
mode=
"aspectFill"
class=
"img"
v-if=
"item.Type==1"
@
click=
"previewImage(index)"
></image>
</view>
<view
style=
"width: 100%;height: 30px;line-height: 30px;"
>
视频
</view>
<view
class=
"nodata"
v-if=
"videolist.length===0"
>
暂无内容
</view>
<view
v-for=
"(item,index) in videolist"
:key=
"index"
class=
"img-box"
style=
"position: relative;"
v-if=
"videolist.length>0"
>
<video
:id=
"'myVideo'+index"
:src=
"item.Path"
style=
"width: 215rpx;height: 215rpx;"
:controls=
'controls'
:show-center-play-btn=
'false'
:show-fullscreen-btn=
'false'
@
fullscreenchange=
'videoControl'
v-if=
"item.Type==2"
></video>
<view
@
click=
"enlarge(index)"
style=
"position: absolute;left: 50%;top: 50%;margin-top: -49rpx;margin-left: -49rpx;width: 98rpx;height: 98rpx;border-radius: 20rpx;background-color: rgba(255,255,255,.4);display: flex;align-items: center;justify-content: center;"
v-if=
"item.Type==2"
>
<!-- 播放按钮 -->
<image
src=
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1616471847000_345.png"
style=
"width: 37rpx;height: 44rpx;"
mode=
""
></image>
</view>
</view>
</view>
</view>
</
template
>
<
script
>
...
...
@@ -37,7 +74,11 @@
controls
:
false
,
//显示默认控件
dataList
:[],
preImg
:[],
videoContext
:
null
videoContext
:
null
,
imgList
:[],
videolist
:[],
isId
:
false
,
}
},
...
...
@@ -55,9 +96,47 @@
})
console
.
log
(
this
.
dataList
)
}
if
(
options
.
Id
&&
options
.
Id
>
0
){
this
.
GetActivityDetial
(
options
.
Id
)
this
.
isId
=
true
}
},
methods
:
{
GetActivityDetial
(
Id
){
this
.
request2
({
url
:
'/api/AppletEducation/GetActivityDetial'
,
data
:
{
Id
:
Id
}
},
res
=>
{
let
FileGroup
=
res
.
data
.
FileGroup
this
.
imgList
=
[];
this
.
videolist
=
[];
FileGroup
.
forEach
(
x
=>
{
if
(
x
.
Key
==
1
){
//图片
if
(
x
.
groupList
&&
x
.
groupList
.
length
>
0
){
x
.
groupList
.
forEach
(
j
=>
{
this
.
imgList
=
j
.
FileList
})
}
}
else
{
if
(
x
.
groupList
&&
x
.
groupList
.
length
>
0
){
x
.
groupList
.
forEach
(
j
=>
{
this
.
videolist
=
j
.
FileList
})
}
}
})
console
.
log
(
this
.
imgList
,
this
.
videolist
)
this
.
imgList
.
map
(
e
=>
{
this
.
preImg
.
push
(
e
.
Path
)
})
}
);
},
previewImage
(
i
)
{
console
.
log
(
i
)
uni
.
previewImage
({
...
...
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