Authored by 王海元

update UI --review by 孙凯

... ... @@ -64,11 +64,10 @@ export default class GroupDetailHeader extends React.Component {
this.timer && TimerMixin.clearTimeout(this.timer);
}
_renderTip(tipTitle,tipDetail) {
_renderTip(tipTitle) {
return(
<View style={styles.container}>
<Text style={styles.tipTitle}>{tipTitle}</Text>
<Text style={styles.tipDetail}>{tipDetail}</Text>
</View>
);
}
... ... @@ -80,7 +79,7 @@ export default class GroupDetailHeader extends React.Component {
<View style={styles.productdetailTimeCountView}>
<Text style={styles.productdetailTimeCount}>还差</Text>
<Text style={styles.productdetailTimeRedCount}>{lackNum}</Text>
<Text style={styles.productdetailTimeCount}>加入,剩余时间</Text>
<Text style={styles.productdetailTimeCount}>拼团成功,剩余时间</Text>
</View>
<View style={styles.productdetailTimeCountView1}>
<Text style={styles.timeItem}>{formatTime.h1 ? formatTime.h1 : 0}</Text>
... ... @@ -96,7 +95,7 @@ export default class GroupDetailHeader extends React.Component {
);
}
render() {
let { groupDetail } = this.props;
let { groupDetail, activityId} = this.props;
let resource = groupDetail ? groupDetail.toJS():null;
if(!resource){
return null;
... ... @@ -113,9 +112,10 @@ export default class GroupDetailHeader extends React.Component {
let productDetail = membershipItems ? membershipItems[0]: '';
let joinLimit = resource.joinLimit;
let perpleNum = membershipItems.length + lackNum;
let productSkn = productDetail ? productDetail.productSkn : '';
let buttonText = '';
let tipTitle = '';
let tipDetail = '';
let tipTitlecolor = '#D0021B';
if(diffTime == 0 ){
diffTime = parseInt(leftTime);
... ... @@ -135,26 +135,21 @@ export default class GroupDetailHeader extends React.Component {
buttonText = '邀请小伙伴拼团' + subtext;
}else if (pageGo == 4) {
tipTitle = '拼团成功';
tipDetail = '我们会尽快安排发货';
buttonText = '查看更多拼团活动';
tipTitlecolor = '#000000';
}else if (pageGo == 5) {
tipTitle = '你来晚了';
tipDetail = '你的好友已经拼团成功';
buttonText = '查看更多拼团活动';
tipTitlecolor = '#000000';
}else if (pageGo == 6) {
tipTitle = '拼团失败';
tipDetail = '购买人数不足,我们会尽快安排退款';
buttonText = '查看更多拼团活动';
}else if (pageGo == 7) {
tipTitle = '拼团失败';
tipDetail = '购买人数不足,我们会尽快安排退款';
buttonText = '查看更多拼团活动';
tipTitlecolor = '#000000';
}else {
tipTitle = '拼团失败';
tipDetail = '购买人数不足,我们会尽快安排退款';
buttonText = '查看更多拼团活动';
tipTitlecolor = '#000000';
}
... ... @@ -170,7 +165,7 @@ export default class GroupDetailHeader extends React.Component {
?
this._renderTime(lackNum,this.state.formatTime)
:
this._renderTip(tipTitle,tipDetail)
this._renderTip(tipTitle)
}
<TouchableOpacity activeOpacity={0.5} style={[styles.button,{backgroundColor: tipTitlecolor}]} onPress={() => {
this.props.didTouchButton && this.props.didTouchButton(resource);
... ... @@ -186,9 +181,11 @@ export default class GroupDetailHeader extends React.Component {
</TouchableOpacity>
</View>
</View>
<View style={styles.product}>
<GroupDetailProduct resource={productDetail} pageGo={pageGo} perpleNum={perpleNum}/>
</View>
<TouchableOpacity activeOpacity={0.5} style={styles.product} onPress={() => {
this.props.didTouchProduct && this.props.didTouchProduct(productSkn,activityId);
}}>
<GroupDetailProduct resource={productDetail} pageGo={pageGo} perpleNum={perpleNum}/>
</TouchableOpacity>
<View style={styles.bottomLine}/>
</View>
);
... ... @@ -310,11 +307,6 @@ let styles = StyleSheet.create({
marginTop: 23*DEVICE_WIDTH_RATIO,
fontWeight: 'bold',
},
tipDetail: {
fontSize: 12,
color: '#B0B0B0',
marginTop: 8*DEVICE_WIDTH_RATIO,
},
productdetailTimeCountView: {
width,
height: 22,
... ...
... ... @@ -31,9 +31,10 @@ export default class GroupProductCell extends React.Component {
return null;
}
let newSrc = getSlicedUrl(resource.get('defaultImages'), 200, 260, 2);
let deleteLineText = '¥' + resource.get('marketPrice');
let deleteLineText = '¥' + resource.get('marketPrice').toFixed(2);
let productSkn = resource.get('productSkn');
let activityId = resource.get('activityId');
let collagePrice = resource.get('collagePrice').toFixed(2);
return (
<View>
<TouchableOpacity activeOpacity={0.8} onPress={() => {
... ... @@ -48,8 +49,8 @@ export default class GroupProductCell extends React.Component {
<Text style={styles.title} numberOfLines={2}>{resource.get('productName')}</Text>
</View>
<View style={styles.priceView}>
<Text style={styles.price1}>¥{resource.get('collagePrice')}</Text>
<DeleteLineText
<Text style={styles.price1}>¥{collagePrice}</Text>
<DeleteLineText
style={styles.oldPriceContainer}
textStyle={styles.price2}
lineStyle={styles.deleteLine}
... ... @@ -60,6 +61,7 @@ export default class GroupProductCell extends React.Component {
<ImageBackground
style={styles.buttonBackImage}
source={require('../images/PT_bt.png')}
resizeMode={'contain'}
>
<View style={styles.buttonS}>
<Text style={styles.button1}>{resource.get('peopleNum')}人成团</Text>
... ... @@ -97,8 +99,8 @@ let styles = StyleSheet.create({
},
activityImage :{
width: 100*DEVICE_WIDTH_RATIO,
height: 130*DEVICE_WIDTH_RATIO,
width: parseInt(100*DEVICE_WIDTH_RATIO),
height: parseInt(130*DEVICE_WIDTH_RATIO),
marginTop: 10*DEVICE_WIDTH_RATIO,
marginLeft: 15*DEVICE_WIDTH_RATIO,
},
... ... @@ -170,7 +172,7 @@ let styles = StyleSheet.create({
flex: 1,
flexDirection: 'row',
justifyContent: 'flex-end',
alignItems: 'center',
alignItems: 'flex-end',
},
buttonBackImage: {
... ...
... ... @@ -24,14 +24,17 @@ export default class GroupPurchaseDetail extends Component {
_renderHeader() {
let {
groupDetail,
activityId,
} = this.props;
return (
<GroupDetailHeader
activityId={activityId}
groupDetail={groupDetail}
updateTime={this.props.updateTime}
didTouchButton={this.props.didTouchButton}
goComment={this.props.goComment}
didTouchProduct={this.props.didTouchProduct}
/>
);
}
... ...
... ... @@ -85,15 +85,14 @@ let styles = StyleSheet.create({
height: 115*DEVICE_WIDTH_RATIO,
alignItems: 'center',
flexDirection: 'row',
justifyContent: 'space-around',
},
button1: {
// marginLeft: 90*DEVICE_WIDTH_RATIO,
marginLeft: (width - 180*DEVICE_WIDTH_RATIO)/3,
alignItems: 'center',
},
button2: {
marginLeft: -10*DEVICE_WIDTH_RATIO,
marginLeft: (width - 180*DEVICE_WIDTH_RATIO)/3,
alignItems: 'center',
},
icon: {
... ... @@ -104,6 +103,8 @@ let styles = StyleSheet.create({
marginTop: 8*DEVICE_WIDTH_RATIO,
fontSize: 12,
color: '#444444',
width: 90*DEVICE_WIDTH_RATIO,
textAlign: 'center',
},
line: {
width: width - 52,
... ...
... ... @@ -351,15 +351,15 @@ let styles = StyleSheet.create({
width,
height: 115*DEVICE_WIDTH_RATIO,
alignItems: 'center',
justifyContent: 'space-around',
flexDirection: 'row',
},
button1: {
alignItems: 'center',
marginLeft: (width - 180*DEVICE_WIDTH_RATIO)/3,
},
button2: {
marginLeft: -10*DEVICE_WIDTH_RATIO,
marginLeft: (width - 180*DEVICE_WIDTH_RATIO)/3,
alignItems: 'center',
},
icon: {
... ... @@ -369,6 +369,8 @@ let styles = StyleSheet.create({
text: {
marginTop: 8*DEVICE_WIDTH_RATIO,
fontSize: 12,
width: 90*DEVICE_WIDTH_RATIO,
textAlign: 'center',
color: '#444444',
},
line: {
... ...
... ... @@ -183,6 +183,7 @@ class GroupPurchaseDetailContainer extends Component {
qrCode={qrCode}
/>
<GroupPurchaseDetail
activityId={activityId}
productList={productList}
groupDetail={groupDetail}
onEndReached={this._onEndReached}
... ...

8.23 KB | W: | H:

9.98 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin