提交 60bc3998 编写于 作者: 赵十四's avatar 赵十四

添加图片左右滑动手势操作

上级 14443cb0
......@@ -17,8 +17,8 @@
<text class="text-content">{{postDetail.content}}</text>
<view class="img-conetent">
<!-- 多张图片 -->
<view class="one-img" v-for="img in postDetail.pictureList">
<view class="post-pic" @click.stop="showPic(img)"
<view class="one-img" v-for="(img,imgIndex) in item.pictureList">
<view class="post-pic" @click.stop="showPic(imgIndex,item.pictureList)"
:style="'background: url('+img+') no-repeat center/cover #eeeeee;'"></view>
</view>
......@@ -209,13 +209,11 @@
})
},
// 图片放大
showPic(imgUrl) {
let arr = [];
arr.push(imgUrl)
console.log(arr, '图片的地址')
showPic(index,list) {
uni.previewImage({
current: 0,
urls: arr
current: index,
urls: list
});
},
//点赞状态改变
......
......@@ -26,13 +26,13 @@
<text class="text-content">{{item.content}}</text>
<view class="img-conetent">
<!-- 多张图片 -->
<view v-if="item.pictureList.length!=1" class="one-img" v-for="img in item.pictureList">
<view class="post-pic" @click.stop="showPic(img)"
<view v-if="item.pictureList.length!=1" class="one-img" v-for="(img,imgIndex) in item.pictureList">
<view class="post-pic" @click.stop="showPic(imgIndex,item.pictureList)"
:style="'background: url('+img+') no-repeat center/cover #eeeeee;'"></view>
</view>
<!-- 单张图片 -->
<view v-if="item.pictureList.length == 1" class="single-pic"
@click.stop="showPic(item.pictureList[0])"
@click.stop="showPic(0,item.pictureList)"
:style="'background: url('+item.pictureList[0]+') no-repeat center/cover #eeeeee;'">
</view>
</view>
......@@ -68,13 +68,13 @@
<text class="text-content">{{item.content}}</text>
<view class="img-conetent">
<!-- 多张图片 -->
<view v-if="item.pictureList.length!=1" class="one-img" v-for="img in item.pictureList">
<view class="post-pic" @click.stop="showPic(img)"
<view v-if="item.pictureList.length!=1" class="one-img" v-for="(img,imgIndex) in item.pictureList">
<view class="post-pic" @click.stop="showPic(imgIndex,item.pictureList)"
:style="'background: url('+img+') no-repeat center/cover #eeeeee;'"></view>
</view>
<!-- 单张图片 -->
<view v-if="item.pictureList.length == 1" class="single-pic"
@click.stop="showPic(item.pictureList[0])"
@click.stop="showPic(0,item.pictureList)"
:style="'background: url('+item.pictureList[0]+') no-repeat center/cover #eeeeee;'">
</view>
</view>
......@@ -101,6 +101,7 @@
<script>
export default {
//下拉刷新
onPullDownRefresh() {
this.getAllPost();
this.getMyPost();
......@@ -182,15 +183,14 @@
});
},
// 图片放大
showPic(imgUrl) {
let arr = [];
arr.push(imgUrl)
console.log(arr, '图片的地址')
showPic(index,list) {
uni.previewImage({
current: 0,
urls: arr
current: index,
urls: list
});
},
//点赞状态改变
changeAllPostLike(index) {
if (this.btnDisabled) {
......@@ -233,7 +233,7 @@
});
}
},
//点赞状态改变
//点赞状态改变(我的帖子部分)
changeMyPostLike(index) {
if (this.btnDisabled) {
return
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册