Toggle navigation
Toggle navigation
This project
Loading...
Sign in
mobile
/
YH_RNComponent
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
shangjf
8 years ago
Commit
0abc8738f88e8975454352098b34e104fd811a36
1 parent
77cef8f9
新增站内信样式 review by 张同海
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
171 additions
and
1 deletions
js/message/components/list/MessageList.js
js/message/components/list/MessageListActivityCell.js
js/message/components/list/MessageList.js
View file @
0abc873
...
...
@@ -24,6 +24,7 @@ import MessageListTextCell from './MessageListTextCell';
import
MessageListOrderCell
from
'./MessageListOrderCell'
;
import
YH_ToolTips
from
'../../../common/components/YH_ToolTips'
import
MessageListEditBottomView
from
'./MessageListEditBottomView'
import
MessageListActivityCell
from
'./MessageListActivityCell'
export
default
class
MessageList
extends
Component
{
constructor
(
props
)
{
...
...
@@ -64,7 +65,6 @@ export default class MessageList extends Component {
case
207
:
case
208
:
case
209
:
case
500
:
{
return
(
<
MessageListSmallIconCell
...
...
@@ -85,6 +85,27 @@ export default class MessageList extends Component {
);
}
break
;
case
500
:
{
return
(
<
MessageListActivityCell
itemData
=
{
rowData
}
onPressListItem
=
{(
itemData
)
=>
{
this
.
setState
({
showToolTips
:
false
});
this
.
props
.
onPressListItem
&&
this
.
props
.
onPressListItem
(
itemData
,
rowID
)
}
}
onLongPressListItem
=
{(
itemData
)
=>
{
this
.
onLongPressListItem
(
itemData
,
rowID
);
}}
selectListItem
=
{(
itemData
)
=>
{
this
.
props
.
selectListItem
&&
this
.
props
.
selectListItem
(
rowID
);
}}
isEditing
=
{
isEditing
}
/
>
);
}
break
;
case
200
:
case
201
:
case
403
:
...
...
js/message/components/list/MessageListActivityCell.js
0 → 100644
View file @
0abc873
'use strict'
;
import
React
,
{
Component
}
from
'react'
;
import
ReactNative
,
{
View
,
Text
,
Image
,
StyleSheet
,
Dimensions
,
Platform
,
TouchableOpacity
,
}
from
'react-native'
;
import
MessageListCellFooter
from
'./MessageListCellFooter'
import
YH_ToolTips
from
'../../../common/components/YH_ToolTips'
import
SlicedImage
from
'../../../common/components/SlicedImage'
import
EditIconView
from
'./EditIconView'
export
default
class
MessageListActivityCell
extends
Component
{
constructor
(
props
)
{
super
(
props
);
}
render
()
{
let
{
itemData
,
isEditing
}
=
this
.
props
;
let
body
=
itemData
.
get
(
'body'
);
let
imageUri
=
body
?
body
.
get
(
'img_url'
,
'www.yohobuy.com'
)
:
'www.yohobuy.com'
;
let
content
=
body
?
body
.
get
(
'content'
,
''
)
:
''
;
let
isSelected
=
itemData
.
get
(
'isSelected'
);
imageUri
=
SlicedImage
.
getSlicedUrl
(
imageUri
,
50
,
50
,
2
);
let
borderLeftWidth
=
isEditing
?
1
:
0
;
let
borderLeftColor
=
isEditing
?
'#e0e0e0'
:
'transparent'
;
let
editStyle
=
{
borderLeftWidth
,
borderLeftColor
};
return
(
<
View
style
=
{
styles
.
editContainer
}
>
{
isEditing
?
<
EditIconView
isSelected
=
{
isSelected
}
onSelectPress
=
{()
=>
{
this
.
props
.
selectListItem
&&
this
.
props
.
selectListItem
(
itemData
);
}}
/
>
:
null
}
<
View
style
=
{[
styles
.
container
,
editStyle
]}
>
<
TouchableOpacity
activeOpacity
=
{
1
}
disabled
=
{
isEditing
}
onLongPress
=
{()
=>
{
this
.
props
.
onLongPressListItem
&&
this
.
props
.
onLongPressListItem
(
itemData
);
}}
onPress
=
{()
=>
{
this
.
props
.
onPressListItem
&&
this
.
props
.
onPressListItem
(
itemData
);
}}
>
<
View
style
=
{
styles
.
contentContainer
}
>
<
View
style
=
{
styles
.
descStyle
}
>
<
Image
style
=
{
styles
.
iconStyle
}
source
=
{{
uri
:
imageUri
}}
resizeMode
=
"contain"
/>
<
View
style
=
{
styles
.
textContainer
}
>
<
Text
numberOfLines
=
{
2
}
style
=
{
styles
.
titleStyle
}
>
{
itemData
.
get
(
'title'
)}
<
/Text
>
<
Text
style
=
{
styles
.
detail
}
numberOfLines
=
{
2
}
>
{
content
}
<
/Text
>
<
/View
>
<
/View
>
<
/View
>
<
/TouchableOpacity
>
<
MessageListCellFooter
onPressListItem
=
{
this
.
props
.
onPressListItem
}
itemData
=
{
itemData
}
/
>
<
/View
>
<
/View
>
)
};
}
let
{
width
,
height
}
=
Dimensions
.
get
(
'window'
);
const
DEVICE_WIDTH_RATIO
=
width
/
375
;
let
styles
=
StyleSheet
.
create
({
editContainer
:
{
flexDirection
:
'row'
},
container
:
{
backgroundColor
:
'white'
,
width
},
contentContainer
:
{
flex
:
1
,
minHeight
:
71
,
flexDirection
:
'column'
,
backgroundColor
:
'white'
,
justifyContent
:
'center'
},
textContainer
:
{
flex
:
1
,
flexDirection
:
'column'
,
},
titleStyle
:
{
marginLeft
:
10
,
fontSize
:
13
,
fontWeight
:
'bold'
,
color
:
'#444444'
,
marginRight
:
15
,
backgroundColor
:
'white'
},
descStyle
:{
flexDirection
:
'row'
,
backgroundColor
:
'white'
},
iconStyle
:
{
marginLeft
:
15
,
backgroundColor
:
'white'
,
width
:
50
,
height
:
50
},
detail
:{
marginLeft
:
10
,
fontSize
:
13
,
fontWeight
:
'bold'
,
color
:
'#444444'
,
maxWidth
:
width
-
15
-
50
-
10
-
22
,
lineHeight
:
18
,
backgroundColor
:
'white'
}
})
...
...
Please
register
or
login
to post a comment