Authored by 孙凯

Merge branch '5.6.0' of http://git.yoho.cn/mobile/YH_RNComponent into 5.6.0

... ... @@ -117,32 +117,11 @@ class BrandStoreContainer extends Component {
}
_onPressCollection(isCollected) {
let param = {
SHOP_ID: this.props.brandStore.shopId,
BRAND_ID: this.props.brandStore.resource.brandBrowse.brandId,
COL_TYPE: 1,
}
if (isCollected) {
this.props.actions.addFavorite();
param = {
SHOP_ID: this.props.brandStore.shopId,
BRAND_ID: this.props.brandStore.resource.brandBrowse.brandId,
COL_TYPE: 1,
TEMPLATE_TYPE:this.props.brandStore.info.shop_template_type,
IS_RED: 0,
}
} else {
this.props.actions.cancelFavorite();
param = {
SHOP_ID: this.props.brandStore.shopId,
BRAND_ID: this.props.brandStore.resource.brandBrowse.brandId,
COL_TYPE: 2,
TEMPLATE_TYPE:this.props.brandStore.info.shop_template_type,
IS_RED: 0,
}
}
ReactNative.NativeModules.YH_CommonHelper.logEvent('YB_BRAND_SHOP_COLLECT_C', param);
}
_onPressCoupon(rowData, resourceId, rowID) {
... ... @@ -154,7 +133,6 @@ class BrandStoreContainer extends Component {
let param = {
SHOP_ID: this.props.brandStore.shopId,
BRAND_ID: this.props.brandStore.resource.brandBrowse.brandId,
FLR_ID: resourceId,
FLR_INDEX: 1,
I_INDEX: rowID+1,
... ... @@ -177,7 +155,6 @@ class BrandStoreContainer extends Component {
let param = {
SHOP_ID: this.props.brandStore.shopId,
BRAND_ID: this.props.brandStore.resource.brandBrowse.brandId,
FLR_ID: this.props.brandStore.resource.hotProducts_APP.resourceId,
FLR_INDEX: 6,
I_INDEX: parseInt(rowId)+1,
... ... @@ -206,7 +183,7 @@ class BrandStoreContainer extends Component {
TAB_ID: 0,
TAB_NAME: '首页',
SORT_TYPE: order,
PRD_ID: productSkn,
PRD_SKN: productSkn,
IS_RED: 0,
TEMPLATE_TYPE:this.props.brandStore.info.shop_template_type,
FILTER_VALUE: this.props.brandStore.filterNameFactors.toJS(),
... ... @@ -229,7 +206,7 @@ class BrandStoreContainer extends Component {
SHOP_ID: this.props.brandStore.shopId,
TAB_ID: 1,
TAB_NAME: '上新',
PRD_ID: productSkn,
PRD_SKN: productSkn,
IS_RED: 0,
TEMPLATE_TYPE:this.props.brandStore.info.shop_template_type,
}
... ... @@ -241,7 +218,7 @@ class BrandStoreContainer extends Component {
SHOP_ID: this.props.brandStore.shopId,
TAB_ID: 2,
TAB_NAME: '人气',
PRD_ID: productSkn,
PRD_SKN: productSkn,
IS_RED: 0,
TEMPLATE_TYPE:this.props.brandStore.info.shop_template_type,
}
... ... @@ -255,7 +232,6 @@ class BrandStoreContainer extends Component {
ReactNative.NativeModules.YH_CommonHelper.jumpWithUrl(url);
let param = {
SHOP_ID: this.props.brandStore.shopId,
BRAND_ID: this.props.brandStore.resource.brandBrowse.brandId,
FLR_ID: this.props.brandStore.resource.hotProducts_APP.resourceId,
FLR_INDEX: 6,
I_INDEX: 0,
... ... @@ -272,7 +248,6 @@ class BrandStoreContainer extends Component {
ReactNative.NativeModules.YH_CommonHelper.jumpWithUrl(url);
let param = {
SHOP_ID: this.props.brandStore.shopId,
BRAND_ID: this.props.brandStore.resource.brandBrowse.brandId,
FLR_ID: this.props.brandStore.resource.brandBrowse.resourceId,
FLR_INDEX: 2,
I_INDEX: rowID+1,
... ... @@ -289,7 +264,6 @@ class BrandStoreContainer extends Component {
ReactNative.NativeModules.YH_CommonHelper.jumpWithUrl(url);
let param = {
SHOP_ID: this.props.brandStore.shopId,
BRAND_ID: this.props.brandStore.resource.brandBrowse.brandId,
FLR_ID: resourceId,
FLR_INDEX: 3,
I_INDEX: rowID+1,
... ... @@ -306,7 +280,6 @@ class BrandStoreContainer extends Component {
ReactNative.NativeModules.YH_CommonHelper.jumpWithUrl(url);
let param = {
SHOP_ID: this.props.brandStore.shopId,
BRAND_ID: this.props.brandStore.resource.brandBrowse.brandId,
FLR_ID: resourceId,
FLR_INDEX: 4,
I_INDEX: rowID+1,
... ... @@ -323,7 +296,6 @@ class BrandStoreContainer extends Component {
ReactNative.NativeModules.YH_CommonHelper.jumpWithUrl(url);
let param = {
SHOP_ID: this.props.brandStore.shopId,
BRAND_ID: this.props.brandStore.resource.brandBrowse.brandId,
FLR_ID: this.props.brandStore.resource.recommend_APP.resourceId,
FLR_INDEX: 5,
I_INDEX: parseInt(rowID)+1,
... ... @@ -357,7 +329,6 @@ class BrandStoreContainer extends Component {
let param = {
SHOP_ID: this.props.brandStore.shopId,
BRAND_ID: this.props.brandStore.resource.brandBrowse.brandId,
TAB_ID: value,
TAB_NAME: name,
TEMPLATE_TYPE: this.props.brandStore.info.shop_template_type,
... ...
... ... @@ -225,7 +225,7 @@ export function getShopInfo() {
SHOP_ID: json.shops_id ? json.shops_id : '0',
}
dispatch(shopDataExposure('YB_SHOW_CLASSICAL_SHOP_INFO', params));
ReactNative.NativeModules.YH_CommonHelper.logEvent('YB_BRAND_SHOP_L', {SHOP_ID: brandStore.shopId, TEMPLATE:json.shop_template_type, IS_RED: 0});
ReactNative.NativeModules.YH_CommonHelper.logEvent('YB_BRAND_SHOP_L', {SHOP_ID: brandStore.shopId, TEMPLATE_TYPE:json.shop_template_type, IS_RED: 0});
})
.catch(error => {
dispatch(shopInfoFailure(error));
... ... @@ -1051,6 +1051,13 @@ export function addFavorite() {
dispatch(addFavoriteSuccess());
return new BrandStoreService(app.host).addFavorite(shopId, favId, uid)
.then(json => {
let param = {
SHOP_ID: brandStore.shopId,
COL_TYPE: 1,
TEMPLATE_TYPE:brandStore.info.shop_template_type,
IS_RED: 0,
}
ReactNative.NativeModules.YH_CommonHelper.logEvent('YB_BRAND_SHOP_COLLECT_C', param);
})
.catch(error => {
dispatch(addFavoriteFailure(error));
... ... @@ -1084,6 +1091,13 @@ export function cancelFavorite() {
.then(uid => {
return new BrandStoreService(app.host).cancelFavorite(shopId, shopId, uid)
.then(json => {
let param = {
SHOP_ID: brandStore.shopId,
COL_TYPE: 2,
TEMPLATE_TYPE:brandStore.info.shop_template_type,
IS_RED: 0,
}
ReactNative.NativeModules.YH_CommonHelper.logEvent('YB_BRAND_SHOP_COLLECT_C', param);
})
.catch(error => {
dispatch(cancelFavoriteFailure(error));
... ...
... ... @@ -77,7 +77,15 @@ export default class List extends Component {
return (
<View style={styles.container}>
{Platform.OS === 'ios'
? <ListView contentContainerStyle={styles.contentContainer} enableEmptySections={true} showsVerticalScrollIndicator={false} dataSource={this.dataSource.cloneWithRowsAndSections(dataBlob)} renderRow={this.renderRow} enablePullToRefresh={true} isOnPullToRefresh={isProductListFetching && products.ptr} onRefreshData={() => {
? <ListView
contentContainerStyle={styles.contentContainer}
enableEmptySections={true}
showsVerticalScrollIndicator={false}
dataSource={this.dataSource.cloneWithRowsAndSections(dataBlob)}
renderRow={this.renderRow}
enablePullToRefresh={true}
isOnPullToRefresh={isProductListFetching && products.ptr}
onRefreshData={() => {
this.props.onRefresh && this.props.onRefresh();
}} onEndReached={() => {
if (list && list.length) {
... ... @@ -90,7 +98,14 @@ export default class List extends Component {
return null;
}
}}/>
: <ListView contentContainerStyle={styles.contentContainer} enableEmptySections={true} showsVerticalScrollIndicator={false} dataSource={this.dataSource.cloneWithRowsAndSections(dataBlob)} renderRow={this.renderRow} enablePullToRefresh={true} refreshControl={< YH_PtrRefresh refreshing = {
: <ListView
contentContainerStyle={styles.contentContainer}
enableEmptySections={true}
showsVerticalScrollIndicator={false}
dataSource={this.dataSource.cloneWithRowsAndSections(dataBlob)}
renderRow={this.renderRow}
enablePullToRefresh={true}
refreshControl={< YH_PtrRefresh refreshing = {
isFetchingAndroid
}
onRefresh = {
... ... @@ -109,6 +124,9 @@ export default class List extends Component {
}
}}/>
}
<LoadingIndicator
isVisible={isProductListFetching && !list.length}
/>
</View>
);
}
... ...
... ... @@ -44,7 +44,7 @@ export default class ListCell extends Component {
likeImgSource =require('../../image/unlike.png')
likeTextColor = '#b0b0b0';
}
let showPraiseButton = is_praised && total_praised;
return (
<TouchableOpacity style={styles.container} onPress={() => {
this.props.onPressDetail && this.props.onPressDetail(product_skn, this.props.index, is_praised, total_praised)
... ... @@ -57,12 +57,14 @@ export default class ListCell extends Component {
<View style={styles.rightPannel}>
<Text numberOfLines={2} style={styles.title}>{product_name}</Text>
<Text numberOfLines={4} style={styles.phrase}>{phrase}</Text>
<TouchableOpacity style={styles.likeButton} activeOpacity={1} onPress={() => {
{showPraiseButton
?<TouchableOpacity style={styles.likeButton} activeOpacity={1} onPress={() => {
this.props.onPressLike && this.props.onPressLike(this.props.index);
}}>
<Image style={styles.likeImage} source={likeImgSource}/>
<Text style={[styles.likeText, {color: likeTextColor}]}>{total_praised}人说赞</Text>
</TouchableOpacity>
: null}
</View>
</View>
</TouchableOpacity>
... ...
... ... @@ -77,7 +77,7 @@ export default class Detail extends Component {
}}/>);
break;
case 'productList':
return (<ProductListCell data={rowData} onPressProduct={this.props.onPressProduct}/>);
return (<ProductListCell data={rowData} onPressProduct={this.props.onPressProduct} _onPressDelayNotice={this.props._onPressDelayNotice}/>);
break;
case 'paymentInfo':
return (<PaymentInfoCell data={rowData}/>);
... ...
... ... @@ -53,6 +53,7 @@ class DetailContainer extends Component {
this.onPressProduct = this.onPressProduct.bind(this);
this.pushMultiPackageWithPackages = this.pushMultiPackageWithPackages.bind(this);
this.onPressReturnOrderCode = this.onPressReturnOrderCode.bind(this);
this.showDelayDeliveryNotice = this.showDelayDeliveryNotice.bind(this);
this.subscription = NativeAppEventEmitter.addListener(
'YHNotificationChangeOnLinePayToCodPay',
(reminder) => {
... ... @@ -101,6 +102,10 @@ class DetailContainer extends Component {
ReactNative.NativeModules.YH_OrderHelper.onPressReturnOrderCode();
}
showDelayDeliveryNotice(noticeString){
NativeModules.YH_OrderHelper.deliveryDelayNotice(noticeString);
}
render() {
let {detail, app} = this.props;
return (
... ... @@ -114,6 +119,7 @@ class DetailContainer extends Component {
onPressExpress={this.onPressExpress}
pushMultiPackageWithPackages={this.pushMultiPackageWithPackages}
onPressReturnOrderCode={this.onPressReturnOrderCode}
_onPressDelayNotice={this.showDelayDeliveryNotice}
/>
);
}
... ...
... ... @@ -37,7 +37,7 @@ export default class GoodsGroupList extends React.Component {
_onPressProductRecommend(data, rowID) {
let {resource} = this.props;
let moduleOrder = resource.get('module_order') + 1;
let moduleOrder = parseInt(resource.get('module_order')) + 1;
let moduleType = resource.get('module_type');
this.props.onPressProductRecommend && this.props.onPressProductRecommend(data, rowID,moduleOrder,moduleType)
}
... ...
... ... @@ -112,31 +112,11 @@ class RedPersonBrandContainer extends Component {
_onPressCollection(isCollected) {
let param = {
SHOP_ID: this.props.redBrand.shopId,
COL_TYPE: 1,
}
if (!isCollected) {
this.props.actions.addFavorite();
param = {
SHOP_ID: this.props.redBrand.shopId,
COL_TYPE: 1,
TEMPLATE_TYPE:this.props.redBrand.shopIntro.shop_template_type,
IS_RED: 1,
}
} else {
this.props.actions.cancelFavorite();
param = {
SHOP_ID: this.props.redBrand.shopId,
COL_TYPE: 2,
TEMPLATE_TYPE:this.props.redBrand.shopIntro.shop_template_type,
IS_RED: 1,
}
}
ReactNative.NativeModules.YH_CommonHelper.logEvent('YB_BRAND_SHOP_COLLECT_C', param);
}
_onPressLaunchProfile(value){
... ... @@ -182,7 +162,7 @@ class RedPersonBrandContainer extends Component {
SHOP_ID: this.props.redBrand.shopId,
FLR_INDEX: moduleOrder,
FLR_NAME: moduleType,
I_INDEX: rowId + 1,
I_INDEX: parseInt(rowId) + 1,
F_URL: url,
TEMPLATE_TYPE:this.props.redBrand.shopIntro.shop_template_type,
IS_RED: 1,
... ... @@ -210,7 +190,7 @@ class RedPersonBrandContainer extends Component {
SHOP_ID: this.props.redBrand.shopId,
TAB_ID: tabID,
TAB_NAME: tabName,
PRD_ID: productSkn,
PRD_SKN: productSkn,
TEMPLATE_TYPE: this.props.redBrand.shopIntro.shop_template_type,
IS_RED: 1,
SORT_TYPE: 1,
... ...
... ... @@ -583,7 +583,7 @@ export function getIntro() {
return new RedBrandService(app.host).getIntro(shopId)
.then(json => {
dispatch(getIntroSuccess(json));
ReactNative.NativeModules.YH_CommonHelper.logEvent('YB_BRAND_SHOP_L', {SHOP_ID: redBrand.shopId, TEMPLATE:json.shop_template_type, IS_RED: 1});
ReactNative.NativeModules.YH_CommonHelper.logEvent('YB_BRAND_SHOP_L', {SHOP_ID: redBrand.shopId, TEMPLATE_TYPE:json.shop_template_type, IS_RED: 1});
})
.catch(error => {
dispatch(getIntroFailure(error));
... ... @@ -1017,6 +1017,13 @@ export function addFavorite() {
dispatch(addFavoriteSuccess(true));
return new RedBrandService(app.host).addFavorite(shopId, favId, uid)
.then(json => {
let param = {
SHOP_ID: this.props.redBrand.shopId,
COL_TYPE: 1,
TEMPLATE_TYPE:this.props.redBrand.shopIntro.shop_template_type,
IS_RED: 1,
}
ReactNative.NativeModules.YH_CommonHelper.logEvent('YB_BRAND_SHOP_COLLECT_C', param);
})
.catch(error => {
dispatch(addFavoriteFailure(error));
... ... @@ -1050,6 +1057,13 @@ export function cancelFavorite() {
.then(uid => {
return new RedBrandService(app.host).cancelFavorite(shopId, shopId, uid)
.then(json => {
let param = {
SHOP_ID: this.props.redBrand.shopId,
COL_TYPE: 2,
TEMPLATE_TYPE:this.props.redBrand.shopIntro.shop_template_type,
IS_RED: 1,
}
ReactNative.NativeModules.YH_CommonHelper.logEvent('YB_BRAND_SHOP_COLLECT_C', param);
})
.catch(error => {
dispatch(cancelFavoriteFailure(error));
... ...