Merge branch 'brand_store' into classify
Showing
3 changed files
with
47 additions
and
32 deletions
@@ -23,7 +23,6 @@ export default class ProductCategoryList extends React.Component { | @@ -23,7 +23,6 @@ export default class ProductCategoryList extends React.Component { | ||
23 | 23 | ||
24 | this.leftRenderRow = this.leftRenderRow.bind(this); | 24 | this.leftRenderRow = this.leftRenderRow.bind(this); |
25 | this.rightRenderRow = this.rightRenderRow.bind(this); | 25 | this.rightRenderRow = this.rightRenderRow.bind(this); |
26 | - this.rightRenderSeparator = this.rightRenderSeparator.bind(this); | ||
27 | this._pressLeftRow = this._pressLeftRow.bind(this); | 26 | this._pressLeftRow = this._pressLeftRow.bind(this); |
28 | this._pressRightRow = this._pressRightRow.bind(this); | 27 | this._pressRightRow = this._pressRightRow.bind(this); |
29 | 28 | ||
@@ -46,40 +45,42 @@ export default class ProductCategoryList extends React.Component { | @@ -46,40 +45,42 @@ export default class ProductCategoryList extends React.Component { | ||
46 | } | 45 | } |
47 | 46 | ||
48 | leftRenderRow(rowData, sectionID, rowID, highlightRow) { | 47 | leftRenderRow(rowData, sectionID, rowID, highlightRow) { |
49 | - let colorStyle = rowData.get('isSelect') ? {backgroundColor: 'white'} : {backgroundColor: '#f4f4f4'}; | ||
50 | - let selectText = this.props.filterNameFactors.get(rowData.get('key')); | 48 | + let arrow = rowData.get('isSelect') ? <Image style={styles.arrow} source={require('../../../../image/filter_category_select_icon.png')}/> : null; |
51 | 49 | ||
52 | return ( | 50 | return ( |
53 | <TouchableOpacity onPress={() => this._pressLeftRow(rowData.toJS())}> | 51 | <TouchableOpacity onPress={() => this._pressLeftRow(rowData.toJS())}> |
54 | - <View style={[styles.leftRow, colorStyle]} > | ||
55 | - <Text style={styles.title} numberOfLines={1}> | ||
56 | - {rowData.get('name')}:{' ' + selectText} | ||
57 | - </Text> | 52 | + <View style={[styles.leftRow]} > |
53 | + | ||
54 | + <View style={styles.leftRowText} > | ||
55 | + <Text style={styles.title} numberOfLines={1}> | ||
56 | + {rowData.get('name')} | ||
57 | + </Text> | ||
58 | + {arrow} | ||
59 | + </View> | ||
60 | + <View style={[styles.underline]}></View> | ||
61 | + | ||
58 | </View> | 62 | </View> |
59 | </TouchableOpacity> | 63 | </TouchableOpacity> |
60 | ); | 64 | ); |
61 | } | 65 | } |
62 | 66 | ||
63 | rightRenderRow(rowData, sectionID, rowID, highlightRow) { | 67 | rightRenderRow(rowData, sectionID, rowID, highlightRow) { |
68 | + | ||
69 | + let colorStyle = rowData.get('isSelect') ? {backgroundColor: '#DBDBDB'} : {backgroundColor: '#f4f4f4'}; | ||
70 | + | ||
64 | return ( | 71 | return ( |
65 | <TouchableOpacity onPress={() => this._pressRightRow(rowData.toJS())}> | 72 | <TouchableOpacity onPress={() => this._pressRightRow(rowData.toJS())}> |
66 | - <View style={styles.rightRow}> | 73 | + <View style={[styles.rightRow, colorStyle]}> |
67 | <Text style={styles.subtitle} numberOfLines={1}> | 74 | <Text style={styles.subtitle} numberOfLines={1}> |
68 | {rowData.get('name')} | 75 | {rowData.get('name')} |
69 | </Text> | 76 | </Text> |
70 | - {rowData.get('isSelect') ? <Image style={styles.image} source={require('../../../../image/sprite.cart.png')}/> : null} | 77 | + <View style={[styles.underline]}></View> |
78 | + | ||
71 | </View> | 79 | </View> |
72 | </TouchableOpacity> | 80 | </TouchableOpacity> |
73 | ); | 81 | ); |
74 | } | 82 | } |
75 | 83 | ||
76 | - rightRenderSeparator(sectionID, rowID, adjacentRowHighlighted) { | ||
77 | - return ( | ||
78 | - <View key={'sep' + rowID} style={styles.separator}> | ||
79 | - </View> | ||
80 | - ); | ||
81 | - } | ||
82 | - | ||
83 | render() { | 84 | render() { |
84 | let {categoryFilterList, filterCategoryDetailFilterList, filterNameFactors} = this.props; | 85 | let {categoryFilterList, filterCategoryDetailFilterList, filterNameFactors} = this.props; |
85 | let subList = []; | 86 | let subList = []; |
@@ -103,7 +104,6 @@ export default class ProductCategoryList extends React.Component { | @@ -103,7 +104,6 @@ export default class ProductCategoryList extends React.Component { | ||
103 | <ListView | 104 | <ListView |
104 | dataSource={this.dataSourceR.cloneWithRows(subList.toArray())} | 105 | dataSource={this.dataSourceR.cloneWithRows(subList.toArray())} |
105 | renderRow={this.rightRenderRow} | 106 | renderRow={this.rightRenderRow} |
106 | - renderSeparator={this.rightRenderSeparator} | ||
107 | scrollsToTop={false} | 107 | scrollsToTop={false} |
108 | /> | 108 | /> |
109 | </View> | 109 | </View> |
@@ -120,45 +120,60 @@ let styles = StyleSheet.create({ | @@ -120,45 +120,60 @@ let styles = StyleSheet.create({ | ||
120 | flex: 1, | 120 | flex: 1, |
121 | flexDirection: 'row', | 121 | flexDirection: 'row', |
122 | position: 'absolute', | 122 | position: 'absolute', |
123 | - top: 37, | 123 | + top: 40, |
124 | left: 0, | 124 | left: 0, |
125 | width: width, | 125 | width: width, |
126 | - height: height - 37 - 44 - 64, | ||
127 | - backgroundColor: 'white', | 126 | + height: height - 40 - 44 - 64, |
127 | + backgroundColor: '#f4f4f4', | ||
128 | + borderTopColor: '#e0e0e0', | ||
129 | + borderWidth: 0.5, | ||
128 | }, | 130 | }, |
129 | leftContentContainer: { | 131 | leftContentContainer: { |
130 | - backgroundColor: '#f4f4f4', | 132 | + backgroundColor: '#ffffff', |
131 | }, | 133 | }, |
132 | leftRow: { | 134 | leftRow: { |
133 | justifyContent: 'center', | 135 | justifyContent: 'center', |
134 | - // alignItems: 'center', | ||
135 | height: 50, | 136 | height: 50, |
136 | width: rowWidth, | 137 | width: rowWidth, |
137 | paddingLeft: 15, | 138 | paddingLeft: 15, |
138 | - backgroundColor: '#f4f4f4', | 139 | + backgroundColor: '#ffffff', |
139 | }, | 140 | }, |
140 | - rightRow: { | 141 | + leftRowText: { |
141 | flexDirection: 'row', | 142 | flexDirection: 'row', |
142 | - // justifyContent: 'center', | ||
143 | alignItems: 'center', | 143 | alignItems: 'center', |
144 | + height: 49.5, | ||
145 | + width: rowWidth, | ||
146 | + }, | ||
147 | + rightRow: { | ||
148 | + flexDirection: 'column', | ||
149 | + justifyContent: 'center', | ||
144 | height: 50, | 150 | height: 50, |
145 | width: rowWidth, | 151 | width: rowWidth, |
146 | - marginLeft: 15, | ||
147 | - backgroundColor: 'white', | ||
148 | - | 152 | + paddingLeft: 15, |
153 | + }, | ||
154 | + underline:{ | ||
155 | + width: rowWidth, | ||
156 | + height: 0.5, | ||
157 | + backgroundColor:'#e0e0e0', | ||
158 | + position: 'absolute', | ||
159 | + bottom: 0, | ||
160 | + | ||
149 | }, | 161 | }, |
150 | title: { | 162 | title: { |
151 | fontSize: 17, | 163 | fontSize: 17, |
152 | color: '#444444', | 164 | color: '#444444', |
165 | + width: rowWidth - 21, | ||
166 | + //flex: 1, | ||
167 | + | ||
153 | }, | 168 | }, |
154 | subtitle: { | 169 | subtitle: { |
155 | fontSize: 14, | 170 | fontSize: 14, |
156 | color: '#b0b0b0', | 171 | color: '#b0b0b0', |
157 | }, | 172 | }, |
158 | - image: { | ||
159 | - // marginTop: 2, | ||
160 | - marginLeft: 5, | ||
161 | - width: 12, | 173 | + arrow: { |
174 | + justifyContent: 'flex-end', | ||
175 | + alignItems: 'center', | ||
176 | + width: 6, | ||
162 | height: 12, | 177 | height: 12, |
163 | }, | 178 | }, |
164 | separator: { | 179 | separator: { |

1.03 KB

1.21 KB
-
Please register or login to post a comment