Commit 0d71ab10 authored by Mac's avatar Mac

1

parent 793b8f9f
<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({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment