Authored by 陈林

Merge branch 'V6.8.7' into 'master'

V6.8.7



See merge request !28
... ... @@ -10,7 +10,7 @@ import TabStatistics from '../components/TabStatistics';
import Statistics from "./Statistics";
import ReactNative from "react-native";
import { TipsAlertItem, TipsAlert } from '../../common/components/YH_TipsAlert';
import Prompt from '../../common/components/Prompt';
const tabTitles = ['昨日', '本月', '上月'];
... ... @@ -43,7 +43,8 @@ export default class Data extends Component {
isShowHelp,
isShowSure,
isShowWithdrawal,
statisticsInfo
statisticsInfo,
tipMessage
} = this.props;
let bindStatus = this.props.settlementInfo.settlementInfoData.hasBankCard;
let scrollEnabled = height < 667;
... ... @@ -138,6 +139,15 @@ export default class Data extends Component {
</ScrollableTabView>
<View style={{height: 10, backgroundColor: '#f0f0f0'}}/>
{tipMessage != '' ?
<Prompt
text={tipMessage}
duration={800}
onPromptHidden={this.props.onHiddenTipMessage}
/>
: null
}
</ScrollView>
);
}
... ...
... ... @@ -157,4 +157,7 @@ export default keyMirror({
SHARETOTAL_REQUEST: null,
SHARETOTAL_SUCCESS: null,
SHARETOTAL_FAILURE: null,
SHOW_TIP_MESSAGE: null,
HIDDEN_TIP_MESSAGE: null,
});
... ...
... ... @@ -54,6 +54,7 @@ class DataContainer extends Component {
this._jumpWithUrl = this._jumpWithUrl.bind(this);
this._resourceJumpWithUrl = this._resourceJumpWithUrl.bind(this);
this._refreshSettlementInfo = this._refreshSettlementInfo.bind(this);
this._onHiddenTipMessage = this._onHiddenTipMessage.bind(this);
}
... ... @@ -106,6 +107,10 @@ class DataContainer extends Component {
this.props.actions.getSettlementInfo();
}
_onHiddenTipMessage() {
this.props.actions.hiddenTipMessage();
}
_changeTab(type){
this.props.actions.getStatisticsInfo(type);
}
... ... @@ -137,6 +142,7 @@ class DataContainer extends Component {
addSettlement,
statisticsInfo,
shareTotalInfo,
tipMessage,
} = this.props.alliance;
let tip = this.state.tips;
let isFetching = settlementInfo.isFetching;
... ... @@ -164,6 +170,8 @@ class DataContainer extends Component {
jumpWithUrl={this._jumpWithUrl}
refreshSettlementInfo={this._refreshSettlementInfo}
resourceJumpWithUrl={this._resourceJumpWithUrl}
tipMessage={tipMessage}
onHiddenTipMessage={this._onHiddenTipMessage}
/>
<LoadingIndicator isVisible={isFetching}/>
</View>
... ...
... ... @@ -22,6 +22,9 @@ const {
SHOW_BANK_INFO_DIALOG,
DISMISS_BANK_INFO_DIALOG,
SHOW_TIP_MESSAGE,
HIDDEN_TIP_MESSAGE,
SET_ORDER_CODE,
SET_ACTIVITY_ID,
SET_SRC,
... ... @@ -169,6 +172,19 @@ export function hiddenBankInfoDialog() {
}
}
export function showTipMessage(message) {
return {
type: SHOW_TIP_MESSAGE,
payload: message
}
}
export function hiddenTipMessage() {
return {
type:HIDDEN_TIP_MESSAGE,
}
}
export function setOrderCode(orderCode) {
return {
type: SET_ORDER_CODE,
... ... @@ -636,6 +652,7 @@ export function getAddSettlement() {
})
.catch(error => {
dispatch(addSettlementFailure(error));
dispatch(showTipMessage(error.message));
});
};
... ...
... ... @@ -12,6 +12,7 @@ let InitialState = Record({
showTipsAlert: false,
showWithdrawalDialog: false,
showBankInfoDialog: false,
tipMessage: '',
settlementInfo: new (Record({
isFetching: false,
... ...
... ... @@ -19,6 +19,9 @@ const {
SHOW_BANK_INFO_DIALOG,
DISMISS_BANK_INFO_DIALOG,
SHOW_TIP_MESSAGE,
HIDDEN_TIP_MESSAGE,
SET_ORDER_CODE,
SET_ACTIVITY_ID,
SET_SRC,
... ... @@ -601,7 +604,14 @@ export default function couponReducer(state = initialState, action) {
.setIn(['shareTotalInfo', 'error'], action.payload);
}
case SHOW_TIP_MESSAGE: {
return state.set('tipMessage', Immutable.fromJS(action.payload));
}
case HIDDEN_TIP_MESSAGE: {
return state.set('tipMessage', '');
}
}
return state;
}
... ...
... ... @@ -16,6 +16,7 @@ import {Immutable, Map} from 'immutable';
import ReceiveGiftAlert from './ReceiveGiftAlert';
import ProductListCell from '../../common/components/ListCell/ProductListCell';
import CouponsBagListCell from "./CouponsBagListCell";
import Prompt from '../../common/components/Prompt';
export default class AssociatorGift extends Component {
constructor(props) {
... ... @@ -101,7 +102,8 @@ export default class AssociatorGift extends Component {
showGiftAlert,
couponsBag,
productList,
drawCouponsBag
drawCouponsBag,
bagTipMessage
} = this.props;
let dataSource = {
... ... @@ -131,6 +133,15 @@ export default class AssociatorGift extends Component {
renderRow={this._renderRow}
renderHeader={this._renderHeader}
/>
{bagTipMessage != '' ?
<Prompt
text={bagTipMessage}
duration={800}
onPromptHidden={this.props.onHiddenBagTipMessage}
/>
: null
}
</View>
);
}
... ...
... ... @@ -25,9 +25,9 @@ export default class CouponsBagListCell extends React.Component {
let nameStyle = data.get('notExpired') ? {color: '#222222'} : {color: '#B0B0B0'};
let bgStyle = data.get('status') === 0 && data.get('notExpired') ? {backgroundColor: '#A69073'} : {backgroundColor: '#B0B0B0'};
let textStyle = data.get('status') === 0 && data.get('notExpired') ? {fontFamily: 'PingFang-SC-Bold'} : {fontFamily: 'PingFang-SC-Medium'};
//"status": 是否已领取 未领取:0,已领取:1;
//"status": 是否已领取 未领取:0,已领取:1,已作废:2
//"notExpired": 未过期:true,过期:false;
let text = data.get('status') === 1 ? '已领取' : data.get('notExpired') ? '领取' : '已失效';
let text = data.get('status') === 2 ? '已作废' : data.get('status') === 1 ? '已领取' : data.get('notExpired') ? '领取' : '已失效';
return (
<View style={styles.container}>
<View style={styles.contentContainer}>
... ...
... ... @@ -24,4 +24,7 @@ export default keyMirror({
COUPONS_BAG_CNT_SUCCESS: null,
COUPONS_BAG_CNT_FAILURE: null,
SHOW_BAG_TIP_MESSAGE: null,
HIDDEN_BAG_TIP_MESSAGE: null,
});
... ...
... ... @@ -48,6 +48,7 @@ class AssociatorGiftContainer extends Component {
this._onPressShopCar = this._onPressShopCar.bind(this);
this._onPressCouponItem = this._onPressCouponItem.bind(this);
this._onPressLookDetail = this._onPressLookDetail.bind(this);
this._onHiddenBagTipMessage = this._onHiddenBagTipMessage.bind(this);
}
componentDidMount() {
... ... @@ -72,6 +73,10 @@ class AssociatorGiftContainer extends Component {
this.props.actions.hiddenGiftAlert();
}
_onHiddenBagTipMessage(){
this.props.actions.hiddenBagTipMessage();
}
_onPressCouponItem(data){
let url = `http://m.yohobuy.com?openby:yohobuy={"action":"go.couponProductList",
"params":{"coupon_id":"${data.get("id")}","coupon_code":"${data.get("couponCode")}"}, "coupon_title":"${data.get("couponName")}"}`;
... ... @@ -134,7 +139,8 @@ class AssociatorGiftContainer extends Component {
couponsBagCnt,
couponsBag,
productList,
drawCouponsBag
drawCouponsBag,
bagTipMessage
} = this.props.associatorGift;
return (
<AssociatorGift
... ... @@ -150,6 +156,8 @@ class AssociatorGiftContainer extends Component {
onPressShopCar={this._onPressShopCar}
onPressCouponItem={this._onPressCouponItem}
onPressLookDetail={this._onPressLookDetail}
bagTipMessage={bagTipMessage}
onHiddenBagTipMessage={this._onHiddenBagTipMessage}
/>
);
}
... ...
... ... @@ -24,6 +24,9 @@ const {
COUPONS_BAG_CNT_SUCCESS,
COUPONS_BAG_CNT_FAILURE,
SHOW_BAG_TIP_MESSAGE,
HIDDEN_BAG_TIP_MESSAGE,
} = require('../../constants/actionTypes').default;
export function displayGiftAlert() {
... ... @@ -118,6 +121,19 @@ export function couponsBagCntFailure(error) {
};
}
export function showBagTipMessage(message) {
return {
type: SHOW_BAG_TIP_MESSAGE,
payload: message
}
}
export function hiddenBagTipMessage() {
return {
type:HIDDEN_BAG_TIP_MESSAGE,
}
}
export function getCouponsBagList() {
return (dispatch, getState) => {
let {app} = getState();
... ... @@ -179,6 +195,7 @@ export function getDrawCouponsBag(couponsBagId) {
})
.catch(error => {
dispatch(drawCouponsBagFailure(error));
dispatch(showBagTipMessage(error.message));
});
};
... ...
... ... @@ -4,6 +4,7 @@ import {Record, List, Map} from 'immutable';
let InitialState = Record({
showGiftAlert: false,
bagTipMessage: '',
couponsBagCnt: new (Record({
isFetching: false,
... ...
... ... @@ -23,6 +23,9 @@ const {
COUPONS_BAG_CNT_SUCCESS,
COUPONS_BAG_CNT_FAILURE,
SHOW_BAG_TIP_MESSAGE,
HIDDEN_BAG_TIP_MESSAGE,
} = require('../../constants/actionTypes').default;
const initialState = new InitialState;
... ... @@ -111,6 +114,15 @@ export default function couponReducer(state = initialState, action) {
return state.setIn(['couponsBagCnt', 'isFetching'], false)
.setIn(['couponsBagCnt', 'error'], action.payload);
}
case SHOW_BAG_TIP_MESSAGE: {
return state.set('bagTipMessage', Immutable.fromJS(action.payload));
}
case HIDDEN_BAG_TIP_MESSAGE: {
return state.set('bagTipMessage', '');
}
}
return state;
... ...
... ... @@ -44,20 +44,22 @@ export default class GroupPurchaseDetail extends Component {
switch(sectionID) {
case 'productResourceInfo': {
// if(!rowData || !rowData.get('data')){
// return null;
// }
// let infoData = rowData.get('data');
// let info = infoData?infoData.toJS():'';
// let item = info[0];
// let src = YH_Image.getSlicedUrl(item.src, width, 70, 2);
let src = 'http://img13.static.yhbimg.com/article/2019/02/28/14/02b72ac74385bdefd089ffa860d29d0862.jpeg';
let data = rowData ? rowData.toJS() : null;
if(data.template_name == "single_image"){
if(!data.data || !data.data[0]){
return null;
}
let resourceData = data.data[0];
let src = YH_Image.getSlicedUrl(resourceData.src, width, 70*DEVICE_WIDTH_RATIO, 2);
let url = resourceData.url;
return(
<View style={{width:width, height:70*DEVICE_WIDTH_RATIO+8, backgroundColor:'#f0f0f0'}}>
<View style={{width:width, height:70*DEVICE_WIDTH_RATIO}}>
<TouchableOpacity activeOpacity={1} onPress={() => {
// this.props.didTouchBanner && this.props.didTouchBanner(item.url);
this.props.didTouchBanner && this.props.didTouchBanner(url);
}}>
<YH_Image style={{width: '100%', height: '100%'}} url={src}></YH_Image>
</TouchableOpacity>
... ... @@ -65,6 +67,8 @@ export default class GroupPurchaseDetail extends Component {
</View>
);
}
return null;
}
case 'productListTitle': {
return(
... ... @@ -92,7 +96,7 @@ export default class GroupPurchaseDetail extends Component {
resource,
} = this.props;
let dataSource = {
productResourceInfo: [1],
productResourceInfo: resource.resourceList ? resource.resourceList.toArray() : [],
productListTitle: [2],
productList: productList.list ? productList.list.toArray() : [],
};
... ...
... ... @@ -63,7 +63,7 @@ class GroupPurchaseDetailContainer extends Component {
async componentDidMount() {
this.props.actions.getProductList();
this.props.actions.fetchActivityGroupDetail(this.props.FP_NAME, this.props.FP_PARAM);
// this.props.actions.fetchResourceInfo();
this.props.actions.fetchResourceInfo();
}
componentWillUnmount() {
... ...
... ... @@ -198,7 +198,7 @@ export function fetchResourceInfo() {
return (dispatch, getState) => {
let {app} = getState();
dispatch(resourceInfoRequest());
let content_code = 'cea0efae77f4e04c935beb1e87181247';
let content_code = '3c3a94fd6c6e19508b6921acd7f6cbad';
return new GroupPurchaseService(app.host).fetchDetailResourceInfo(content_code)
.then(json => {
dispatch(resourceInfoSuccess(json));
... ...