fix:ima-camera用uni.getSystemInfo动态宽高取代flex:1
This commit is contained in:
parent
651b3d8ec7
commit
95ff306da4
@ -3,7 +3,7 @@
|
||||
<!-- 相机预览 -->
|
||||
<ima-camera-view
|
||||
ref="cameraRef"
|
||||
style="width:750rpx;flex:1;"
|
||||
:style="'width:' + winWidth + 'px;height:' + winHeight + 'px;'"
|
||||
flash="off"
|
||||
facing="back"
|
||||
@onPictureTaken="onPictureTaken"
|
||||
@ -49,9 +49,20 @@
|
||||
return {
|
||||
capturedList: [],
|
||||
cameraReady: false,
|
||||
facing: 'back'
|
||||
facing: 'back',
|
||||
winWidth: 750,
|
||||
winHeight: 1334
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
var that = this
|
||||
uni.getSystemInfo({
|
||||
success: function(res) {
|
||||
that.winWidth = res.windowWidth
|
||||
that.winHeight = res.windowHeight
|
||||
}
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
onCameraOpened() {
|
||||
this.cameraReady = true
|
||||
@ -117,7 +128,6 @@
|
||||
.cc-page {
|
||||
flex: 1;
|
||||
background-color: #000000;
|
||||
position: relative;
|
||||
}
|
||||
/* 顶部 */
|
||||
.cc-topbar {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user