Authored by lixia.zhang

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

@@ -32,6 +32,7 @@ import UserLogoutFaildReasonContainer from './containers/UserLogoutFaildReasonCo @@ -32,6 +32,7 @@ import UserLogoutFaildReasonContainer from './containers/UserLogoutFaildReasonCo
32 import UserLogoutStatusContainer from './containers/UserLogoutStatusContainer'; 32 import UserLogoutStatusContainer from './containers/UserLogoutStatusContainer';
33 33
34 import {setPlatform, setHost, setChannel, setServiceHost} from './reducers/app/appActions'; 34 import {setPlatform, setHost, setChannel, setServiceHost} from './reducers/app/appActions';
  35 +import {processCancelFaildDesc} from './reducers/userLogout/userLogoutActions';
35 36
36 function getInitialState() { 37 function getInitialState() {
37 const _initState = { 38 const _initState = {
@@ -48,11 +49,13 @@ export default function native(platform) { @@ -48,11 +49,13 @@ export default function native(platform) {
48 49
49 render() { 50 render() {
50 let type = this.props.type; 51 let type = this.props.type;
  52 + let cancleFialdDesc = this.props.cancleFialdDesc;
51 const store = configureStore(getInitialState()); 53 const store = configureStore(getInitialState());
52 store.dispatch(setPlatform(platform)); 54 store.dispatch(setPlatform(platform));
53 store.dispatch(setHost(this.props.host)); 55 store.dispatch(setHost(this.props.host));
54 store.dispatch(setChannel(this.props.channelId)); 56 store.dispatch(setChannel(this.props.channelId));
55 store.dispatch(setServiceHost(this.props.serviceHost)); 57 store.dispatch(setServiceHost(this.props.serviceHost));
  58 + store.dispatch(processCancelFaildDesc(cancleFialdDesc));
56 if (type == 'userLogoutClause') { 59 if (type == 'userLogoutClause') {
57 return ( 60 return (
58 <Provider store={store}> 61 <Provider store={store}>
@@ -15,7 +15,6 @@ import ReactNative, { @@ -15,7 +15,6 @@ import ReactNative, {
15 TouchableOpacity 15 TouchableOpacity
16 } from 'react-native'; 16 } from 'react-native';
17 17
18 -  
19 export default class UserLogoutFaild extends Component { 18 export default class UserLogoutFaild extends Component {
20 19
21 constructor(props) { 20 constructor(props) {
@@ -57,9 +56,12 @@ export default class UserLogoutFaild extends Component { @@ -57,9 +56,12 @@ export default class UserLogoutFaild extends Component {
57 : 56 :
58 <View style={styles.textReasonContainer}> 57 <View style={styles.textReasonContainer}>
59 <View> 58 <View>
60 - <Text style={styles.reasonText}>1.您的账户内未使用完的有货币数量大于200</Text>  
61 - <Text style={styles.reasonText}>2.您的账户内有未使用完的礼品卡</Text>  
62 - <Text style={styles.reasonText}>3.30天内有过订单</Text> 59 +
  60 + {
  61 + this.props.cancleFialdDesc && this.props.cancleFialdDesc.map((item, i) => {
  62 + return <Text style={styles.reasonText}>{i+1}.{item}</Text>
  63 + })
  64 + }
63 </View> 65 </View>
64 <View style={{flexDirection:'row', marginTop:30}}> 66 <View style={{flexDirection:'row', marginTop:30}}>
65 <Text style={styles.reasonBottomText}>如有疑问请联系</Text> 67 <Text style={styles.reasonBottomText}>如有疑问请联系</Text>
@@ -15,6 +15,7 @@ export default keyMirror({ @@ -15,6 +15,7 @@ export default keyMirror({
15 FETCH_LOGOUT_STATUS_REQUEST: null, 15 FETCH_LOGOUT_STATUS_REQUEST: null,
16 FETCH_LOGOUT_STATUS_SUCCESS: null, 16 FETCH_LOGOUT_STATUS_SUCCESS: null,
17 FETCH_LOGOUT_STATUS_FAILURE: null, 17 FETCH_LOGOUT_STATUS_FAILURE: null,
  18 + SET_CANCEL_FAILD_DESC: null,
18 19
19 20
20 //注销原因 21 //注销原因
@@ -61,10 +61,13 @@ class UserLogoutFaildReasonContainer extends Component { @@ -61,10 +61,13 @@ class UserLogoutFaildReasonContainer extends Component {
61 61
62 62
63 render() { 63 render() {
  64 + let {cancleFialdDesc} = this.props.userLogout;
  65 + cancleFialdDesc = cancleFialdDesc.toJS();
64 return ( 66 return (
65 <UserLogoutFaild 67 <UserLogoutFaild
66 isFaildReasonPage={true} 68 isFaildReasonPage={true}
67 gotoOnlineService={this._gotoOnlineService} 69 gotoOnlineService={this._gotoOnlineService}
  70 + cancleFialdDesc={cancleFialdDesc}
68 /> 71 />
69 ); 72 );
70 } 73 }
@@ -18,6 +18,7 @@ const { @@ -18,6 +18,7 @@ const {
18 FETCH_LOGOUT_STATUS_REQUEST, 18 FETCH_LOGOUT_STATUS_REQUEST,
19 FETCH_LOGOUT_STATUS_SUCCESS, 19 FETCH_LOGOUT_STATUS_SUCCESS,
20 FETCH_LOGOUT_STATUS_FAILURE, 20 FETCH_LOGOUT_STATUS_FAILURE,
  21 + SET_CANCEL_FAILD_DESC
21 } = require('../../constants/actionTypes').default; 22 } = require('../../constants/actionTypes').default;
22 23
23 export function onPressLogoutClause() { 24 export function onPressLogoutClause() {
@@ -53,6 +54,12 @@ export function fetchLogoutStatusFailure(message) { @@ -53,6 +54,12 @@ export function fetchLogoutStatusFailure(message) {
53 payload: message 54 payload: message
54 } 55 }
55 } 56 }
  57 +export function setCancelFaildDesc(json) {
  58 + return{
  59 + type: SET_CANCEL_FAILD_DESC,
  60 + payload: json
  61 + }
  62 +}
56 63
57 export function confirmLogoutAction() { 64 export function confirmLogoutAction() {
58 return (dispatch, getState) => { 65 return (dispatch, getState) => {
@@ -69,7 +76,6 @@ export function checkUserLogedIn() { @@ -69,7 +76,6 @@ export function checkUserLogedIn() {
69 let fetchLogoutState = (uid) => { 76 let fetchLogoutState = (uid) => {
70 return new UserLogoutService(app.host).fetchLogoutState(uid) 77 return new UserLogoutService(app.host).fetchLogoutState(uid)
71 .then(json => { 78 .then(json => {
72 - json.desc = ["查询最近一年内订单超时","查询最近一年内订单超时","查询最近一年内订单超时"]  
73 dispatch(fetchLogoutStatusSuccess({state:json.status, descList:json.desc})); 79 dispatch(fetchLogoutStatusSuccess({state:json.status, descList:json.desc}));
74 }) 80 })
75 .catch(error => { 81 .catch(error => {
@@ -91,13 +97,19 @@ export function checkUserLogedIn() { @@ -91,13 +97,19 @@ export function checkUserLogedIn() {
91 }); 97 });
92 } 98 }
93 } 99 }
  100 +export function processCancelFaildDesc(desc) {
  101 + return (dispatch, getState) => {
  102 + var array = desc.split(',');
  103 + dispatch(setCancelFaildDesc(array));
  104 + }
  105 +}
94 106
95 //注销失败 107 //注销失败
96 export function gotoLogoutFaildReason() { 108 export function gotoLogoutFaildReason() {
97 return (dispatch, getState) => { 109 return (dispatch, getState) => {
98 let {userLogout} = getState(); 110 let {userLogout} = getState();
99 let {cancleFialdDesc} = userLogout; 111 let {cancleFialdDesc} = userLogout;
100 - let url = `http://m.yohobuy.com?openby:yohobuy={"action":"go.userLogout","params":{"title":"注销失败","type":"userLogoutFaildReason","cancleFialdDesc":`+ JSON.stringify(cancleFialdDesc.toJS()) +`}}`; 112 + let url = `http://m.yohobuy.com?openby:yohobuy={"action":"go.userLogout","params":{"title":"注销失败","type":"userLogoutFaildReason","cancleFialdDesc":"`+ cancleFialdDesc.toJS().join() +`"}}`;
101 ReactNative.NativeModules.YH_CommonHelper.jumpWithUrl(url); 113 ReactNative.NativeModules.YH_CommonHelper.jumpWithUrl(url);
102 } 114 }
103 } 115 }
@@ -14,6 +14,7 @@ const { @@ -14,6 +14,7 @@ const {
14 FETCH_LOGOUT_STATUS_REQUEST, 14 FETCH_LOGOUT_STATUS_REQUEST,
15 FETCH_LOGOUT_STATUS_SUCCESS, 15 FETCH_LOGOUT_STATUS_SUCCESS,
16 FETCH_LOGOUT_STATUS_FAILURE, 16 FETCH_LOGOUT_STATUS_FAILURE,
  17 + SET_CANCEL_FAILD_DESC
17 } = require('../../constants/actionTypes').default; 18 } = require('../../constants/actionTypes').default;
18 19
19 const initialState = new InitialState; 20 const initialState = new InitialState;
@@ -35,6 +36,9 @@ export default function userLogoutReducer(state=initialState, action) { @@ -35,6 +36,9 @@ export default function userLogoutReducer(state=initialState, action) {
35 return state.set('isFetching', false) 36 return state.set('isFetching', false)
36 .set('tipMessage', action.payload); 37 .set('tipMessage', action.payload);
37 } 38 }
  39 + case SET_CANCEL_FAILD_DESC:{
  40 + return state.set('cancleFialdDesc', Immutable.fromJS(action.payload))
  41 + }
38 42
39 } 43 }
40 return state; 44 return state;