Authored by shangjf

修复站内信UI问题 review by 陈琳

... ... @@ -22,13 +22,18 @@ export default class YH_ToolTips extends Component {
{
this.props.actions.map((item,index)=>{
return (
<Text
style={index==this.props.actions.length-1 ? styles.textStyle : [styles.textStyle, styles.midLine]}
key={`toolTip${index}`}
onPress={item.onPress}
>
{item.text}
</Text>
<View
style={index==this.props.actions.length-1 ? styles.textContainer : [styles.textContainer, styles.midLine]}
key={`toolTip${index}`}
>
<Text
style={styles.textStyle}
key={`toolTip${index}`}
onPress={item.onPress}
>
{item.text}
</Text>
</View>
);
})
}
... ... @@ -64,6 +69,12 @@ let styles = StyleSheet.create({
alignItems: 'center'
},
textContainer: {
height: 20,
justifyContent: 'center',
alignItems: 'center'
},
textStyle: {
paddingLeft: 10,
paddingRight: 10,
... ...
... ... @@ -189,7 +189,7 @@ export default class MessageList extends Component {
render() {
let {isFetching, endReached, list, listId, shouldShowEmpty} = this.props.data;
let isLoadingMore = list.size != 0 && isFetching;
if (shouldShowEmpty) {
return (
<View style={styles.container}>
... ... @@ -207,6 +207,9 @@ export default class MessageList extends Component {
dataSource={this.dataSource.cloneWithRows(list.toArray())}
renderRow={this.renderRow}
enableEmptySections={true}
onScroll={() => {
this.setState({showToolTips: false});
}}
onEndReached={() => {
if (list.size != 0) {
this.props.onEndReached && this.props.onEndReached();
... ...
... ... @@ -12,6 +12,7 @@ import ReactNative, {
} from 'react-native';
import MessageListCellFooter from './MessageListCellFooter'
import SlicedImage from '../../../common/components/SlicedImage'
export default class MessageListBigIconCell extends Component {
constructor(props) {
... ... @@ -23,7 +24,8 @@ export default class MessageListBigIconCell extends Component {
let body = itemData.get('body');
let imageUri = body ? body.get('img_url', 'www.yohobuy.com') : 'www.yohobuy.com';
let content = body ? body.get('content','') : '';
imageUri = imageUri.replace('{width}', width).replace('{height}', iconHeight).replace('{mode}',2);
imageUri = SlicedImage.getSlicedUrl(imageUri, width, iconHeight, 2);
return(
<View style={styles.container}>
<TouchableOpacity
... ...
... ... @@ -60,7 +60,7 @@ let styles = StyleSheet.create({
},
bottomSeparator: {
width,
height: 1,
height: 0.5,
backgroundColor: '#e0e0e0'
},
textContainer: {
... ...
... ... @@ -46,6 +46,6 @@ let styles = StyleSheet.create({
marginTop: 10.5,
backgroundColor: '#e0e0e0',
width,
height: 1,
height: 0.5,
}
})
... ...
... ... @@ -12,6 +12,7 @@ import ReactNative, {
} from 'react-native';
import MessageListCellFooter from './MessageListCellFooter'
import SlicedImage from '../../../common/components/SlicedImage'
export default class MessageListOrderCell extends Component {
constructor(props) {
... ... @@ -22,8 +23,7 @@ export default class MessageListOrderCell extends Component {
let body = itemData.get('body');
let imageUri = body ? body.get('img_url','www.yohobuy.com') : 'www.yohobuy.com';
let content = body ? body.get('content','') : '';
imageUri = imageUri.replace('{width}', 46).replace('{height}', 60).replace('{mode}',2);
imageUri = SlicedImage.getSlicedUrl(imageUri, 46, 60, 2)
return(
<View style={styles.container}>
<TouchableOpacity
... ...
... ... @@ -13,19 +13,20 @@ import ReactNative, {
import MessageListCellFooter from './MessageListCellFooter'
import YH_ToolTips from '../../../common/components/YH_ToolTips'
import SlicedImage from '../../../common/components/SlicedImage'
export default class MessageListSmallIconCell extends Component {
constructor(props) {
super(props);
}
render() {
let itemData = this.props.itemData;
let body = itemData.get('body');
let imageUri = body ? body.get('img_url','www.yohobuy.com') : 'www.yohobuy.com';
let content = body ? body.get('content','') : '';
imageUri = imageUri.replace('{width}', 50).replace('{height}', 50).replace('{mode}',2);
imageUri = SlicedImage.getSlicedUrl(imageUri, 50, 50, 2);
return(
<View style={styles.container}>
<TouchableOpacity
... ...
... ... @@ -124,7 +124,7 @@ let styles = StyleSheet.create({
},
renderSeparatorStyle: {
left: 15,
height: 1,
height: 0.5,
width: width-15,
backgroundColor: '#e0e0e0',
},
... ...
... ... @@ -76,7 +76,7 @@ export function messageList() {
return (dispatch, getState) => {
let {app, list} = getState();
if (list.isFetching || list.endReached || list.error) {
if (list.isFetching || list.endReached || list.error || (!list.endReached && list.pageCount == 1)) {
return;
}
... ... @@ -88,7 +88,7 @@ export function messageList() {
return new MessageListService(app.host).fetchMessageList(page,pageSize,sourcePage,list.listId)
.then(json => {
let payload = parseMessageList(json);
payload.endReached = payload.currentPage == payload.pageCount;
payload.endReached = (payload.currentPage == payload.pageCount) && (payload.pageCount != 1);
if (payload.currentPage > 1) {
let oldList = list.list.toJS();
... ...