Authored by 盖剑秋

Show anti fraud view controled by server. reviewed by Boss Hai.

... ... @@ -15,7 +15,7 @@ import detailInitialState from './reducers/detail/detailInitialState';
import ListContainer from './containers/ListContainer';
import DetailContainer from './containers/DetailContainer';
import {setPlatform, setHost, setServiceHost, setSingleHost, setChannel} from './reducers/app/appActions';
import {setPlatform, setHost, setServiceHost, setSingleHost, setChannel, setShowAntiFraud} from './reducers/app/appActions';
import {setOrderCode} from './reducers/detail/detailActions';
... ... @@ -41,6 +41,7 @@ export default function native(platform) {
store.dispatch(setServiceHost(this.props.serviceHost));
store.dispatch(setSingleHost(this.props.singleHost));
store.dispatch(setChannel(this.props.channelId));
store.dispatch(setShowAntiFraud(this.props.showAntiFraud));
let type = this.props.type;
if (type == 'list') {
store.dispatch(setShowIndex(this.props.firstShowIndex));
... ...
... ... @@ -189,7 +189,7 @@ export default class Detail extends Component {
}
let dataSource = {
'tip': data
'tip': data && this.props.showAntiFraud
? [1]
: [],
'address': data
... ...
... ... @@ -42,4 +42,5 @@ export default keyMirror({
DELETE_ORDER_SUCCESS: null,
DELETE_ORDER_FAILURE: null,
SET_SHOW_ANTI_FRAUD: null,
});
... ...
... ... @@ -104,7 +104,7 @@ class DetailContainer extends Component {
}
onPressAntiFraudTip() {
ReactNative.NativeModules.YH_OrderHelper.jumpAntiFraudDetailViewController();
}
showDelayDeliveryNotice(noticeString){
... ... @@ -115,6 +115,7 @@ class DetailContainer extends Component {
let {detail, app} = this.props;
return (
<Detail
showAntiFraud={app.showAntiFraud}
resource={detail}
channel={app.channel}
onPressFooterAction={this.onPressFooterAction}
... ...
... ... @@ -10,8 +10,16 @@ const {
SET_SINGLE_HOST,
SET_YOHOOD_TICKET,
SET_YOHOOD_TICKETS,
SET_SHOW_ANTI_FRAUD,
} = require('../../constants/actionTypes').default;
export function setShowAntiFraud(showAntiFraud) {
return {
type: SET_SHOW_ANTI_FRAUD,
payload: showAntiFraud,
}
}
export function setPlatform(platform) {
return {
type: SET_PLATFORM,
... ...
... ... @@ -10,6 +10,7 @@ let InitialState = Record({
singleHost: 'http://single.yoho.cn/favorite',
yohoodTicketSkn:'51335912',
yohoodTicketsSkn: '51335908',
showAntiFraud: true,
});
export default InitialState;
... ...
... ... @@ -10,6 +10,7 @@ const {
SET_SINGLE_HOST,
SET_YOHOOD_TICKETS,
SET_YOHOOD_TICKET,
SET_SHOW_ANTI_FRAUD,
} = require('../../constants/actionTypes').default;
const initialState = new InitialState;
... ... @@ -18,6 +19,8 @@ export default function appReducer(state = initialState, action) {
if (!(state instanceof InitialState)) return initialState.merge(state);
switch (action.type) {
case SET_SHOW_ANTI_FRAUD:
return state.set('showAntiFraud', action.payload);
case SET_PLATFORM:
return state.set('platform', action.payload);
case SET_CHANNEL:
... ...