Commit 69de021bcd6f780cf4c1da384c1f62b7ec7e76ee
1 parent
559b4992
新增手机端
Showing
52 changed files
with
220 additions
and
195 deletions
package.json
| @@ -30,6 +30,7 @@ | @@ -30,6 +30,7 @@ | ||
| 30 | "lodash-decorators": "^6.0.1", | 30 | "lodash-decorators": "^6.0.1", |
| 31 | "moment": "^2.30.1", | 31 | "moment": "^2.30.1", |
| 32 | "numeral": "^2.0.6", | 32 | "numeral": "^2.0.6", |
| 33 | + "rc-form": "2.4.11", | ||
| 33 | "react-dnd": "^14.0.5", | 34 | "react-dnd": "^14.0.5", |
| 34 | "react-dnd-html5-backend": "^14.1.0", | 35 | "react-dnd-html5-backend": "^14.1.0", |
| 35 | "react-draggable": "4.4.5", | 36 | "react-draggable": "4.4.5", |
| @@ -41,7 +42,8 @@ | @@ -41,7 +42,8 @@ | ||
| 41 | "react-resizable": "^3.0.5", | 42 | "react-resizable": "^3.0.5", |
| 42 | "react-sortable-hoc": "^2.0.0", | 43 | "react-sortable-hoc": "^2.0.0", |
| 43 | "react-to-print": "^3.0.5", | 44 | "react-to-print": "^3.0.5", |
| 44 | - "umi": "^4.4.11" | 45 | + "umi": "^4.4.11", |
| 46 | + "weixin-js-sdk": "1.6.0" | ||
| 45 | }, | 47 | }, |
| 46 | "devDependencies": { | 48 | "devDependencies": { |
| 47 | "@types/react": "^18.0.33", | 49 | "@types/react": "^18.0.33", |
src/components/Common/BoxShowImgMaterial/indexNew.js
| @@ -170,7 +170,7 @@ const BoxShowImgMaterial = props => { | @@ -170,7 +170,7 @@ const BoxShowImgMaterial = props => { | ||
| 170 | ).toFixed(2); | 170 | ).toFixed(2); |
| 171 | useEffect( | 171 | useEffect( |
| 172 | () => { | 172 | () => { |
| 173 | - setBoxKey(new Date().getTime()); | 173 | + // setBoxKey(new Date().getTime()); |
| 174 | setTimeout(() => { | 174 | setTimeout(() => { |
| 175 | // if (boxRef.current && textRef.current && textRefs.current && nTextRef.current && nTextRefs.current) | 175 | // if (boxRef.current && textRef.current && textRefs.current && nTextRef.current && nTextRefs.current) |
| 176 | if (boxRef.current && textRef.current && textRefs.current && nTextRef.current && nTextRefs.current) { | 176 | if (boxRef.current && textRef.current && textRefs.current && nTextRef.current && nTextRefs.current) { |
src/components/Common/PrintPdf/PreviewPdf.js
| 1 | /* eslint-disable prefer-destructuring */ | 1 | /* eslint-disable prefer-destructuring */ |
| 2 | /* eslint no-dupe-keys: 0, no-mixed-operators: 0 */ | 2 | /* eslint no-dupe-keys: 0, no-mixed-operators: 0 */ |
| 3 | import React from 'react'; | 3 | import React from 'react'; |
| 4 | -import { InputItem, Icon } from 'antd-mobile'; | 4 | +import { InputItem, Icon } from 'antd-mobile-v2'; |
| 5 | import { Document, Page, pdfjs } from 'react-pdf'; | 5 | import { Document, Page, pdfjs } from 'react-pdf'; |
| 6 | import 'antd-mobile-v2/dist/antd-mobile.css'; | 6 | import 'antd-mobile-v2/dist/antd-mobile.css'; |
| 7 | import pdfstyles from './printpdf.less'; | 7 | import pdfstyles from './printpdf.less'; |
src/components/Common/Typesetting/typesetting.js
| @@ -417,7 +417,7 @@ const Typesetting = props => { | @@ -417,7 +417,7 @@ const Typesetting = props => { | ||
| 417 | useEffect( | 417 | useEffect( |
| 418 | () => { | 418 | () => { |
| 419 | // 计算缩放比例 | 419 | // 计算缩放比例 |
| 420 | - setBoxKey(new Date().getTime()); | 420 | + // setBoxKey(new Date().getTime()); |
| 421 | setTimeout(() => { | 421 | setTimeout(() => { |
| 422 | const scaleX = (clientWidth - 50) / (outerWidth + 110); | 422 | const scaleX = (clientWidth - 50) / (outerWidth + 110); |
| 423 | const scaleY = (clientHeight - 5) / (outerHeight + 90); | 423 | const scaleY = (clientHeight - 5) / (outerHeight + 90); |
| @@ -482,10 +482,11 @@ const Typesetting = props => { | @@ -482,10 +482,11 @@ const Typesetting = props => { | ||
| 482 | if (propsData && L) { | 482 | if (propsData && L) { |
| 483 | const sMaterialsName = slaveData.find(x => x.sTreeNodeName === selectedNode.showName && x.sBoxModel === props.boxModel).sMaterialsName; | 483 | const sMaterialsName = slaveData.find(x => x.sTreeNodeName === selectedNode.showName && x.sBoxModel === props.boxModel).sMaterialsName; |
| 484 | const propsDataLeft = Number(propsData.props.style.left.slice(0, -2)); | 484 | const propsDataLeft = Number(propsData.props.style.left.slice(0, -2)); |
| 485 | + // 长需要找出最大的 | ||
| 485 | const propsDataWidth = Number(propsData.props.style.width.slice(0, -2)); | 486 | const propsDataWidth = Number(propsData.props.style.width.slice(0, -2)); |
| 486 | const propsDataHeight = Number(propsData.props.style.height.slice(0, -2)); | 487 | const propsDataHeight = Number(propsData.props.style.height.slice(0, -2)); |
| 487 | const propsDataTop = Number(propsData.props.style.top.slice(0, -2)); | 488 | const propsDataTop = Number(propsData.props.style.top.slice(0, -2)); |
| 488 | - const newMaterialLength = propsDataLeft + propsDataWidth; // 原纸长 | 489 | + const newMaterialLength = propsDataLeft + innerWidthCombined; // 原纸长 |
| 489 | const newMaterialWidth = propsDataTop + propsDataHeight - dSBLB; | 490 | const newMaterialWidth = propsDataTop + propsDataHeight - dSBLB; |
| 490 | // 计算开数 | 491 | // 计算开数 |
| 491 | const dSinglePQty = variables | 492 | const dSinglePQty = variables |
| @@ -557,12 +558,11 @@ const Typesetting = props => { | @@ -557,12 +558,11 @@ const Typesetting = props => { | ||
| 557 | }, 0); // 使用 0 延迟,将任务放入事件队列 | 558 | }, 0); // 使用 0 延迟,将任务放入事件队列 |
| 558 | } | 559 | } |
| 559 | const isMax = slaveDataDetail?.dMaxLength && Number(slaveDataDetail?.dMaxLength) >= Number(slaveRowData?.dMachineLength); | 560 | const isMax = slaveDataDetail?.dMaxLength && Number(slaveDataDetail?.dMaxLength) >= Number(slaveRowData?.dMachineLength); |
| 560 | - console.log("🚀 ~ isMax:", isMax,slaveDataDetail?.dMaxLength,slaveRowData?.dMachineLength) | ||
| 561 | const isShow = slaveRowData && slaveRowData.dMachineLength && slaveRowData.dMaxWidth && slaveRowData.dMaxLength && isMax && innerDivs.length; | 561 | const isShow = slaveRowData && slaveRowData.dMachineLength && slaveRowData.dMaxWidth && slaveRowData.dMaxLength && isMax && innerDivs.length; |
| 562 | 562 | ||
| 563 | const onClick = () => { | 563 | const onClick = () => { |
| 564 | setIsModalOpen(true); | 564 | setIsModalOpen(true); |
| 565 | - setBoxKeys(new Date().getTime()); | 565 | + // setBoxKeys(new Date().getTime()); |
| 566 | setTimeout(() => { | 566 | setTimeout(() => { |
| 567 | const scaleX = 1200 / outerWidth; | 567 | const scaleX = 1200 / outerWidth; |
| 568 | const scaleY = 500 / outerHeight; | 568 | const scaleY = 500 / outerHeight; |
src/components/Common/commonBusiness.js
| @@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
| 3 | */ | 3 | */ |
| 4 | /* eslint-disable */ | 4 | /* eslint-disable */ |
| 5 | import { Modal } from 'antd-v4'; | 5 | import { Modal } from 'antd-v4'; |
| 6 | -import { Modal as mobileModal } from 'antd-mobile'; | 6 | +import { Modal as mobileModal } from 'antd-mobile-v2'; |
| 7 | 7 | ||
| 8 | import { message } from '@/utils/common/message'; | 8 | import { message } from '@/utils/common/message'; |
| 9 | import moment from 'moment'; | 9 | import moment from 'moment'; |
src/components/Common/commonBusiness1.js
| @@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
| 3 | */ | 3 | */ |
| 4 | /* eslint-disable */ | 4 | /* eslint-disable */ |
| 5 | import { Modal } from 'antd'; | 5 | import { Modal } from 'antd'; |
| 6 | -import { Modal as mobileModal } from 'antd-mobile'; | 6 | +import { Modal as mobileModal } from 'antd-mobile-v2'; |
| 7 | 7 | ||
| 8 | import { message } from '@/utils/common/message'; | 8 | import { message } from '@/utils/common/message'; |
| 9 | import moment from 'moment'; | 9 | import moment from 'moment'; |
src/components/PrintPdf/PreviewPdf.js
| 1 | /* eslint-disable prefer-destructuring */ | 1 | /* eslint-disable prefer-destructuring */ |
| 2 | /* eslint no-dupe-keys: 0, no-mixed-operators: 0 */ | 2 | /* eslint no-dupe-keys: 0, no-mixed-operators: 0 */ |
| 3 | import React from 'react'; | 3 | import React from 'react'; |
| 4 | -import { InputItem, Icon } from 'antd-mobile'; | 4 | +import { InputItem, Icon } from 'antd-mobile-v2'; |
| 5 | import { Document, Page, pdfjs } from 'react-pdf'; | 5 | import { Document, Page, pdfjs } from 'react-pdf'; |
| 6 | import 'antd-mobile-v2/dist/antd-mobile.css'; | 6 | import 'antd-mobile-v2/dist/antd-mobile.css'; |
| 7 | import * as commonUtils from '@/utils/utils'; | 7 | import * as commonUtils from '@/utils/utils'; |
src/mobile/common/CommobileBase.js
| @@ -5,7 +5,7 @@ | @@ -5,7 +5,7 @@ | ||
| 5 | 5 | ||
| 6 | import React, { Component } from 'react'; | 6 | import React, { Component } from 'react'; |
| 7 | import moment from 'moment'; | 7 | import moment from 'moment'; |
| 8 | -import { Modal, Toast } from 'antd-mobile'; | 8 | +import { Modal, Toast } from 'antd-mobile-v2'; |
| 9 | import { addResult } from '@/utils/common/calcuate'; | 9 | import { addResult } from '@/utils/common/calcuate'; |
| 10 | import commonConfig from '../../utils/config'; | 10 | import commonConfig from '../../utils/config'; |
| 11 | import * as commonUtils from '../../utils/utils'; | 11 | import * as commonUtils from '../../utils/utils'; |
src/mobile/common/CommobileBill.js
| 1 | /* eslint-disable */ | 1 | /* eslint-disable */ |
| 2 | import React from 'react'; | 2 | import React from 'react'; |
| 3 | import weixin from 'weixin-js-sdk'; | 3 | import weixin from 'weixin-js-sdk'; |
| 4 | -import { Flex, Button, ListView, Toast } from 'antd-mobile'; | 4 | +import { Flex, Button, ListView, Toast } from 'antd-mobile-v2'; |
| 5 | import { createForm } from 'rc-form'; | 5 | import { createForm } from 'rc-form'; |
| 6 | import 'antd-mobile-v2/dist/antd-mobile.css'; | 6 | import 'antd-mobile-v2/dist/antd-mobile.css'; |
| 7 | import CommobileBase from './CommobileBase'; | 7 | import CommobileBase from './CommobileBase'; |
src/mobile/common/CommobileBillEvent.js
| @@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
| 4 | * Created by mar105 on 2019-01-08. | 4 | * Created by mar105 on 2019-01-08. |
| 5 | */ | 5 | */ |
| 6 | import React, { Component } from 'react'; | 6 | import React, { Component } from 'react'; |
| 7 | -import { Toast } from 'antd-mobile'; | 7 | +import { Toast } from 'antd-mobile-v2'; |
| 8 | import * as commonUtils from '../../utils/utils'; | 8 | import * as commonUtils from '../../utils/utils'; |
| 9 | import * as commonFunc from '../../components/Common/commonFunc'; | 9 | import * as commonFunc from '../../components/Common/commonFunc'; |
| 10 | import * as commonBusiness from '../../components/Common/commonBusiness'; | 10 | import * as commonBusiness from '../../components/Common/commonBusiness'; |
src/mobile/common/CommobileClassifyEvent.js
| 1 | /* eslint-disable array-callback-return,no-undef,prefer-destructuring */ | 1 | /* eslint-disable array-callback-return,no-undef,prefer-destructuring */ |
| 2 | import React, { Component } from 'react'; | 2 | import React, { Component } from 'react'; |
| 3 | -import { Modal } from 'antd-mobile'; | 3 | +import { Modal } from 'antd-mobile-v2'; |
| 4 | import * as commonUtils from '../../utils/utils'; /* 通用方法 */ | 4 | import * as commonUtils from '../../utils/utils'; /* 通用方法 */ |
| 5 | import commonConfig from '../../utils/config'; | 5 | import commonConfig from '../../utils/config'; |
| 6 | import * as commonServices from '../../services/services'; | 6 | import * as commonServices from '../../services/services'; |
src/mobile/common/CommobileComponent.js
| 1 | /* eslint-disable */ | 1 | /* eslint-disable */ |
| 2 | -import { List, InputItem, Picker, TextareaItem, DatePicker, Checkbox, Toast } from 'antd-mobile'; | 2 | +import { List, InputItem, Picker, TextareaItem, DatePicker, Checkbox, Toast } from 'antd-mobile-v2'; |
| 3 | import moment from 'moment'; | 3 | import moment from 'moment'; |
| 4 | import React, { Component } from 'react'; | 4 | import React, { Component } from 'react'; |
| 5 | import { debounce } from 'lodash'; | 5 | import { debounce } from 'lodash'; |
src/mobile/common/CommobileList.js
| @@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
| 2 | /* eslint-disable prefer-destructuring */ | 2 | /* eslint-disable prefer-destructuring */ |
| 3 | /* eslint no-dupe-keys: 0, no-mixed-operators: 0 */ | 3 | /* eslint no-dupe-keys: 0, no-mixed-operators: 0 */ |
| 4 | import React from 'react'; | 4 | import React from 'react'; |
| 5 | -import { ListView, Checkbox, Modal, Toast, Flex } from 'antd-mobile'; | 5 | +import { ListView, Checkbox, Modal, Toast, Flex } from 'antd-mobile-v2'; |
| 6 | import { createForm } from 'rc-form'; | 6 | import { createForm } from 'rc-form'; |
| 7 | import 'antd-mobile-v2/dist/antd-mobile.css'; | 7 | import 'antd-mobile-v2/dist/antd-mobile.css'; |
| 8 | import commonConfig from '../../utils/config'; | 8 | import commonConfig from '../../utils/config'; |
src/mobile/common/CommobileListEvent.js
| @@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
| 3 | * Created by mar105 on 2019-03-27. | 3 | * Created by mar105 on 2019-03-27. |
| 4 | */ | 4 | */ |
| 5 | import React, { Component } from 'react'; | 5 | import React, { Component } from 'react'; |
| 6 | -import { Toast, Modal, TextareaItem, List } from 'antd-mobile'; | 6 | +import { Toast, Modal, TextareaItem, List } from 'antd-mobile-v2'; |
| 7 | import { history } from 'umi'; | 7 | import { history } from 'umi'; |
| 8 | import * as commonUtils from '../../utils/utils'; /* 通用方法 */ | 8 | import * as commonUtils from '../../utils/utils'; /* 通用方法 */ |
| 9 | import commonConfig from '../../utils/config'; | 9 | import commonConfig from '../../utils/config'; |
src/mobile/common/CommobileModalList.jsx
| @@ -3,7 +3,7 @@ import React, { PureComponent } from 'react'; | @@ -3,7 +3,7 @@ import React, { PureComponent } from 'react'; | ||
| 3 | import { createForm } from 'rc-form'; | 3 | import { createForm } from 'rc-form'; |
| 4 | import CommobileBase from '../../mobile/common/CommobileBase'; | 4 | import CommobileBase from '../../mobile/common/CommobileBase'; |
| 5 | import CommobileListEvent from './CommobileListEvent'; | 5 | import CommobileListEvent from './CommobileListEvent'; |
| 6 | -import { Checkbox, ListView, TextareaItem } from 'antd-mobile'; | 6 | +import { Checkbox, ListView, TextareaItem } from 'antd-mobile-v2'; |
| 7 | import * as commonUtils from '../../utils/utils'; | 7 | import * as commonUtils from '../../utils/utils'; |
| 8 | 8 | ||
| 9 | 9 |
src/mobile/common/CommobilePrintPdf.js
| 1 | /* eslint-disable prefer-destructuring */ | 1 | /* eslint-disable prefer-destructuring */ |
| 2 | /* eslint no-dupe-keys: 0, no-mixed-operators: 0 */ | 2 | /* eslint no-dupe-keys: 0, no-mixed-operators: 0 */ |
| 3 | import React from 'react'; | 3 | import React from 'react'; |
| 4 | -import { InputItem, Icon } from 'antd-mobile'; | 4 | +import { InputItem, Icon } from 'antd-mobile-v2'; |
| 5 | import { Document, Page, pdfjs } from 'react-pdf'; | 5 | import { Document, Page, pdfjs } from 'react-pdf'; |
| 6 | import 'antd-mobile-v2/dist/antd-mobile.css'; | 6 | import 'antd-mobile-v2/dist/antd-mobile.css'; |
| 7 | import * as commonUtils from '../../utils/utils'; | 7 | import * as commonUtils from '../../utils/utils'; |
src/mobile/common/CommobileSearchComponent.js
| @@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
| 2 | /* eslint no-dupe-keys: 0, no-mixed-operators: 0 */ | 2 | /* eslint no-dupe-keys: 0, no-mixed-operators: 0 */ |
| 3 | import React from 'react'; | 3 | import React from 'react'; |
| 4 | import weixin from 'weixin-js-sdk'; | 4 | import weixin from 'weixin-js-sdk'; |
| 5 | -import { Tabs, Badge, SearchBar, Modal, Button, Menu, ActivityIndicator, Flex, WhiteSpace, Toast, List } from 'antd-mobile'; | 5 | +import { Tabs, Badge, SearchBar, Modal, Button, Menu, ActivityIndicator, Flex, WhiteSpace, Toast, List } from 'antd-mobile-v2'; |
| 6 | import 'antd-mobile-v2/dist/antd-mobile.css'; | 6 | import 'antd-mobile-v2/dist/antd-mobile.css'; |
| 7 | import styles from '.././mobile.less'; | 7 | import styles from '.././mobile.less'; |
| 8 | import commonConfig from '../../utils/config'; | 8 | import commonConfig from '../../utils/config'; |
src/mobile/common/CommobileStep.js
| 1 | /* eslint-disable prefer-destructuring */ | 1 | /* eslint-disable prefer-destructuring */ |
| 2 | /* eslint no-dupe-keys: 0, no-mixed-operators: 0 */ | 2 | /* eslint no-dupe-keys: 0, no-mixed-operators: 0 */ |
| 3 | import React from 'react'; | 3 | import React from 'react'; |
| 4 | -import { Steps } from 'antd-mobile'; | 4 | +import { Steps } from 'antd-mobile-v2'; |
| 5 | import 'antd-mobile-v2/dist/antd-mobile.css'; | 5 | import 'antd-mobile-v2/dist/antd-mobile.css'; |
| 6 | import CommobileBase from '../../mobile/common/CommobileBase'; | 6 | import CommobileBase from '../../mobile/common/CommobileBase'; |
| 7 | import CommobileListEvent from './CommobileListEvent'; | 7 | import CommobileListEvent from './CommobileListEvent'; |
src/mobile/common/CommobileSubBill.js
| 1 | /* eslint-disable */ | 1 | /* eslint-disable */ |
| 2 | import React from 'react'; | 2 | import React from 'react'; |
| 3 | import weixin from 'weixin-js-sdk'; | 3 | import weixin from 'weixin-js-sdk'; |
| 4 | -import { Flex, Button, ListView, Toast, Tabs, Badge, Modal} from 'antd-mobile'; | 4 | +import { Flex, Button, ListView, Toast, Tabs, Badge, Modal} from 'antd-mobile-v2'; |
| 5 | import { createForm } from 'rc-form'; | 5 | import { createForm } from 'rc-form'; |
| 6 | import 'antd-mobile-v2/dist/antd-mobile.css'; | 6 | import 'antd-mobile-v2/dist/antd-mobile.css'; |
| 7 | import CommobileBase from './CommobileBase'; | 7 | import CommobileBase from './CommobileBase'; |
src/mobile/common/CommobileSubBillEvent.js
| @@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
| 4 | * Created by mar105 on 2019-01-08. | 4 | * Created by mar105 on 2019-01-08. |
| 5 | */ | 5 | */ |
| 6 | import React, { Component } from 'react'; | 6 | import React, { Component } from 'react'; |
| 7 | -import { Toast,Modal } from 'antd-mobile'; | 7 | +import { Toast,Modal } from 'antd-mobile-v2'; |
| 8 | import * as commonUtils from '../../utils/utils'; | 8 | import * as commonUtils from '../../utils/utils'; |
| 9 | import * as commonFunc from '../../components/Common/commonFunc'; | 9 | import * as commonFunc from '../../components/Common/commonFunc'; |
| 10 | import * as commonBusiness from '../../components/Common/commonBusiness'; | 10 | import * as commonBusiness from '../../components/Common/commonBusiness'; |
src/mobile/common/CommobileTabBill.js
| 1 | /* eslint-disable */ | 1 | /* eslint-disable */ |
| 2 | import React from 'react'; | 2 | import React from 'react'; |
| 3 | import weixin from 'weixin-js-sdk'; | 3 | import weixin from 'weixin-js-sdk'; |
| 4 | -import { Flex, Button, ListView, Toast, Tabs, Badge,} from 'antd-mobile'; | 4 | +import { Flex, Button, ListView, Toast, Tabs, Badge,} from 'antd-mobile-v2'; |
| 5 | import { createForm } from 'rc-form'; | 5 | import { createForm } from 'rc-form'; |
| 6 | import 'antd-mobile-v2/dist/antd-mobile.css'; | 6 | import 'antd-mobile-v2/dist/antd-mobile.css'; |
| 7 | import CommobileBase from './CommobileBase'; | 7 | import CommobileBase from './CommobileBase'; |
src/mobile/common/CommobileToolBar.js
| 1 | /* eslint-disable */ | 1 | /* eslint-disable */ |
| 2 | import React, { Component } from 'react'; | 2 | import React, { Component } from 'react'; |
| 3 | -import { Button, Toast } from 'antd-mobile'; | 3 | +import { Button, Toast } from 'antd-mobile-v2'; |
| 4 | import * as commonUtils from '../../utils/utils'; | 4 | import * as commonUtils from '../../utils/utils'; |
| 5 | import commonConfig from '../../utils/config'; | 5 | import commonConfig from '../../utils/config'; |
| 6 | import * as commonServices from '../../services/services'; | 6 | import * as commonServices from '../../services/services'; |
src/mobile/common/CommobileView.js
| @@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
| 3 | */ | 3 | */ |
| 4 | /* eslint-disable object-curly-newline,prefer-destructuring */ | 4 | /* eslint-disable object-curly-newline,prefer-destructuring */ |
| 5 | import React, { Component } from 'react'; | 5 | import React, { Component } from 'react'; |
| 6 | -import { List } from 'antd-mobile'; | 6 | +import { List } from 'antd-mobile-v2'; |
| 7 | import ShowType from './CommobileComponent'; | 7 | import ShowType from './CommobileComponent'; |
| 8 | import * as commonUtils from '../../utils/utils'; /* 通用方法 */ | 8 | import * as commonUtils from '../../utils/utils'; /* 通用方法 */ |
| 9 | 9 |
src/mobile/common/CommobileViewMaster.js
| @@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
| 3 | */ | 3 | */ |
| 4 | /* eslint-disable object-curly-newline,prefer-destructuring */ | 4 | /* eslint-disable object-curly-newline,prefer-destructuring */ |
| 5 | import React, { Component } from 'react'; | 5 | import React, { Component } from 'react'; |
| 6 | -import { List, Flex } from 'antd-mobile'; | 6 | +import { List, Flex } from 'antd-mobile-v2'; |
| 7 | import ShowType from './CommobileComponent'; | 7 | import ShowType from './CommobileComponent'; |
| 8 | import * as commonUtils from '../../utils/utils'; | 8 | import * as commonUtils from '../../utils/utils'; |
| 9 | import styles from '../mobile.less'; /* 通用方法 */ | 9 | import styles from '../mobile.less'; /* 通用方法 */ |
src/mobile/common/CommobileViewSlave.js
| @@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
| 3 | */ | 3 | */ |
| 4 | /* eslint-disable object-curly-newline,prefer-destructuring */ | 4 | /* eslint-disable object-curly-newline,prefer-destructuring */ |
| 5 | import React, { Component } from 'react'; | 5 | import React, { Component } from 'react'; |
| 6 | -import { List } from 'antd-mobile'; | 6 | +import { List } from 'antd-mobile-v2'; |
| 7 | import ShowType from './CommobileComponent'; | 7 | import ShowType from './CommobileComponent'; |
| 8 | import * as commonUtils from '../../utils/utils'; | 8 | import * as commonUtils from '../../utils/utils'; |
| 9 | import styles from '../mobile.less'; /* 通用方法 */ | 9 | import styles from '../mobile.less'; /* 通用方法 */ |
src/mobile/common/ContactsInfoMobile.js
| 1 | import React from 'react'; | 1 | import React from 'react'; |
| 2 | -import { Grid, Result } from 'antd-mobile'; | 2 | +import { Grid, Result } from 'antd-mobile-v2'; |
| 3 | import { createForm } from 'rc-form'; | 3 | import { createForm } from 'rc-form'; |
| 4 | import 'antd-mobile-v2/dist/antd-mobile.css'; | 4 | import 'antd-mobile-v2/dist/antd-mobile.css'; |
| 5 | import styles from '../mobile.less'; | 5 | import styles from '../mobile.less'; |
src/mobile/common/ContactsMobile.js
| 1 | import React from 'react'; | 1 | import React from 'react'; |
| 2 | -import { ListView } from 'antd-mobile'; | 2 | +import { ListView } from 'antd-mobile-v2'; |
| 3 | import styles from '../mobile.less'; | 3 | import styles from '../mobile.less'; |
| 4 | // eslint-disable-next-line import/first | 4 | // eslint-disable-next-line import/first |
| 5 | import 'antd-mobile-v2/dist/antd-mobile.css'; | 5 | import 'antd-mobile-v2/dist/antd-mobile.css'; |
src/mobile/common/DeviceMobile.js
| 1 | /* eslint-disable prefer-destructuring */ | 1 | /* eslint-disable prefer-destructuring */ |
| 2 | /* eslint no-dupe-keys: 0, no-mixed-operators: 0 */ | 2 | /* eslint no-dupe-keys: 0, no-mixed-operators: 0 */ |
| 3 | import React from 'react'; | 3 | import React from 'react'; |
| 4 | -import { Tabs, Badge, SearchBar, ListView, Modal, List, Button } from 'antd-mobile'; | 4 | +import { Tabs, Badge, SearchBar, ListView, Modal, List, Button } from 'antd-mobile-v2'; |
| 5 | import 'antd-mobile-v2/dist/antd-mobile.css'; | 5 | import 'antd-mobile-v2/dist/antd-mobile.css'; |
| 6 | import styles from '.././mobile.less'; | 6 | import styles from '.././mobile.less'; |
| 7 | import commonConfig from '../../utils/config'; | 7 | import commonConfig from '../../utils/config'; |
src/mobile/common/ExamineMobile.js
| 1 | /* eslint-disable */ | 1 | /* eslint-disable */ |
| 2 | import React from 'react'; | 2 | import React from 'react'; |
| 3 | -import { Flex, Button, ListView, Toast, TextareaItem, Steps, WhiteSpace, WingBlank } from 'antd-mobile'; | 3 | +import { Flex, Button, ListView, Toast, TextareaItem, Steps, WhiteSpace, WingBlank } from 'antd-mobile-v2'; |
| 4 | import { DownlandOutline, ArrowDownCircleOutline, CheckCircleFill, ClockCircleFill, HandPayCircleOutline, InformationCircleOutline, } from 'antd-mobile-icons' | 4 | import { DownlandOutline, ArrowDownCircleOutline, CheckCircleFill, ClockCircleFill, HandPayCircleOutline, InformationCircleOutline, } from 'antd-mobile-icons' |
| 5 | import { Space, Dropdown, Menu } from 'antd'; | 5 | import { Space, Dropdown, Menu } from 'antd'; |
| 6 | import { createForm } from 'rc-form'; | 6 | import { createForm } from 'rc-form'; |
src/mobile/common/ExamineMobile1.js
| 1 | import React from 'react'; | 1 | import React from 'react'; |
| 2 | -import { Button, Card, TextareaItem, WhiteSpace, WingBlank, ListView } from 'antd-mobile'; | 2 | +import { Button, Card, TextareaItem, WhiteSpace, WingBlank, ListView } from 'antd-mobile-v2'; |
| 3 | // import { createForm } from 'rc-form'; | 3 | // import { createForm } from 'rc-form'; |
| 4 | import 'antd-mobile-v2/dist/antd-mobile.css'; | 4 | import 'antd-mobile-v2/dist/antd-mobile.css'; |
| 5 | import CommobileBase from './CommobileBase'; | 5 | import CommobileBase from './CommobileBase'; |
src/mobile/common/MessageMobile.js
| 1 | import React from 'react'; | 1 | import React from 'react'; |
| 2 | // eslint-disable-next-line no-unused-vars | 2 | // eslint-disable-next-line no-unused-vars |
| 3 | -import { Tabs, Badge, ListView, SearchBar } from 'antd-mobile'; | ||
| 4 | -import 'antd-mobile-v2/dist/antd-mobile.css'; | 3 | +import { Tabs, Badge, ListView, SearchBar } from 'antd-mobile-v2'; |
| 4 | +import 'antd-mobile/dist/antd-mobile.css'; | ||
| 5 | // import ExamineMobile from './ExamineMobile'; | 5 | // import ExamineMobile from './ExamineMobile'; |
| 6 | import commonConfig from '../../utils/config'; | 6 | import commonConfig from '../../utils/config'; |
| 7 | import * as commonUtils from '../../utils/utils'; | 7 | import * as commonUtils from '../../utils/utils'; |
src/mobile/common/MyselfMobile.js
| 1 | import React from 'react'; | 1 | import React from 'react'; |
| 2 | -import { Button, List } from 'antd-mobile'; | 2 | +import { Button, List } from 'antd-mobile-v2'; |
| 3 | import 'antd-mobile-v2/dist/antd-mobile.css'; | 3 | import 'antd-mobile-v2/dist/antd-mobile.css'; |
| 4 | // import ExamineMobile from './ExamineMobile'; | 4 | // import ExamineMobile from './ExamineMobile'; |
| 5 | import commonConfig from '../../utils/config'; | 5 | import commonConfig from '../../utils/config'; |
src/mobile/common/ProcessReportMobile.js
| 1 | import React from 'react'; | 1 | import React from 'react'; |
| 2 | -import { Flex, Button, ListView, Toast } from 'antd-mobile'; | 2 | +import { Flex, Button, ListView, Toast } from 'antd-mobile-v2'; |
| 3 | import { createForm } from 'rc-form'; | 3 | import { createForm } from 'rc-form'; |
| 4 | import 'antd-mobile-v2/dist/antd-mobile.css'; | 4 | import 'antd-mobile-v2/dist/antd-mobile.css'; |
| 5 | import CommobileBase from './CommobileBase'; | 5 | import CommobileBase from './CommobileBase'; |
src/mobile/common/RevisePasswordMobile.js
| 1 | import React from 'react'; | 1 | import React from 'react'; |
| 2 | -import { List, InputItem, NavBar, Toast } from 'antd-mobile'; | 2 | +import { List, InputItem, NavBar, Toast } from 'antd-mobile-v2'; |
| 3 | import { createForm } from 'rc-form'; | 3 | import { createForm } from 'rc-form'; |
| 4 | import 'antd-mobile-v2/dist/antd-mobile.css'; | 4 | import 'antd-mobile-v2/dist/antd-mobile.css'; |
| 5 | // import ExamineMobile from './ExamineMobile'; | 5 | // import ExamineMobile from './ExamineMobile'; |
src/mobile/common/SceneCssMobile.js
| 1 | import React from 'react'; | 1 | import React from 'react'; |
| 2 | -import { Grid, Toast } from 'antd-mobile'; | 2 | +import { Grid, Toast } from 'antd-mobile-v2'; |
| 3 | import 'antd-mobile-v2/dist/antd-mobile.css'; | 3 | import 'antd-mobile-v2/dist/antd-mobile.css'; |
| 4 | import styles from './SceneMobile.less'; | 4 | import styles from './SceneMobile.less'; |
| 5 | // eslint-disable-next-line import/first | 5 | // eslint-disable-next-line import/first |
src/mobile/common/SceneMobile.js
| 1 | import React from 'react'; | 1 | import React from 'react'; |
| 2 | -import { Button, Grid, Toast } from 'antd-mobile'; | 2 | +import { Button, Grid, Toast } from 'antd-mobile-v2'; |
| 3 | import 'antd-mobile-v2/dist/antd-mobile.css'; | 3 | import 'antd-mobile-v2/dist/antd-mobile.css'; |
| 4 | import styles from './SceneMobile.less'; | 4 | import styles from './SceneMobile.less'; |
| 5 | // eslint-disable-next-line import/first | 5 | // eslint-disable-next-line import/first |
src/mobile/common/SceneSrmMobile.js
| 1 | import React from 'react'; | 1 | import React from 'react'; |
| 2 | -import { Grid, Toast } from 'antd-mobile'; | 2 | +import { Grid, Toast } from 'antd-mobile-v2'; |
| 3 | import 'antd-mobile-v2/dist/antd-mobile.css'; | 3 | import 'antd-mobile-v2/dist/antd-mobile.css'; |
| 4 | import styles from './SceneMobile.less'; | 4 | import styles from './SceneMobile.less'; |
| 5 | // eslint-disable-next-line import/first | 5 | // eslint-disable-next-line import/first |
src/mobile/common/WorkBenchMobile.js
| 1 | import React from 'react'; | 1 | import React from 'react'; |
| 2 | -import { Grid, Toast } from 'antd-mobile'; | 2 | +import { Grid, Toast } from 'antd-mobile-v2'; |
| 3 | import 'antd-mobile-v2/dist/antd-mobile.css'; | 3 | import 'antd-mobile-v2/dist/antd-mobile.css'; |
| 4 | import styles from './SceneMobile.less'; | 4 | import styles from './SceneMobile.less'; |
| 5 | import commonConfig from '../../utils/config'; | 5 | import commonConfig from '../../utils/config'; |
src/mobile/components/FileManageMobile.js
| 1 | /* eslint-disable prefer-destructuring */ | 1 | /* eslint-disable prefer-destructuring */ |
| 2 | /* eslint no-dupe-keys: 0, no-mixed-operators: 0 */ | 2 | /* eslint no-dupe-keys: 0, no-mixed-operators: 0 */ |
| 3 | import React from 'react'; | 3 | import React from 'react'; |
| 4 | -import { Button, Modal } from 'antd-mobile'; | 4 | +import { Button, Modal } from 'antd-mobile-v2'; |
| 5 | import 'antd-mobile-v2/dist/antd-mobile.css'; | 5 | import 'antd-mobile-v2/dist/antd-mobile.css'; |
| 6 | import * as commonUtils from '../../utils/utils'; | 6 | import * as commonUtils from '../../utils/utils'; |
| 7 | import CommobileClassifyEvent from '../common/CommobileClassifyEvent'; | 7 | import CommobileClassifyEvent from '../common/CommobileClassifyEvent'; |
src/mobile/components/FileManageMobileWx.js
| @@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
| 2 | /* eslint-disable prefer-destructuring */ | 2 | /* eslint-disable prefer-destructuring */ |
| 3 | /* eslint no-dupe-keys: 0, no-mixed-operators: 0 */ | 3 | /* eslint no-dupe-keys: 0, no-mixed-operators: 0 */ |
| 4 | import React from 'react'; | 4 | import React from 'react'; |
| 5 | -import { Button, Toast } from 'antd-mobile'; | 5 | +import { Button, Toast } from 'antd-mobile-v2'; |
| 6 | import 'antd-mobile-v2/dist/antd-mobile.css'; | 6 | import 'antd-mobile-v2/dist/antd-mobile.css'; |
| 7 | import weixin from 'weixin-js-sdk'; | 7 | import weixin from 'weixin-js-sdk'; |
| 8 | import logo from '@/assets/footer_logo.png'; | 8 | import logo from '@/assets/footer_logo.png'; |
src/mobile/components/FileShowMobile.js
| @@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
| 2 | /* eslint-disable prefer-destructuring */ | 2 | /* eslint-disable prefer-destructuring */ |
| 3 | /* eslint no-dupe-keys: 0, no-mixed-operators: 0 */ | 3 | /* eslint no-dupe-keys: 0, no-mixed-operators: 0 */ |
| 4 | import React from 'react'; | 4 | import React from 'react'; |
| 5 | -import { Button, Modal } from 'antd-mobile'; | 5 | +import { Button, Modal } from 'antd-mobile-v2'; |
| 6 | import 'antd-mobile-v2/dist/antd-mobile.css'; | 6 | import 'antd-mobile-v2/dist/antd-mobile.css'; |
| 7 | import * as commonUtils from '../../utils/utils'; | 7 | import * as commonUtils from '../../utils/utils'; |
| 8 | import CommobileClassifyEvent from '../common/CommobileClassifyEvent'; | 8 | import CommobileClassifyEvent from '../common/CommobileClassifyEvent'; |
src/mobile/components/modal.jsx
| 1 | /*eslint-disable*/ | 1 | /*eslint-disable*/ |
| 2 | import React, { PureComponent } from 'react'; | 2 | import React, { PureComponent } from 'react'; |
| 3 | -import { Modal } from 'antd-mobile'; | 3 | +import { Modal } from 'antd-mobile-v2'; |
| 4 | 4 | ||
| 5 | export default class ModalBase extends PureComponent { | 5 | export default class ModalBase extends PureComponent { |
| 6 | state = { | 6 | state = { |
src/mobile/components/preView.js
src/mobile/login/LoginMobile.js
| @@ -146,6 +146,8 @@ class LoginMobile extends React.Component { | @@ -146,6 +146,8 @@ class LoginMobile extends React.Component { | ||
| 146 | type: 'loginMobile/login', | 146 | type: 'loginMobile/login', |
| 147 | payload: { ...param, dispatch }, | 147 | payload: { ...param, dispatch }, |
| 148 | }); | 148 | }); |
| 149 | + console.log('登录成功',param,dispatch); | ||
| 150 | + | ||
| 149 | } else { | 151 | } else { |
| 150 | Toast.fail(dataReturn.msg); | 152 | Toast.fail(dataReturn.msg); |
| 151 | } | 153 | } |
src/mobile/logincss/LoginCss.js
| 1 | import React from 'react'; | 1 | import React from 'react'; |
| 2 | import { createForm } from 'rc-form'; | 2 | import { createForm } from 'rc-form'; |
| 3 | -import { InputItem, Button, WhiteSpace, Toast, Modal, Picker, List } from 'antd-mobile'; | 3 | +import { InputItem, Button, WhiteSpace, Toast, Modal, Picker, List } from 'antd-mobile-v2'; |
| 4 | import 'antd-mobile-v2/dist/antd-mobile.css'; | 4 | import 'antd-mobile-v2/dist/antd-mobile.css'; |
| 5 | import styles from './LoginCss.less'; | 5 | import styles from './LoginCss.less'; |
| 6 | import LoginIcon from '../../assets/mobile/logoCss.png'; | 6 | import LoginIcon from '../../assets/mobile/logoCss.png'; |
src/mobile/loginsrm/LoginSrm.js
| 1 | import React from 'react'; | 1 | import React from 'react'; |
| 2 | import { createForm } from 'rc-form'; | 2 | import { createForm } from 'rc-form'; |
| 3 | -import { InputItem, Button, WhiteSpace, Toast, Modal, Picker, List } from 'antd-mobile'; | 3 | +import { InputItem, Button, WhiteSpace, Toast, Modal, Picker, List } from 'antd-mobile-v2'; |
| 4 | import 'antd-mobile-v2/dist/antd-mobile.css'; | 4 | import 'antd-mobile-v2/dist/antd-mobile.css'; |
| 5 | import styles from './LoginSrm.less'; | 5 | import styles from './LoginSrm.less'; |
| 6 | import LoginIcon from '../../assets/mobile/logoSrm.png'; | 6 | import LoginIcon from '../../assets/mobile/logoSrm.png'; |
src/models/app.js
| @@ -3,7 +3,7 @@ import config from '../utils/config'; | @@ -3,7 +3,7 @@ import config from '../utils/config'; | ||
| 3 | import * as utils from '../utils/utils'; | 3 | import * as utils from '../utils/utils'; |
| 4 | import * as services from '../services/services'; | 4 | import * as services from '../services/services'; |
| 5 | import { message, notification, Modal } from 'antd-v4'; | 5 | import { message, notification, Modal } from 'antd-v4'; |
| 6 | -// import { Toast } from 'antd-mobile'; | 6 | +// import { Toast } from 'antd-mobile-v2'; |
| 7 | import * as commonFunc from '../components/Common/commonFunc';/* 通用单据方法 */ | 7 | import * as commonFunc from '../components/Common/commonFunc';/* 通用单据方法 */ |
| 8 | 8 | ||
| 9 | const { confirm } = Modal; | 9 | const { confirm } = Modal; |
src/routes/mobile/IndexCssMobile.js
| 1 | /* eslint-disable */ | 1 | /* eslint-disable */ |
| 2 | import React from 'react'; | 2 | import React from 'react'; |
| 3 | import 'antd-mobile-v2/dist/antd-mobile.css'; | 3 | import 'antd-mobile-v2/dist/antd-mobile.css'; |
| 4 | -import { Icon, NavBar, TabBar, Modal } from 'antd-mobile'; | ||
| 5 | -import { connect,history } from 'umi'; | 4 | +import { Icon, NavBar, TabBar, Modal } from 'antd-mobile-v2'; |
| 5 | +// import { history } from 'dva/router'; | ||
| 6 | +import { connect,history } from 'umi'; | ||
| 6 | 7 | ||
| 7 | import styles from './IndexMobile.less'; | 8 | import styles from './IndexMobile.less'; |
| 8 | import SceneCssMobile from './common/SceneCssMobile'; | 9 | import SceneCssMobile from './common/SceneCssMobile'; |
src/routes/mobile/IndexMobile.js
| 1 | -import React from 'react'; | ||
| 2 | -import 'antd-mobile-v2/dist/antd-mobile.css'; | ||
| 3 | -import { Icon, NavBar, TabBar, Modal } from 'antd-mobile-v2'; | ||
| 4 | -import { connect,history } from 'umi'; | 1 | +import React from "react"; |
| 2 | +import "antd-mobile-v2/dist/antd-mobile.css"; | ||
| 3 | +import { Icon, NavBar, TabBar, Modal } from "antd-mobile-v2"; | ||
| 4 | +// import { history } from 'dva/router'; | ||
| 5 | +import { connect, history } from "umi"; | ||
| 5 | 6 | ||
| 6 | -import * as commonUtils from '@/utils/utils'; | ||
| 7 | -import styles from './IndexMobile.less'; | ||
| 8 | -import SceneMobile from './common/SceneMobile'; | ||
| 9 | -import MessageMobile from './common/MessageMobile'; | ||
| 10 | -import ContactsMobile from './common/ContactsMobile'; | ||
| 11 | -import WorkBenchMobile from './common/WorkBenchMobile'; | ||
| 12 | -import CommobileList from './commobileList/commobileList'; | ||
| 13 | -import ProcessReportMobile from './common/ProcessReportMobile'; | ||
| 14 | -import MyselfMobile from './common/MyselfMobile'; | ||
| 15 | -import ContactsInfoMobile from './common/ContactsInfoMobile'; | ||
| 16 | -import RevisePasswordMobile from './common/RevisePasswordMobile'; | ||
| 17 | -import CommobileBill from './common/commobileBill'; | ||
| 18 | -import CommobilePrintPdf from './common/commobilePrintPdf'; | ||
| 19 | -import ExamineMobile from './common/ExamineMobile'; | ||
| 20 | -import Icon1 from '../../assets/mobile/1.png'; | ||
| 21 | -import Icon11 from '../../assets/mobile/11.png'; | ||
| 22 | -import Icon2 from '../../assets/mobile/2.png'; | ||
| 23 | -import Icon21 from '../../assets/mobile/21.png'; | ||
| 24 | -import Icon3 from '../../assets/mobile/3.png'; | ||
| 25 | -import Icon31 from '../../assets/mobile/31.png'; | 7 | +import * as commonUtils from "@/utils/utils"; |
| 8 | +import styles from "./IndexMobile.less"; | ||
| 9 | +import SceneMobile from "./common/SceneMobile"; | ||
| 10 | +import MessageMobile from "./common/MessageMobile"; | ||
| 11 | +import ContactsMobile from "./common/ContactsMobile"; | ||
| 12 | +import WorkBenchMobile from "./common/WorkBenchMobile"; | ||
| 13 | +import CommobileList from "./commobileList/commobileList"; | ||
| 14 | +import ProcessReportMobile from "./common/ProcessReportMobile"; | ||
| 15 | +import MyselfMobile from "./common/MyselfMobile"; | ||
| 16 | +import ContactsInfoMobile from "./common/ContactsInfoMobile"; | ||
| 17 | +import RevisePasswordMobile from "./common/RevisePasswordMobile"; | ||
| 18 | +import CommobileBill from "./common/commobileBill"; | ||
| 19 | +import CommobilePrintPdf from "./common/commobilePrintPdf"; | ||
| 20 | +import ExamineMobile from "./common/ExamineMobile"; | ||
| 21 | +import Icon1 from "../../assets/mobile/1.png"; | ||
| 22 | +import Icon11 from "../../assets/mobile/11.png"; | ||
| 23 | +import Icon2 from "../../assets/mobile/2.png"; | ||
| 24 | +import Icon21 from "../../assets/mobile/21.png"; | ||
| 25 | +import Icon3 from "../../assets/mobile/3.png"; | ||
| 26 | +import Icon31 from "../../assets/mobile/31.png"; | ||
| 26 | // import Icon4 from '../../assets/mobile/4.png'; | 27 | // import Icon4 from '../../assets/mobile/4.png'; |
| 27 | // import Icon41 from '../../assets/mobile/41.png'; | 28 | // import Icon41 from '../../assets/mobile/41.png'; |
| 28 | -import Icon5 from '../../assets/mobile/5.png'; | ||
| 29 | -import Icon51 from '../../assets/mobile/51.png'; | 29 | +import Icon5 from "../../assets/mobile/5.png"; |
| 30 | +import Icon51 from "../../assets/mobile/51.png"; | ||
| 30 | // import AppUtil from '../../utils/AppUtil'; | 31 | // import AppUtil from '../../utils/AppUtil'; |
| 31 | -import * as commonBusiness from '../../components/Common/commonBusiness'; | 32 | +import * as commonBusiness from "../../components/Common/commonBusiness"; |
| 32 | 33 | ||
| 33 | // eslint-disable-next-line prefer-destructuring | 34 | // eslint-disable-next-line prefer-destructuring |
| 34 | const alert = Modal.alert; | 35 | const alert = Modal.alert; |
| @@ -36,8 +37,8 @@ class IndexMobile extends React.Component { | @@ -36,8 +37,8 @@ class IndexMobile extends React.Component { | ||
| 36 | constructor(props) { | 37 | constructor(props) { |
| 37 | super(props); | 38 | super(props); |
| 38 | this.state = { | 39 | this.state = { |
| 39 | - selectedTab: 'scene', | ||
| 40 | - title: '现场', | 40 | + selectedTab: "scene", |
| 41 | + title: "现场", | ||
| 41 | hidden: false, | 42 | hidden: false, |
| 42 | fullScreen: true, | 43 | fullScreen: true, |
| 43 | touchStartPageX: 0, // 滑动开始的Y坐标 | 44 | touchStartPageX: 0, // 滑动开始的Y坐标 |
| @@ -45,13 +46,13 @@ class IndexMobile extends React.Component { | @@ -45,13 +46,13 @@ class IndexMobile extends React.Component { | ||
| 45 | }; | 46 | }; |
| 46 | } | 47 | } |
| 47 | componentWillMount() { | 48 | componentWillMount() { |
| 48 | - this.props.dispatch(history.push('/indexMobile')); // 刷新时更新路由,避免底部按钮和返回按钮错乱显示 | 49 | + this.props.dispatch(history.push("/indexMobile")); // 刷新时更新路由,避免底部按钮和返回按钮错乱显示 |
| 49 | if (this.props.routing && this.props.routing) { | 50 | if (this.props.routing && this.props.routing) { |
| 50 | const { state } = this.props.routing; | 51 | const { state } = this.props.routing; |
| 51 | if (state) { | 52 | if (state) { |
| 52 | const { sId } = state; | 53 | const { sId } = state; |
| 53 | - if (sId === 'myself') { | ||
| 54 | - this.setState({ selectedTab: 'myself' }); | 54 | + if (sId === "myself") { |
| 55 | + this.setState({ selectedTab: "myself" }); | ||
| 55 | // this.renderContent('contacts'); | 56 | // this.renderContent('contacts'); |
| 56 | } | 57 | } |
| 57 | } | 58 | } |
| @@ -63,50 +64,51 @@ class IndexMobile extends React.Component { | @@ -63,50 +64,51 @@ class IndexMobile extends React.Component { | ||
| 63 | componentDidUpdate(prevProps) { | 64 | componentDidUpdate(prevProps) { |
| 64 | /* eslint-disable */ | 65 | /* eslint-disable */ |
| 65 | if (prevProps?.location.state !== this.props.location.state) { | 66 | if (prevProps?.location.state !== this.props.location.state) { |
| 66 | - const originTitle = ({ | ||
| 67 | - message: '消息', | ||
| 68 | - scene: '现场', | ||
| 69 | - workbench: '工作台', | ||
| 70 | - device: '设备', | ||
| 71 | - myself: '我的', | ||
| 72 | - })[this.state.selectedTab]; | ||
| 73 | - | 67 | + const originTitle = { |
| 68 | + message: "消息", | ||
| 69 | + scene: "现场", | ||
| 70 | + workbench: "工作台", | ||
| 71 | + device: "设备", | ||
| 72 | + myself: "我的", | ||
| 73 | + }[this.state.selectedTab]; | ||
| 74 | + | ||
| 74 | try { | 75 | try { |
| 75 | - const path = JSON.parse(this.props.location.state || '{}'); | 76 | + const path = JSON.parse(this.props.location.state || "{}"); |
| 76 | this.setState({ title: path.title || originTitle }); | 77 | this.setState({ title: path.title || originTitle }); |
| 77 | - } catch (error) { | 78 | + } catch (error) { |
| 78 | this.setState({ title: originTitle }); | 79 | this.setState({ title: originTitle }); |
| 79 | } | 80 | } |
| 80 | } | 81 | } |
| 81 | } | 82 | } |
| 82 | 83 | ||
| 83 | - handleTouchStart = (e) => { | 84 | + handleTouchStart = e => { |
| 84 | this.setState({ | 85 | this.setState({ |
| 85 | touchStartPageX: e.changedTouches[0].pageX, | 86 | touchStartPageX: e.changedTouches[0].pageX, |
| 86 | touchStartPageY: e.changedTouches[0].pageY, | 87 | touchStartPageY: e.changedTouches[0].pageY, |
| 87 | }); | 88 | }); |
| 88 | - } | 89 | + }; |
| 89 | 90 | ||
| 90 | - handleTouchEnd = (e) => { | 91 | + handleTouchEnd = e => { |
| 91 | const touchEndtPageX = e.changedTouches[0].pageX; | 92 | const touchEndtPageX = e.changedTouches[0].pageX; |
| 92 | const touchEndtPageY = e.changedTouches[0].pageY; | 93 | const touchEndtPageY = e.changedTouches[0].pageY; |
| 93 | const touchDireactionX = touchEndtPageX - this.state.touchStartPageX; // 滑动横向坐标 | 94 | const touchDireactionX = touchEndtPageX - this.state.touchStartPageX; // 滑动横向坐标 |
| 94 | const touchDireactionY = touchEndtPageY - this.state.touchStartPageY; // 滑动横向坐标 | 95 | const touchDireactionY = touchEndtPageY - this.state.touchStartPageY; // 滑动横向坐标 |
| 95 | - if (touchDireactionX > 100 && touchDireactionY > -80) { // 滑动一定距离 | 96 | + if (touchDireactionX > 100 && touchDireactionY > -80) { |
| 97 | + // 滑动一定距离 | ||
| 96 | const { plus } = window; | 98 | const { plus } = window; |
| 97 | - if (location.pathname === '/indexMobile') { | ||
| 98 | - alert('确定退出吗?', '', [ | ||
| 99 | - { text: '取消', onPress: () => {} }, | ||
| 100 | - { text: '是', onPress: () => plus.runtime.quit() }, // 关闭app | 99 | + if (location.pathname === "/indexMobile") { |
| 100 | + alert("确定退出吗?", "", [ | ||
| 101 | + { text: "取消", onPress: () => {} }, | ||
| 102 | + { text: "是", onPress: () => plus.runtime.quit() }, // 关闭app | ||
| 101 | ]); | 103 | ]); |
| 102 | } else { | 104 | } else { |
| 103 | window.history.back(-1); | 105 | window.history.back(-1); |
| 104 | } | 106 | } |
| 105 | } | 107 | } |
| 106 | - } | 108 | + }; |
| 107 | renderContent(pageText) { | 109 | renderContent(pageText) { |
| 108 | - if (pageText === 'message') { | ||
| 109 | - if (location.pathname === '/indexMobile/examine') { | 110 | + if (pageText === "message") { |
| 111 | + if (location.pathname === "/indexMobile/examine") { | ||
| 110 | return ( | 112 | return ( |
| 111 | <div className={styles.demoContainer}> | 113 | <div className={styles.demoContainer}> |
| 112 | <ExamineMobile {...this.props} /> | 114 | <ExamineMobile {...this.props} /> |
| @@ -119,26 +121,26 @@ class IndexMobile extends React.Component { | @@ -119,26 +121,26 @@ class IndexMobile extends React.Component { | ||
| 119 | </div> | 121 | </div> |
| 120 | ); | 122 | ); |
| 121 | } | 123 | } |
| 122 | - } else if (pageText === 'scene') { | ||
| 123 | - if (location.pathname === '/indexMobile/commobileList') { | 124 | + } else if (pageText === "scene") { |
| 125 | + if (location.pathname === "/indexMobile/commobileList") { | ||
| 124 | return ( | 126 | return ( |
| 125 | <div className={styles.demoContainer}> | 127 | <div className={styles.demoContainer}> |
| 126 | <CommobileList {...this.props} /> | 128 | <CommobileList {...this.props} /> |
| 127 | </div> | 129 | </div> |
| 128 | ); | 130 | ); |
| 129 | - } else if (location.pathname === '/indexMobile/printPdf') { | 131 | + } else if (location.pathname === "/indexMobile/printPdf") { |
| 130 | return ( | 132 | return ( |
| 131 | <div className={styles.demoContainer}> | 133 | <div className={styles.demoContainer}> |
| 132 | <CommobilePrintPdf {...this.props} /> | 134 | <CommobilePrintPdf {...this.props} /> |
| 133 | </div> | 135 | </div> |
| 134 | ); | 136 | ); |
| 135 | - } else if (location.pathname === '/indexMobile/processReport') { | 137 | + } else if (location.pathname === "/indexMobile/processReport") { |
| 136 | return ( | 138 | return ( |
| 137 | <div className={styles.demoContainer}> | 139 | <div className={styles.demoContainer}> |
| 138 | <ProcessReportMobile {...this.props} /> | 140 | <ProcessReportMobile {...this.props} /> |
| 139 | </div> | 141 | </div> |
| 140 | ); | 142 | ); |
| 141 | - } else if (location.pathname === '/indexMobile/commobileBill') { | 143 | + } else if (location.pathname === "/indexMobile/commobileBill") { |
| 142 | return ( | 144 | return ( |
| 143 | <div className={styles.demoContainer}> | 145 | <div className={styles.demoContainer}> |
| 144 | <CommobileBill {...this.props} /> | 146 | <CommobileBill {...this.props} /> |
| @@ -152,14 +154,14 @@ class IndexMobile extends React.Component { | @@ -152,14 +154,14 @@ class IndexMobile extends React.Component { | ||
| 152 | </div> | 154 | </div> |
| 153 | ); | 155 | ); |
| 154 | } | 156 | } |
| 155 | - } else if (pageText === 'workbench') { | ||
| 156 | - if (location.pathname === '/indexMobile/commobileList') { | 157 | + } else if (pageText === "workbench") { |
| 158 | + if (location.pathname === "/indexMobile/commobileList") { | ||
| 157 | return ( | 159 | return ( |
| 158 | <div className={styles.demoContainer}> | 160 | <div className={styles.demoContainer}> |
| 159 | <CommobileList {...this.props} /> | 161 | <CommobileList {...this.props} /> |
| 160 | </div> | 162 | </div> |
| 161 | ); | 163 | ); |
| 162 | - } else if (location.pathname === '/indexMobile/commobileBill') { | 164 | + } else if (location.pathname === "/indexMobile/commobileBill") { |
| 163 | return ( | 165 | return ( |
| 164 | <div className={styles.demoContainer}> | 166 | <div className={styles.demoContainer}> |
| 165 | <CommobileBill {...this.props} /> | 167 | <CommobileBill {...this.props} /> |
| @@ -172,24 +174,22 @@ class IndexMobile extends React.Component { | @@ -172,24 +174,22 @@ class IndexMobile extends React.Component { | ||
| 172 | </div> | 174 | </div> |
| 173 | ); | 175 | ); |
| 174 | } | 176 | } |
| 175 | - } else if (pageText === 'device') { | ||
| 176 | - return ( | ||
| 177 | - <CommobileList {...this.props} sModelsId="101251240115015888433389260" /> | ||
| 178 | - ); | ||
| 179 | - } else if (pageText === 'myself') { | ||
| 180 | - if (location.pathname === '/indexMobile/contacts') { | 177 | + } else if (pageText === "device") { |
| 178 | + return <CommobileList {...this.props} sModelsId="101251240115015888433389260" />; | ||
| 179 | + } else if (pageText === "myself") { | ||
| 180 | + if (location.pathname === "/indexMobile/contacts") { | ||
| 181 | return ( | 181 | return ( |
| 182 | <div className={styles.demoContainer}> | 182 | <div className={styles.demoContainer}> |
| 183 | <ContactsMobile {...this.props} sModelType={pageText} sModelsId="101251240115015888435981690" /> | 183 | <ContactsMobile {...this.props} sModelType={pageText} sModelsId="101251240115015888435981690" /> |
| 184 | </div> | 184 | </div> |
| 185 | ); | 185 | ); |
| 186 | - } else if (location.pathname === '/indexMobile/revisePassword') { | 186 | + } else if (location.pathname === "/indexMobile/revisePassword") { |
| 187 | return ( | 187 | return ( |
| 188 | <div className={styles.demoContainer}> | 188 | <div className={styles.demoContainer}> |
| 189 | <RevisePasswordMobile {...this.props} sModelsId="101251240115015888435981690" /> | 189 | <RevisePasswordMobile {...this.props} sModelsId="101251240115015888435981690" /> |
| 190 | </div> | 190 | </div> |
| 191 | ); | 191 | ); |
| 192 | - } else if (location.pathname === '/indexMobile/contactsInfo') { | 192 | + } else if (location.pathname === "/indexMobile/contactsInfo") { |
| 193 | return ( | 193 | return ( |
| 194 | <div className={styles.demoContainer}> | 194 | <div className={styles.demoContainer}> |
| 195 | <ContactsInfoMobile {...this.props} sModelsId="101251240115015892479567200" /> | 195 | <ContactsInfoMobile {...this.props} sModelsId="101251240115015892479567200" /> |
| @@ -207,8 +207,8 @@ class IndexMobile extends React.Component { | @@ -207,8 +207,8 @@ class IndexMobile extends React.Component { | ||
| 207 | 207 | ||
| 208 | render() { | 208 | render() { |
| 209 | const { hidden } = this.state; | 209 | const { hidden } = this.state; |
| 210 | - const TabBarHidden = location.pathname === '/indexMobile' ? hidden : true; | ||
| 211 | - const navbarIconShow = !['/indexMobile/commobileBill'].includes(location.pathname); | 210 | + const TabBarHidden = location.pathname === "/indexMobile" ? hidden : true; |
| 211 | + const navbarIconShow = !["/indexMobile/commobileBill"].includes(location.pathname); | ||
| 212 | const msg = this.props.app.unRead; | 212 | const msg = this.props.app.unRead; |
| 213 | const msgObj = commonUtils.isJSON(msg) ? JSON.parse(msg) : {}; | 213 | const msgObj = commonUtils.isJSON(msg) ? JSON.parse(msg) : {}; |
| 214 | return ( | 214 | return ( |
| @@ -216,14 +216,13 @@ class IndexMobile extends React.Component { | @@ -216,14 +216,13 @@ class IndexMobile extends React.Component { | ||
| 216 | <div className="demoName"> | 216 | <div className="demoName"> |
| 217 | <NavBar | 217 | <NavBar |
| 218 | // mode="light" | 218 | // mode="light" |
| 219 | - style={{ background: '#f0f0f0', color: '#888' }} | 219 | + style={{ background: "#f0f0f0", color: "#888" }} |
| 220 | icon={TabBarHidden && navbarIconShow ? <Icon type="left" /> : null} | 220 | icon={TabBarHidden && navbarIconShow ? <Icon type="left" /> : null} |
| 221 | onLeftClick={() => { | 221 | onLeftClick={() => { |
| 222 | if (TabBarHidden && navbarIconShow) { | 222 | if (TabBarHidden && navbarIconShow) { |
| 223 | window.history.back(-1); | 223 | window.history.back(-1); |
| 224 | } | 224 | } |
| 225 | - } | ||
| 226 | - } | 225 | + }} |
| 227 | className={styles.iconColor} | 226 | className={styles.iconColor} |
| 228 | > | 227 | > |
| 229 | {this.state.title} | 228 | {this.state.title} |
| @@ -231,9 +230,17 @@ class IndexMobile extends React.Component { | @@ -231,9 +230,17 @@ class IndexMobile extends React.Component { | ||
| 231 | </div> | 230 | </div> |
| 232 | <div | 231 | <div |
| 233 | className="demo-preview-item" | 232 | className="demo-preview-item" |
| 234 | - style={this.state.fullScreen ? { | ||
| 235 | - position: 'fixed', width: '100%', top: '40px', bottom: 0, background: '#f0f0f0', | ||
| 236 | - } : { height: 400 }} | 233 | + style={ |
| 234 | + this.state.fullScreen | ||
| 235 | + ? { | ||
| 236 | + position: "fixed", | ||
| 237 | + width: "100%", | ||
| 238 | + top: "40px", | ||
| 239 | + bottom: 0, | ||
| 240 | + background: "#f0f0f0", | ||
| 241 | + } | ||
| 242 | + : { height: 400 } | ||
| 243 | + } | ||
| 237 | onTouchStart={this.handleTouchStart.bind(this)} | 244 | onTouchStart={this.handleTouchStart.bind(this)} |
| 238 | onTouchEnd={this.handleTouchEnd.bind(this)} | 245 | onTouchEnd={this.handleTouchEnd.bind(this)} |
| 239 | > | 246 | > |
| @@ -243,139 +250,153 @@ class IndexMobile extends React.Component { | @@ -243,139 +250,153 @@ class IndexMobile extends React.Component { | ||
| 243 | tintColor="#33A3F4" | 250 | tintColor="#33A3F4" |
| 244 | barTintColor="white" | 251 | barTintColor="white" |
| 245 | hidden={TabBarHidden} | 252 | hidden={TabBarHidden} |
| 246 | - style={{ display: location.pathname === '/indexMobile' ? 'block' : 'none' }} | 253 | + style={{ display: location.pathname === "/indexMobile" ? "block" : "none" }} |
| 247 | > | 254 | > |
| 248 | <TabBar.Item | 255 | <TabBar.Item |
| 249 | title="消息" | 256 | title="消息" |
| 250 | key="message" | 257 | key="message" |
| 251 | - icon={<div style={{ | ||
| 252 | - width: '22px', | ||
| 253 | - height: '22px', | ||
| 254 | - background: `url(${Icon11}) center center / 21px 21px no-repeat`, | ||
| 255 | - }} | ||
| 256 | - /> | 258 | + icon={ |
| 259 | + <div | ||
| 260 | + style={{ | ||
| 261 | + width: "22px", | ||
| 262 | + height: "22px", | ||
| 263 | + background: `url(${Icon11}) center center / 21px 21px no-repeat`, | ||
| 264 | + }} | ||
| 265 | + /> | ||
| 257 | } | 266 | } |
| 258 | - selectedIcon={<div style={{ | ||
| 259 | - width: '22px', | ||
| 260 | - height: '22px', | ||
| 261 | - background: `url(${Icon1}) center center / 21px 21px no-repeat`, | ||
| 262 | - }} | ||
| 263 | - /> | 267 | + selectedIcon={ |
| 268 | + <div | ||
| 269 | + style={{ | ||
| 270 | + width: "22px", | ||
| 271 | + height: "22px", | ||
| 272 | + background: `url(${Icon1}) center center / 21px 21px no-repeat`, | ||
| 273 | + }} | ||
| 274 | + /> | ||
| 264 | } | 275 | } |
| 265 | - selected={this.state.selectedTab === 'message'} | 276 | + selected={this.state.selectedTab === "message"} |
| 266 | badge={msgObj.iCount || 0} | 277 | badge={msgObj.iCount || 0} |
| 267 | onPress={() => { | 278 | onPress={() => { |
| 268 | const { app } = this.props; | 279 | const { app } = this.props; |
| 269 | const { token } = app; | 280 | const { token } = app; |
| 270 | commonBusiness.clearSocketData({ token, value: {}, sModelsId: 100 }); | 281 | commonBusiness.clearSocketData({ token, value: {}, sModelsId: 100 }); |
| 271 | this.setState({ | 282 | this.setState({ |
| 272 | - selectedTab: 'message', title: '消息', | 283 | + selectedTab: "message", |
| 284 | + title: "消息", | ||
| 273 | }); | 285 | }); |
| 274 | - this.props.dispatch(history.push('/indexMobile')); | 286 | + this.props.dispatch(history.push("/indexMobile")); |
| 275 | }} | 287 | }} |
| 276 | data-seed="logId" | 288 | data-seed="logId" |
| 277 | > | 289 | > |
| 278 | - {this.state.selectedTab === 'message' ? this.renderContent(this.state.selectedTab) : ''} | 290 | + {this.state.selectedTab === "message" ? this.renderContent(this.state.selectedTab) : ""} |
| 279 | </TabBar.Item> | 291 | </TabBar.Item> |
| 280 | <TabBar.Item | 292 | <TabBar.Item |
| 281 | icon={ | 293 | icon={ |
| 282 | - <div style={{ | ||
| 283 | - width: '22px', | ||
| 284 | - height: '22px', | ||
| 285 | - background: `url(${Icon21}) center center / 21px 21px no-repeat`, | ||
| 286 | - }} | 294 | + <div |
| 295 | + style={{ | ||
| 296 | + width: "22px", | ||
| 297 | + height: "22px", | ||
| 298 | + background: `url(${Icon21}) center center / 21px 21px no-repeat`, | ||
| 299 | + }} | ||
| 287 | /> | 300 | /> |
| 288 | } | 301 | } |
| 289 | selectedIcon={ | 302 | selectedIcon={ |
| 290 | - <div style={{ | ||
| 291 | - width: '22px', | ||
| 292 | - height: '22px', | ||
| 293 | - background: `url(${Icon2}) center center / 21px 21px no-repeat`, | ||
| 294 | - }} | 303 | + <div |
| 304 | + style={{ | ||
| 305 | + width: "22px", | ||
| 306 | + height: "22px", | ||
| 307 | + background: `url(${Icon2}) center center / 21px 21px no-repeat`, | ||
| 308 | + }} | ||
| 295 | /> | 309 | /> |
| 296 | } | 310 | } |
| 297 | title="现场" | 311 | title="现场" |
| 298 | key="scene" | 312 | key="scene" |
| 299 | // badge="new" | 313 | // badge="new" |
| 300 | - selected={this.state.selectedTab === 'scene'} | 314 | + selected={this.state.selectedTab === "scene"} |
| 301 | onPress={() => { | 315 | onPress={() => { |
| 302 | const { app } = this.props; | 316 | const { app } = this.props; |
| 303 | const { token } = app; | 317 | const { token } = app; |
| 304 | commonBusiness.clearSocketData({ token, value: {}, sModelsId: 100 }); | 318 | commonBusiness.clearSocketData({ token, value: {}, sModelsId: 100 }); |
| 305 | this.setState({ | 319 | this.setState({ |
| 306 | - selectedTab: 'scene', title: '现场', | 320 | + selectedTab: "scene", |
| 321 | + title: "现场", | ||
| 307 | }); | 322 | }); |
| 308 | - this.props.dispatch(history.push('/indexMobile')); | 323 | + this.props.dispatch(history.push("/indexMobile")); |
| 309 | }} | 324 | }} |
| 310 | data-seed="logId1" | 325 | data-seed="logId1" |
| 311 | > | 326 | > |
| 312 | - {this.state.selectedTab === 'scene' ? this.renderContent(this.state.selectedTab) : ''} | 327 | + {this.state.selectedTab === "scene" ? this.renderContent(this.state.selectedTab) : ""} |
| 313 | </TabBar.Item> | 328 | </TabBar.Item> |
| 314 | <TabBar.Item | 329 | <TabBar.Item |
| 315 | icon={ | 330 | icon={ |
| 316 | - <div style={{ | ||
| 317 | - width: '22px', | ||
| 318 | - height: '22px', | ||
| 319 | - background: `url(${Icon31}) center center / 21px 21px no-repeat`, | ||
| 320 | - }} | 331 | + <div |
| 332 | + style={{ | ||
| 333 | + width: "22px", | ||
| 334 | + height: "22px", | ||
| 335 | + background: `url(${Icon31}) center center / 21px 21px no-repeat`, | ||
| 336 | + }} | ||
| 321 | /> | 337 | /> |
| 322 | } | 338 | } |
| 323 | selectedIcon={ | 339 | selectedIcon={ |
| 324 | - <div style={{ | ||
| 325 | - width: '22px', | ||
| 326 | - height: '22px', | ||
| 327 | - background: `url(${Icon3}) center center / 21px 21px no-repeat`, | ||
| 328 | - }} | 340 | + <div |
| 341 | + style={{ | ||
| 342 | + width: "22px", | ||
| 343 | + height: "22px", | ||
| 344 | + background: `url(${Icon3}) center center / 21px 21px no-repeat`, | ||
| 345 | + }} | ||
| 329 | /> | 346 | /> |
| 330 | } | 347 | } |
| 331 | title="工作台" | 348 | title="工作台" |
| 332 | key="workbench" | 349 | key="workbench" |
| 333 | // badge="2" | 350 | // badge="2" |
| 334 | - selected={this.state.selectedTab === 'workbench'} | 351 | + selected={this.state.selectedTab === "workbench"} |
| 335 | onPress={() => { | 352 | onPress={() => { |
| 336 | const { app } = this.props; | 353 | const { app } = this.props; |
| 337 | const { token } = app; | 354 | const { token } = app; |
| 338 | commonBusiness.clearSocketData({ token, value: {}, sModelsId: 100 }); | 355 | commonBusiness.clearSocketData({ token, value: {}, sModelsId: 100 }); |
| 339 | this.setState({ | 356 | this.setState({ |
| 340 | - selectedTab: 'workbench', title: '工作台', | 357 | + selectedTab: "workbench", |
| 358 | + title: "工作台", | ||
| 341 | }); | 359 | }); |
| 342 | - this.props.dispatch(history.push('/indexMobile')); | 360 | + this.props.dispatch(history.push("/indexMobile")); |
| 343 | }} | 361 | }} |
| 344 | > | 362 | > |
| 345 | - {this.state.selectedTab === 'workbench' ? this.renderContent(this.state.selectedTab) : ''} | 363 | + {this.state.selectedTab === "workbench" ? this.renderContent(this.state.selectedTab) : ""} |
| 346 | </TabBar.Item> | 364 | </TabBar.Item> |
| 347 | <TabBar.Item | 365 | <TabBar.Item |
| 348 | icon={ | 366 | icon={ |
| 349 | - <div style={{ | ||
| 350 | - width: '22px', | ||
| 351 | - height: '22px', | ||
| 352 | - background: `url(${Icon51}) center center / 21px 21px no-repeat`, | ||
| 353 | - }} | 367 | + <div |
| 368 | + style={{ | ||
| 369 | + width: "22px", | ||
| 370 | + height: "22px", | ||
| 371 | + background: `url(${Icon51}) center center / 21px 21px no-repeat`, | ||
| 372 | + }} | ||
| 354 | /> | 373 | /> |
| 355 | } | 374 | } |
| 356 | selectedIcon={ | 375 | selectedIcon={ |
| 357 | - <div style={{ | ||
| 358 | - width: '22px', | ||
| 359 | - height: '22px', | ||
| 360 | - background: `url(${Icon5}) center center / 21px 21px no-repeat`, | ||
| 361 | - }} | 376 | + <div |
| 377 | + style={{ | ||
| 378 | + width: "22px", | ||
| 379 | + height: "22px", | ||
| 380 | + background: `url(${Icon5}) center center / 21px 21px no-repeat`, | ||
| 381 | + }} | ||
| 362 | /> | 382 | /> |
| 363 | } | 383 | } |
| 364 | title="我的" | 384 | title="我的" |
| 365 | key="contacts" | 385 | key="contacts" |
| 366 | // badge="4" | 386 | // badge="4" |
| 367 | - selected={this.state.selectedTab === 'myself'} | 387 | + selected={this.state.selectedTab === "myself"} |
| 368 | onPress={() => { | 388 | onPress={() => { |
| 369 | const { app } = this.props; | 389 | const { app } = this.props; |
| 370 | const { token } = app; | 390 | const { token } = app; |
| 371 | commonBusiness.clearSocketData({ token, value: {}, sModelsId: 100 }); | 391 | commonBusiness.clearSocketData({ token, value: {}, sModelsId: 100 }); |
| 372 | this.setState({ | 392 | this.setState({ |
| 373 | - selectedTab: 'myself', title: '我的', | 393 | + selectedTab: "myself", |
| 394 | + title: "我的", | ||
| 374 | }); | 395 | }); |
| 375 | - this.props.dispatch(history.push('/indexMobile')); | 396 | + this.props.dispatch(history.push("/indexMobile")); |
| 376 | }} | 397 | }} |
| 377 | > | 398 | > |
| 378 | - {this.state.selectedTab === 'myself' ? this.renderContent(this.state.selectedTab) : ''} | 399 | + {this.state.selectedTab === "myself" ? this.renderContent(this.state.selectedTab) : ""} |
| 379 | </TabBar.Item> | 400 | </TabBar.Item> |
| 380 | </TabBar> | 401 | </TabBar> |
| 381 | </div> | 402 | </div> |
| @@ -383,6 +404,4 @@ class IndexMobile extends React.Component { | @@ -383,6 +404,4 @@ class IndexMobile extends React.Component { | ||
| 383 | ); | 404 | ); |
| 384 | } | 405 | } |
| 385 | } | 406 | } |
| 386 | -export default connect(({ app, routing }) => | ||
| 387 | - ({ app, routing }))(IndexMobile); | ||
| 388 | - | 407 | +export default connect(({ app, routing }) => ({ app, routing }))(IndexMobile); |
src/routes/mobile/IndexSrmMobile.js
| 1 | /* eslint-disable */ | 1 | /* eslint-disable */ |
| 2 | import React from 'react'; | 2 | import React from 'react'; |
| 3 | import 'antd-mobile-v2/dist/antd-mobile.css'; | 3 | import 'antd-mobile-v2/dist/antd-mobile.css'; |
| 4 | -import { Icon, NavBar, TabBar, Modal } from 'antd-mobile'; | ||
| 5 | -import { connect,history } from 'dva'; | 4 | +import { Icon, NavBar, TabBar, Modal } from 'antd-mobile-v2'; |
| 5 | +// import { history } from 'dva/router'; | ||
| 6 | +import { connect,history } from 'umi'; | ||
| 6 | 7 | ||
| 7 | import styles from './IndexMobile.less'; | 8 | import styles from './IndexMobile.less'; |
| 8 | import SceneSrmMobile from './common/SceneSrmMobile'; | 9 | import SceneSrmMobile from './common/SceneSrmMobile'; |
src/routes/mobile/commobileList/commobileList.js
| @@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
| 4 | */ | 4 | */ |
| 5 | 5 | ||
| 6 | import React from 'react'; | 6 | import React from 'react'; |
| 7 | -import { connect } from 'dva'; | 7 | +import { connect } from 'umi'; |
| 8 | import CommobileListComponent from '../../../mobile/common/CommobileList'; | 8 | import CommobileListComponent from '../../../mobile/common/CommobileList'; |
| 9 | import * as commonUtils from '../../../utils/utils'; | 9 | import * as commonUtils from '../../../utils/utils'; |
| 10 | 10 |
src/utils/common/message.js
| 1 | /* eslint-disable */ | 1 | /* eslint-disable */ |
| 2 | import { Modal, message as antdMessage } from 'antd-v4'; | 2 | import { Modal, message as antdMessage } from 'antd-v4'; |
| 3 | -import { Modal as mobileModal } from 'antd-mobile'; | 3 | +import { Modal as mobileModal } from 'antd-mobile-v2'; |
| 4 | 4 | ||
| 5 | const { warning } = Modal; | 5 | const { warning } = Modal; |
| 6 | const antdMobileAlert = mobileModal.alert; | 6 | const antdMobileAlert = mobileModal.alert; |