Commit fe84451b authored by 罗超's avatar 罗超

1

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