...
|
...
|
@@ -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',
|
...
|
...
|
@@ -103,6 +107,10 @@ class ContentMessageContainer extends Component { |
|
|
});
|
|
|
}
|
|
|
|
|
|
_hideToastMessage() {
|
|
|
this.props.actions.hideToastMessage();
|
|
|
}
|
|
|
|
|
|
//跳转到种草H5
|
|
|
_jumpToPersonalGrassPage(optUid) {
|
|
|
|
...
|
...
|
@@ -131,31 +139,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 +180,9 @@ class ContentMessageContainer extends Component { |
|
|
tabButtons,
|
|
|
commentList,
|
|
|
isPullToRefresh,
|
|
|
isFetching
|
|
|
isFetching,
|
|
|
toastMessage,
|
|
|
isShowToast,
|
|
|
} = this.props
|
|
|
|
|
|
return (
|
...
|
...
|
@@ -175,6 +192,8 @@ class ContentMessageContainer extends Component { |
|
|
this.messageView = view
|
|
|
}}
|
|
|
contentTipFlag={contentTipFlag}
|
|
|
toastMessage={toastMessage}
|
|
|
isShowToast={isShowToast}
|
|
|
tabButtons={tabButtons}
|
|
|
commentList={commentList}
|
|
|
isPullToRefresh={isPullToRefresh}
|
...
|
...
|
@@ -187,6 +206,7 @@ class ContentMessageContainer extends Component { |
|
|
jumpToPersonalGrassPage={this._jumpToPersonalGrassPage}
|
|
|
jumpToGrassDetailPage={this._jumpToGrassDetailPage}
|
|
|
onPressTabAction={this._onPressTabAction}
|
|
|
hideToastMessage={this._hideToastMessage}
|
|
|
/>
|
|
|
</View>
|
|
|
)
|
...
|
...
|
|