Authored by 张丽霞

浏览记录和收藏商品优化,review by Redding

'use strict';
import React, {Component} from 'react';
import ReactNative, {
View,
Text,
Image,
ListView,
StyleSheet,
Dimensions,
TouchableOpacity,
} from 'react-native';
import LoadingIndicator from '../../../common/components/LoadingIndicator';
import ProductCell from './ProductCell';
import CategorySelector from './CategorySelector';
import NoDataView from '../product/NoDataView'
import { SwipeListView } from 'react-native-swipe-list-view';
export default class Browse extends Component {
constructor(props) {
super(props);
this.renderRow = this.renderRow.bind(this);
this.renderSectionHeader = this.renderSectionHeader.bind(this);
this.deleteRow = this.deleteRow.bind(this);
this.dataSource = new ListView.DataSource({
rowHasChanged: (r1, r2) => !Immutable.is(r1, r2),
});
this.state = {
isSwiping: false,
};
this.listView = null;
this.swipeable = {};
}
componentWillReceiveProps(nextProps) {
if (this.props.data.isDeleting
&& this.props.data.isDeleting != nextProps.data.isDeleting) {
}
}
rightButtons(rowData, rowID) {
const rightButtons = [
<TouchableOpacity
activeOpacity={1}
style={{
flex: 1,
justifyContent: 'center',
backgroundColor: 'red',
}}
onPress={() => {
this.props.onPressDelete && this.props.onPressDelete(rowData, rowID);
}}
>
<Text style={{color: 'white', fontSize: 17, paddingLeft: 20}}>删除</Text>
</TouchableOpacity>,
];
return rightButtons;
}
renderRow(rowData, sectionID, rowID) {
return (
<ProductCell
key={'row' + rowID}
data={rowData}
onPressProduct={this.props.onPressProduct}
onPressFindSimilar={this.props.onPressFindSimilar}
/>
);
}
deleteRow(data, secId, rowId, rowMap) {
rowMap[`${secId}${rowId}`].closeRow();
this.props.onPressDelete && this.props.onPressDelete(data, rowId);
}
renderSectionHeader() {
let {isFetching, selectedProductList, categoryList, selectedCategoryIndex} = this.props.data;
return (
<CategorySelector
data={categoryList}
selectedCategoryIndex={selectedCategoryIndex}
onPressCategory={(rowData, rowID) => {
this.listView && this.listView.scrollTo({x: 0, y: 0, animated: false});
this.props.onPressCategory && this.props.onPressCategory(rowData, rowID);
}}
/>
);
}
render() {
let {isFetching, productList, selectedProductList, categoryList, selectedCategoryIndex, isDeleting, showEmpty} = this.props.data;
let isLoading = (selectedProductList.size == 0 && isFetching) || isDeleting;
let showList = !isFetching && productList.size > 0;
return (
<View style={styles.container}>
{showList ? <SwipeListView
listViewRef={ ref => this.listView = ref }
scrollEnabled={!this.state.isSwiping}
enableEmptySections={true}
disableRightSwipe={true}
dataSource={this.dataSource.cloneWithRows(selectedProductList.toArray())}
renderRow={this.renderRow}
renderSectionHeader={this.renderSectionHeader}renderHiddenRow={ (data, secId, rowId, rowMap) => (
<View style={styles.rowBack}>
<Text></Text>
<Text>
<TouchableOpacity activeOpacity={1} style={styles.tailContainer} onPress={ _ => this.deleteRow(data, secId, rowId, rowMap)}>
<Text style={styles.tailText}>删除</Text>
</TouchableOpacity>
</Text>
</View>
)}
rightOpenValue={-70}
/> : null}
{showEmpty ? <NoDataView type={'browse'} onPressGuangGuang={this.props.onPressGuangGuang}/> : null}
<LoadingIndicator
isVisible={isLoading}
/>
</View>
);
}
}
let {width, height} = Dimensions.get('window');
let styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#f0f0f0',
},
rowBack: {
alignItems: 'center',
backgroundColor: '#DDD',
flex: 1,
flexDirection: 'row',
justifyContent: 'space-between',
paddingLeft: 15,
},
tailContainer: {
width: 70,
height: 130,
alignItems: 'center',
justifyContent: 'center',
backgroundColor: 'red'
},
tailText: {
color: 'white',
fontSize: 17,
backgroundColor: 'red'
},
});
... ...
'use strict';
import React, {Component} from 'react';
import ReactNative, {
View,
Text,
Image,
ListView,
TouchableOpacity,
StyleSheet,
Dimensions,
Animated,
Easing,
Platform
} from 'react-native';
import Immutable, {Map, List} from 'immutable';
import YH_Image from '../../../common/components/YH_Image';
import DeleteLineText from '../../../common/components/DeleteLineText';
export default class ProductCell extends Component {
constructor(props) {
super(props);
this.renderBottomView = this.renderBottomView.bind(this);
this.state = {
marginLeft: new Animated.Value(0)
}
}
shouldComponentUpdate(nextProps, nextState) {
if (this.props.data !== nextProps.data) {
return true;
}
if (this.props.editedRow !== nextProps.editedRow) {
return true;
}
return false;
}
renderBottomView() {
let data = this.props.data;
let showSoldOut = data.get('storage', 0) == 0 ? true : false;
if (showSoldOut) {
return (
<View style={[styles.bottomView, styles.soldOutContainer]}>
<Text style={styles.soldOut}>{'已售罄'}</Text>
</View>
);
}
let showOffShelf = data.get('status', 0) == 0 ? true : false;
let showReduce = data.get('price_down', 0) == 0 ? false : true;
if (!showOffShelf && showReduce) {
let reduceStr = '¥' + (parseFloat(data.get('price_down'))).toFixed(2);
return (
<View style={[styles.bottomView, styles.reduceContainer]}>
<Image style={styles.reduceImage} source={require('../../images/browse/mine_goods_low_icon.png')}/>
<Text style={styles.reduceText} numberOfLines={1}>
{'已降'}
<Text style={{
color: '#d0021b'
}}>{reduceStr}</Text>
</Text>
</View>
);
}
return null;
}
render() {
let data = this.props.data;
let prdImage = YH_Image.getSlicedUrl(data.get('image', ''), 76, 102, 2);
let salePrice = 0; // 售卖价
let originPrice = 0; // 原价
let salePriceStr = ''; // 拼接的售卖价
let originPriceStr = ''; // 拼接的原价
let showOriginPrice = true; // 是否显示原价
let salePriceColor = '#d0021b'; // 不显示原价时,售卖价颜色
salePrice = parseFloat(data.get('sales_price'));
originPrice = parseFloat(data.get('market_price'));
salePriceStr = '¥' + salePrice.toFixed(2);
originPriceStr = '¥' + originPrice.toFixed(2);
if (!originPrice || (salePrice == originPrice)) {
showOriginPrice = false;
salePriceColor = '#444444';
}
// let priceBottom = showOriginPrice ? 30 : 40;
let {editing, editedRow, rowID} = this.props;
let showLeft = editing && editedRow != rowID;
let showTail = editing && editedRow == rowID;
let marginLeft = showTail ? -70 : 0;
Animated.timing(this.state.marginLeft, {
toValue: marginLeft,
duration: 150,
easing: Easing.linear
}).start();
return (
<View style={styles.fatherContainer}>
{showLeft
? <TouchableOpacity activeOpacity={1} style={styles.deleteContainer} onPress={() => {
this.props.setEditedIndex && this.props.setEditedIndex(rowID);
}}>
<View style={styles.deleteCircle}>
<View style={styles.deleteBar}/>
</View>
</TouchableOpacity>
: null}
<Animated.View style={[
styles.container, {
marginLeft: this.state.marginLeft
}
]}>
<TouchableOpacity activeOpacity={1} style={[styles.container]} onPress={() => {
this.props.onPressProduct && this.props.onPressProduct(data);
}}>
<View style={styles.container}>
<View style={styles.leftContainer}>
<YH_Image style={styles.prdImage} url={prdImage}/>
<View>
<Text style={styles.prdName} numberOfLines={2}>{data.get('product_name', '')}</Text>
</View>
</View>
<Image style={styles.arrow} source={require('../../images/browse/shared_next_icon.png')}/>
<View style={styles.priceContainer}>
<Text style={[
styles.nowPrice, {
color: salePriceColor
}
]} numberOfLines={1}>{salePriceStr}</Text>
{showOriginPrice
? <DeleteLineText style={styles.oldPriceContainer} textStyle={styles.oldPrice} lineStyle={styles.deleteLine} text={originPriceStr}/>
: null}
</View>
{this.renderBottomView()}
{this.props.currentTab != 'global'
? <TouchableOpacity activeOpacity={1} style={styles.similar} onPress={() => {
this.props.onPressFindSimilar && this.props.onPressFindSimilar(data);
}}>
<Image source={require('../../images/browse/shopcart_findResemblance.png')}/>
</TouchableOpacity>
: null}
<View style={styles.separator}/>
</View>
</TouchableOpacity>
</Animated.View>
</View>
);
}
};
let {width} = Dimensions.get('window');
const DEVICE_WIDTH_RATIO = width / 320;
let imageWidth = Math.floor(width / 2);
let imageHeight = Math.floor(imageWidth * 180 / 375);
let nameWidth = width - 15 - 76 - 10 - 55;
let topLeftWidth = width - Math.ceil(84 * DEVICE_WIDTH_RATIO);
let styles = StyleSheet.create({
fatherContainer: {
flexDirection: 'row',
alignItems: 'center',
backgroundColor: 'white'
},
deleteContainer: {
width: 40,
height: 70,
alignItems: 'center',
justifyContent: 'center',
backgroundColor: 'white',
paddingLeft: 5
},
deleteCircle: {
width: 22,
height: 22,
borderRadius: 11,
backgroundColor: 'red',
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'center'
},
deleteBar: {
width: 11,
height: 1.5,
backgroundColor: 'white'
},
tailContainer: {
width: 70,
height: 122,
alignItems: 'center',
justifyContent: 'center',
backgroundColor: 'red'
},
tailText: {
color: 'white',
fontSize: 17,
backgroundColor: 'red'
},
container: {
flexDirection: 'row',
justifyContent: 'space-between',
alignItems: 'center',
width: width,
backgroundColor: 'white'
},
leftContainer: {
flexDirection: 'row'
},
prdImage: {
marginLeft: 15,
marginTop: 10,
marginBottom: 10,
width: 76,
height: 102
},
prdName: {
fontFamily: 'HelveticaNeue-Light',
fontSize: 12,
marginTop: 22,
marginLeft: 10,
width: nameWidth
},
priceContainer: {
position: 'absolute',
flexDirection: 'row',
marginTop: 20,
left: 91,
bottom: 40
},
nowPrice: {
fontSize: 14,
color: '#d0021b',
marginLeft: 10
},
oldPriceContainer: {
flexDirection: 'row',
marginLeft: 5,
marginTop: 2
},
oldPrice: {
fontSize: 12,
color: '#b0b0b0',
height: 16
},
deleteLine: {
position: 'absolute',
top: (16 / 2) - 1,
left: 0,
right: 0,
height: 1,
backgroundColor: '#b0b0b0'
},
bottomView: {
position: 'absolute',
left: 100,
bottom: 11,
width: nameWidth,
},
soldOutContainer: {
width: 45,
height: 15,
borderRadius: 7.5,
backgroundColor: 'gray',
justifyContent: 'center'
},
soldOut: {
fontSize: 12,
color: 'white',
textAlign: 'center',
textAlignVertical:'center',
width: 45,
height: 15,
paddingTop: Platform.OS === 'ios' ? 1.0:-0.5,
backgroundColor: 'transparent'
},
reduceContainer: {
flexDirection: 'row',
},
reduceImage: {
width: 15,
height: 15
},
reduceText: {
marginLeft: 2,
fontSize: 12,
color: '#b0b0b0',
width: nameWidth - 15 - 2
},
similar: {
position: 'absolute',
width: 56,
height: 25,
right: 15,
bottom: 12,
},
separator: {
position: 'absolute',
bottom: 0,
left: 96,
width,
height: 1,
backgroundColor: '#f0f0f0'
},
arrow: {
marginRight: 15,
width: 9,
height: 15
}
});
... ...
'use strict';
import React, {Component} from 'react';
import ReactNative, {
View,
Text,
Image,
ListView,
StyleSheet,
Dimensions,
TouchableOpacity,
} from 'react-native';
import LoadingIndicator from '../../../common/components/LoadingIndicator';
import ProductCell from '../browse/ProductCell';
import CategorySelector from '../browse/CategorySelector';
import TabHeader from './TabHeader'
import NoDataView from './NoDataView'
import { SwipeListView } from 'react-native-swipe-list-view';
export default class Product extends Component {
constructor(props) {
super(props);
this.renderRow = this.renderRow.bind(this);
this.renderHeader = this.renderHeader.bind(this);
this.handleScroll = this.handleScroll.bind(this);
this.renderSectionHeader = this.renderSectionHeader.bind(this);
this.renderFooter = this.renderFooter.bind(this);
this.deleteRow = this.deleteRow.bind(this);
this.dataSource = new ListView.DataSource({
rowHasChanged: (r1, r2) => !Immutable.is(r1, r2),
});
this.state = {
isSwiping: false,
showFooter: false,
};
this.listView = null;
this.swipeable = {};
}
handleScroll() {
let {editing,commonProduct, globalProduct} = this.props.data;
if (editing &&(commonProduct.get('editedIndex') >= 0 || globalProduct.get('editedIndex') >= 0 )) {
this.props.setEditedIndex && this.props.setEditedIndex(-1);
}
}
rightButtons(rowData, rowID) {
const rightButtons = [
<TouchableOpacity
activeOpacity={1}
style={{
flex: 1,
justifyContent: 'center',
backgroundColor: 'red',
}}
onPress={() => {
this.props.onPressDelete && this.props.onPressDelete(rowData, rowID);
}}
>
<Text style={{color: 'white', fontSize: 17, paddingLeft: 20}}>删除</Text>
</TouchableOpacity>,
];
return rightButtons;
}
renderRow(rowData, sectionID, rowID) {
let {
commonProduct,
globalProduct,
editing,
currentTab,
} = this.props.data;
let editedRow = -1;
if (currentTab == 'common') {
let {editedIndex} = commonProduct;
editedRow = editedIndex;
}
if (currentTab == 'global') {
let {editedIndex} = globalProduct;
editedRow = editedIndex;
}
let buttons = editing?null: this.rightButtons(rowData, rowID);
return (
<ProductCell
key={'row' + rowID}
data={rowData}
onPressProduct={this.props.onPressProduct}
onPressFindSimilar={this.props.onPressFindSimilar}
editing={editing}
editedRow={editedRow}
rowID={parseInt(rowID)}
setEditedIndex={this.props.setEditedIndex}
onPressDelete={this.props.onPressDelete}
currentTab={currentTab}
/>
);
}
deleteRow(data, secId, rowId, rowMap) {
rowMap[`${secId}${rowId}`].closeRow();
this.props.onPressDelete && this.props.onPressDelete(data, rowId);
}
renderFooter() {
let {
commonProduct,
currentTab,
} = this.props.data;
if (currentTab == 'common' && commonProduct.get('productList').size == 0) {
return (
<NoDataView type={'product'} onPressGuangGuang={this.props.onPressGuangGuang}/>
);
}
if (this.state.showFooter) {
return(
<View style={styles.footerContainer}>
<Image style={styles.footerImage} resizeMode={'contain'} source={require('../../images/product/shared_bottom.png')}/>
</View>
)
}
}
renderHeader() {
let {
commonProduct,
globalProduct,
editing,
currentTab,
} = this.props.data;
let {productList} = globalProduct;
if (productList.size == 0) {
return null;
}
return (<TabHeader
currentTab={currentTab}
onPressTab={(tab)=>{
if (tab == currentTab) {
return;
}
this.props.onPressTab && this.props.onPressTab(tab);
}}
/>)
}
renderSectionHeader(sectionData, sectionID) {
let {
commonProduct,
globalProduct,
editing,
currentTab,
} = this.props.data;
if (currentTab == 'global') {
return null;
}
if (currentTab == 'common') {
let {isFetching, selectedProductList, categoryList, selectedCategoryIndex} = commonProduct;
if (selectedProductList.size == 0) {
return null;
}
return (
<CategorySelector
data={categoryList}
selectedCategoryIndex={selectedCategoryIndex}
onPressCategory={(rowData, rowID) => {
this.listView && this.listView.scrollTo({x: 0, y: 0, animated: false});
this.props.onPressCategory && this.props.onPressCategory(rowData, rowID);
}}
/>
);
}
return null;
}
render() {
let {
commonProduct,
globalProduct,
editing,
currentTab,
} = this.props.data;
let dataArray = [];
let isLoading = false;
let showList = (commonProduct.get('productList').size && !commonProduct.get('isFetching')) || (globalProduct.get('productList').size && !commonProduct.get('isFetching'));
let showEmpty = commonProduct.get('showEmpty') && globalProduct.get('showEmpty');
if (currentTab == 'common') {
let {isFetching, selectedProductList, categoryList, selectedCategoryIndex, isDeleting} = commonProduct;
isLoading = (selectedProductList.size == 0 && isFetching) || isDeleting;
dataArray = selectedProductList.toArray();
}
if (currentTab == 'global') {
let {isFetching, productList, isDeleting} = globalProduct;
isLoading = (productList.size == 0 && isFetching) || isDeleting;
dataArray = productList.toArray();
}
return (
<View style={styles.container}>
{showList ? <SwipeListView
listViewRef={ ref => this.listView = ref }
enableEmptySections={true}
dataSource={this.dataSource.cloneWithRows(dataArray)}
renderRow={this.renderRow}
renderHeader={this.renderHeader}
renderSectionHeader={this.renderSectionHeader}
onScroll={this.handleScroll}
disableRightSwipe={true}
renderFooter={this.renderFooter}
bounces={dataArray.length > 0}
scrollEnabled={!this.state.isSwiping}
onContentSizeChange={(contentWidth, contentHeight) => {
this.setState({showFooter: contentHeight >= height - 64})
}}
renderHiddenRow={ (data, secId, rowId, rowMap) => (
<View style={styles.rowBack}>
<Text></Text>
<Text>
<TouchableOpacity activeOpacity={1} style={styles.tailContainer} onPress={_ => this.deleteRow(data, secId, rowId, rowMap)}>
<Text style={styles.tailText}>删除</Text>
</TouchableOpacity>
</Text>
</View>
)}
rightOpenValue={-70}
/> : null}
{showEmpty ? <NoDataView type={'product'} onPressGuangGuang={this.props.onPressGuangGuang}/> : null}
<LoadingIndicator
isVisible={isLoading}
/>
</View>
);
}
}
let {width, height} = Dimensions.get('window');
let styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor:'#f0f0f0',
},
rowBack: {
alignItems: 'center',
backgroundColor: '#DDD',
flex: 1,
flexDirection: 'row',
justifyContent: 'space-between',
paddingLeft: 15,
},
tailContainer: {
width: 70,
height: 130,
alignItems: 'center',
justifyContent: 'center',
backgroundColor: 'red'
},
tailText: {
color: 'white',
fontSize: 17,
backgroundColor: 'red'
},
footerContainer: {
width: width,
height: 74,
alignItems: 'center',
justifyContent: 'center',
backgroundColor: '#f0f0f0',
},
footerImage: {
width: 200,
height: 44,
}
});
... ...
'use strict';
import React, {Component} from 'react';
import ReactNative, {
View,
Text,
Image,
ListView,
TouchableOpacity,
StyleSheet,
Dimensions,
Animated,
Easing,
Platform
} from 'react-native';
import Immutable, {Map, List} from 'immutable';
import YH_Image from '../../../common/components/YH_Image';
import DeleteLineText from '../../../common/components/DeleteLineText';
export default class ProductCell extends Component {
constructor(props) {
super(props);
this.renderBottomView = this.renderBottomView.bind(this);
this.state = {
marginLeft: new Animated.Value(0)
}
}
shouldComponentUpdate(nextProps, nextState) {
if (this.props.data !== nextProps.data) {
return true;
}
if (this.props.rowID !== nextProps.rowID) {
return true;
}
return false;
}
renderBottomView() {
let data = this.props.data;
let showSoldOut = data.get('storage', 0) == 0 ? true : false;
if (showSoldOut) {
return (
<View style={[styles.bottomView, styles.soldOutContainer]}>
<Text style={styles.soldOut}>{'已售罄'}</Text>
</View>
);
}
let showOffShelf = data.get('status', 0) == 0 ? true : false;
let showReduce = data.get('price_down', 0) == 0 ? false : true;
if (!showOffShelf && showReduce) {
let reduceStr = '¥' + (parseFloat(data.get('price_down'))).toFixed(2);
return (
<View style={[styles.bottomView, styles.reduceContainer]}>
<Image style={styles.reduceImage} source={require('../../images/browse/mine_goods_low_icon.png')}/>
<Text style={styles.reduceText} numberOfLines={1}>
{'已降'}
<Text style={{
color: '#d0021b'
}}>{reduceStr}</Text>
</Text>
</View>
);
}
return null;
}
render() {
let data = this.props.data;
let prdImage = YH_Image.getSlicedUrl(data.get('image', ''), 76, 102, 2);
let salePrice = 0; // 售卖价
let originPrice = 0; // 原价
let salePriceStr = ''; // 拼接的售卖价
let originPriceStr = ''; // 拼接的原价
let showOriginPrice = true; // 是否显示原价
let salePriceColor = '#d0021b'; // 不显示原价时,售卖价颜色
salePrice = parseFloat(data.get('sales_price'));
originPrice = parseFloat(data.get('market_price'));
salePriceStr = '¥' + salePrice.toFixed(2);
originPriceStr = '¥' + originPrice.toFixed(2);
if (!originPrice || (salePrice == originPrice)) {
showOriginPrice = false;
salePriceColor = '#444444';
}
// let priceBottom = showOriginPrice ? 30 : 40;
let {editing, editedRow, rowID} = this.props;
let showLeft = editing && editedRow != rowID;
let showTail = editing && editedRow == rowID;
let marginLeft = showTail ? -70 : 0;
Animated.timing(this.state.marginLeft, {
toValue: marginLeft,
duration: 150,
easing: Easing.linear
}).start();
return (
<View style={styles.fatherContainer}>
{showLeft
? <TouchableOpacity activeOpacity={1} style={styles.deleteContainer} onPress={() => {
this.props.setEditedIndex && this.props.setEditedIndex(rowID);
}}>
<View style={styles.deleteCircle}>
<View style={styles.deleteBar}/>
</View>
</TouchableOpacity>
: null}
<Animated.View style={[
styles.container, {
marginLeft: this.state.marginLeft
}
]}>
<TouchableOpacity activeOpacity={1} style={[styles.container]} onPress={() => {
this.props.onPressProduct && this.props.onPressProduct(data);
}}>
<View style={styles.container}>
<View style={styles.leftContainer}>
<YH_Image style={styles.prdImage} url={prdImage}/>
<View>
<Text style={styles.prdName} numberOfLines={2}>{data.get('product_name', '')}</Text>
</View>
</View>
<Image style={styles.arrow} source={require('../../images/browse/shared_next_icon.png')}/>
<View style={styles.priceContainer}>
<Text style={[
styles.nowPrice, {
color: salePriceColor
}
]} numberOfLines={1}>{salePriceStr}</Text>
{showOriginPrice
? <DeleteLineText style={styles.oldPriceContainer} textStyle={styles.oldPrice} lineStyle={styles.deleteLine} text={originPriceStr}/>
: null}
</View>
{this.renderBottomView()}
{this.props.currentTab != 'global'
? <TouchableOpacity activeOpacity={1} style={styles.similar} onPress={() => {
this.props.onPressFindSimilar && this.props.onPressFindSimilar(data);
}}>
<Image source={require('../../images/browse/shopcart_findResemblance.png')}/>
</TouchableOpacity>
: null}
<View style={styles.separator}/>
</View>
</TouchableOpacity>
</Animated.View>
</View>
);
}
};
let {width} = Dimensions.get('window');
const DEVICE_WIDTH_RATIO = width / 320;
let imageWidth = Math.floor(width / 2);
let imageHeight = Math.floor(imageWidth * 180 / 375);
let nameWidth = width - 15 - 76 - 10 - 55;
let topLeftWidth = width - Math.ceil(84 * DEVICE_WIDTH_RATIO);
let styles = StyleSheet.create({
fatherContainer: {
flexDirection: 'row',
alignItems: 'center',
backgroundColor: 'white'
},
deleteContainer: {
width: 40,
height: 70,
alignItems: 'center',
justifyContent: 'center',
backgroundColor: 'white',
paddingLeft: 5
},
deleteCircle: {
width: 22,
height: 22,
borderRadius: 11,
backgroundColor: 'red',
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'center'
},
deleteBar: {
width: 11,
height: 1.5,
backgroundColor: 'white'
},
tailContainer: {
width: 70,
height: 122,
alignItems: 'center',
justifyContent: 'center',
backgroundColor: 'red'
},
tailText: {
color: 'white',
fontSize: 17,
backgroundColor: 'red'
},
container: {
flexDirection: 'row',
justifyContent: 'space-between',
alignItems: 'center',
width: width,
backgroundColor: 'white'
},
leftContainer: {
flexDirection: 'row'
},
prdImage: {
marginLeft: 15,
marginTop: 10,
marginBottom: 10,
width: 76,
height: 102
},
prdName: {
fontFamily: 'HelveticaNeue-Light',
fontSize: 12,
marginTop: 22,
marginLeft: 10,
width: nameWidth
},
priceContainer: {
position: 'absolute',
flexDirection: 'row',
marginTop: 20,
left: 91,
bottom: 40
},
nowPrice: {
fontSize: 14,
color: '#d0021b',
marginLeft: 10
},
oldPriceContainer: {
flexDirection: 'row',
marginLeft: 5,
marginTop: 2
},
oldPrice: {
fontSize: 12,
color: '#b0b0b0',
height: 16
},
deleteLine: {
position: 'absolute',
top: (16 / 2) - 1,
left: 0,
right: 0,
height: 1,
backgroundColor: '#b0b0b0'
},
bottomView: {
position: 'absolute',
left: 100,
bottom: 11,
width: nameWidth,
},
soldOutContainer: {
width: 45,
height: 15,
borderRadius: 7.5,
backgroundColor: 'gray',
justifyContent: 'center'
},
soldOut: {
fontSize: 12,
color: 'white',
textAlign: 'center',
textAlignVertical:'center',
width: 45,
height: 15,
paddingTop: Platform.OS === 'ios' ? 1.0:-0.5,
backgroundColor: 'transparent'
},
reduceContainer: {
flexDirection: 'row',
},
reduceImage: {
width: 15,
height: 15
},
reduceText: {
marginLeft: 2,
fontSize: 12,
color: '#b0b0b0',
width: nameWidth - 15 - 2
},
similar: {
position: 'absolute',
width: 56,
height: 25,
right: 15,
bottom: 12,
},
separator: {
position: 'absolute',
bottom: 0,
left: 96,
width,
height: 1,
backgroundColor: '#f0f0f0'
},
arrow: {
marginRight: 15,
width: 9,
height: 15
}
});
... ...
... ... @@ -8,7 +8,7 @@ let commonProduct = new(Record({
categoryList: List(),
productList: List(),
currentPage: 0,
pageSize: 100,
pageSize: 500,
selectedCategoryIndex: 0,
selectedProductList: List(),
... ... @@ -22,7 +22,7 @@ let globalProduct = new(Record({
error: null,
productList: List(),
currentPage: 0,
pageSize: 100,
pageSize: 500,
isDeleting: false,
editedIndex: -1,
... ...
... ... @@ -26,6 +26,7 @@
"react-native-scrollable-mixin": "^1.0.1",
"react-native-simple-store": "^1.1.0",
"react-native-smart-toast": "^1.1.1",
"react-native-swipe-list-view": "^0.4.1",
"react-native-swipeable": "^0.4.0",
"react-native-swiper": "^1.5.4",
"react-native-switch-pro": "^0.4.2",
... ...