Authored by 陈林

Merge branch 'V6.9.3' into 'master'

V6.9.3



See merge request !32
... ... @@ -59,17 +59,32 @@ export default class ContentLikedListCell extends Component {
</View>
</View>
<TouchableOpacity activeOpacity={1} onPress={() => this.props.jumpToGrassDetailPage && this.props.jumpToGrassDetailPage(rowData.articleId, rowData.rootCommentId)}>
<TouchableOpacity activeOpacity={1} onPress={() => this.props.jumpToGrassDetailPage && this.props.jumpToGrassDetailPage(rowData.articleId, rowData.rootCommentId, rowData.isDelete)}>
{ rowData.isDelete === 'N' ?
<View style={ styles.originView} >
<Text style={styles.copyText}>原文</Text>
<YH_Image url={imageUrl} style={styles.imageStyle} />
{ imageUrl ? <YH_Image url={imageUrl} style={styles.imageStyle} /> : null }
{rowData.content ?
<Text style={styles.originText} numberOfLines={1}>{rowData.content}</Text>
:
<View style={{height: 5}} />
<Text style={styles.originText} numberOfLines={1}>
<Text>{rowData.content}</Text>
<Text>{'...'}</Text>
</Text>
:
<View style={{height: 5}} />
}
</View>
:
<View style={ styles.originView} >
<Text style={styles.deleteText} numberOfLines={1}>{'原文已被作者删除'}</Text>
</View> }
</TouchableOpacity>
<View style={styles.timeView}>
... ... @@ -166,4 +181,13 @@ let styles = StyleSheet.create({
height: 0.5,
backgroundColor: '#e0e0e0'
},
deleteText: {
fontFamily: 'PingFang-SC-Regular',
fontSize: 12,
color: '#b0b0b0',
marginLeft: 9,
marginRight: 16,
marginTop: 10,
marginBottom: 10
},
});
... ...
... ... @@ -58,7 +58,7 @@ export default class ContentMessageCell extends Component {
</TouchableOpacity>
<Text style={styles.subnameText}>{subName}</Text>
</View>
<TouchableOpacity activeOpacity={1} style={styles.replyContainer} onPress={()=> this.props.jumpToShowKeyboard && this.props.jumpToShowKeyboard(rowData.userName, rowData.commentId)}>
<TouchableOpacity activeOpacity={1} style={styles.replyContainer} onPress={()=> this.props.jumpToShowKeyboard && this.props.jumpToShowKeyboard(rowData.userName, rowData.commentId, rowData.isDelete)}>
<Image style={styles.replyImage} resizeMode="contain" source={require('../../images/content_reply.png')}/>
</TouchableOpacity>
</View>
... ... @@ -69,7 +69,7 @@ export default class ContentMessageCell extends Component {
{ status ?
<TouchableOpacity activeOpacity={1} onPress={() => this.props.jumpToGrassDetailPage && this.props.jumpToGrassDetailPage(rowData.articleId, rowData.rootCommentId)}>
<TouchableOpacity activeOpacity={1} onPress={() => this.props.jumpToGrassDetailPage && this.props.jumpToGrassDetailPage(rowData.articleId, rowData.rootCommentId, rowData.isDelete, status)}>
<View style={styles.ownerReplyView}>
<Text style={{paddingLeft: 10, paddingTop: 14, paddingRight: 1, paddingBottom: 12}} numberOfLines={3}>
<Text style={styles.replyText}>我的评论:</Text>
... ... @@ -80,22 +80,32 @@ export default class ContentMessageCell extends Component {
:
<TouchableOpacity activeOpacity={1} onPress={() => this.props.jumpToGrassDetailPage && this.props.jumpToGrassDetailPage(rowData.articleId, rowData.rootCommentId)}>
<View style={ styles.originContainerView} >
<Text style={styles.copyText}>原文</Text>
{ imageUrl ? <YH_Image url={imageUrl} style={styles.imageStyle} /> : null }
<TouchableOpacity activeOpacity={1} onPress={() => this.props.jumpToGrassDetailPage && this.props.jumpToGrassDetailPage(rowData.articleId, rowData.rootCommentId, rowData.isDelete, status)}>
{ rowData.isDelete === 'N' ?
<View style={ styles.originContainerView} >
<Text style={styles.copyText}>原文</Text>
{ imageUrl ? <YH_Image url={imageUrl} style={styles.imageStyle} /> : null }
{rowData.content ?
{rowData.content ?
<Text style={styles.originText} numberOfLines={1}>
<Text>{rowData.content}</Text>
<Text>{'...'}</Text>
</Text>
:
<View style={{height: 5}} />
}
<Text style={styles.originText} numberOfLines={1}>
<Text>{rowData.content}</Text>
<Text>{'...'}</Text>
</Text>
:
<View style={{height: 5}} />
}
</View>
:
<View style={ styles.originContainerView} >
<Text style={styles.deleteText} numberOfLines={1}>{'原文已被作者删除'}</Text>
</View>
}
</TouchableOpacity> }
<View style={styles.timeView}>
... ... @@ -209,6 +219,15 @@ let styles = StyleSheet.create({
marginRight: 16,
marginBottom: 9,
},
deleteText: {
fontFamily: 'PingFang-SC-Regular',
fontSize: 12,
color: '#b0b0b0',
marginLeft: 9,
marginRight: 16,
marginTop: 10,
marginBottom: 10
},
timeView: {
alignItems: 'flex-start',
marginBottom: 10,
... ...
... ... @@ -96,7 +96,7 @@ export default class ContentMessageView extends Component {
}
render() {
let {commentList, isPullToRefresh, tipMessage} = this.props;
let {commentList, isPullToRefresh, tipMessage, isShowToast, toastMessage} = this.props;
return (
<View style={styles.container}>
... ... @@ -164,6 +164,12 @@ export default class ContentMessageView extends Component {
: null
}
{isShowToast ? <Prompt
text={toastMessage}
duration={3000}
onPromptHidden={this.props.hideToastMessage}
/> : null}
</View>
);
}
... ...
... ... @@ -62,4 +62,7 @@ export default keyMirror({
MESSAGE_CLEAR_COMMENT_LIST: null,
CLEAR_BADGE_NUM_SUCCESS: null,
UPDATE_TIP_FLAG_SUCCESS: null,
SHOW_TOAST: null,
HIDE_TOAST: null,
});
... ...
... ... @@ -100,9 +100,12 @@ class ContentListContainer extends Component {
NativeModules.YH_CommonHelper.jumpWithUrl(path);
}
_jumpToGrassDetailPage(articleId, rootCommentId) {
let {communityHost} = this.props
_jumpToGrassDetailPage(articleId, rootCommentId, isDelete) {
if (isDelete === 'Y') {
return;
}
let {communityHost} = this.props
let url = communityHost + (Platform.OS === 'ios' ? '/grass': '') + `/article/detail/${articleId}`+ `?commentId=${rootCommentId}`
let action, params;
if(Platform.OS === 'ios') {
... ...
... ... @@ -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>
)
... ...
... ... @@ -45,8 +45,24 @@ const {
CLEAR_BADGE_NUM_SUCCESS,
UPDATE_TIP_FLAG_SUCCESS,
SHOW_TOAST,
HIDE_TOAST,
} = require('../../constants/actionTypes').default;
export function showToastMessage(value) {
return {
type: SHOW_TOAST,
payload: value
};
}
export function hideToastMessage() {
return {
type: HIDE_TOAST,
};
}
export function setContentListId(id) {
return {
type: SET_CONTENT_LIST_ID,
... ...
... ... @@ -50,6 +50,9 @@ let InitialState = Record({
error: null,
})),
isShowToast: false,
toastMessage: '',
});
export default InitialState;
... ...
... ... @@ -42,6 +42,9 @@ const {
CLEAR_BADGE_NUM_SUCCESS,
UPDATE_TIP_FLAG_SUCCESS,
SHOW_TOAST,
HIDE_TOAST,
} = require('../../constants/actionTypes').default;
const initialState = new InitialState;
... ... @@ -192,6 +195,11 @@ export default function grassReducer(state=initialState, action) {
return state.set('contentTipFlag', action.payload);
}
case SHOW_TOAST:
return state.set('isShowToast', true).set('toastMessage', action.payload)
case HIDE_TOAST:
return state.set('isShowToast', false).set('toastMessage', '')
}
return state;
}
... ...
... ... @@ -91,7 +91,8 @@ class CouponContainer extends Component {
}
_onPressMore(){
ReactNative.NativeModules.YH_MyAssetsViewHelper.lookAroundBtnTappedForCoupon();
let jumpUrl = `http://m.yohobuy.com?openby:yohobuy={"action":"go.attention","params":{"actiontype":"0"}}`;
ReactNative.NativeModules.YH_CommonHelper.jumpWithUrl(jumpUrl);
}
render() {
... ...
... ... @@ -26,6 +26,7 @@ import {
setHost,
setServiceHost,
setChannel,
setContentCode,
} from './reducers/app/appActions';
... ... @@ -43,11 +44,12 @@ export default function native(platform) {
render() {
let type = this.props.type;
const store = configureStore(getInitialState());
const store = configureStore(getInitialState());
store.dispatch(setPlatform(platform));
store.dispatch(setHost(this.props.host));
store.dispatch(setChannel(this.props.channelId));
store.dispatch(setServiceHost(this.props.serviceHost));
store.dispatch(setContentCode(this.props.contentCode));
if (type == 'recForYou' ) {
return (
<Provider store={store}>
... ...
... ... @@ -27,7 +27,7 @@ export default class BrandCell extends Component {
let shop_logo = data.get('shop_logo');
let shops_id = data.get('shops_id');
let new_product_num = data.get('new_product_num');
shop_logo = YH_Image.getSlicedUrl(shop_logo, 100, 50, 2);
shop_logo = YH_Image.getSlicedUrl(shop_logo, 70, 35, 2);
let yh_exposureData = data.get('yh_exposureData');
return (
<TouchableOpacity style={styles.container} yh_exposureData={yh_exposureData} onPress={()=>{this.props.onPressShop&&this.props.onPressShop(data, index);}}>
... ... @@ -46,20 +46,22 @@ let {width, height} = Dimensions.get('window');
let styles = StyleSheet.create({
container: {
height: 76,
width: 80,
backgroundColor: 'white',
marginTop: 10,
marginRight: 4,
},
image: {
marginTop: 0,
width: 80,
height: 40,
marginTop: 5,
marginLeft: 5,
marginRight: 5,
width: 70,
height: 35,
resizeMode: 'contain',
},
footerContainer: {
marginTop: 12,
marginBottom: 8,
width: 80,
height: 16,
flexDirection: 'row',
... ...
... ... @@ -6,6 +6,7 @@ export default keyMirror({
SET_HOST: null,
SET_SERVICE_HOST: null,
SET_CHANNEL: null,
SET_CONTENT_CODE: null,
RECOMMEND_SHOP_REQUEST: null,
RECOMMEND_SHOP_SUCCESS: null,
... ...
... ... @@ -5,8 +5,9 @@ import ReactNative from 'react-native';
const {
SET_PLATFORM,
SET_CHANNEL,
SET_HOST,
SET_SERVICE_HOST,
SET_HOST,
SET_SERVICE_HOST,
SET_CONTENT_CODE,
} = require('../../constants/actionTypes').default;
export function setPlatform(platform) {
... ... @@ -35,4 +36,11 @@ export function setServiceHost(host) {
type: SET_SERVICE_HOST,
payload: host
};
}
\ No newline at end of file
}
export function setContentCode(contentCode) {
return {
type: SET_CONTENT_CODE,
payload: contentCode
};
}
... ...
... ... @@ -8,6 +8,7 @@ let InitialState = Record({
host: 'http://api.yoho.cn',
serviceHost: 'http://api.yoho.cn',
globalHost: 'http://api-global.yohobuy.com',
contentCode: '',
});
export default InitialState;
... ...
... ... @@ -7,6 +7,7 @@ const {
SET_CHANNEL,
SET_HOST,
SET_SERVICE_HOST,
SET_CONTENT_CODE,
} = require('../../constants/actionTypes').default;
const initialState = new InitialState;
... ... @@ -23,6 +24,8 @@ export default function appReducer(state = initialState, action) {
return state.set('host', action.payload);
case SET_SERVICE_HOST:
return state.set('serviceHost', action.payload);
case SET_CONTENT_CODE:
return state.set('contentCode', action.payload);
}
return state;
... ...
... ... @@ -110,8 +110,9 @@ export function getResourceInfoFailure(error) {
export function getResourceInfo(callback) {
return (dispatch, getState) => {
let {app} = getState();
let contentCode = app.contentCode ? app.contentCode : '1f2e07cb63811680154ba693c954dd62';
dispatch(getResourceInfoRequest());
return new NewArrivalService(app.host).fetchResourceInfo('1f2e07cb63811680154ba693c954dd62')
return new NewArrivalService(app.host).fetchResourceInfo(contentCode)
.then(json => {
let newJson = exposeResourceInfoData(json);
... ...
... ... @@ -133,7 +133,7 @@ class ListContainer extends Component {
}
_onPressEmptyItem() {
let jumpUrl = `http://m.yohobuy.com?openby:yohobuy={"action":"go.new"}`;
let jumpUrl = `http://m.yohobuy.com?openby:yohobuy={"action":"go.attention","params":{"actiontype":"0"}}`;
ReactNative.NativeModules.YH_CommonHelper.jumpWithUrl(jumpUrl);
}
... ...
... ... @@ -234,7 +234,7 @@ export default class Product extends Component {
let dataArray = [];
let isLoading = false;
let showList = (commonProduct.get('productList').size && !commonProduct.get('isFetching')) || (globalProduct.get('productList').size && !commonProduct.get('isFetching'));
let showEmpty = commonProduct.get('showEmpty') && globalProduct.get('showEmpty');
let showEmpty = (currentTab == 'common' && commonProduct.get('showEmpty')) || (currentTab == 'global' && globalProduct.get('showEmpty'));
if (currentTab == 'common') {
let {isFetching, selectedProductList, categoryList, selectedCategoryIndex, isDeleting} = commonProduct;
isLoading = (selectedProductList.size == 0 && isFetching) || isDeleting;
... ...