camera组件scanCode模式下scan-area无法动态修改
<camera device-position= "back" flash= "off" mode= "scanCode" scan-area= "{{scanArea}}" bindscancode= "handleRecognizeCode" binderror= "handleError" class= "pusher" > <cover-view class= "liver-mask" > <cover-view class= "lcd-labelcode-{{recognizeStep}}" /> </cover-view> </camera> |
业务需要 根据步骤动态设置 ScanArea 的值,用于框定特定位置的识别区域,但发现 setData 之后camera组件没有更新对应的 scan-area :
const SCAN_AREAS = [ [0, 60, winWidth, 60], [0, 204, winWidth, 50], [0, 260, winWidth, 50] ] this .setData({ recognizeStep: 2, scanArea: SCAN_AREAS[1] }) |
1 回复