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
QC-L
7 years ago
Commit
3db50fbeaa5bbfb18028077dd9e1f07e8f137b36
1 parent
ecedf838
消除项目中的异常问题
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
19 deletions
js/alliance/components/Home.js
js/alliance/components/cell/EditorTalk.js
js/common/components/YH_TipsAlert.js
js/alliance/components/Home.js
View file @
3db50fb
...
...
@@ -187,6 +187,9 @@ export default class Home extends Component {
this
.
props
.
onEndReached
&&
this
.
props
.
onEndReached
();
}
}}
keyExtractor
=
{(
item
,
index
)
=>
{
return
index
}}
/>
<
/View>
);
...
...
@@ -223,8 +226,7 @@ let styles = StyleSheet.create({
backgroundColor
:
'#e0e0e0'
},
contentContainer
:
{
flexDirection
:
'row'
,
flexWrap
:
'wrap'
,
flexDirection
:
'column'
,
backgroundColor
:
'white'
},
listContainer
:
{
...
...
js/alliance/components/cell/EditorTalk.js
View file @
3db50fb
...
...
@@ -17,6 +17,7 @@ export default class EditorTalk extends Component {
super
(
props
);
this
.
_handleData
=
this
.
_handleData
.
bind
(
this
);
this
.
_handleParamsJumpWithUrl
=
this
.
_handleParamsJumpWithUrl
.
bind
(
this
);
this
.
_handleTextStyleError
=
this
.
_handleTextStyleError
.
bind
(
this
);
}
shouldComponentUpdate
(
nextProps
)
{
...
...
@@ -53,6 +54,16 @@ export default class EditorTalk extends Component {
this
.
props
.
resourceJumpWithUrl
&&
this
.
props
.
resourceJumpWithUrl
(
url
,
'talk'
,
params
);
}
_handleTextStyleError
(
item
,
index
)
{
let
newItem
=
item
;
if
(
item
.
text
)
{
newItem
=
Object
.
assign
({},
item
)
delete
newItem
[
'text'
];
delete
newItem
[
'size'
];
}
return
<
Text
key
=
{
index
}
style
=
{
newItem
}
>
{
item
.
text
}
<
/Text
>
}
render
()
{
let
{
mainTitlelist
,
subTitlelist
,
contextlist
,
url
}
=
this
.
_handleData
();
let
image
=
this
.
props
.
image
;
...
...
@@ -73,24 +84,13 @@ export default class EditorTalk extends Component {
source
=
{
image
}
style
=
{
styles
.
backgroundImage
}
/
>
<
Text
style
=
{
styles
.
bannerMainTitle
}
>
{
mainTitlelist
.
map
(
item
=>
{
return
<
Text
style
=
{
item
}
>
{
item
.
text
}
<
/Text
>
})}
<
/Text
>
<
Text
style
=
{
styles
.
bannerMainTitle
}
>
{
mainTitlelist
.
map
(
this
.
_handleTextStyleError
)}
<
/Text
>
<
Text
style
=
{
styles
.
bannerSubTitle
}
>
{
subTitlelist
.
map
(
item
=>
{
let
newItem
=
item
;
if
(
item
.
text
)
{
newItem
=
Object
.
assign
({},
item
)
delete
newItem
[
'text'
];
}
return
<
Text
style
=
{
newItem
}
>
{
item
.
text
}
<
/Text
>
})}
{
subTitlelist
.
map
(
this
.
_handleTextStyleError
)}
<
/Text
>
<
Text
style
=
{
styles
.
bannerContext
}
>
{
contextlist
.
map
(
item
=>
{
return
<
Text
style
=
{
item
}
>
{
item
.
text
}
<
/Text
>
})
contextlist
.
map
(
this
.
_handleTextStyleError
)
}
<
/Text
>
<
/TouchableOpacity
>
...
...
js/common/components/YH_TipsAlert.js
View file @
3db50fb
...
...
@@ -45,11 +45,12 @@ class TipsAlert extends React.Component {
_renderChildren
(
children
)
{
return
children
.
map
((
element
,
index
)
=>
{
if
(
index
===
children
.
length
)
return
element
return
(
<
React
.
Fragment
>
<
React
.
Fragment
key
=
{
index
}
>
{
element
}
<
View
style
=
{{
width
:
0.5
,
height
:
'100%'
,
backgroundColor
:
'#e0e0e0'
}}
><
/View>
if
(
index
!==
children
.
length
)
{
<
View
style
=
{{
width
:
0.5
,
height
:
'100%'
,
backgroundColor
:
'#e0e0e0'
}}
><
/View>
}
<
/React.Fragment>
)
});
...
...
Please
register
or
login
to post a comment