import React, { Component } from 'react';
import { Text } from 'react-native';
import QRScannerViewComponent from '../../../components/QRScannerViewComponent';

class QRScannerScreen extends Component {
  barcodeReceived= (e) => {
    console.info(`Type: ${e.type}Data: ${e.data}`);
  }
  renderTitleBar= () => {
    return (
      <Text
        style={{ color: 'white', textAlignVertical: 'center', textAlign: 'center', font: 20, padding: 12 }}
      >这里添加标题
      </Text>
    );
  }

  renderMenu =() => {
    return (
      <Text
        style={{ color: 'white', textAlignVertical: 'center', textAlign: 'center', font: 20, padding: 12 }}
      >这里添加底部菜单
      </Text>
    );
  }
  render() {
    return (
      <QRScannerViewComponent
        onScanResultReceived={this.barcodeReceived}
        renderTopBarView={this.renderTitleBar}
        renderBottomMenuView={this.renderMenu}
      />
    );
  }
}
export default QRScannerScreen;
