...
|
...
|
@@ -29,6 +29,8 @@ function mapStateToProps(state) { |
|
|
contentTipFlag: state.content.contentTipFlag,
|
|
|
tipMessage: state.content.tipMessage,
|
|
|
communityHost: state.app.communityHost,
|
|
|
toastMessage: state.content.toastMessage,
|
|
|
isShowToast: state.content.isShowToast,
|
|
|
};
|
|
|
}
|
|
|
|
...
|
...
|
@@ -55,6 +57,8 @@ class ContentMessageContainer extends Component { |
|
|
this._jumpToPersonalGrassPage = this._jumpToPersonalGrassPage.bind(this);
|
|
|
this._jumpToGrassDetailPage = this._jumpToGrassDetailPage.bind(this);
|
|
|
this._onPressTabAction = this._onPressTabAction.bind(this);
|
|
|
this._hideToastMessage = this._hideToastMessage.bind(this);
|
|
|
|
|
|
|
|
|
this.subscription = NativeAppEventEmitter.addListener(
|
|
|
'YHUpdateAuthStatusEvent',
|
...
|
...
|
@@ -97,12 +101,21 @@ class ContentMessageContainer extends Component { |
|
|
NativeModules.YH_CommonHelper.jumpWithUrl(actionUrl);
|
|
|
}
|
|
|
|
|
|
_jumpToShowKeyboard(userName, commentId) {
|
|
|
_jumpToShowKeyboard(userName, commentId, isDelete) {
|
|
|
if (isDelete === 'Y') {
|
|
|
this.props.actions.showToastMessage('原文已被作者删除');
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
NativeModules.YH_CommonHelper.showkeyBoardView(userName).then(replyValue => {
|
|
|
this.props.actions.addArticleCommentAction(replyValue, commentId);
|
|
|
});
|
|
|
}
|
|
|
|
|
|
_hideToastMessage() {
|
|
|
this.props.actions.hideToastMessage();
|
|
|
}
|
|
|
|
|
|
//跳转到种草H5
|
|
|
_jumpToPersonalGrassPage(optUid) {
|
|
|
|
...
|
...
|
@@ -131,31 +144,38 @@ class ContentMessageContainer extends Component { |
|
|
NativeModules.YH_CommonHelper.jumpWithUrl(path);
|
|
|
}
|
|
|
|
|
|
_jumpToGrassDetailPage(articleId, rootCommentId) {
|
|
|
|
|
|
let {communityHost} = this.props
|
|
|
let url = communityHost + (Platform.OS === 'ios' ? '/grass': '') + `/article/detail/${articleId}`+ `?commentId=${rootCommentId}`
|
|
|
|
|
|
let action, params;
|
|
|
if(Platform.OS === 'ios') {
|
|
|
action = 'go.h5';
|
|
|
params = {
|
|
|
url,
|
|
|
param : { headerid: "-1", toplayoutByH5: 'Y' }
|
|
|
}
|
|
|
} else {
|
|
|
action = 'go.h5';
|
|
|
params = {
|
|
|
url,
|
|
|
param : { headerid: "-1", toplayoutByH5: 'Y' }
|
|
|
}
|
|
|
}
|
|
|
let jumpParams = {
|
|
|
action,
|
|
|
params
|
|
|
}
|
|
|
let path = 'http://m.yohobuy.com?openby:yohobuy=' + JSON.stringify(jumpParams);
|
|
|
NativeModules.YH_CommonHelper.jumpWithUrl(path);
|
|
|
_jumpToGrassDetailPage(articleId, rootCommentId, isDelete, status) {
|
|
|
|
|
|
if (isDelete === 'Y') {
|
|
|
if (status) {
|
|
|
this.props.actions.showToastMessage('原文已被作者删除');
|
|
|
}
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
let {communityHost} = this.props
|
|
|
let url = communityHost + (Platform.OS === 'ios' ? '/grass': '') + `/article/detail/${articleId}`+ `?commentId=${rootCommentId}`
|
|
|
|
|
|
let action, params;
|
|
|
if(Platform.OS === 'ios') {
|
|
|
action = 'go.h5';
|
|
|
params = {
|
|
|
url,
|
|
|
param : { headerid: "-1", toplayoutByH5: 'Y' }
|
|
|
}
|
|
|
} else {
|
|
|
action = 'go.h5';
|
|
|
params = {
|
|
|
url,
|
|
|
param : { headerid: "-1", toplayoutByH5: 'Y' }
|
|
|
}
|
|
|
}
|
|
|
let jumpParams = {
|
|
|
action,
|
|
|
params
|
|
|
}
|
|
|
let path = 'http://m.yohobuy.com?openby:yohobuy=' + JSON.stringify(jumpParams);
|
|
|
NativeModules.YH_CommonHelper.jumpWithUrl(path);
|
|
|
}
|
|
|
|
|
|
render() {
|
...
|
...
|
@@ -165,7 +185,9 @@ class ContentMessageContainer extends Component { |
|
|
tabButtons,
|
|
|
commentList,
|
|
|
isPullToRefresh,
|
|
|
isFetching
|
|
|
isFetching,
|
|
|
toastMessage,
|
|
|
isShowToast,
|
|
|
} = this.props
|
|
|
|
|
|
return (
|
...
|
...
|
@@ -175,6 +197,8 @@ class ContentMessageContainer extends Component { |
|
|
this.messageView = view
|
|
|
}}
|
|
|
contentTipFlag={contentTipFlag}
|
|
|
toastMessage={toastMessage}
|
|
|
isShowToast={isShowToast}
|
|
|
tabButtons={tabButtons}
|
|
|
commentList={commentList}
|
|
|
isPullToRefresh={isPullToRefresh}
|
...
|
...
|
@@ -187,6 +211,7 @@ class ContentMessageContainer extends Component { |
|
|
jumpToPersonalGrassPage={this._jumpToPersonalGrassPage}
|
|
|
jumpToGrassDetailPage={this._jumpToGrassDetailPage}
|
|
|
onPressTabAction={this._onPressTabAction}
|
|
|
hideToastMessage={this._hideToastMessage}
|
|
|
/>
|
|
|
</View>
|
|
|
)
|
...
|
...
|
|