copyRight.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. import { SHOW_COPY_MODAL, CLOSE_COPY_MODAL, GET_COPY_MESSAGE, SHOW_DISCLAIMER_MODAL, CLOSE_DISCLAIMER_MODAL, GET_DISCLAIMER_MESSAGE, GET_VERSION ,SHOW_LOADING} from "../types/copyRight";
  2. import { showCopyModal, closeCopyModal, getMessage, showDisclatmerModal, closeDisclatmerModal, getDisMessage, getVersion} from "../actions/copyRight";
  3. const initState = {
  4. copyVisible: false,
  5. disVisible: false,
  6. number: "",
  7. date: "",
  8. content: [],
  9. disContent: [],
  10. hasNewVersion: false
  11. };
  12. export default function(state = initState, action) {
  13. const res = Object.assign({},state);
  14. switch (action.type) {
  15. case SHOW_COPY_MODAL:
  16. return showCopyModal(state, action);
  17. case CLOSE_COPY_MODAL:
  18. return closeCopyModal(state, action);
  19. case SHOW_DISCLAIMER_MODAL:
  20. return showDisclatmerModal(state, action);
  21. case CLOSE_DISCLAIMER_MODAL:
  22. return closeDisclatmerModal(state, action);
  23. case GET_COPY_MESSAGE:
  24. return getMessage(state, action);
  25. case GET_DISCLAIMER_MESSAGE:
  26. return getDisMessage(state, action);
  27. case GET_VERSION:
  28. return getVersion(state, action);
  29. case SHOW_LOADING:
  30. res.loading = action.flag;
  31. return res;
  32. default:
  33. return state;
  34. }
  35. }