店铺模块化埋点&删除log,留埋点log验收后删,review by redding
Showing
4 changed files
with
49 additions
and
23 deletions
@@ -24,7 +24,7 @@ export default class GoodsGroupList extends React.Component { | @@ -24,7 +24,7 @@ export default class GoodsGroupList extends React.Component { | ||
24 | rowHasChanged: (r1, r2) => !Immutable.is(r1, r2), | 24 | rowHasChanged: (r1, r2) => !Immutable.is(r1, r2), |
25 | }); | 25 | }); |
26 | this.renderRow = this.renderRow.bind(this); | 26 | this.renderRow = this.renderRow.bind(this); |
27 | - this._onPressProductCell = this._onPressProductCell.bind(this); | 27 | + this._onPressProductRecommend = this._onPressProductRecommend.bind(this); |
28 | } | 28 | } |
29 | 29 | ||
30 | shouldComponentUpdate(nextProps){ | 30 | shouldComponentUpdate(nextProps){ |
@@ -35,11 +35,11 @@ export default class GoodsGroupList extends React.Component { | @@ -35,11 +35,11 @@ export default class GoodsGroupList extends React.Component { | ||
35 | } | 35 | } |
36 | } | 36 | } |
37 | 37 | ||
38 | - _onPressProductCell(data, rowID) { | 38 | + _onPressProductRecommend(data, rowID) { |
39 | let {resource} = this.props; | 39 | let {resource} = this.props; |
40 | let moduleOrder = resource.get('module_order') + 1; | 40 | let moduleOrder = resource.get('module_order') + 1; |
41 | let moduleType = resource.get('module_type'); | 41 | let moduleType = resource.get('module_type'); |
42 | - this.props.onPressProductCell && this.props.onPressProductCell(data, rowID,moduleOrder,moduleType) | 42 | + this.props.onPressProductRecommend && this.props.onPressProductRecommend(data, rowID,moduleOrder,moduleType) |
43 | } | 43 | } |
44 | 44 | ||
45 | renderRow(rowData, sectionID, rowID, highlightRow) { | 45 | renderRow(rowData, sectionID, rowID, highlightRow) { |
@@ -53,7 +53,7 @@ export default class GoodsGroupList extends React.Component { | @@ -53,7 +53,7 @@ export default class GoodsGroupList extends React.Component { | ||
53 | key={'row' + rowID} | 53 | key={'row' + rowID} |
54 | rowID={rowID} | 54 | rowID={rowID} |
55 | data={rowData} | 55 | data={rowData} |
56 | - onPressProduct={this._onPressProductCell} | 56 | + onPressProduct={this._onPressProductRecommend} |
57 | /> | 57 | /> |
58 | ); | 58 | ); |
59 | } | 59 | } |
@@ -137,7 +137,7 @@ export default class RedBrand extends Component { | @@ -137,7 +137,7 @@ export default class RedBrand extends Component { | ||
137 | }else if (rowData.get('module_type') == 'FourImage') { | 137 | }else if (rowData.get('module_type') == 'FourImage') { |
138 | return(<FourImages resource={rowData} onPressProduct={this.props.onPressProduct}/>); | 138 | return(<FourImages resource={rowData} onPressProduct={this.props.onPressProduct}/>); |
139 | }else if (rowData.get('module_type') == 'AppRecommendProduct') { | 139 | }else if (rowData.get('module_type') == 'AppRecommendProduct') { |
140 | - return(<GoodsGroupList resource={rowData} onPressProductCell={this.props.onPressProductCell}/>); | 140 | + return(<GoodsGroupList resource={rowData} onPressProductRecommend={this.props.onPressProductRecommend}/>); |
141 | } | 141 | } |
142 | } else if (sectionID == 'productList' || sectionID == 'newProductList') { | 142 | } else if (sectionID == 'productList' || sectionID == 'newProductList') { |
143 | let similarIndex = this.props.similarIndex; | 143 | let similarIndex = this.props.similarIndex; |
@@ -147,7 +147,6 @@ export default class RedBrand extends Component { | @@ -147,7 +147,6 @@ export default class RedBrand extends Component { | ||
147 | && this.state.scrollEnd | 147 | && this.state.scrollEnd |
148 | && rowID == this.state.selectedVisibleIndex | 148 | && rowID == this.state.selectedVisibleIndex |
149 | && rowID != similarIndex; | 149 | && rowID != similarIndex; |
150 | - rowData.tabID = this.props.fliter; | ||
151 | return ( | 150 | return ( |
152 | <BrandProductListCell | 151 | <BrandProductListCell |
153 | style={[styles.listContainer, customStyle]} | 152 | style={[styles.listContainer, customStyle]} |
@@ -57,6 +57,7 @@ class RedPersonBrandContainer extends Component { | @@ -57,6 +57,7 @@ class RedPersonBrandContainer extends Component { | ||
57 | this._onPressLink = this._onPressLink.bind(this); | 57 | this._onPressLink = this._onPressLink.bind(this); |
58 | this._onLongPressProduct = this._onLongPressProduct.bind(this); | 58 | this._onLongPressProduct = this._onLongPressProduct.bind(this); |
59 | this._onPressFindSimilar = this._onPressFindSimilar.bind(this); | 59 | this._onPressFindSimilar = this._onPressFindSimilar.bind(this); |
60 | + this._onPressProductRecommend = this._onPressProductRecommend.bind(this); | ||
60 | } | 61 | } |
61 | 62 | ||
62 | componentDidMount() { | 63 | componentDidMount() { |
@@ -151,7 +152,7 @@ class RedPersonBrandContainer extends Component { | @@ -151,7 +152,7 @@ class RedPersonBrandContainer extends Component { | ||
151 | ReactNative.NativeModules.YH_CommonHelper.jumpWithUrl(url); | 152 | ReactNative.NativeModules.YH_CommonHelper.jumpWithUrl(url); |
152 | } | 153 | } |
153 | 154 | ||
154 | - _onPressProductCell(product, rowId=0, moduleOrder, moduleType) { | 155 | + _onPressProductRecommend(product, rowId=0, moduleOrder, moduleType) { |
155 | let productSkn = product && product.get('product_skn', 0); | 156 | let productSkn = product && product.get('product_skn', 0); |
156 | if (!productSkn) { | 157 | if (!productSkn) { |
157 | return; | 158 | return; |
@@ -173,6 +174,47 @@ class RedPersonBrandContainer extends Component { | @@ -173,6 +174,47 @@ class RedPersonBrandContainer extends Component { | ||
173 | ReactNative.NativeModules.YH_CommonHelper.logEvent('YB_BRAND_SHOP_HOME_FLR_C', param); | 174 | ReactNative.NativeModules.YH_CommonHelper.logEvent('YB_BRAND_SHOP_HOME_FLR_C', param); |
174 | } | 175 | } |
175 | 176 | ||
177 | + _onPressProductCell(product, rowId=0) { | ||
178 | + let productSkn = product && product.get('product_skn', 0); | ||
179 | + if (!productSkn) { | ||
180 | + return; | ||
181 | + } | ||
182 | + let url = `http://m.yohobuy.com?openby:yohobuy={"action":"go.productDetail","params":{"product_skn":"${productSkn}"}}`; | ||
183 | + ReactNative.NativeModules.YH_CommonHelper.jumpWithUrl(url); | ||
184 | + let tabID = this.props.redBrand.fliter; | ||
185 | + let tabName = '首页'; | ||
186 | + if (tabID == '1') { | ||
187 | + tabName = '新品'; | ||
188 | + } else if (tabID == '2') { | ||
189 | + tabName = '全部商品'; | ||
190 | + } | ||
191 | + let orderName = this.props.redBrand.productList.orderName; | ||
192 | + let sortType = 0; | ||
193 | + if (orderName == '最新') { | ||
194 | + sortType = 1; | ||
195 | + }else if (orderName == '价格') { | ||
196 | + sortType = 2; | ||
197 | + }else if (orderName == '折扣') { | ||
198 | + sortType = 3; | ||
199 | + } | ||
200 | + let param = { | ||
201 | + SHOP_ID: this.props.redBrand.shopId, | ||
202 | + TAB_ID: tabID, | ||
203 | + TAB_NAME: tabName, | ||
204 | + PRD_ID: productSkn, | ||
205 | + TEMPLATE_TYPE: this.props.redBrand.shopIntro.shop_template_type, | ||
206 | + IS_RED: 1, | ||
207 | + SORT_TYPE: 1, | ||
208 | + } | ||
209 | + if (tabID != '1') { | ||
210 | + param.FILTER_VALUE = this.props.redBrand.filterNameFactors.toJS(); | ||
211 | + param.SORT_TYPE = sortType; | ||
212 | + } | ||
213 | + console.log('------点击品牌店铺页中全部TAB中的商品列表时---red---'); | ||
214 | + console.log(param); | ||
215 | + ReactNative.NativeModules.YH_CommonHelper.logEvent('YB_BRAND_SHOP_HOME_FLR_C', param); | ||
216 | + } | ||
217 | + | ||
176 | _onPressProduct(linkType,linkReource,moduleOrder,moduleType,i_index){ | 218 | _onPressProduct(linkType,linkReource,moduleOrder,moduleType,i_index){ |
177 | let url = ''; | 219 | let url = ''; |
178 | if (!linkReource) { | 220 | if (!linkReource) { |
@@ -304,6 +346,7 @@ class RedPersonBrandContainer extends Component { | @@ -304,6 +346,7 @@ class RedPersonBrandContainer extends Component { | ||
304 | onPressCollection={this._onPressCollection} | 346 | onPressCollection={this._onPressCollection} |
305 | onPressLink={this._onPressLink} | 347 | onPressLink={this._onPressLink} |
306 | onPressProductCell={this._onPressProductCell} | 348 | onPressProductCell={this._onPressProductCell} |
349 | + onPressProductRecommend={this._onPressProductRecommend} | ||
307 | onLongPressProduct={this._onLongPressProduct} | 350 | onLongPressProduct={this._onLongPressProduct} |
308 | onPressFindSimilar={this._onPressFindSimilar} | 351 | onPressFindSimilar={this._onPressFindSimilar} |
309 | showSimilarGuider={showSimilarGuider} | 352 | showSimilarGuider={showSimilarGuider} |
@@ -627,8 +627,6 @@ export function getRedBrandDecorator() { | @@ -627,8 +627,6 @@ export function getRedBrandDecorator() { | ||
627 | if (rooms) { | 627 | if (rooms) { |
628 | dispatch(getVideoLiveCount(rooms)); | 628 | dispatch(getVideoLiveCount(rooms)); |
629 | } | 629 | } |
630 | - console.log('---->>>>>floor'); | ||
631 | - console.log(payload); | ||
632 | dispatch(getProduct(payload)); | 630 | dispatch(getProduct(payload)); |
633 | 631 | ||
634 | dispatch(getRedBrandDecoratorSuccess(payload)); | 632 | dispatch(getRedBrandDecoratorSuccess(payload)); |
@@ -714,8 +712,6 @@ export function appRecommendProduct(dataSource) { | @@ -714,8 +712,6 @@ export function appRecommendProduct(dataSource) { | ||
714 | return new RedBrandService(app.host).searchProductBySkn(SKNs) | 712 | return new RedBrandService(app.host).searchProductBySkn(SKNs) |
715 | .then(json => { | 713 | .then(json => { |
716 | let product_list = json.product_list; | 714 | let product_list = json.product_list; |
717 | - console.log('----<<<<<<<<product_list'); | ||
718 | - console.log(product_list); | ||
719 | item.list = product_list; | 715 | item.list = product_list; |
720 | dispatch(productSuccess(dataSource)); | 716 | dispatch(productSuccess(dataSource)); |
721 | }) | 717 | }) |
@@ -728,8 +724,6 @@ export function appRecommendProduct(dataSource) { | @@ -728,8 +724,6 @@ export function appRecommendProduct(dataSource) { | ||
728 | return new RedBrandService(app.host).productList(shopId, channel, order, 1, pageSize) | 724 | return new RedBrandService(app.host).productList(shopId, channel, order, 1, pageSize) |
729 | .then(json => { | 725 | .then(json => { |
730 | let product_list = json.product_list; | 726 | let product_list = json.product_list; |
731 | - console.log('----------111111'); | ||
732 | - console.log(product_list); | ||
733 | item.list = product_list; | 727 | item.list = product_list; |
734 | dispatch(productSuccess(dataSource)); | 728 | dispatch(productSuccess(dataSource)); |
735 | 729 | ||
@@ -749,10 +743,6 @@ export function getProduct(dataSource) { | @@ -749,10 +743,6 @@ export function getProduct(dataSource) { | ||
749 | let originJson = json; | 743 | let originJson = json; |
750 | let list = originJson.modules; | 744 | let list = originJson.modules; |
751 | let sknList = []; | 745 | let sknList = []; |
752 | - | ||
753 | - console.log('----originJson'); | ||
754 | - console.log(originJson); | ||
755 | - | ||
756 | list.map((item, i) => { | 746 | list.map((item, i) => { |
757 | if (item.module_type == 'SknList') { | 747 | if (item.module_type == 'SknList') { |
758 | sknList = item.module_data.data; | 748 | sknList = item.module_data.data; |
@@ -766,17 +756,11 @@ export function getProduct(dataSource) { | @@ -766,17 +756,11 @@ export function getProduct(dataSource) { | ||
766 | SKNs = SKNs + ',' + item; | 756 | SKNs = SKNs + ',' + item; |
767 | } | 757 | } |
768 | }); | 758 | }); |
769 | - console.log(SKNs); | ||
770 | - console.log('SKNs'); | ||
771 | 759 | ||
772 | dispatch(productRequest()); | 760 | dispatch(productRequest()); |
773 | return new RedBrandService(app.host).searchProductBySkn(SKNs) | 761 | return new RedBrandService(app.host).searchProductBySkn(SKNs) |
774 | .then(json => { | 762 | .then(json => { |
775 | let product_list = json.product_list; | 763 | let product_list = json.product_list; |
776 | - console.log(json); | ||
777 | - console.log('json'); | ||
778 | - console.log(list); | ||
779 | - | ||
780 | list.map((item, i) => { | 764 | list.map((item, i) => { |
781 | let data = item.module_data.data; | 765 | let data = item.module_data.data; |
782 | data.map((m, i) => { | 766 | data.map((m, i) => { |
-
Please register or login to post a comment