Authored by 于良

Merge branch 'develop' of http://git.yoho.cn/mobile/YH_RNComponent into develop

Conflicts:
	js/App.js
... ... @@ -2,14 +2,14 @@
import Community from './community/Community';
import Plustar from './plustar/Plustar';
// import QRCode from './qrcode/QRCode';
import Coupon from './coupon/Coupon';
import Search from './search/Search';
import QRCode from './qrcode/QRCode';
// import Search from './search/Search';
export default function native(platform) {
Community(platform);
Plustar(platform);
Coupon(platform);
// QRCode(platform);
Search(platform);
QRCode(platform);
// Search(platform);
}
... ...
... ... @@ -156,6 +156,13 @@ function parseFloors(json) {
data = single_image(item.data);
} else if (templateName == 'getCoupon') {
data = getCoupon(item.data);
if(!data.couponID){
if(floors.length>1){
if(floors[floors.length-1].templateName=='text'){
floors.pop();
}
}
}
}
let floor = {
... ...
... ... @@ -14,20 +14,24 @@ import ReactNative, {
NetInfo,
} from 'react-native';
import Camera from 'react-native-camera';
import Camera from 'yh_rncamera';
const yh_QRCodeHelperEvt = new NativeEventEmitter(ReactNative.NativeModules.YH_QRCodeHelper)
let camera;
let scanTypeValue, animationFromTopToBottom;
let animationStartHeight = Dimensions.get('window').height * 0.10;
let animationEndHeight = Dimensions.get('window').height * 0.44;
let kScreenPointScale = Dimensions.get('window').width/320.0;
let kScreenPoint6Scale = Dimensions.get('window').width/375.0;
let KScanRectOfInterestWidth = (175+220)*kScreenPointScale/Dimensions.get('window').height;
let KScanRectOfInterestHeight = (190+220)*kScreenPointScale/ Dimensions.get('window').width;
export default class QRCode extends React.Component {
startAnimation() {
Animated.timing(this.state.destX, {
toValue: animationFromTopToBottom ? animationEndHeight : animationStartHeight,
duration: 2500,
duration: 1500,
}).start(() => {
this.startAnimation();
animationFromTopToBottom = !animationFromTopToBottom;
... ... @@ -49,17 +53,6 @@ export default class QRCode extends React.Component {
}
_onBarCodeRead(e) {
console.log(e);
let type = scanTypeValue;
if (e.bounds.origin.x >= 50 && e.bounds.origin.x <= 250 && e.bounds.origin.y >= 70 && e.bounds.origin.y < 270 && e.bounds.size.width < 200 && e.bounds.size.height < 200) {
camera._removeOnBarCodeReadListener();
this.props._onBarCodeRead && this.props._onBarCodeRead(e.data);
}
}
render() {
let {scanType} = this.props;
scanTypeValue = scanType;
... ... @@ -77,6 +70,7 @@ export default class QRCode extends React.Component {
this.props.onBarCodeRead && this.props.onBarCodeRead(e.data);
}
}}
rectOfCameraInterest={{x:0, y:0, width:KScanRectOfInterestWidth, height:KScanRectOfInterestHeight}}//{{x:0, y:0, width:0.69542253, height:1.28125 }}
style={styles.camera}
captureAudio={false}
>
... ...
... ... @@ -16,7 +16,7 @@
"react": "^15.3.1",
"react-immutable-proptypes": "^2.1.0",
"react-native": "0.32.0",
"react-native-camera": "github:lwansbrough/react-native-camera#1747ec4b0a52472cf2e8ad95f2c3603595e28e13",
"yh_rncamera": "0.1.0",
"react-native-device-info": "0.9.5",
"react-native-fabric": "0.2.2",
"react-native-progress": "^3.0.1",
... ...