Browse Source

获取查体模板时加loading

liucf 6 năm trước cách đây
mục cha
commit
8974e91fcb
2 tập tin đã thay đổi với 4 bổ sung1 xóa
  1. 2 1
      src/containers/CheckBody.js
  2. 2 0
      src/store/async-actions/fetchModules.js

+ 2 - 1
src/containers/CheckBody.js

@@ -1,7 +1,7 @@
 import {connect} from 'react-redux';
 import CheckBody from '@components/CheckBody';
 import {getModule,getInitData} from '@store/async-actions/fetchModules.js';
-import {HIDE,RESET,SETDROPSHOW,ISREAD,SEARCH_DROP_LOCATION} from '@store/types/homePage.js';
+import {HIDE,RESET,SETDROPSHOW,ISREAD,SEARCH_DROP_LOCATION,MODI_LOADING} from '@store/types/homePage.js';
 import {SELECTSEARCHDATA} from "@store/types/checkBody";
 import {billing} from '@store/async-actions/pushMessage';
 import {filterDataArr} from '@utils/tools.js';
@@ -32,6 +32,7 @@ function mapStateToProps(state){
 function mapDispatchToProps(dispatch,state){
   return {
     getInit(){
+      dispatch({type:MODI_LOADING,flag:true});
       dispatch(getInitData());
     },
     fetchModules(param){

+ 2 - 0
src/store/async-actions/fetchModules.js

@@ -10,6 +10,7 @@ import {SETOTHERHISTORY,ISREAD} from "../types/homePage";
 import {SAVE_TABLE_RESULT,SET_CHRONIC_PUSHS} from "../types/pushMessage";
 import config from "@config/index";
 import {CURRENT_CHRONIC} from '@store/types/currentIll';
+import {MODI_LOADING} from '@store/types/homePage.js';
 
 const api={
   getSpreadModule:'/questionInfo/getByIds',
@@ -154,6 +155,7 @@ export function getInitData(){
     };
     json(api.getBigPush,param).then((res)=>{
       if(+res.data.code === 0){
+        dispatch({type:MODI_LOADING,flag:false});
         const data = res.data.data&&res.data.data.vital;
         const str = JSON.stringify(data);
         const arr = fullfillText(JSON.parse(str),false,false,false).newArr;