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
Plain Diff
Browse Files
Authored by
王钱钧
9 years ago
Commit
198f3dd11bbafae03c9f59725a094ebd3b40f77b
2 parents
090550ee
14cc41e3
Merge branch 'develop' of
http://git.yoho.cn/mobile/YH_RNComponent
into develop
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
56 additions
and
22 deletions
js/community/components/posting/AssertsPicker.js
js/community/components/posting/Posting.js
js/community/containers/PostingContainer.js
js/community/reducers/subject/subjectPostActions.js
js/community/components/posting/AssertsPicker.js
View file @
198f3dd
...
...
@@ -46,12 +46,17 @@ export default class AssertsPicker extends Component {
}
let
plusStyle
=
styles
.
itemContainer
;
let
itemStyle
=
null
;
if
(
assets
.
length
==
0
)
{
plusStyle
=
{
flex
:
1
,
height
:
175
,
alignItems
:
'center'
,
justifyContent
:
'center'
,
};
itemStyle
=
{
top
:
-
10
,
};
}
return
(
...
...
@@ -61,7 +66,7 @@ export default class AssertsPicker extends Component {
YH_CommunityAssetsPicker
.
presentImagePicker
(
assets
);
}}
>
<
Image
style
=
{
styles
.
item
}
source
=
{
require
(
'../../images/posting/add.png'
)}
/
>
<
Image
style
=
{
[
styles
.
item
,
itemStyle
]
}
source
=
{
require
(
'../../images/posting/add.png'
)}
/
>
<
/TouchableOpacity
>
);
}
...
...
@@ -73,21 +78,32 @@ export default class AssertsPicker extends Component {
return
(
<
ScrollView
ref
=
{
ref
=>
this
.
scrollView
=
ref
}
style
=
{
styles
.
scroll
}
contentContainerStyle
=
{
styles
.
scrollContainer
}
horizontal
=
{
true
}
onContentSizeChange
=
{(
width
,
height
)
=>
{
let
screenWidth
=
Dimensions
.
get
(
'window'
).
width
;
let
offset
;
if
(
width
>
screenWidth
)
{
this
.
scrollView
.
scrollTo
({
x
:
width
-
screenWidth
});
}
}}
>
{
assets
.
map
((
asset
,
index
)
=>
{
return
(
<
View
style
=
{
styles
.
itemContainer
}
key
=
{
index
}
>
<
Image
style
=
{
styles
.
item
}
source
=
{
asset
}
/
>
<
TouchableOpacity
onPress
=
{()
=>
{
this
.
deleteAsset
(
index
);}}
>
<
Image
style
=
{
styles
.
itemDelete
}
source
=
{
require
(
'../../images/posting/delete.png'
)}
/
>
<
/TouchableOpacity
>
<
/View
>
);
})}
{
this
.
renderPlus
(
assets
)}
<
View
style
=
{
styles
.
scrollContainer
}
>
{
assets
.
map
((
asset
,
index
)
=>
{
return
(
<
View
style
=
{
styles
.
itemContainer
}
key
=
{
index
}
>
<
Image
style
=
{
styles
.
item
}
source
=
{
asset
}
/
>
<
TouchableOpacity
onPress
=
{()
=>
{
this
.
deleteAsset
(
index
);}}
>
<
Image
style
=
{
styles
.
itemDelete
}
source
=
{
require
(
'../../images/posting/delete.png'
)}
/
>
<
/TouchableOpacity
>
<
/View
>
);
})}
{
this
.
renderPlus
(
assets
)}
<
/View
>
<
/ScrollView
>
);
}
...
...
@@ -112,13 +128,16 @@ export default class AssertsPicker extends Component {
const
styles
=
StyleSheet
.
create
({
container
:
{
flex
:
1
,
height
:
200
,
},
scroll
:
{
height
:
200
,
height
:
175
,
},
scrollContainer
:
{
flexDirection
:
'row'
,
justifyContent
:
'center'
,
alignItems
:
'center'
,
height
:
175
,
paddingLeft
:
24
,
paddingRight
:
12
,
},
...
...
js/community/components/posting/Posting.js
View file @
198f3dd
...
...
@@ -214,6 +214,8 @@ export default class Posting extends Component {
{
this
.
props
.
selectedBoard
}
<
/Text
>
<
/View
>
<
View
style
=
{
styles
.
toolTopLine
}
/
>
<
View
style
=
{
styles
.
toolBottomLine
}
/
>
<
/View
>
<
AssertsPicker
style
=
{[
styles
.
boardSelectionContainer
,{
height
:
this
.
state
.
imageState
,}]}
...
...
@@ -255,6 +257,7 @@ const styles = StyleSheet.create({
container
:
{
top
:
0
,
flex
:
1
,
backgroundColor
:
'white'
,
},
titleInput
:
{
left
:
0
,
...
...
@@ -316,12 +319,25 @@ const styles = StyleSheet.create({
right
:
0
,
left
:
0
,
height
:
41
,
borderColor
:
'#a0a0a0'
,
borderBottomWidth
:
0.5
,
borderTopWidth
:
0.5
,
alignItems
:
'center'
,
justifyContent
:
'center'
,
},
toolTopLine
:
{
position
:
'absolute'
,
left
:
0
,
top
:
0
,
width
:
width
,
height
:
0.5
,
backgroundColor
:
'#e0e0e0'
,
},
toolBottomLine
:
{
position
:
'absolute'
,
left
:
0
,
bottom
:
0
,
width
:
width
,
height
:
0.5
,
backgroundColor
:
'#e0e0e0'
,
},
imgIcon
:
{
left
:
15
,
width
:
19
,
...
...
js/community/containers/PostingContainer.js
View file @
198f3dd
...
...
@@ -144,7 +144,8 @@ let navbarHeight = (Platform.OS === 'android') ? 50 : 64;
let
styles
=
StyleSheet
.
create
({
container
:
{
top
:
navbarHeight
,
height
:
height
-
navbarHeight
-
49
,
marginBottom
:
navbarHeight
,
flex
:
1
,
},
});
...
...
js/community/reducers/subject/subjectPostActions.js
View file @
198f3dd
...
...
@@ -167,7 +167,7 @@ export function onRightPressed(sid) {
}
}
let
title
=
item
.
postsTitle
||
contentStr
||
'潮流社区'
;
let
content
=
item
.
authorInfo
.
nickName
||
''
+
'在潮流社区发布的潮流主题帖很赞,快来看看!'
let
content
=
(
item
.
authorInfo
.
nickName
||
''
)
+
'在潮流社区发布的潮流主题帖很赞,快来看看!'
let
shareInfo
=
{
title
,
content
,
...
...
@@ -175,9 +175,7 @@ export function onRightPressed(sid) {
linkUrl
:
item
.
shareUrl
,
}
dispatch
(
doShare
(
sid
,
shareInfo
));
}
else
{
Alert
.
alert
(
'提示'
,
'获取分享信息失败'
);
}
}
}
}
}
...
...
Please
register
or
login
to post a comment