Authored by zhouxl

【埋点】--review by 宏勇

... ... @@ -32,6 +32,7 @@ export default class Focus extends React.Component {
return (
<View style={{height:sliderHeight, width:width}}>
<ImageSlider
yh_viewVisible = {true}
resource={data}
sliderWidth={width}
sliderHeight={sliderHeight}
... ...
export const CODE_ALLIANCE_BANNER_RESOURCE_CODE = "b688fc3b15100d23f247271b7dbe1193";
... ...
'use strict';
import ReactNative from 'react-native';
import {DeviceEventEmitter} from 'react-native';
import AllianceService from '../../services/AllianceService';
import {setproductPool, setSkns} from "../app/appActions";
import {CODE_ALLIANCE_BANNER_RESOURCE_CODE} from '../../constants'
const Platform = require('Platform');
... ... @@ -919,8 +919,19 @@ export function getResourceInfo(callback) {
return (dispatch, getState) => {
let {app} = getState();
dispatch(getResourceRequest());
return new AllianceService(app.host).fetchResourceInfo('b688fc3b15100d23f247271b7dbe1193')
return new AllianceService(app.host).fetchResourceInfo(CODE_ALLIANCE_BANNER_RESOURCE_CODE)
.then(json => {
let bannerList = json.length > 0 && json[0].data ? json[0].data : [];
bannerList.forEach(function (item, index) {
item.yh_exposureData = {
P_NAME: Platform.OS === 'ios' ? 'iFP_Alliance' : 'aFP_Alliance',
P_PARAM: CODE_ALLIANCE_BANNER_RESOURCE_CODE,
F_URL: item.url,
I_INDEX: index,
exposureEnd: 1
};
return item
})
dispatch(getResourceSuccess(json));
callback && typeof callback === 'function' && callback(json)
... ...
... ... @@ -7,6 +7,7 @@ import GroupProductCell from './GroupProductCell';
import GroupDetailHeader from './GroupDetailHeader';
import YH_Image from '../../common/components/YH_Image';
import {getSlicedUrl} from '../../classify/utils/Utils';
const {YH_CommonHelper} = NativeModules;
export default class GroupPurchaseDetail extends Component {
constructor(props) {
... ... @@ -58,8 +59,9 @@ export default class GroupPurchaseDetail extends Component {
return(
<View style={{width:width, height:70*DEVICE_WIDTH_RATIO+8, backgroundColor:'#f0f0f0'}}>
<View style={{width:width, height:70*DEVICE_WIDTH_RATIO}}>
<TouchableOpacity activeOpacity={1} onPress={() => {
<TouchableOpacity yh_exposureData={resourceData.yh_exposureData} activeOpacity={1} onPress={() => {
this.props.didTouchBanner && this.props.didTouchBanner(url);
YH_CommonHelper.logEvent('YB_GROUP_DEATIL_BANNER_C', resourceData.yh_exposureData);
}}>
<YH_Image style={{width: '100%', height: '100%'}} url={src}></YH_Image>
</TouchableOpacity>
... ... @@ -107,6 +109,7 @@ export default class GroupPurchaseDetail extends Component {
ref={(c) => {
this.listView = c;
}}
yh_viewVisible = {true}
enableEmptySections={true}
dataSource={this.dataSource.cloneWithRowsAndSections(dataSource)}
renderRow={this._renderRow}
... ...
... ... @@ -235,6 +235,18 @@ export function fetchResourceInfo() {
let content_code = '3c3a94fd6c6e19508b6921acd7f6cbad';
return new GroupPurchaseService(app.host).fetchDetailResourceInfo(content_code)
.then(json => {
let resourceList = json.length > 0 && json[0].data ? json[0].data : [];
resourceList.forEach(function (item, index) {
item.yh_exposureData = {
P_NAME: Platform.OS === 'ios' ? 'iFP_GroupPurchaseDetail' : 'aFP_GroupPurchaseDetail',
P_PARAM: content_code,
F_URL: item.url,
I_INDEX: index,
exposureEnd: 1
};
return item
})
dispatch(resourceInfoSuccess(json));
})
.catch(error => {
... ...