uniapp图片自适应_uniapp 仿微信朋友圈,微博晒图 图片自适应排版
data() {return{
imgPicList: [],
imgboxtype:0,
imgwidth:0,
imgpad:0,
imgheight:''}
},
props: {
imgList: {
type: Array
},
num: {
type: Number,default: 0},
pad: {
type: Number,default: 0}
},
methods: {//图片预览
previewpic(cind, clist) {
console.log(cind, clist);
uni.previewImage({
urls: clist,
current: cind,
indicator:'default'});
},
getheight() {
let that= this;const query = uni.createSelectorQuery().in(that)
query.select('.imgitem').boundingClientRect()
query.exec(function(res) {
console.log(res[0].width)if (that.num == 1) {
that.imgheight= '100%';
}else if (that.num == 2 || that.num == 4) {
that.imgheight= (res[0].width).toFixed(2) + 'px';
}else{
that.imgheight= (res[0].width).toFixed(2) + 'px';
}
})//const query = uni.createSelectorQuery().in(this).select('.imgitem');//uni.createSelectorQuery().select('.imgitem').boundingClientRect(res => {//console.log('reac', res)//if (this.num == 1) {//this.imgheight = '100%';//} else if (this.num == 2 || this.num == 4) {//this.imgheight = (res.width).toFixed(2) + 'px';//} else {//this.imgheight = (res.width).toFixed(2) + 'px';//}//}).exec()
}
},
mounted() {//let this = this;
this.imgPicList = this.imgList;if (this.num == 1) {this.imgboxtype = 0;this.imgwidth = 100 + '%';
}else if (this.num == 2 || this.num == 4) {this.imgboxtype = 1;this.imgwidth = 49 + '%';
}else if (this.num == 3 || this.num > 4) {this.imgboxtype = 2;this.imgwidth = 32 + '%';
}this.$nextTick(function() {this.getheight();
})
}
}
.flex {
display: flex;
}
.justify {
justify-content: space-between;
}
.receiveimage {
margin-top: 28rpx;
display: flex;
flex-wrap: wrap;
width:100%;
.onepic {
width:100%;//height: 188rpx;//height: auto;
margin-bottom: 28rpx;&:nth-child(3n) {
margin-right: 0;
}
}
.doublepic {//width: 340rpx;//height: 340rpx;
margin-right: 12rpx;
margin-bottom: 12rpx;&:nth-child(2n) {
margin-right: 0;
}
}
.triplepic {//width: 222rpx;//height: 222rpx;
margin-right: 12rpx;
margin-bottom: 12rpx;&:nth-child(3n) {
margin-right: 0;
}
}
}
}
uniapp图片自适应_uniapp 仿微信朋友圈,微博晒图 图片自适应排版相关推荐
- android 打开微信好友动态图片,Android GridView仿微信朋友圈显示图片
最近项目要求上传多图并且多图显示,而且要规则的显示,就像微信朋友圈的图片显示一样. 利用GridView再适合不过了,GridView可以动态加载图片的数量,而且还比较规律,下面说一下自己的思路: 1 ...
- Android 仿微信朋友圈9宫格图片展示多选图片
转载请标明出处: http://blog.csdn.net/airsaid/article/details/51026447 本文出自:[周游的博客] 申明 该项目后续没有维护,并且里面存在一些 Bu ...
- vue整合uniapp_uni-app仿微信App界面|vue+uniapp聊天室|仿微信朋友圈
项目简介 基于uni-app+vue+vuex+uniPop+swiper等技术开发的仿微信聊天室uniapp-chatroom项目,类似vue及小程序api语法使开发更加方便,实现了发送图文消息.表 ...
- Android 仿微信朋友圈添加图片
github地址(欢迎下载Demo) https://github.com/zhouxu88/WXCircleAddPic 老习惯,先上图,着急用的朋友,直接带走Demo,先拿来用吧,毕竟老板催的紧, ...
- android从九宫格全屏预览,仿微信朋友圈展示图片的九宫格图片展示控件,支持点击图片全屏预览大图...
AssNineGridView 仿微信朋友圈展示图片的九宫格图片展示控件,支持点击图片全屏预览大图(可自定义). 写在前面 这是一个九宫格控件,本来是很久之前就写好了,现在才开源出来,也是看了很多优秀 ...
- Android 实现仿微信朋友圈九宫格图片+NineGridView+ImageWatcher(图片查看:1.预览,2.拖动,3.放大,4.左右滑动,5.长按保存到手机)的功能
一.测试 实现: 二.添加依赖包: implementation 'androidx.appcompat:appcompat:1.1.0'implementation 'androidx.recycl ...
- 安卓开发仿微信图片拖拽_仿微信朋友圈发表图片拖拽和删除功能
原标题:仿微信朋友圈发表图片拖拽和删除功能 中国联通在香港公布了上市公司2017年中期业绩.2017年上半年,公司主要业绩指标持续向好,收入稳步回升,服务收入达到人民币1,241.1亿元,同比增长3. ...
- 仿微信朋友圈选择图片
仿微信朋友圈选择图片 该版本实现了如下功能: 1.从相册选择图片,对图片进行了缓存处理,选择图片的时候,图片不会出现OOM 2.加入了拍照功能 3.加入了图库功能,可以让你的图片滚动起来了,如果你想使 ...
- Android仿微信朋友圈发图片和文字
Android仿微信朋友圈发图片和文字的一个开源项目,其在github上的项目主页是:https://github.com/zhangphil/FangWeiXinPengYouQuanFaTuPia ...
最新文章
- git 修改仓库的描述_git简介、基本命令和仓库操作
- 条款10 令operator=返回一个reference to *this
- python读取ttf_python解析字体反爬
- Java基础11-封装(思想、访问权限、this、构造方法)
- 教你买虚拟主机不会受骗的九个方法
- jquery-ui寺
- D1. All are Same
- java生成有理数_JAVA程序设计-有理数类的设计
- FireBase Android版本测试
- 如何通过定时关机命令,实现Windows XP的自动关机?
- SoC,SiP,IP和Chiplet的区别
- 企业微信之网页授权登录
- 【综述】A Comprehensive Survey on Graph NeuralNetworks(2)
- 怎么在微云服务器找一个文件,微云文件在哪里打开_怎么快速找到微云文件
- PIE二次开发(一)入门介绍及环境搭建
- 博日科技招股书失效,中金公司已停止对其辅导,放弃港交所上市?
- mac 文件隐藏加密工具_如何在照片内部加密和隐藏您的个人文件
- InterSystems开发者竞赛:InterSystems IRIS Analytics
- linux中负载值为多少正常_Linux系统Load average负载详细解释
- 8种 骨干级 架构设计模式 图示 分析 优缺点 总结
热门文章
- Echart 图表模板变量 {a}, {b},{c},{d},{e}
- 2018 中国城市天气代码
- 《滚雪球:巴菲特和他的财富人生》(The Snowball:Warren Buffett and the Business of Life)[PDF] - VeryCD电驴大全...
- JavaScript前端开发小游戏之智能拼图
- 网络安全--入侵阶段介绍
- 【Hive】sort by、order by、 distribute by、 group by 、cluster by区别
- Python数据分析实战2.4-注释【python】
- 数据工程学建设思考与实践
- 商务汇报类PPT模板
- xmpp协议抓包_在MAC下基于Openfire和Spark的XMPP协议实现