Authored by yoho-js001

5.4.1埋点。reviewed by 煤老板。

@@ -90,18 +90,14 @@ export default class Brand extends Component { @@ -90,18 +90,14 @@ export default class Brand extends Component {
90 } 90 }
91 91
92 renderRow(rowData, sectionID, rowID, highlightRow) { 92 renderRow(rowData, sectionID, rowID, highlightRow) {
93 - if (this.props.brandFliter == 0) {  
94 let title = sectionID == '0-9' ? '0' : sectionID; 93 let title = sectionID == '0-9' ? '0' : sectionID;
  94 + // console.log(sectionID);
  95 + // console.log(rowData);
95 return ( 96 return (
96 <View onLayout={this.onLayout.bind(this, sectionID)}> 97 <View onLayout={this.onLayout.bind(this, sectionID)}>
97 <BLKBrandCell title={title} rowData={rowData} onPressBrandItem={this.props.onPressBrandItem}/> 98 <BLKBrandCell title={title} rowData={rowData} onPressBrandItem={this.props.onPressBrandItem}/>
98 </View> 99 </View>
99 ); 100 );
100 - } else {  
101 - return (  
102 - <NewHotBannerListCell rowData={rowData} onPressBrandItem={this.props.onPressBrandItem}/>  
103 - );  
104 - }  
105 } 101 }
106 102
107 render() { 103 render() {
@@ -136,37 +132,21 @@ export default class Brand extends Component { @@ -136,37 +132,21 @@ export default class Brand extends Component {
136 } 132 }
137 133
138 let list; 134 let list;
139 - let listDataSource;  
140 let contentContainerStyle; 135 let contentContainerStyle;
141 - let renderSectionHeader = null;  
142 - let showIndexForListView = false;  
143 let showsVerticalScrollIndicator = false; 136 let showsVerticalScrollIndicator = false;
144 137
145 - if (brandFliter == 0) {  
146 list = data ? data.get('all_list') : null; 138 list = data ? data.get('all_list') : null;
147 let newList = {}; 139 let newList = {};
148 list && list.map((value, key) => { 140 list && list.map((value, key) => {
149 newList[key] = [value.toArray()]; 141 newList[key] = [value.toArray()];
150 }); 142 });
151 - listDataSource = newList ? this.dataSource.cloneWithRowsAndSections(newList) : null;  
152 - 143 + // console.log(newList);
  144 + // console.log('aaaaa');
  145 + // console.log(data?data.toJS():'null');
153 contentContainerStyle = styles.contentContainerOne; 146 contentContainerStyle = styles.contentContainerOne;
154 - renderSectionHeader = this.renderSectionHeader;  
155 147
156 - showIndexForListView = true;  
157 this.sectionData = newList; 148 this.sectionData = newList;
158 this.sectionDataKey = data.get('all_list_key').toJS(); 149 this.sectionDataKey = data.get('all_list_key').toJS();
159 - } else if (brandFliter == 1) {  
160 - list = data ? data.get('new_list') : null;  
161 - listDataSource = list ? this.dataSource.cloneWithRows(list.toArray()) : null;  
162 - contentContainerStyle = styles.contentContainerTwo;  
163 - showsVerticalScrollIndicator = true;  
164 - } else if (brandFliter == 2) {  
165 - list = data ? data.get('hot_list') : null;  
166 - listDataSource = list ? this.dataSource.cloneWithRows(list.toArray()) : null;  
167 - contentContainerStyle = styles.contentContainerTwo;  
168 - showsVerticalScrollIndicator = true;  
169 - }  
170 150
171 if (!list) { 151 if (!list) {
172 return null; 152 return null;
@@ -180,26 +160,16 @@ export default class Brand extends Component { @@ -180,26 +160,16 @@ export default class Brand extends Component {
180 ref={(ref)=>this.listView=ref} 160 ref={(ref)=>this.listView=ref}
181 initialListSize={1000} 161 initialListSize={1000}
182 contentContainerStyle={contentContainerStyle} 162 contentContainerStyle={contentContainerStyle}
183 - enableEmptySections={true}  
184 - dataSource={listDataSource} 163 + enableEmptySections={false}
  164 + dataSource={this.dataSource.cloneWithRowsAndSections(newList)}
185 renderRow={this.renderRow} 165 renderRow={this.renderRow}
186 showsVerticalScrollIndicator={showsVerticalScrollIndicator} 166 showsVerticalScrollIndicator={showsVerticalScrollIndicator}
187 renderHeader={this.renderHeader} 167 renderHeader={this.renderHeader}
188 /> 168 />
189 -  
190 - {showIndexForListView ? <IndexListView dataSource={list.keySeq().toArray()} onLetterPress={this.scrollToSection}/> : null}  
191 - 169 + <IndexListView dataSource={list.keySeq().toArray()} onLetterPress={this.scrollToSection}/>
192 <LoadingIndicator 170 <LoadingIndicator
193 isVisible={isFetching} 171 isVisible={isFetching}
194 /> 172 />
195 -  
196 - {showSearch ? <BrandSearch  
197 - data={search}  
198 - onTextChange={this.props.onTextChange}  
199 - onClickCancel={this.props.onClickCancel}  
200 - onPressClearHistory={this.props.onPressClearHistory}  
201 - onPressBrandSearchItem={this.props.onPressBrandSearchItem}  
202 - onPressSearchHistoryItem={this.props.onPressSearchHistoryItem} /> : null}  
203 </View> 173 </View>
204 ); 174 );
205 } 175 }
@@ -378,8 +378,6 @@ export function getBrandResource(channel) { @@ -378,8 +378,6 @@ export function getBrandResource(channel) {
378 return new BrandService(app.serviceHost).getBrandResource(channel, content_code) 378 return new BrandService(app.serviceHost).getBrandResource(channel, content_code)
379 .then(json => { 379 .then(json => {
380 let payload = parseResourceResources(json); 380 let payload = parseResourceResources(json);
381 - console.log('aaaaa');  
382 - console.log(payload);  
383 if (channel == 1) { 381 if (channel == 1) {
384 dispatch(getBrandResourceForBoySuccess(payload)); 382 dispatch(getBrandResourceForBoySuccess(payload));
385 }else if (channel == 2) { 383 }else if (channel == 2) {
@@ -385,7 +385,7 @@ class NewArrivalContainer extends Component { @@ -385,7 +385,7 @@ class NewArrivalContainer extends Component {
385 F_NM: '最新上架', 385 F_NM: '最新上架',
386 F_INDEX, 386 F_INDEX,
387 I_INDEX, 387 I_INDEX,
388 - SORT_NM: this.props.newArrival.productList.order, 388 + SORT_NM: this.sortNameWithParam(this.props.newArrival.productList.order),
389 FILTER_VALUE: this.props.newArrival.filterFactors.toJS(), 389 FILTER_VALUE: this.props.newArrival.filterFactors.toJS(),
390 PRD_SKN: productSkn, 390 PRD_SKN: productSkn,
391 } 391 }
@@ -393,6 +393,16 @@ class NewArrivalContainer extends Component { @@ -393,6 +393,16 @@ class NewArrivalContainer extends Component {
393 393
394 } 394 }
395 395
  396 + sortNameWithParam(param) {
  397 + if (param == 's_p_asc' || param == 's_p_desc') {
  398 + return '价格';
  399 + }
  400 + if (param == 'p_d_asc' || param == 'p_d_desc') {
  401 + return '折扣';
  402 + }
  403 + return '最新';
  404 + }
  405 +
396 _goToRecommendForYou() { 406 _goToRecommendForYou() {
397 this.props.actions.goToRecommendForYou(); 407 this.props.actions.goToRecommendForYou();
398 } 408 }