Authored by 张丽霞

Merge branch '5.4.1' into 5.5.0

@@ -180,7 +180,7 @@ class HomeContainer extends Component { @@ -180,7 +180,7 @@ class HomeContainer extends Component {
180 rec_pose = '100011'; 180 rec_pose = '100011';
181 } 181 }
182 182
183 - if (app.channel != 4) { 183 + if (app.channel == 1 || app.channel == 2) {
184 rec_id = data.favorite.get('rec_id',''); 184 rec_id = data.favorite.get('rec_id','');
185 185
186 let chooseForYouParam = { 186 let chooseForYouParam = {
@@ -238,12 +238,12 @@ class HomeContainer extends Component { @@ -238,12 +238,12 @@ class HomeContainer extends Component {
238 'I_INDEX': parseInt(index)+1 238 'I_INDEX': parseInt(index)+1
239 }; 239 };
240 240
241 - NativeModules.YH_CommonHelper.logEvent('YB_MY_NOTICE_C', param); 241 + NativeModules.YH_CommonHelper.logEvent('YB_MAIN_EVENT', param);
242 } 242 }
243 243
244 onPressAnnounceItem(jumpUrl, imageUrl, index, floorData, floorIndex) { 244 onPressAnnounceItem(jumpUrl, imageUrl, index, floorData, floorIndex) {
245 this.jumpWithUrl(jumpUrl, imageUrl, index, floorData, floorIndex); 245 this.jumpWithUrl(jumpUrl, imageUrl, index, floorData, floorIndex);
246 - NativeModules.YH_CommonHelper.logEvent('YB_MAIN_EVENT', {'POS_ID': '2'}); 246 + NativeModules.YH_CommonHelper.logEvent('YB_MY_NOTICE_C', {'POS_ID': '2'});
247 } 247 }
248 248
249 onPressShopFavorite(shopId, index) { 249 onPressShopFavorite(shopId, index) {
@@ -201,6 +201,19 @@ function reportHomeData(payload) { @@ -201,6 +201,19 @@ function reportHomeData(payload) {
201 } 201 }
202 } 202 }
203 203
  204 +function reportFavoriteData(payload) {
  205 + return (dispatch) => {
  206 + try {
  207 + let reportData = floorParser.parseReportProductList(payload);
  208 + ReactNative.NativeModules.YH_CommonHelper.logEvent('YB_SHOW_MAIN_RECOMMEND', {'DATA': reportData});
  209 + } catch (e) {
  210 + __DEV__ && console.error(e);
  211 + } finally {
  212 +
  213 + }
  214 + }
  215 +}
  216 +
204 export function fetchHomeFavoriteList() { 217 export function fetchHomeFavoriteList() {
205 return (dispatch, getState) => { 218 return (dispatch, getState) => {
206 let {app, home} = getState(); 219 let {app, home} = getState();
@@ -239,7 +252,7 @@ export function fetchBoyGirlFavoriteList() { @@ -239,7 +252,7 @@ export function fetchBoyGirlFavoriteList() {
239 return new HomeService(app.host).fetchHomeFavoriteData(channel, contentCode, gender, fromPage, page) 252 return new HomeService(app.host).fetchHomeFavoriteData(channel, contentCode, gender, fromPage, page)
240 .then(json =>{ 253 .then(json =>{
241 let payload = floorParser.parseBoyGirlFavorite(json); 254 let payload = floorParser.parseBoyGirlFavorite(json);
242 - 255 + dispatch(reportFavoriteData(payload));
243 if (payload.currentPage > 1) { 256 if (payload.currentPage > 1) {
244 let oldList = currentChannelData.favorite.get('list').toJS(); 257 let oldList = currentChannelData.favorite.get('list').toJS();
245 let newList = [...oldList, ...payload.list]; 258 let newList = [...oldList, ...payload.list];
@@ -306,6 +319,7 @@ export function fetchKidsFavoriteList() { @@ -306,6 +319,7 @@ export function fetchKidsFavoriteList() {
306 return new HomeService(app.host).fetchHomeKidFavoriteData(fromPage, page) 319 return new HomeService(app.host).fetchHomeKidFavoriteData(fromPage, page)
307 .then(json =>{ 320 .then(json =>{
308 let payload = floorParser.parseKidsFavorite(json); 321 let payload = floorParser.parseKidsFavorite(json);
  322 + dispatch(reportFavoriteData(payload));
309 if (payload.currentPage > 1) { 323 if (payload.currentPage > 1) {
310 let oldList = kid.favorite.get('list').toJS(); 324 let oldList = kid.favorite.get('list').toJS();
311 let newList = [...oldList, ...payload.list]; 325 let newList = [...oldList, ...payload.list];
@@ -260,6 +260,8 @@ function heightForFloor(item, immutable=false) { @@ -260,6 +260,8 @@ function heightForFloor(item, immutable=false) {
260 return floorHeight; 260 return floorHeight;
261 } 261 }
262 262
  263 +
  264 +
263 function homeDataParse(data, channel) { 265 function homeDataParse(data, channel) {
264 let {list, cached, isFetching, isFirstLoad, endReached, favorite, bottomBanner, hotList, newList, selectIndex} = data; 266 let {list, cached, isFetching, isFirstLoad, endReached, favorite, bottomBanner, hotList, newList, selectIndex} = data;
265 let floorList = list.size > 0 ? list.toArray() : cached.get('list').toArray(); 267 let floorList = list.size > 0 ? list.toArray() : cached.get('list').toArray();
@@ -646,6 +648,34 @@ function parseReportData(list) { @@ -646,6 +648,34 @@ function parseReportData(list) {
646 return reportData; 648 return reportData;
647 } 649 }
648 650
  651 +function parseReportProductList(json) {
  652 + let reportData = [];
  653 + let productData = {};
  654 + let productList = [];
  655 +
  656 + let list = json && json.list ? json.list : [];
  657 + let page = json && json.currentPage ? json.currentPage : 1;
  658 +
  659 + let index = 1;
  660 + if (page >= 1) {
  661 + index = (page-1)*50 +1;
  662 + }
  663 +
  664 + for (var i = 0; i < list.length; i++) {
  665 + let product = list[i];
  666 + let param = {
  667 + 'I_INDEX': i + index,
  668 + 'IMAGE_URL': product&&product.default_images ? product.default_images : '',
  669 + 'PRD_SKN': product&&product.product_skn ? product.product_skn : ''
  670 + }
  671 + productList.push(param);
  672 + }
  673 +
  674 + productData.LIST = productList;
  675 + reportData.push(productData);
  676 + return reportData;
  677 +}
  678 +
649 module.exports = { 679 module.exports = {
650 calcluateFloorHeight, 680 calcluateFloorHeight,
651 heightForFloor, 681 heightForFloor,
@@ -658,5 +688,6 @@ module.exports = { @@ -658,5 +688,6 @@ module.exports = {
658 parseBottomBanner, 688 parseBottomBanner,
659 parseShopInfo, 689 parseShopInfo,
660 parseRecommendPop, 690 parseRecommendPop,
661 - parseReportData 691 + parseReportData,
  692 + parseReportProductList
662 }; 693 };