<camera mode="normal" device-position="{{cardPosition}}" flash="off" style="height:{{ cameraHeight-60 }}px">
<cover-view class="controls" style="width: 100%;height: 100%;">
<cover-image wx:if="{{cardType == 1}}" class="icon-w569-h828" src="/images/icon/take_idcard_a.png" />
<cover-image wx:elif="{{cardType == 2}}" class="icon-w569-h828" src="/images/icon/take_idcard_b.png" />
<cover-image wx:else class="icon-w569-h828" src="https://img-blog.csdnimg.cn/20210126144317636.png" />
</cover-view>
</camera>
Component({
properties: {
cardType: String,
},
observers:{
'cardType':function(e){
const that = this;
if(e == 1 || e == 2){
that.setData({
cardPosition:'back'
})
}else{
that.setData({
cardPosition:'front'
})
}
}
},
data: {
cameraHeight: wx.getSystemInfoSync().windowHeight,
cameraWidth: wx.getSystemInfoSync().windowWidth,
hide: true,
cardPosition:'back',
myCanvas1_canvas: '',
myCanvas1_ctx: '',
},
......
});
你好,麻烦提供出现问题的具体机型、微信版本号、系统版本号,以及能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)