AssistCheck.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. import React from 'react';
  2. import {
  3. connect
  4. } from 'react-redux';
  5. import AssistCheck from '@components/AssistCheck';
  6. import { assistLable,delAssistLabel,changeAssistVal,changeDate } from '@store/actions/assistCheck';
  7. import { getSearchList,getInstroduce } from '@store/async-actions/assistCheck';
  8. import {ISREAD} from '@store/types/homePage.js';
  9. import {billing} from '@store/async-actions/pushMessage';
  10. function mapStateToProps(state) {console.log(state)
  11. return {
  12. list:state.assistCheck.list,
  13. assistLabel:state.assistCheck.assistLabel,
  14. isRead:state.homePage.isRead,
  15. winWidth:state.homePage.windowWidth,
  16. assistList:state.homePage.assistList,
  17. }
  18. }
  19. function mapDispatchToProps(dispatch, store) {
  20. return {
  21. getInfomation(id,name){
  22. dispatch(getInstroduce(id,name))
  23. },
  24. handleChangeValue(val) {
  25. dispatch(getSearchList(val))
  26. },
  27. handleSign(id,idx,type){
  28. dispatch(assistLable(id,idx,type))
  29. },
  30. handleDelAssist(idx){
  31. dispatch(delAssistLabel(idx))
  32. dispatch({
  33. type:ISREAD
  34. })
  35. },
  36. handleChangeAssistValue(val,idx){
  37. dispatch(changeAssistVal(val,idx))
  38. },
  39. handleChangeDate(info,idx){
  40. let date = info.year+'-'+(info.month<10?'0'+info.month:info.month)+'-'+(info.day<10?'0'+info.day:info.day);
  41. dispatch(changeDate(date,idx))
  42. },
  43. //右侧推送
  44. fetchPushInfos(){
  45. //调右侧推送
  46. dispatch(billing());
  47. }
  48. }
  49. }
  50. const AssistCheckAction = connect(mapStateToProps, mapDispatchToProps)(AssistCheck);
  51. export default AssistCheckAction;