Commit de226a5981cbff207a7afcdf8b9f8957fc82352d
1 parent
b733e5d2
移动端
Showing
3 changed files
with
16 additions
and
6 deletions
src/mobile/common/CommobileBill.js
| 1 | 1 | /* eslint-disable */ |
| 2 | 2 | import React from 'react'; |
| 3 | 3 | import weixin from 'weixin-js-sdk'; |
| 4 | -import { Flex, Button, ListView, Toast } from 'antd-mobile-v2'; | |
| 4 | +import { Flex, Button, ListView, Toast } from 'antd-mobile'; | |
| 5 | 5 | import { createForm } from 'rc-form'; |
| 6 | -import 'antd-mobile-v2/dist/antd-mobile.css'; | |
| 6 | +import 'antd-mobile/dist/antd-mobile.css'; | |
| 7 | 7 | import CommobileBase from './CommobileBase'; |
| 8 | 8 | import CommobileBillEvent from './CommobileBillEvent'; |
| 9 | 9 | import CommobileViewMaster from './CommobileViewMaster'; |
| 10 | -import commonConfig from '../../utils/config'; | |
| 10 | +import * as commonConfig from '../../utils/config'; | |
| 11 | 11 | import * as commonUtils from '../../utils/utils'; |
| 12 | 12 | import ShowType from './CommobileComponent'; |
| 13 | 13 | import CommobileToolBar from './CommobileToolBar'; | ... | ... |
src/routes/mobile/IndexMobile.js
| ... | ... | @@ -2,7 +2,7 @@ import React from "react"; |
| 2 | 2 | import "antd-mobile-v2/dist/antd-mobile.css"; |
| 3 | 3 | import { Icon, NavBar, TabBar, Modal } from "antd-mobile-v2"; |
| 4 | 4 | // import { routerRedux } from 'dva/router'; |
| 5 | -import { connect, history } from "umi"; | |
| 5 | +import { connect, history, useLocation } from "umi"; | |
| 6 | 6 | |
| 7 | 7 | import * as commonUtils from "@/utils/utils"; |
| 8 | 8 | import styles from "./IndexMobile.less"; |
| ... | ... | @@ -36,6 +36,7 @@ const alert = Modal.alert; |
| 36 | 36 | class IndexMobile extends React.Component { |
| 37 | 37 | constructor(props) { |
| 38 | 38 | super(props); |
| 39 | + | |
| 39 | 40 | this.state = { |
| 40 | 41 | selectedTab: "scene", |
| 41 | 42 | title: "现场", |
| ... | ... | @@ -47,6 +48,8 @@ class IndexMobile extends React.Component { |
| 47 | 48 | } |
| 48 | 49 | componentWillMount() { |
| 49 | 50 | history.push("/indexMobile"); // 刷新时更新路由,避免底部按钮和返回按钮错乱显示 |
| 51 | + console.log("🚀 ~ IndexMobile ~ componentWillMount ~ this.props:", this.props) | |
| 52 | + | |
| 50 | 53 | if (this.props.routing && this.props.routing) { |
| 51 | 54 | const { state } = this.props.routing; |
| 52 | 55 | if (state) { |
| ... | ... | @@ -103,6 +106,9 @@ class IndexMobile extends React.Component { |
| 103 | 106 | ]); |
| 104 | 107 | } else { |
| 105 | 108 | window.history.back(-1); |
| 109 | + setTimeout(() => { | |
| 110 | + this.props.dispatch({ type: "app/refreshPage" }); | |
| 111 | + }, 100); | |
| 106 | 112 | } |
| 107 | 113 | } |
| 108 | 114 | }; |
| ... | ... | @@ -221,6 +227,10 @@ class IndexMobile extends React.Component { |
| 221 | 227 | onLeftClick={() => { |
| 222 | 228 | if (TabBarHidden && navbarIconShow) { |
| 223 | 229 | window.history.back(-1); |
| 230 | + setTimeout(() => { | |
| 231 | + this.props.dispatch({ type: "app/refreshPage" }); | |
| 232 | + // history.push(location.pathname); | |
| 233 | + }, 100); | |
| 224 | 234 | } |
| 225 | 235 | }} |
| 226 | 236 | className={styles.iconColor} |
| ... | ... | @@ -404,4 +414,4 @@ class IndexMobile extends React.Component { |
| 404 | 414 | ); |
| 405 | 415 | } |
| 406 | 416 | } |
| 407 | -export default connect(({ app, routing }) => ({ app, routing }))(IndexMobile); | |
| 417 | +export default connect(({ app, routing }) => ({ app, routing, ...history }))(IndexMobile); | ... | ... |
src/routes/mobile/common/commobileBill.js
| ... | ... | @@ -4,7 +4,7 @@ |
| 4 | 4 | */ |
| 5 | 5 | |
| 6 | 6 | import React from 'react'; |
| 7 | -import { connect } from 'dva'; | |
| 7 | +import { connect } from 'umi'; | |
| 8 | 8 | // import CommobileBillComponent from '../../../mobile/common/CommobileTabBill'; |
| 9 | 9 | import CommobileBillComponent from '../../../mobile/common/CommobileSubBill'; |
| 10 | 10 | import * as commonUtils from '../../../utils/utils'; | ... | ... |