Commit fe84451b authored by 罗超's avatar 罗超

1

parent d67153af
......@@ -2,16 +2,16 @@
<view class="img-list">
<view class="img-navs">
<view v-for="(item,index) in navList" :key="index" class="nav-btn" :class="{'check-nav':index===curNavIndex,'last-nav':index===navList.length-1}" @click="changeNav(index)">
{{item.TagName}}
{{item.TagName||'其他'}}
</view>
</view>
<view class="img-list-box">
<view v-for="(item,index) in dataList.TagPicList" :key="item.ID" class="img-list-item" @click="">
<view v-for="(item,index) in dataList.TagPicList" :key="item.ID" class="img-list-item" :style="{'margin-right':index%2 ==0?'20rpx':0}">
<view class="img-box" @click="previewImage(index,item.Path)" v-if="item.type==='image'">
<image :src="imgBaseUrl+item.Path" mode="aspectFit" :style="{'margin-right':index%2 ==0?'20rpx':0}"></image>
<image :src="item.Path" mode="aspectFit" ></image>
</view>
<view class="img-box" style="position: relative" v-if="item.type==='video'">
<video id="myVideo" :src="imgBaseUrl+item.Path"
<video id="myVideo" :src="item.Path"
:controls='controls'
:show-center-play-btn='false'
:show-fullscreen-btn='false'
......@@ -77,7 +77,7 @@
this.navList = res.data.AllPicList;
this.dataList=res.data.AllPicList[index]
this.dataList.TagPicList.forEach(item=>{
if(item.Path.indexOf('jpg')!==-1||item.Path.indexOf('png')!==-1||item.Path.indexOf('JPEG')!==-1){
if(item.Path.indexOf('jpg')!==-1||item.Path.indexOf('png')!==-1||item.Path.indexOf('jpeg')!==-1){
item.type='image'
}else if(item.Path.indexOf('mp4')!==-1){
item.type='video'
......@@ -96,7 +96,7 @@
//预览图片
previewImage(i,url) {
uni.previewImage({
urls: [this.imgBaseUrl+url],
urls: [url],
current: i,
longPressActions: {
itemList: ["发送给朋友", "保存图片", "收藏"],
......@@ -160,20 +160,20 @@
}
.img-list-box{
padding: 0 45rpx;
display: flex;
flex-wrap: wrap;
.img-list-item{
width: 315rpx;
margin-bottom: 20rpx;
.img-box{
width: 315rpx;
height: 315rpx;
background-color: #E7E7E7;
border-radius: 20rpx;
overflow: hidden;
display: flex;
justify-content: space-between;
image{
width: 100%;
height: 100%;
// margin-right: 20rpx;
margin-bottom: 20rpx;
}
#myVideo{
width: 100%;
......
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