Authored by lixia.zhang

注销失败原因的传递,review by 戴强

... ... @@ -32,6 +32,7 @@ import UserLogoutFaildReasonContainer from './containers/UserLogoutFaildReasonCo
import UserLogoutStatusContainer from './containers/UserLogoutStatusContainer';
import {setPlatform, setHost, setChannel, setServiceHost} from './reducers/app/appActions';
import {processCancelFaildDesc} from './reducers/userLogout/userLogoutActions';
function getInitialState() {
const _initState = {
... ... @@ -48,11 +49,13 @@ export default function native(platform) {
render() {
let type = this.props.type;
let cancleFialdDesc = this.props.cancleFialdDesc;
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(processCancelFaildDesc(cancleFialdDesc));
if (type == 'userLogoutClause') {
return (
<Provider store={store}>
... ...
... ... @@ -15,7 +15,6 @@ import ReactNative, {
TouchableOpacity
} from 'react-native';
export default class UserLogoutFaild extends Component {
constructor(props) {
... ... @@ -57,9 +56,12 @@ export default class UserLogoutFaild extends Component {
:
<View style={styles.textReasonContainer}>
<View>
<Text style={styles.reasonText}>1.您的账户内未使用完的有货币数量大于200</Text>
<Text style={styles.reasonText}>2.您的账户内有未使用完的礼品卡</Text>
<Text style={styles.reasonText}>3.30天内有过订单</Text>
{
this.props.cancleFialdDesc && this.props.cancleFialdDesc.map((item, i) => {
return <Text style={styles.reasonText}>{i+1}.{item}</Text>
})
}
</View>
<View style={{flexDirection:'row', marginTop:30}}>
<Text style={styles.reasonBottomText}>如有疑问请联系</Text>
... ...
... ... @@ -15,6 +15,7 @@ export default keyMirror({
FETCH_LOGOUT_STATUS_REQUEST: null,
FETCH_LOGOUT_STATUS_SUCCESS: null,
FETCH_LOGOUT_STATUS_FAILURE: null,
SET_CANCEL_FAILD_DESC: null,
//注销原因
... ...
... ... @@ -61,10 +61,13 @@ class UserLogoutFaildReasonContainer extends Component {
render() {
let {cancleFialdDesc} = this.props.userLogout;
cancleFialdDesc = cancleFialdDesc.toJS();
return (
<UserLogoutFaild
isFaildReasonPage={true}
gotoOnlineService={this._gotoOnlineService}
cancleFialdDesc={cancleFialdDesc}
/>
);
}
... ...
... ... @@ -18,6 +18,7 @@ const {
FETCH_LOGOUT_STATUS_REQUEST,
FETCH_LOGOUT_STATUS_SUCCESS,
FETCH_LOGOUT_STATUS_FAILURE,
SET_CANCEL_FAILD_DESC
} = require('../../constants/actionTypes').default;
export function onPressLogoutClause() {
... ... @@ -53,6 +54,12 @@ export function fetchLogoutStatusFailure(message) {
payload: message
}
}
export function setCancelFaildDesc(json) {
return{
type: SET_CANCEL_FAILD_DESC,
payload: json
}
}
export function confirmLogoutAction() {
return (dispatch, getState) => {
... ... @@ -69,7 +76,6 @@ export function checkUserLogedIn() {
let fetchLogoutState = (uid) => {
return new UserLogoutService(app.host).fetchLogoutState(uid)
.then(json => {
json.desc = ["查询最近一年内订单超时","查询最近一年内订单超时","查询最近一年内订单超时"]
dispatch(fetchLogoutStatusSuccess({state:json.status, descList:json.desc}));
})
.catch(error => {
... ... @@ -91,13 +97,19 @@ export function checkUserLogedIn() {
});
}
}
export function processCancelFaildDesc(desc) {
return (dispatch, getState) => {
var array = desc.split(',');
dispatch(setCancelFaildDesc(array));
}
}
//注销失败
export function gotoLogoutFaildReason() {
return (dispatch, getState) => {
let {userLogout} = getState();
let {cancleFialdDesc} = userLogout;
let url = `http://m.yohobuy.com?openby:yohobuy={"action":"go.userLogout","params":{"title":"注销失败","type":"userLogoutFaildReason","cancleFialdDesc":`+ JSON.stringify(cancleFialdDesc.toJS()) +`}}`;
let url = `http://m.yohobuy.com?openby:yohobuy={"action":"go.userLogout","params":{"title":"注销失败","type":"userLogoutFaildReason","cancleFialdDesc":"`+ cancleFialdDesc.toJS().join() +`"}}`;
ReactNative.NativeModules.YH_CommonHelper.jumpWithUrl(url);
}
}
... ...
... ... @@ -14,6 +14,7 @@ const {
FETCH_LOGOUT_STATUS_REQUEST,
FETCH_LOGOUT_STATUS_SUCCESS,
FETCH_LOGOUT_STATUS_FAILURE,
SET_CANCEL_FAILD_DESC
} = require('../../constants/actionTypes').default;
const initialState = new InitialState;
... ... @@ -35,6 +36,9 @@ export default function userLogoutReducer(state=initialState, action) {
return state.set('isFetching', false)
.set('tipMessage', action.payload);
}
case SET_CANCEL_FAILD_DESC:{
return state.set('cancleFialdDesc', Immutable.fromJS(action.payload))
}
}
return state;
... ...