时间:2019-05-03 来源:小程序工厂
IOS白屏必现,我们家测试非要说是我调用的闪光灯,相信你能复现的。期待你的回复。
代码片段不可用
贴这里可以吧。
wxml:
wxss:
.flex{
display: flex;
}
.flex_j_c{
justify-content: center;
}
.flex_a_c{
align-items: center;
}
.pro{
position: absolute;
top: 100rpx;
height: 550rpx;
/* width: 550rpx; */
z-index: 1000;
left: 50%;
}
.btn{
border-radius: 0;
border: 1rpx solid transparent;
}
.btns{
margin: 0 10rpx;
width: 50%;
}
.btn_bg{
background-color: #679af2;
color: #fff;
}
.btn_bd{
color: #679af2;
background-color: #fff;
border: 1rpx #679af2 solid;
}
.small-btn{
width: 50%;
margin: 0 35rpx;
box-sizing: border-box;
}
.preview{
font-size: 28rpx;
padding: 15rpx;
}
.imgbox{
display: flex;
flex-wrap: wrap;
width: 100%;
box-sizing: border-box;
margin: 1rpx;
}
.imgbox image{
margin: 1rpx 0;
padding: 0 1rpx;
width: 33.33%;
height: 250rpx;
box-sizing: border-box;
}
button{
border-radius: 0;
}
button:after{
border: none;
}
js:
takePhoto: function() {
// console.log('123');
var that = this;
const ctx = wx.createCameraContext();
var imgList = this.data.imgList;
if (imgList.length <= 2) {
if (imgList.length == 3) {
// that.triggerEvent('myTap', {
// imgList
// });
}
ctx.takePhoto({
quality: 'high',
success: (res) => {
if (imgList && imgList.length > 0) {
imgList.push(res.tempImagePath);
} else {
imgList = [res.tempImagePath]
}
this.setData({
imgList: imgList
})
}
})
}else{
console.log('最多三张');
}
},
error: function(e) {
console.log(e.detail)
},
clear: function(){
this.setData({
imgList: []
})
},
deleteThis: function(data){
var that = this;
wx.showModal({
title: '提示',
content: '确认重拍该张照片?',
success: function(res){
console.log(res,res.confirm);
if (res.confirm){
console.log(res.confirm, data.currentTarget.dataset);
that.data.imgList.splice(data.currentTarget.dataset.index,1);
that.setData({
imgList: that.data.imgList
})
}else{
}
},
})
},
next: function(){
var that = this;
this.triggerEvent('next', {
imgList:that.data.imgList
});
}