/* eslint-disable */ import React from 'react'; import 'antd-mobile/dist/antd-mobile.css'; import { Icon, NavBar, TabBar, Modal } from 'antd-mobile'; import { routerRedux } from 'dva/router'; import { connect } from 'dva'; import styles from './IndexMobile.less'; import SceneSrmMobile from './common/SceneSrmMobile'; import MessageMobile from './common/MessageMobile'; import ContactsMobile from './common/ContactsMobile'; import WorkBenchMobile from './common/WorkBenchMobile'; import CommobileList from './commobileList/commobileList'; import ProcessReportMobile from './common/ProcessReportMobile'; import MyselfMobile from './common/MyselfMobile'; import ContactsInfoMobile from './common/ContactsInfoMobile'; import RevisePasswordMobile from './common/RevisePasswordMobile'; import CommobileBill from './common/commobileBill'; import CommobilePrintPdf from './common/commobilePrintPdf'; import Icon1 from '../../assets/mobile/1.png'; import Icon11 from '../../assets/mobile/11.png'; import Icon2 from '../../assets/mobile/2.png'; import Icon21 from '../../assets/mobile/21.png'; import Icon3 from '../../assets/mobile/3.png'; import Icon31 from '../../assets/mobile/31.png'; import Icon4 from '../../assets/mobile/4.png'; import Icon41 from '../../assets/mobile/41.png'; import Icon5 from '../../assets/mobile/5.png'; import Icon51 from '../../assets/mobile/51.png'; // import AppUtil from '../../utils/AppUtil'; import * as commonBusiness from '../../components/Common/commonBusiness'; // eslint-disable-next-line prefer-destructuring const alert = Modal.alert; class indexSrmMobile extends React.Component { constructor(props) { super(props); this.state = { selectedTab: 'scene', title: '现场', hidden: false, fullScreen: true, touchStartPageX: 0, // 滑动开始的Y坐标 touchStartPageY: 0, }; } componentWillMount() { this.props.dispatch(routerRedux.push('/indexSrmMobile')); // 刷新时更新路由,避免底部按钮和返回按钮错乱显示 if (this.props.routing && this.props.routing) { const { state } = this.props.routing; if (state) { const { sId } = state; if (sId === 'myself') { this.setState({ selectedTab: 'myself' }); // this.renderContent('contacts'); } } } // AppUtil.addDrag(); } handleTouchStart = (e) => { this.setState({ touchStartPageX: e.changedTouches[0].pageX, touchStartPageY: e.changedTouches[0].pageY, }); } handleTouchEnd = (e) => { const touchEndtPageX = e.changedTouches[0].pageX; const touchEndtPageY = e.changedTouches[0].pageY; const touchDireactionX = touchEndtPageX - this.state.touchStartPageX; // 滑动横向坐标 const touchDireactionY = touchEndtPageY - this.state.touchStartPageY; // 滑动横向坐标 if (touchDireactionX > 100 && touchDireactionY > -80) { // 滑动一定距离 const { plus } = window; if (location.pathname === '/indexSrmMobile') { alert('确定退出吗?', '', [ { text: '取消', onPress: () => {} }, { text: '是', onPress: () => plus.runtime.quit() }, // 关闭app ]); } else { window.history.back(-1); } } } renderContent(pageText) { if (pageText === 'message') { return (