Authored by hongyong.zhao

点击自动埋点 — reviewed by yjc

... ... @@ -29,6 +29,8 @@ import type {ViewStyleProp} from '../../StyleSheet/StyleSheet';
import type {ColorValue} from '../../StyleSheet/StyleSheetTypes';
import type {Props as TouchableWithoutFeedbackProps} from './TouchableWithoutFeedback';
import type {TVParallaxPropertiesType} from '../AppleTV/TVViewPropTypes';
const { YH_CommonHelper } = require('../../BatchedBridge/NativeModules');
const DEFAULT_PROPS = {
activeOpacity: 0.85,
... ... @@ -334,6 +336,13 @@ const TouchableHighlight = ((createReactClass({
);
}
this.props.onPress && this.props.onPress(e);
let eventName = this.props.yh_clickData && this.props.yh_clickData.eventName
let param = this.props.yh_clickData
if (param) {
delete param.eventName
}
eventName && YH_CommonHelper && YH_CommonHelper.logEvent(eventName, param)
},
touchableHandleLongPress: function(e: PressEvent) {
... ...
... ... @@ -27,6 +27,8 @@ import type {Props as TouchableWithoutFeedbackProps} from './TouchableWithoutFee
import type {ViewStyleProp} from '../../StyleSheet/StyleSheet';
import type {TVParallaxPropertiesType} from '../AppleTV/TVViewPropTypes';
import type {PressEvent} from '../../Types/CoreEventTypes';
const { YH_CommonHelper } = require('../../BatchedBridge/NativeModules');
const PRESS_RETENTION_OFFSET = {top: 20, left: 20, right: 20, bottom: 30};
... ... @@ -262,6 +264,13 @@ const TouchableOpacity = ((createReactClass({
touchableHandlePress: function(e: PressEvent) {
this.props.onPress && this.props.onPress(e);
let eventName = this.props.yh_clickData && this.props.yh_clickData.eventName
let param = this.props.yh_clickData
if (param) {
delete param.eventName
}
eventName && YH_CommonHelper && YH_CommonHelper.logEvent(eventName, param)
},
touchableHandleLongPress: function(e: PressEvent) {
... ...
... ... @@ -18,6 +18,7 @@ const View = require('../View/View');
const createReactClass = require('create-react-class');
const ensurePositiveDelayProps = require('./ensurePositiveDelayProps');
const { YH_CommonHelper } = require('../../BatchedBridge/NativeModules');
const {
DeprecatedAccessibilityRoles,
... ... @@ -216,6 +217,13 @@ const TouchableWithoutFeedback = ((createReactClass({
*/
touchableHandlePress: function(e: PressEvent) {
this.props.onPress && this.props.onPress(e);
let eventName = this.props.yh_clickData && this.props.yh_clickData.eventName
let param = this.props.yh_clickData
if (param) {
delete param.eventName
}
eventName && YH_CommonHelper && YH_CommonHelper.logEvent(eventName, param)
},
touchableHandleActivePressIn: function(e: PressEvent) {
... ...