...
|
...
|
@@ -3,7 +3,6 @@ |
|
|
import React, {Component} from "react";
|
|
|
import {View, Text, Image, ListView, StyleSheet, Dimensions, TouchableOpacity} from "react-native";
|
|
|
import SlicedImage from "../../../common/components/SlicedImage";
|
|
|
import DeleteLineText from "../../../common/components/DeleteLineText";
|
|
|
|
|
|
|
|
|
export default class ProductListView extends Component {
|
...
|
...
|
@@ -26,7 +25,7 @@ export default class ProductListView extends Component { |
|
|
let tipState = '';
|
|
|
let btnBgColor = '#d30018';
|
|
|
let btnTextcolor = 'white';
|
|
|
let url = rowData.url;
|
|
|
let url = rowData.shopUrl;
|
|
|
if (rowData.over) {
|
|
|
tipState = '已抢光';
|
|
|
btnBgColor = '#b2b2b2';
|
...
|
...
|
@@ -47,64 +46,48 @@ export default class ProductListView extends Component { |
|
|
this.props.onPressProductItem && this.props.onPressProductItem(rowData);
|
|
|
}}>
|
|
|
<View style={styles.rowContainer}>
|
|
|
<View style = {
|
|
|
styles.leftImage
|
|
|
} >
|
|
|
<Image style={
|
|
|
{
|
|
|
flex: 1,
|
|
|
}
|
|
|
}
|
|
|
source={
|
|
|
{
|
|
|
uri: brandIconUrl
|
|
|
}
|
|
|
}/>
|
|
|
<View style={styles.leftImage}>
|
|
|
<Image style={{flex: 1,}}
|
|
|
source={{uri: brandIconUrl}}/>
|
|
|
{tipState == '已抢光' ?
|
|
|
<View style={
|
|
|
[styles.imageBottomTag, {
|
|
|
backgroundColor: btnBgColor,
|
|
|
position: 'absolute',
|
|
|
}]
|
|
|
} >
|
|
|
<Text style={{color: btnTextcolor}} > {tipState} </Text>
|
|
|
<View style={styles.soldOutContainer}>
|
|
|
<Image source={require('../../images/yqg.png')}/>
|
|
|
</View>
|
|
|
:null }
|
|
|
: null }
|
|
|
|
|
|
</View>
|
|
|
|
|
|
|
|
|
|
|
|
<View style={styles.rowRight}>
|
|
|
<View style={styles.productTitlePrice}>
|
|
|
<Text style={styles.productTitle}
|
|
|
numberOfLines={2}>{rowData.productName}</Text>
|
|
|
<View style={[styles.secKillMarketPriceContainer, {marginTop: 5}]}>
|
|
|
|
|
|
<View style={{
|
|
|
flexDirection: 'row',
|
|
|
flex: 1,
|
|
|
alignItems: 'flex-end',
|
|
|
justifyContent: 'space-between'
|
|
|
}}>
|
|
|
<View style={{}}>
|
|
|
<Text
|
|
|
style={styles.seckillPrice}>¥{rowData.secKillPrice}</Text>
|
|
|
<DeleteLineText style={{top: 3, left: 8}} text={'¥' + rowData.marketPrice}/>
|
|
|
</View>
|
|
|
style={styles.seckillPrice}>¥{parseFloat(rowData.secKillPrice + "").toFixed(2)}</Text>
|
|
|
<Text style={styles.originPrice}>
|
|
|
{'¥' + parseFloat(rowData.marketPrice + '').toFixed(2)}</Text>
|
|
|
</View>
|
|
|
<View style={styles.priceClickTipView}>
|
|
|
<View style={styles.priceClickTipViewLeft}>
|
|
|
{rowData.wait ?
|
|
|
<View style={[styles.secKillMarketPriceContainer, {marginTop: 2}]}>
|
|
|
<Image style={{top: 1.5, marginRight: 2}}
|
|
|
source={require('../../images/time_icon.png')}/>
|
|
|
<Text style={styles.seckillBeginTimeTip}>{rowData.readableTime}开始</Text>
|
|
|
</View>
|
|
|
: null }
|
|
|
</View>
|
|
|
|
|
|
{tipState == '已抢光' && url && url.length?
|
|
|
<View onPress={()=>{
|
|
|
<View style={{justifyContent: 'center'}}>
|
|
|
{tipState == '已抢光' && url && url.length ?
|
|
|
<TouchableOpacity onPress={()=> {
|
|
|
this.props.onPressGuangShopWithURL && this.props.onPressGuangShopWithURL(url);
|
|
|
}} style={[styles.priceClickTipViewRight, {backgroundColor: 'white', borderColor:'black', borderWidth: 1}]}>
|
|
|
}} style={[styles.priceClickTipViewRight, {
|
|
|
backgroundColor: 'white',
|
|
|
borderColor: 'black',
|
|
|
borderWidth: 1
|
|
|
}]}>
|
|
|
<Text style={{color: 'black'}}>进店逛逛</Text>
|
|
|
</View>
|
|
|
:null}
|
|
|
</TouchableOpacity>
|
|
|
: null}
|
|
|
|
|
|
{tipState != '已抢光'? <TouchableOpacity onPress={() => {
|
|
|
{tipState != '已抢光' ? <TouchableOpacity onPress={() => {
|
|
|
if (this.tipMessage == '') {
|
|
|
if (rowData.wait) {
|
|
|
this.props.onPressRemindBtn && this.props.onPressRemindBtn(rowData);
|
...
|
...
|
@@ -128,8 +111,12 @@ export default class ProductListView extends Component { |
|
|
</View>
|
|
|
}
|
|
|
|
|
|
</TouchableOpacity>:null
|
|
|
</TouchableOpacity> : null
|
|
|
}
|
|
|
{rowData.wait &&
|
|
|
<Text style={styles.seckillBeginTimeTip}>{rowData.readableTime + ' 开始'}</Text>}
|
|
|
|
|
|
</View>
|
|
|
</View>
|
|
|
</View>
|
|
|
<View style={styles.separator}/>
|
...
|
...
|
@@ -162,30 +149,30 @@ let styles = StyleSheet.create({ |
|
|
leftImage: {
|
|
|
width: adjustPx(imageWidth),
|
|
|
height: adjustPx(imageHeight),
|
|
|
marginRight: adjustPx(10),
|
|
|
resizeMode: 'cover',
|
|
|
|
|
|
},
|
|
|
imageBottomTag: {
|
|
|
width: adjustPx(imageWidth),
|
|
|
height: 30,
|
|
|
marginRight: 10,
|
|
|
marginTop: adjustPx(imageHeight) - 30,
|
|
|
soldOutContainer: {
|
|
|
backgroundColor: '#0000007F',
|
|
|
position: 'absolute',
|
|
|
left: 0,
|
|
|
right: 0,
|
|
|
bottom: 0,
|
|
|
top: 0,
|
|
|
alignItems: 'center',
|
|
|
justifyContent: 'center',
|
|
|
borderRadius: 3,
|
|
|
backgroundColor: '#d0021b',
|
|
|
},
|
|
|
rowRight: {
|
|
|
flexDirection: 'column',
|
|
|
marginLeft: 10,
|
|
|
justifyContent: 'space-between',
|
|
|
flex: 1,
|
|
|
},
|
|
|
priceClickTipView: {
|
|
|
flexDirection: 'row',
|
|
|
justifyContent: 'space-between',
|
|
|
width: width - imageWidth - 35,
|
|
|
height: 50,
|
|
|
// backgroundColor: 'white',
|
|
|
backgroundColor: 'yellow',
|
|
|
},
|
|
|
priceClickTipViewLeft: {
|
|
|
top: 25,
|
...
|
...
|
@@ -200,10 +187,7 @@ let styles = StyleSheet.create({ |
|
|
borderRadius: 3,
|
|
|
backgroundColor: '#d0021b',
|
|
|
},
|
|
|
productTitlePrice: {
|
|
|
width: width - imageWidth - 30,
|
|
|
flexDirection: 'column',
|
|
|
},
|
|
|
|
|
|
secKillMarketPriceContainer: {
|
|
|
flexDirection: 'row',
|
|
|
alignItems: 'center'
|
...
|
...
|
@@ -227,11 +211,20 @@ let styles = StyleSheet.create({ |
|
|
},
|
|
|
seckillPrice: {
|
|
|
fontSize: 18,
|
|
|
lineHeight: 21,
|
|
|
fontWeight: 'bold',
|
|
|
color: '#d0021b',
|
|
|
},
|
|
|
originPrice: {
|
|
|
textDecorationLine: 'line-through',
|
|
|
color: '#B0B0B0',
|
|
|
fontSize: 12,
|
|
|
lineHeight: 17
|
|
|
},
|
|
|
seckillBeginTimeTip: {
|
|
|
fontSize: 11,
|
|
|
color: '#b0b0b0',
|
|
|
fontSize: 9,
|
|
|
marginTop: 6,
|
|
|
color: '#D0021B',
|
|
|
},
|
|
|
separator: {
|
|
|
position: 'absolute',
|
...
|
...
|
|