tplus-portaltouch 3.43.1 → 3.44.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/dutyandsettle/dutysettlebill.js +55 -81
- package/dist/components/dutyandsettle/dutysettlebill.js.map +1 -1
- package/dist/components/header/style.less +4 -3
- package/dist/containers/Main/index.js +7 -4
- package/dist/containers/Main/index.js.map +1 -1
- package/dist/pages/Portalbc/index.js +45 -69
- package/dist/pages/Portalbc/index.js.map +1 -1
- package/dist/pages/Portalbc/index.less +3 -2
- package/dist/stores/IframeStore.js +140 -0
- package/dist/stores/IframeStore.js.map +1 -0
- package/dist/stores/index.js +6 -1
- package/dist/stores/index.js.map +1 -1
- package/package.json +37 -37
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["tplus-portaltouch/containers/Main/index.js"],"names":["Main","hasElectron","env","platform","constant","electron","window","rx$","MainContainer","observer","props","currentFocus","initWebFrameZoom","webFrame","value","localStore","get","setZoomFactor","parseFloat","doDeeplinkingUrl","ipcRenderer","on","event","ret","params","console","log","stores","user","orgId","userId","param","split","reduce","accumulator","current","key","cloudUserId","User","logout","changeLogoSubject","subject","Subject","changeLogo","subscribe","next","v","setLogo","changeHsySubject","changeHsy","setHsy","addHotKeyChangeLister","document","addEventListener","registerHotKey","removeHotKeyChangeLister","removeEventListener","back","fn","setState","hsy_s","hsy_f","store","logoUrl","logo","logoNode","url","isPortal","isLogin","state","isVerticalTouch","isNewRetailBCPos","bcParams","theme","portalStore","themeStore","defualtImage","hotKeyInjectOrEject","type","hotKeyAction","registerKeys","allKeys","hotKey","hotKeyConfig","forEach","keyboard","index","nativeMs","onIpcRendererGlobalShortcut","hotKeyActionHandle","blurButton","target","nodeName","blur","isSetHotKey","hotKeyCreate","observerCallback","observerDom","pressed","clickBefore","activeElement","filter","srcElement","tagName","className","indexOf","undefined","attributes","childList","subtree","attributeFilter","register","operationKeys","esc","enter","modals","querySelectorAll","modal","style","display","drawers","modalsAndDrawers","sort","dom1","dom2","style1","getComputedStyle","style2","zIndex","visibleDom","length","$","clearFocus","setFocus","getFocusId","querySelector","find","handle","toggleKeyCode","message","bind","keys","i","unbind","Message","info","action","handleInfoRender","solt","onCollapse","collapsed","menuOnClick","selectedKeys","handleClose","Keyboard","close","handleOk","count","modifyPassStore","modifyPassWord","headMenuSelect","footer","text","closable","map","btn","loading","modalRouter","hide","offlineSys","shouldInOffline","show","title","width","modalType","onHide","destroyOnClose","history","push","portalStores","posLoginStore","savePosCode","isAutoTest","location","search","isShowFourTab","screen","isHorizontalPad","storeUtil","isHorizontalSunMi","isHorizontalSunMi_FuPing","isMobileEnvironment","infoRender","headHook","addClass","id","removeClass","currentId","actionHook","actionFrom","actionChange","body","classList","add","ModalWraper","confirm","content","cancelable","onOk","onCancel","unsubscribe","portalHead","loginHead","retailOrder","pathname","storeInfo","options","isRetailOrder","headProps","businessName","storeName","dateFormat","menu","icon","onClick","orgName","posCode","posIsLogin","hideAll","classNames","layoutClassName","join","height","match","isExact","routes","Component","childContextTypes","PropTypes","func","object","React","cloneElement"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBA4ZwBA,I;;AA5ZxB;;;;AACA;;;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AAEA,IAAMC,cAAeC,oBAAIC,QAAJ,KAAiBD,oBAAIE,QAAJ,CAAaD,QAAb,CAAsBE,QAA5D;AACAC,OAAOC,GAAP,GAAa,EAAb;;IAGMC,a,OADLC,mB;;;AAGC,yBAAYC,KAAZ,EAAmB;AAAA;;AAAA,oJACXA,KADW;;AAAA,UADnBC,YACmB,GADJ,IACI;;AAAA,UA2BnBC,gBA3BmB,GA2BA,YAAM;AACvB,UAAIC,WAAW,MAAKR,QAAL,GAAgB,MAAKA,QAAL,CAAcQ,QAA9B,GAAyC,IAAxD;AACA,UAAIC,QAAQC,2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AU,cAAV,GAA2B,EAAxF,CAJF;AAKE,qBAASA,OALX;AAME,sBAAU,KAAK1D,KAAL,CAAW6K,QANvB;AAOE,qBAAS,KAAK7K,KAAL,CAAWuK;AAPtB,aADF;AAUE;AAAC,wCAAD,CAAQ,OAAR;AAAA;AACG,iBAAKvK,KAAL,CAAW+N,KAAX,CAAiBC,OAAjB,GAA4B,8BAAC,kBAAD,OAA5B,GAAgD;AAAC,oCAAD;AAAA;AAAS,mBAAKhO,KAAL,CAAWiO;AAApB;AADnD;AAVF;AAJF,OADF;AAqBD;;;EAtYyBC,gB,WAuBnBC,iB,GAAoB;AACzB7C,cAAY8C,oBAAUC,IADG;AAEzB9C,YAAU6C,oBAAUE,MAFK;AAGzB1C,cAAYwC,oBAAUE;AAHG,C;;AAkXd,SAAShP,IAAT,CAAcU,KAAd,EAAqB;AAAA,MAC1BiO,MAD0B,GACFjO,KADE,CAC1BiO,MAD0B;AAAA,MAClBpE,WADkB,GACF7J,KADE,CAClB6J,WADkB;;;AAGlC,MAAIA,WAAJ,EAAiB;AACf,WAAO;AAAC,4BAAD;AAAA;AAASoE;AAAT,KAAP;AACD;;AAED,SAAOM,gBAAMC,YAAN,CAAmB,8BAAC,aAAD,OAAnB,EAAsCxO,KAAtC,CAAP;AACD","file":"index.js","sourcesContent":["import React, { Component } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { observer } from 'mobx-react';\r\nimport { Button } from 'antd';\r\nimport { history, Switch, stores, env, nativeMs, localStore } from 'mutants-microfx';\r\nimport { Ticon, Layout, Keyboard, ModalWraper, Message, hotKey } from 'tplus-components-touch';\r\nimport { platform, localStore as storeUtil } from 'mutants-util';\r\nimport { User } from 'tplus-api';\r\nimport { Subject } from 'rxjs';\r\nimport { Redirect } from 'react-router';\r\nimport Header from '../../components/header';\r\nimport PortalPageBC from '../../pages/Portalbc';\r\nimport portalStores from '../../stores';\r\nimport { closeWebPage, getQueryString, operationKeys } from '../../utils/index';\r\n\r\nconst hasElectron = (env.platform === env.constant.platform.electron);\r\nwindow.rx$ = {};\r\n\r\n@observer\r\nclass MainContainer extends Component {\r\n currentFocus = null;\r\n constructor(props) {\r\n super(props);\r\n this.hasElectron = hasElectron;\r\n this.state = {\r\n hsy_s: false,\r\n hsy_f: null\r\n };\r\n portalStores.posLoginStore.savePosCode();\r\n this.electron = nativeMs && nativeMs.get('electron');\r\n this.isAutoTest = getQueryString(location.search, 'at');\r\n this.isShowFourTab = this.hasElectron && window.screen.width < 1024 ? true : false;\r\n //针对800*600分辨率下,页面显示不全的做一下处理。\r\n if (this.isShowFourTab == true) this.initWebFrameZoom();\r\n\r\n const isHorizontalPad = storeUtil.get('isHorizontalPad')// 是否在PAD\r\n const isHorizontalSunMi = storeUtil.get('isHorizontalSunMi'); //是否在商米(SunMi)\r\n const isHorizontalSunMi_FuPing = storeUtil.get('isHorizontalSunMi_FuPing'); //是否在商米(SunMi)\r\n\r\n this.isHorizontalSunMi_FuPing = !!isHorizontalSunMi_FuPing;\r\n this.isMobileEnvironment = !!isHorizontalPad || !!isHorizontalSunMi || !!isHorizontalSunMi_FuPing;\r\n }\r\n static childContextTypes = {\r\n infoRender: PropTypes.func,\r\n headHook: PropTypes.object,\r\n actionHook: PropTypes.object,\r\n }\r\n\r\n initWebFrameZoom = () => {\r\n let webFrame = this.electron ? this.electron.webFrame : null;\r\n let value = localStore.get('webFrameZoomValue') || '0.7';\r\n if (webFrame) webFrame.setZoomFactor(parseFloat(value));\r\n }\r\n getChildContext() {\r\n return {\r\n infoRender: this.handleInfoRender,\r\n headHook: {\r\n addClass: (id, key) => {\r\n this.setState(state => ({\r\n [key]: [...(state[key] || []), id],\r\n }));\r\n },\r\n removeClass: (id, key) => {\r\n this.setState(state => ({\r\n [key]: state[key].filter(currentId => currentId !== id),\r\n }));\r\n }\r\n },\r\n actionHook: {\r\n actionFrom: this.actionFrom,\r\n actionChange: (value) => {\r\n this.actionFrom = value;\r\n }\r\n },\r\n };\r\n }\r\n\r\n // 内置默认\r\n // keys = ['esc', 'enter', 'ctrl+f1', ...Object.keys(hotKey.hotKeyConfig)];\r\n\r\n // 解决从url地址唤醒exe,不同账号的处理问题。\r\n doDeeplinkingUrl = () => {\r\n if (this.hasElectron === false) return;\r\n let { ipcRenderer } = this.electron || {ipcRenderer:null};\r\n ipcRenderer && ipcRenderer.on(\"asynchronous-deeplinkingUrl\", (event, ret, params) => {\r\n if (ret) {\r\n console.log('deeplinkingUrl:' + ret)\r\n const {orgId, userId} = stores.user || {};\r\n if (!orgId || !userId) return;\r\n const param = ret.split('&').reduce((accumulator, current) => {\r\n if (!current) return accumulator;\r\n const [key, value] = current.split('=') || [];\r\n accumulator[key] = value;\r\n return accumulator;\r\n }, {});\r\n console.log(orgId, userId, param)\r\n if (param.orgId !== orgId || param.cloudUserId !== userId) {\r\n User.logout();\r\n }\r\n }\r\n })\r\n }\r\n\r\n componentWillMount() {\r\n this.changeLogoSubject();\r\n this.changeHsySubject();\r\n const { isVerticalTouch } = platform || {};\r\n if (isVerticalTouch === true) {\r\n document.body.classList.add('vertical-touch-platform');\r\n }\r\n }\r\n\r\n changeLogoSubject = () => {\r\n const subject = new Subject();\r\n rx$.changeLogo = subject;\r\n\r\n subject\r\n .subscribe({\r\n next: (v) => this.setLogo(v)\r\n });\r\n }\r\n\r\n changeHsySubject = () => {\r\n const subject = new Subject();\r\n rx$.changeHsy = subject;\r\n\r\n subject\r\n .subscribe({\r\n next: (v) => this.setHsy(v)\r\n });\r\n }\r\n\r\n componentDidMount() {\r\n this.registerHotKey();\r\n this.addHotKeyChangeLister();\r\n rx$.changeLogo.next();\r\n document.body.addEventListener('focus', this.blurButton, true)\r\n this.doDeeplinkingUrl();\r\n\r\n if (this.hasElectron === true) {\r\n document.body.classList.add('electron-env');\r\n } else {\r\n if (this.isAutoTest || this.isMobileEnvironment) return; //自动化测试不弹窗\r\n ModalWraper.confirm({\r\n className: 'tplus-confirm-modal',\r\n title: \"温馨提示\",\r\n content: '智+新零售POS端不允许浏览器直接访问,请从智+产品中下载安装客户端程序使用!',\r\n cancelable:false,\r\n onOk() {\r\n closeWebPage();\r\n },\r\n onCancel(){\r\n closeWebPage();\r\n }\r\n });\r\n }\r\n }\r\n addHotKeyChangeLister = () => {\r\n document.addEventListener(\"RESET_USER_STORE\",this.registerHotKey);\r\n }\r\n removeHotKeyChangeLister = () => {\r\n document.removeEventListener(\"RESET_USER_STORE\",this.registerHotKey);\r\n }\r\n\r\n componentWillUnmount() {\r\n rx$.changeLogo.unsubscribe();\r\n rx$.changeHsy.unsubscribe();\r\n document.body.removeEventListener('focus', this.blurButton, true)\r\n // clearInterval(this.addObserverDomTimer);\r\n }\r\n\r\n setHsy = (v) => {\r\n const { back, fn } = v || {};\r\n if (back === true) {\r\n this.setState({ hsy_s: true, hsy_f: fn })\r\n } else {\r\n this.setState({ hsy_s: false, hsy_f: null })\r\n }\r\n }\r\n\r\n setLogo = (v) => {\r\n const store = localStore.get('StoreKey') || {};\r\n const { logo: logoUrl } = store;\r\n logoUrl && this.setState({ logoUrl });\r\n }\r\n\r\n logoNode = (url, isPortal, isLogin) => {\r\n const { hsy_s, hsy_f } = this.state;\r\n const { isVerticalTouch, isNewRetailBCPos } = platform || {};\r\n const bcParams = isNewRetailBCPos ? '-bc' : '';\r\n const theme = stores.portalStore.themeStore;\r\n const defualtImage = (isVerticalTouch === true) ? `https://newretail.static.chanjet.com/tinified/logo${bcParams}.png` : `https://newretail.static.chanjet.com/${((!hsy_s && isPortal) || (theme === 'dark' && !isLogin)) ? 'protal-chanjet' : 'chanjet'}-logo${bcParams}.png?v=1`;\r\n if (hsy_s === true) {\r\n return (<div className='business-logo-container'>\r\n <Ticon type='zhiPOS-fanhuishouye2' className='back_i' onClick={() => { hsy_f && hsy_f() }} />\r\n <img src={url || defualtImage} className=\"example-logo\" />\r\n </div>);\r\n }\r\n return <img src={url || defualtImage} className=\"example-logo\" />\r\n }\r\n\r\n //未使用?\r\n hotKeyInjectOrEject = (type, hotKeyAction) => {\r\n const registerKeys = ['esc', 'enter'];\r\n const allKeys = [...registerKeys, ...Object.keys(hotKey.hotKeyConfig)];\r\n allKeys.forEach((keyboard, index) => {\r\n nativeMs.onIpcRendererGlobalShortcut({ type, keyboard }, hotKeyActionHandle);\r\n });\r\n }\r\n\r\n blurButton = ({ target }) => { // 焦点为 button 时 移除焦点,防止触发 bee 组件enter快捷键\r\n if (target && target.nodeName === 'BUTTON') {\r\n target.blur();\r\n }\r\n }\r\n\r\n registerHotKey = () => {\r\n this.isSetHotKey = true;\r\n\r\n this.hotKeyCreate = hotKey({\r\n observerCallback: this.observerDom,\r\n log: true,\r\n pressed: this.hotKeyAction,\r\n clickBefore: () => {\r\n const { activeElement } = document;\r\n activeElement && activeElement.blur();\r\n },\r\n filter: event => {\r\n const { tagName, className } = event.target || event.srcElement || {};\r\n\r\n return !(event.key === 'Enter' && tagName === 'INPUT' && !~className.indexOf('hot-key-not-filter'));\r\n }\r\n });\r\n\r\n this.hotKeyCreate.observer(undefined, { attributes: true, childList: true, subtree: true ,attributeFilter: ['class', 'style'], });\r\n this.hotKeyCreate.register('esc')('.hot-key-focus-container')(operationKeys.esc);\r\n this.hotKeyCreate.register('enter')('.hot-key-focus-container')(operationKeys.enter);\r\n }\r\n\r\n observerDom = () => {\r\n\r\n const modals = [...document.querySelectorAll('.ant-modal-wrap')].filter((modal) => modal.style && modal.style.display !== 'none'); //ant-module\r\n const drawers = [...document.querySelectorAll('.ant-drawer-open')] //ant-drawer\r\n let modalsAndDrawers = [...modals, ...drawers].sort((dom1, dom2) => {\r\n let style1 = window.getComputedStyle(dom1);\r\n let style2 = window.getComputedStyle(dom2);\r\n return style2.zIndex - style1.zIndex\r\n });\r\n\r\n let visibleDom = modalsAndDrawers.length > 0 ? modalsAndDrawers[0] : null\r\n\r\n if (visibleDom) {\r\n if (this.currentFocus !== visibleDom) {\r\n $.clearFocus();\r\n this.currentFocus = visibleDom\r\n return $.setFocus(visibleDom);\r\n }\r\n return;\r\n }\r\n\r\n if ($.getFocusId() !== '1') {\r\n if (this.currentFocus !== 'App' || !document.querySelector(\".hot-key-focus-container\")) {\r\n $.clearFocus();\r\n this.currentFocus = 'App';\r\n $.find('.app', true).setFocus();\r\n }\r\n return;\r\n }\r\n }\r\n\r\n hotKeyAction = (event, handle) => {\r\n const { key } = handle || {};\r\n const toggleKeyCode = 'ctrl+f1';\r\n if (key === toggleKeyCode) {\r\n const isSetHotKey = this.isSetHotKey = !this.isSetHotKey;\r\n const message = isSetHotKey ? '设置' : '取消';\r\n if (isSetHotKey) {\r\n $.bind(this.keys.filter(i => i !== toggleKeyCode), this.hotKeyAction);\r\n } else {\r\n $.unbind(this.keys.filter(i => i !== toggleKeyCode));\r\n }\r\n return Message.info(`已${message}快捷键`);\r\n }\r\n\r\n $.action(key);\r\n }\r\n\r\n handleInfoRender = (solt) => {\r\n this.setState({solt})\r\n }\r\n onCollapse = () => {\r\n const {collapsed} = this.state;\r\n this.setState({collapsed: !collapsed});\r\n }\r\n menuOnClick = ({key}) => {\r\n console.log(key)\r\n this.setState({selectedKeys: key});\r\n }\r\n\r\n handleClose = () => {\r\n Keyboard.close();\r\n }\r\n\r\n handleOk = (type, count) => {\r\n stores.modifyPassStore.modifyPassWord();\r\n }\r\n\r\n headMenuSelect = ({key}) => {\r\n var footer = [\r\n {text: '取消', className: 'modifypass-cancal-button', closable: true, action: this.handleClose},\r\n {text: '确定', className: 'modifypass-ok-button', action: this.handleOk, type: 'primary'}\r\n ];\r\n footer = !!footer.length && <div>\r\n {footer.map((btn, i) =>\r\n <Button\r\n className={btn.className || ''}\r\n key={i}\r\n type={btn.type}\r\n loading={btn.loading}\r\n onClick={() => {\r\n const {action} = btn || {};\r\n if (typeof action === 'function') action();\r\n if (btn.closable) {\r\n stores.modalRouter.hide('/modifypass');\r\n }\r\n }}\r\n >\r\n {btn.text}\r\n </Button>)}\r\n </div>\r\n switch (key) {\r\n case 'logout':\r\n User.logout();\r\n break;\r\n case 'modifypass':\r\n {\r\n if(!stores.offlineSys.shouldInOffline()) return;\r\n stores.modalRouter.show({\r\n url: '/modifypass',\r\n title: '修改密码',\r\n className: 'modify-password',\r\n width: 402,\r\n footer,modalType:'mid',\r\n onHide: () => stores.modalRouter.hide('/modifypass'),\r\n destroyOnClose: true,\r\n });\r\n }\r\n break;\r\n default:\r\n history.push(`/${key}`);\r\n break;\r\n }\r\n }\r\n render() {\r\n const { collapsed, selectedKeys, solt, portalHead = [], loginHead = [], retailOrder = [], logoUrl, hsy_s } = this.state;\r\n const pathname = history.location.pathname;\r\n const storeInfo = stores.user.options.get('store');\r\n const isPortal = !!portalHead.length;\r\n const isLogin = !!loginHead.length;\r\n const isRetailOrder = !!retailOrder.length;\r\n const headProps = {\r\n logo: this.logoNode(logoUrl, isPortal, isLogin),\r\n businessName: '',\r\n storeName: '',\r\n dateFormat: 'yyyy年MM月dd日 hh:mm:ss',\r\n menu: [\r\n { title: '注销', key: 'logout', icon: 'zhuxiao' },\r\n { title: '修改密码', key: 'modifypass', icon: 'suoping' }\r\n ],\r\n onClick: this.headMenuSelect\r\n };\r\n if (storeInfo) {\r\n headProps.businessName = storeInfo.orgName;\r\n headProps.storeName = storeInfo.storeName;\r\n headProps.posCode = storeInfo.posCode;\r\n }\r\n\r\n // 如果存在商米副屏则优先加载商米副屏\r\n if (this.isHorizontalSunMi_FuPing) {\r\n return <Redirect to={'/vicescreen'} />\r\n }\r\n console.log('!stores.posLoginStore.posIsLogin=============', !stores.posLoginStore.posIsLogin);\r\n if (!stores.posLoginStore.posIsLogin && !~pathname.indexOf('login')) {\r\n stores.modalRouter.hideAll && stores.modalRouter.hideAll();\r\n return <Redirect to={'/login'} />\r\n }\r\n const classNames = ['isPortal-layout', 'isRetailOrder-layout'];\r\n const layoutClassName = [isPortal, isRetailOrder].map((v, i) => (v ? classNames[i] : '')).join(' ');\r\n return (\r\n <Layout\r\n style={{ height: '100%' }}\r\n className={layoutClassName}\r\n >\r\n <Layout>\r\n <Header\r\n {...headProps}\r\n solt={solt}\r\n isPortal={isPortal}\r\n className={`${(!hsy_s && isPortal) ? 'isPortal-head' : ''} ${isLogin ? 'isLogin-head' : ''}`}\r\n isLogin={isLogin}\r\n location={this.props.location}\r\n history={this.props.history}\r\n />\r\n <Layout.Content>\r\n {this.props.match.isExact ? (<PortalPageBC />) : <Switch>{this.props.routes}</Switch>}\r\n </Layout.Content>\r\n </Layout>\r\n </Layout>\r\n )\r\n }\r\n}\r\n\r\nexport default function Main(props) {\r\n const { routes, modalRouter } = props;\r\n\r\n if (modalRouter) {\r\n return <Switch>{routes}</Switch>;\r\n }\r\n\r\n return React.cloneElement(<MainContainer />, props);\r\n}\r\n"]}
|
1
|
+
{"version":3,"sources":["tplus-portaltouch/containers/Main/index.js"],"names":["Main","hasElectron","env","platform","constant","electron","window","rx$","MainContainer","observer","props","currentFocus","sys_parms","tinified_logo_bc","ossAliyuncsFileURL","protal_chanjet_logo_bc","chanjet_logo_bc","initWebFrameZoom","webFrame","value","localStore","get","setZoomFactor","parseFloat","doDeeplinkingUrl","ipcRenderer","on","event","ret","params","console","log","stores","user","orgId","userId","param","split","reduce","accumulator","current","key","cloudUserId","User","logout","changeLogoSubject","subject","Subject","changeLogo","subscribe","next","v","setLogo","changeHsySubject","changeHsy","setHsy","addHotKeyChangeLister","document","addEventListener","registerHotKey","removeHotKeyChangeLister","removeEventListener","back","fn","setState","hsy_s","hsy_f","store","logoUrl","logo","logoNode","url","isPortal","isLogin","state","isVerticalTouch","theme","portalStore","themeStore","defualtImage","hotKeyInjectOrEject","type","hotKeyAction","registerKeys","allKeys","hotKey","hotKeyConfig","forEach","keyboard","index","nativeMs","onIpcRendererGlobalShortcut","hotKeyActionHandle","blurButton","target","nodeName","blur","isSetHotKey","hotKeyCreate","observerCallback","observerDom","pressed","clickBefore","activeElement","filter","srcElement","tagName","className","indexOf","undefined","attributes","childList","subtree","attributeFilter","register","operationKeys","esc","enter","modals","querySelectorAll","modal","style","display","drawers","modalsAndDrawers","sort","dom1","dom2","style1","getComputedStyle","style2","zIndex","visibleDom","length","$","clearFocus","setFocus","getFocusId","querySelector","find","handle","toggleKeyCode","message","bind","keys","i","unbind","Message","info","action","handleInfoRender","solt","onCollapse","collapsed","menuOnClick","selectedKeys","handleClose","Keyboard","close","handleOk","count","modifyPassStore","modifyPassWord","headMenuSelect","footer","text","closable","map","btn","loading","modalRouter","hide","offlineSys","shouldInOffline","show","title","width","modalType","onHide","destroyOnClose","history","push","portalStores","posLoginStore","savePosCode","isAutoTest","location","search","isShowFourTab","screen","isHorizontalPad","storeUtil","isHorizontalSunMi","isHorizontalSunMi_FuPing","isMobileEnvironment","infoRender","headHook","addClass","id","removeClass","currentId","actionHook","actionFrom","actionChange","body","classList","add","ModalWraper","confirm","content","cancelable","onOk","onCancel","unsubscribe","portalHead","loginHead","retailOrder","pathname","storeInfo","options","isRetailOrder","headProps","businessName","storeName","dateFormat","menu","icon","onClick","orgName","posCode","posIsLogin","hideAll","classNames","layoutClassName","join","height","match","isExact","routes","Component","childContextTypes","PropTypes","func","object","React","cloneElement"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAmawBA,I;;AAnaxB;;;;AACA;;;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AAEA,IAAMC,cAAeC,oBAAIC,QAAJ,KAAiBD,oBAAIE,QAAJ,CAAaD,QAAb,CAAsBE,QAA5D;AACAC,OAAOC,GAAP,GAAa,EAAb;;IAGMC,a,OADLC,mB;;;AAWC,yBAAYC,KAAZ,EAAmB;AAAA;;AAAA,oJACXA,KADW;;AAAA,UARnBC,YAQmB,GARJ,IAQI;AAAA,UANnBC,SAMmB,GANP;AACVC,wBAAqBP,OAAOQ,kBAA5B,0BADU;AAEVC,8BAA2BT,OAAOQ,kBAAlC,gCAFU;AAGVE,uBAAoBV,OAAOQ,kBAA3B;AAHU,KAMO;;AAAA,UA2BnBG,gBA3BmB,GA2BA,YAAM;A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AHZ;AAIE,wBAAe,CAACP,KAAD,IAAUO,QAAX,GAAuB,eAAvB,GAAyC,EAAvD,WAA6DC,UAAU,cAAV,GAA2B,EAAxF,CAJF;AAKE,qBAASA,OALX;AAME,sBAAU,KAAK/D,KAAL,CAAWgL,QANvB;AAOE,qBAAS,KAAKhL,KAAL,CAAW0K;AAPtB,aADF;AAUE;AAAC,wCAAD,CAAQ,OAAR;AAAA;AACG,iBAAK1K,KAAL,CAAWkO,KAAX,CAAiBC,OAAjB,GAA4B,8BAAC,kBAAD,OAA5B,GAAgD;AAAC,oCAAD;AAAA;AAAS,mBAAKnO,KAAL,CAAWoO;AAApB;AADnD;AAVF;AAJF,OADF;AAqBD;;;EA7YyBC,gB,WA+BnBC,iB,GAAoB;AACzB7C,cAAY8C,oBAAUC,IADG;AAEzB9C,YAAU6C,oBAAUE,MAFK;AAGzB1C,cAAYwC,oBAAUE;AAHG,C;;AAiXd,SAASnP,IAAT,CAAcU,KAAd,EAAqB;AAAA,MAC1BoO,MAD0B,GACFpO,KADE,CAC1BoO,MAD0B;AAAA,MAClBpE,WADkB,GACFhK,KADE,CAClBgK,WADkB;;;AAGlC,MAAIA,WAAJ,EAAiB;AACf,WAAO;AAAC,4BAAD;AAAA;AAASoE;AAAT,KAAP;AACD;;AAED,SAAOM,gBAAMC,YAAN,CAAmB,8BAAC,aAAD,OAAnB,EAAsC3O,KAAtC,CAAP;AACD","file":"index.js","sourcesContent":["import React, { Component } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { observer } from 'mobx-react';\r\nimport { Button } from 'antd';\r\nimport { history, Switch, stores, env, nativeMs, localStore } from 'mutants-microfx';\r\nimport { Ticon, Layout, Keyboard, ModalWraper, Message, hotKey } from 'tplus-components-touch';\r\nimport { platform, localStore as storeUtil } from 'mutants-util';\r\nimport { User } from 'tplus-api';\r\nimport { Subject } from 'rxjs';\r\nimport { Redirect } from 'react-router';\r\nimport Header from '../../components/header';\r\nimport PortalPageBC from '../../pages/Portalbc';\r\nimport portalStores from '../../stores';\r\nimport { closeWebPage, getQueryString, operationKeys } from '../../utils/index';\r\n\r\nconst hasElectron = (env.platform === env.constant.platform.electron);\r\nwindow.rx$ = {};\r\n\r\n@observer\r\nclass MainContainer extends Component {\r\n\r\n currentFocus = null;\r\n\r\n sys_parms = {\r\n tinified_logo_bc: `${window.ossAliyuncsFileURL}/tinified/logo-bc.png`,\r\n protal_chanjet_logo_bc: `${window.ossAliyuncsFileURL}/protal-chanjet-logo-bc.png`,\r\n chanjet_logo_bc: `${window.ossAliyuncsFileURL}/chanjet-logo-bc.png`,\r\n }\r\n\r\n constructor(props) {\r\n super(props);\r\n this.hasElectron = hasElectron;\r\n this.state = {\r\n hsy_s: false,\r\n hsy_f: null\r\n };\r\n portalStores.posLoginStore.savePosCode();\r\n this.electron = nativeMs && nativeMs.get('electron');\r\n this.isAutoTest = getQueryString(location.search, 'at');\r\n this.isShowFourTab = this.hasElectron && window.screen.width < 1024 ? true : false;\r\n //针对800*600分辨率下,页面显示不全的做一下处理。\r\n if (this.isShowFourTab == true) this.initWebFrameZoom();\r\n\r\n const isHorizontalPad = storeUtil.get('isHorizontalPad')// 是否在PAD\r\n const isHorizontalSunMi = storeUtil.get('isHorizontalSunMi'); //是否在商米(SunMi)\r\n const isHorizontalSunMi_FuPing = storeUtil.get('isHorizontalSunMi_FuPing'); //是否在商米(SunMi)\r\n\r\n this.isHorizontalSunMi_FuPing = !!isHorizontalSunMi_FuPing;\r\n this.isMobileEnvironment = !!isHorizontalPad || !!isHorizontalSunMi || !!isHorizontalSunMi_FuPing;\r\n }\r\n static childContextTypes = {\r\n infoRender: PropTypes.func,\r\n headHook: PropTypes.object,\r\n actionHook: PropTypes.object,\r\n }\r\n\r\n initWebFrameZoom = () => {\r\n let webFrame = this.electron ? this.electron.webFrame : null;\r\n let value = localStore.get('webFrameZoomValue') || '0.7';\r\n if (webFrame) webFrame.setZoomFactor(parseFloat(value));\r\n }\r\n getChildContext() {\r\n return {\r\n infoRender: this.handleInfoRender,\r\n headHook: {\r\n addClass: (id, key) => {\r\n this.setState(state => ({\r\n [key]: [...(state[key] || []), id],\r\n }));\r\n },\r\n removeClass: (id, key) => {\r\n this.setState(state => ({\r\n [key]: state[key].filter(currentId => currentId !== id),\r\n }));\r\n }\r\n },\r\n actionHook: {\r\n actionFrom: this.actionFrom,\r\n actionChange: (value) => {\r\n this.actionFrom = value;\r\n }\r\n },\r\n };\r\n }\r\n\r\n // 内置默认\r\n // keys = ['esc', 'enter', 'ctrl+f1', ...Object.keys(hotKey.hotKeyConfig)];\r\n\r\n // 解决从url地址唤醒exe,不同账号的处理问题。\r\n doDeeplinkingUrl = () => {\r\n if (this.hasElectron === false) return;\r\n let { ipcRenderer } = this.electron || {ipcRenderer:null};\r\n ipcRenderer && ipcRenderer.on(\"asynchronous-deeplinkingUrl\", (event, ret, params) => {\r\n if (ret) {\r\n console.log('deeplinkingUrl:' + ret)\r\n const {orgId, userId} = stores.user || {};\r\n if (!orgId || !userId) return;\r\n const param = ret.split('&').reduce((accumulator, current) => {\r\n if (!current) return accumulator;\r\n const [key, value] = current.split('=') || [];\r\n accumulator[key] = value;\r\n return accumulator;\r\n }, {});\r\n console.log(orgId, userId, param)\r\n if (param.orgId !== orgId || param.cloudUserId !== userId) {\r\n User.logout();\r\n }\r\n }\r\n })\r\n }\r\n\r\n componentWillMount() {\r\n this.changeLogoSubject();\r\n this.changeHsySubject();\r\n const { isVerticalTouch } = platform || {};\r\n if (isVerticalTouch === true) {\r\n document.body.classList.add('vertical-touch-platform');\r\n }\r\n }\r\n\r\n changeLogoSubject = () => {\r\n const subject = new Subject();\r\n rx$.changeLogo = subject;\r\n\r\n subject\r\n .subscribe({\r\n next: (v) => this.setLogo(v)\r\n });\r\n }\r\n\r\n changeHsySubject = () => {\r\n const subject = new Subject();\r\n rx$.changeHsy = subject;\r\n\r\n subject\r\n .subscribe({\r\n next: (v) => this.setHsy(v)\r\n });\r\n }\r\n\r\n componentDidMount() {\r\n this.registerHotKey();\r\n this.addHotKeyChangeLister();\r\n rx$.changeLogo.next();\r\n document.body.addEventListener('focus', this.blurButton, true)\r\n this.doDeeplinkingUrl();\r\n\r\n if (this.hasElectron === true) {\r\n document.body.classList.add('electron-env');\r\n } else {\r\n if (this.isAutoTest || this.isMobileEnvironment) return; //自动化测试不弹窗\r\n ModalWraper.confirm({\r\n className: 'tplus-confirm-modal',\r\n title: \"温馨提示\",\r\n content: '智+新零售POS端不允许浏览器直接访问,请从智+产品中下载安装客户端程序使用!',\r\n cancelable:false,\r\n onOk() {\r\n closeWebPage();\r\n },\r\n onCancel(){\r\n closeWebPage();\r\n }\r\n });\r\n }\r\n }\r\n addHotKeyChangeLister = () => {\r\n document.addEventListener(\"RESET_USER_STORE\",this.registerHotKey);\r\n }\r\n removeHotKeyChangeLister = () => {\r\n document.removeEventListener(\"RESET_USER_STORE\",this.registerHotKey);\r\n }\r\n\r\n componentWillUnmount() {\r\n rx$.changeLogo.unsubscribe();\r\n rx$.changeHsy.unsubscribe();\r\n document.body.removeEventListener('focus', this.blurButton, true)\r\n // clearInterval(this.addObserverDomTimer);\r\n }\r\n\r\n setHsy = (v) => {\r\n const { back, fn } = v || {};\r\n if (back === true) {\r\n this.setState({ hsy_s: true, hsy_f: fn })\r\n } else {\r\n this.setState({ hsy_s: false, hsy_f: null })\r\n }\r\n }\r\n\r\n setLogo = (v) => {\r\n const store = localStore.get('StoreKey') || {};\r\n const { logo: logoUrl } = store;\r\n logoUrl && this.setState({ logoUrl });\r\n }\r\n\r\n logoNode = (url, isPortal, isLogin) => {\r\n const { hsy_s, hsy_f } = this.state;\r\n const { isVerticalTouch } = platform || {};\r\n const theme = stores.portalStore.themeStore;\r\n const defualtImage = (isVerticalTouch === true) ? this.sys_parms.tinified_logo_bc : (((!hsy_s && isPortal) || (theme === 'dark' && !isLogin) ? this.sys_parms.protal_chanjet_logo_bc : this.sys_parms.chanjet_logo_bc) + '?v=1');\r\n if (hsy_s === true) {\r\n return (<div className='business-logo-container'>\r\n <Ticon type='zhiPOS-fanhuishouye2' className='back_i' onClick={() => { hsy_f && hsy_f() }} />\r\n <img src={url || defualtImage} className=\"example-logo\" />\r\n </div>);\r\n }\r\n return <img src={url || defualtImage} className=\"example-logo\" />\r\n }\r\n\r\n //未使用?\r\n hotKeyInjectOrEject = (type, hotKeyAction) => {\r\n const registerKeys = ['esc', 'enter'];\r\n const allKeys = [...registerKeys, ...Object.keys(hotKey.hotKeyConfig)];\r\n allKeys.forEach((keyboard, index) => {\r\n nativeMs.onIpcRendererGlobalShortcut({ type, keyboard }, hotKeyActionHandle);\r\n });\r\n }\r\n\r\n blurButton = ({ target }) => { // 焦点为 button 时 移除焦点,防止触发 bee 组件enter快捷键\r\n if (target && target.nodeName === 'BUTTON') {\r\n target.blur();\r\n }\r\n }\r\n\r\n registerHotKey = () => {\r\n this.isSetHotKey = true;\r\n\r\n this.hotKeyCreate = hotKey({\r\n observerCallback: this.observerDom,\r\n log: true,\r\n pressed: this.hotKeyAction,\r\n clickBefore: () => {\r\n const { activeElement } = document;\r\n activeElement && activeElement.blur();\r\n },\r\n filter: event => {\r\n const { tagName, className } = event.target || event.srcElement || {};\r\n\r\n return !(event.key === 'Enter' && tagName === 'INPUT' && !~className.indexOf('hot-key-not-filter'));\r\n }\r\n });\r\n\r\n this.hotKeyCreate.observer(undefined, { attributes: true, childList: true, subtree: true ,attributeFilter: ['class', 'style'], });\r\n this.hotKeyCreate.register('esc')('.hot-key-focus-container')(operationKeys.esc);\r\n this.hotKeyCreate.register('enter')('.hot-key-focus-container')(operationKeys.enter);\r\n }\r\n\r\n observerDom = () => {\r\n\r\n const modals = [...document.querySelectorAll('.ant-modal-wrap')].filter((modal) => modal.style && modal.style.display !== 'none'); //ant-module\r\n const drawers = [...document.querySelectorAll('.ant-drawer-open')] //ant-drawer\r\n let modalsAndDrawers = [...modals, ...drawers].sort((dom1, dom2) => {\r\n let style1 = window.getComputedStyle(dom1);\r\n let style2 = window.getComputedStyle(dom2);\r\n return style2.zIndex - style1.zIndex\r\n });\r\n\r\n let visibleDom = modalsAndDrawers.length > 0 ? modalsAndDrawers[0] : null\r\n\r\n if (visibleDom) {\r\n if (this.currentFocus !== visibleDom) {\r\n $.clearFocus();\r\n this.currentFocus = visibleDom\r\n return $.setFocus(visibleDom);\r\n }\r\n return;\r\n }\r\n\r\n if ($.getFocusId() !== '1') {\r\n if (this.currentFocus !== 'App' || !document.querySelector(\".hot-key-focus-container\")) {\r\n $.clearFocus();\r\n this.currentFocus = 'App';\r\n $.find('.app', true).setFocus();\r\n }\r\n return;\r\n }\r\n }\r\n\r\n hotKeyAction = (event, handle) => {\r\n const { key } = handle || {};\r\n const toggleKeyCode = 'ctrl+f1';\r\n if (key === toggleKeyCode) {\r\n const isSetHotKey = this.isSetHotKey = !this.isSetHotKey;\r\n const message = isSetHotKey ? '设置' : '取消';\r\n if (isSetHotKey) {\r\n $.bind(this.keys.filter(i => i !== toggleKeyCode), this.hotKeyAction);\r\n } else {\r\n $.unbind(this.keys.filter(i => i !== toggleKeyCode));\r\n }\r\n return Message.info(`已${message}快捷键`);\r\n }\r\n\r\n $.action(key);\r\n }\r\n\r\n handleInfoRender = (solt) => {\r\n this.setState({solt})\r\n }\r\n onCollapse = () => {\r\n const {collapsed} = this.state;\r\n this.setState({collapsed: !collapsed});\r\n }\r\n menuOnClick = ({key}) => {\r\n console.log(key)\r\n this.setState({selectedKeys: key});\r\n }\r\n\r\n handleClose = () => {\r\n Keyboard.close();\r\n }\r\n\r\n handleOk = (type, count) => {\r\n stores.modifyPassStore.modifyPassWord();\r\n }\r\n\r\n headMenuSelect = ({key}) => {\r\n var footer = [\r\n {text: '取消', className: 'modifypass-cancal-button', closable: true, action: this.handleClose},\r\n {text: '确定', className: 'modifypass-ok-button', action: this.handleOk, type: 'primary'}\r\n ];\r\n footer = !!footer.length && <div>\r\n {footer.map((btn, i) =>\r\n <Button\r\n className={btn.className || ''}\r\n key={i}\r\n type={btn.type}\r\n loading={btn.loading}\r\n onClick={() => {\r\n const {action} = btn || {};\r\n if (typeof action === 'function') action();\r\n if (btn.closable) {\r\n stores.modalRouter.hide('/modifypass');\r\n }\r\n }}\r\n >\r\n {btn.text}\r\n </Button>)}\r\n </div>\r\n switch (key) {\r\n case 'logout':\r\n User.logout();\r\n break;\r\n case 'modifypass':\r\n {\r\n if(!stores.offlineSys.shouldInOffline()) return;\r\n stores.modalRouter.show({\r\n url: '/modifypass',\r\n title: '修改密码',\r\n className: 'modify-password',\r\n width: 402,\r\n footer,modalType:'mid',\r\n onHide: () => stores.modalRouter.hide('/modifypass'),\r\n destroyOnClose: true,\r\n });\r\n }\r\n break;\r\n default:\r\n history.push(`/${key}`);\r\n break;\r\n }\r\n }\r\n render() {\r\n const { collapsed, selectedKeys, solt, portalHead = [], loginHead = [], retailOrder = [], logoUrl, hsy_s } = this.state;\r\n const pathname = history.location.pathname;\r\n const storeInfo = stores.user.options.get('store');\r\n const isPortal = !!portalHead.length;\r\n const isLogin = !!loginHead.length;\r\n const isRetailOrder = !!retailOrder.length;\r\n const headProps = {\r\n logo: this.logoNode(logoUrl, isPortal, isLogin),\r\n businessName: '',\r\n storeName: '',\r\n dateFormat: 'yyyy年MM月dd日 hh:mm:ss',\r\n menu: [\r\n { title: '注销', key: 'logout', icon: 'zhuxiao' },\r\n { title: '修改密码', key: 'modifypass', icon: 'suoping' }\r\n ],\r\n onClick: this.headMenuSelect\r\n };\r\n if (storeInfo) {\r\n headProps.businessName = storeInfo.orgName;\r\n headProps.storeName = storeInfo.storeName;\r\n headProps.posCode = storeInfo.posCode;\r\n }\r\n\r\n // 如果存在商米副屏则优先加载商米副屏\r\n if (this.isHorizontalSunMi_FuPing) {\r\n return <Redirect to={'/vicescreen'} />\r\n }\r\n console.log('!stores.posLoginStore.posIsLogin=============', !stores.posLoginStore.posIsLogin);\r\n if (!stores.posLoginStore.posIsLogin && !~pathname.indexOf('login')) {\r\n stores.modalRouter.hideAll && stores.modalRouter.hideAll();\r\n return <Redirect to={'/login'} />\r\n }\r\n const classNames = ['isPortal-layout', 'isRetailOrder-layout'];\r\n const layoutClassName = [isPortal, isRetailOrder].map((v, i) => (v ? classNames[i] : '')).join(' ');\r\n return (\r\n <Layout\r\n style={{ height: '100%' }}\r\n className={layoutClassName}\r\n >\r\n <Layout>\r\n <Header\r\n {...headProps}\r\n solt={solt}\r\n isPortal={isPortal}\r\n className={`${(!hsy_s && isPortal) ? 'isPortal-head' : ''} ${isLogin ? 'isLogin-head' : ''}`}\r\n isLogin={isLogin}\r\n location={this.props.location}\r\n history={this.props.history}\r\n />\r\n <Layout.Content>\r\n {this.props.match.isExact ? (<PortalPageBC />) : <Switch>{this.props.routes}</Switch>}\r\n </Layout.Content>\r\n </Layout>\r\n </Layout>\r\n )\r\n }\r\n}\r\n\r\nexport default function Main(props) {\r\n const { routes, modalRouter } = props;\r\n\r\n if (modalRouter) {\r\n return <Switch>{routes}</Switch>;\r\n }\r\n\r\n return React.cloneElement(<MainContainer />, props);\r\n}\r\n"]}
|
@@ -107,9 +107,12 @@ var _rxjs = require('rxjs');
|
|
107
107
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
108
108
|
|
109
109
|
var hasElectron = _mutantsMicrofx.env.platform === _mutantsMicrofx.env.constant.platform.electron;
|
110
|
-
var Content = _tplusComponentsTouch.Layout.Content
|
110
|
+
var Content = _tplusComponentsTouch.Layout.Content,
|
111
|
+
Footer = _tplusComponentsTouch.Layout.Footer;
|
111
112
|
|
113
|
+
var tplusWindow = null;
|
112
114
|
var HTTP_PROXY_URL = 'http://tfproxy.chanjet.com/?url=';
|
115
|
+
var CC_FRAME_CONF = { id: 'external-frame-cc', identOnly: '_pos_web_', initConnect: 'initConnect', HsyLoadFinish: 'HsyLoadFinish', HsyRouterClean: 'HsyRouterClean', HsyRouterJump: 'HsyRouterJump' };
|
113
116
|
|
114
117
|
var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_Component) {
|
115
118
|
(0, _inherits3.default)(_default, _Component);
|
@@ -218,7 +221,7 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
|
|
218
221
|
_this$context = _this.context, _this$context$stores = _this$context.stores, stores = _this$context$stores === undefined ? {} : _this$context$stores, _this$context$headHoo = _this$context.headHook;
|
219
222
|
_this$context$headHoo = _this$context$headHoo === undefined ? {} : _this$context$headHoo;
|
220
223
|
addClass = _this$context$headHoo.addClass;
|
221
|
-
hasUseOffline =
|
224
|
+
hasUseOffline = (0, _tplusPoslogin.PosInitData)('IsOfflineCash') === "1" && !(_this.isVerticalTouch || _this.isMobileEnvironment); //是否允许离线
|
222
225
|
// const hasUseOffline = true;
|
223
226
|
|
224
227
|
if (!(hasUseOffline == true)) {
|
@@ -282,19 +285,6 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
|
|
282
285
|
}, _callee2, _this2, [[8, 13, 16, 19]]);
|
283
286
|
}));
|
284
287
|
|
285
|
-
_this.initHsyPage = function () {
|
286
|
-
var external_frame = document.getElementById('external-frame-cc');
|
287
|
-
var win = external_frame && external_frame.contentWindow;
|
288
|
-
var timer = setTimeout(function () {
|
289
|
-
_this.setState({ isHsyLoadFinish: true });
|
290
|
-
}, 15000);
|
291
|
-
if (!win) return;
|
292
|
-
win.HsyLoadFinish = function () {
|
293
|
-
clearTimeout(timer);
|
294
|
-
_this.setState({ isHsyLoadFinish: true });
|
295
|
-
};
|
296
|
-
};
|
297
|
-
|
298
288
|
_this.sunMiPresentationInit = function (result) {
|
299
289
|
//SunMi初始化参数设置。
|
300
290
|
//副屏幕交互。硬件改动20200428 需要在商米页面加载成功后才能发送 初始化命令
|
@@ -322,7 +312,7 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
|
|
322
312
|
_this.getTcBasicInfoInit = function () {
|
323
313
|
var userStore = _tplusApi.User.restore();
|
324
314
|
var sid = userStore.sid;
|
325
|
-
var tplusUrl =
|
315
|
+
var tplusUrl = (0, _tplusPoslogin.PosInitData)("TplusSite") || (0, _tplusPoslogin.PosInitData)("tplusinnersite");
|
326
316
|
if (!tplusUrl) {
|
327
317
|
var msg = "请用admin登录,在服务器配置–地址配置处,设置“内部或外部网络访问T+服务器的地址”!";
|
328
318
|
_tplusComponentsTouch.ModalWraper.warning({
|
@@ -409,29 +399,17 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
|
|
409
399
|
|
410
400
|
var errorTip = void 0;
|
411
401
|
|
412
|
-
// 离线模式
|
413
402
|
if (!_mutantsMicrofx.stores.offlineSys.shouldOpenHomeOperation(Name)) {
|
414
|
-
_tplusComponentsTouch.Message.warn("离线模式下此操作不可用"
|
415
|
-
return;
|
416
|
-
}
|
417
|
-
|
418
|
-
// 会员拉新
|
419
|
-
if (type == 'memberRecruitment' && _this.isEnablePromotion == false) {
|
420
|
-
_tplusComponentsTouch.Message.warn("您还未开通促销管理,请立即开通", { duration: 3 });
|
403
|
+
_tplusComponentsTouch.Message.warn("离线模式下此操作不可用");
|
421
404
|
return;
|
422
405
|
}
|
423
406
|
|
424
|
-
// 会员消费查询
|
425
|
-
if (type == 'memberConsumDetail' && _this.isEnableMember == false) {
|
426
|
-
_tplusComponentsTouch.Message.warn("您还未开通会员管理,请立即开通", { duration: 3 });
|
427
|
-
return;
|
428
|
-
}
|
429
|
-
|
430
|
-
// 更多
|
431
407
|
if (type == 'more') {
|
408
|
+
// if (this.isMobileEnvironment) { //暂时不支持android系统跳转
|
409
|
+
// return Message.warn('新功能正在研发中,敬请期待。');
|
410
|
+
// }
|
432
411
|
return _this.setState({ showMoreModal: true });
|
433
412
|
}
|
434
|
-
|
435
413
|
if (!Title) {
|
436
414
|
return _tplusComponentsTouch.ModalWraper.warning({
|
437
415
|
title: '提示',
|
@@ -663,7 +641,7 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
|
|
663
641
|
|
664
642
|
_this.toHsyPage = function () {
|
665
643
|
var _ref9 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee4(params) {
|
666
|
-
var content_only, bar_bg, bar_active_bg, menu, secondRouter, activePrompt, closePrompt, closeable, leavePrompt, lock, pageId, pageParams, path, tabId, tabLabel, pageType, _k, filter, IdWarehouse, WarehouseName, IsPerformanceDistribution, _ref10, _ref10$IdStore, IdStore, _ref10$PosId, PosId, _ref11, _ref11$storeName, storeName, commonArgs, actionUrl, cc_url, CC_WEB_URL
|
644
|
+
var content_only, bar_bg, bar_active_bg, menu, secondRouter, activePrompt, closePrompt, closeable, leavePrompt, lock, pageId, pageParams, path, tabId, tabLabel, pageType, _k, filter, IdWarehouse, WarehouseName, IsPerformanceDistribution, _ref10, _ref10$IdStore, IdStore, _ref10$PosId, PosId, _ref11, _ref11$storeName, storeName, commonArgs, actionUrl, cc_url, CC_WEB_URL;
|
667
645
|
|
668
646
|
return _regenerator2.default.wrap(function _callee4$(_context4) {
|
669
647
|
while (1) {
|
@@ -673,9 +651,9 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
|
|
673
651
|
filter = {};
|
674
652
|
//对仓库参数的处理
|
675
653
|
|
676
|
-
IdWarehouse =
|
677
|
-
WarehouseName =
|
678
|
-
IsPerformanceDistribution =
|
654
|
+
IdWarehouse = (0, _tplusPoslogin.PosInitData)('IdWarehouse') || '';
|
655
|
+
WarehouseName = (0, _tplusPoslogin.PosInitData)('WarehouseName') || '';
|
656
|
+
IsPerformanceDistribution = (0, _tplusPoslogin.PosInitData)('PerformanceDistribution') === 'SHIPPER_STORE' || false;
|
679
657
|
_ref10 = _mutantsMicrofx.stores.user.options.get('loginInfo') || {}, _ref10$IdStore = _ref10.IdStore, IdStore = _ref10$IdStore === undefined ? '' : _ref10$IdStore, _ref10$PosId = _ref10.PosId, PosId = _ref10$PosId === undefined ? '' : _ref10$PosId;
|
680
658
|
_ref11 = _mutantsMicrofx.stores.user.options.get('store') || {}, _ref11$storeName = _ref11.storeName, storeName = _ref11$storeName === undefined ? '' : _ref11$storeName;
|
681
659
|
_context4.t0 = pageType;
|
@@ -801,14 +779,12 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
|
|
801
779
|
|
802
780
|
console.log('CC_WEB_URL:', CC_WEB_URL);
|
803
781
|
window.android_CommonFun.openWebUrlByOutBrowser(CC_WEB_URL);
|
804
|
-
_context4.next =
|
782
|
+
_context4.next = 40;
|
805
783
|
break;
|
806
784
|
|
807
785
|
case 37:
|
808
|
-
|
809
|
-
|
810
|
-
|
811
|
-
win && win.HsyRouterJump && win.HsyRouterJump(pageId, pageParams, { closeable: closeable, tabLabel: tabLabel });
|
786
|
+
// this.ccFrameWin && this.ccFrameWin.HsyRouterJump && this.ccFrameWin.HsyRouterJump(pageId, pageParams, { closeable, tabLabel });
|
787
|
+
_this.ccFrameStore && _this.ccFrameStore.sendMessage({ type: CC_FRAME_CONF.HsyRouterJump, pageId: pageId, pageParams: pageParams, extStateParams: { closeable: closeable, tabLabel: tabLabel }, _ident_only_: CC_FRAME_CONF.identOnly });
|
812
788
|
if (_this.state.showMoreModal === true) {
|
813
789
|
_this.setState({ loadHsyPage: true, showMoreModal: false });
|
814
790
|
} else {
|
@@ -818,14 +794,13 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
|
|
818
794
|
back: true, fn: function fn() {
|
819
795
|
_this.setState({ loadHsyPage: false });
|
820
796
|
rx$.changeHsy.next({ back: false });
|
821
|
-
//
|
822
|
-
|
823
|
-
|
824
|
-
wins && wins.HsyRouterClean && win.HsyRouterClean();
|
797
|
+
// 在打开页签之前,关闭之前的,返回键的回调函数
|
798
|
+
// this.ccFrameWin && this.ccFrameWin.HsyRouterClean && this.ccFrameWin.HsyRouterClean();
|
799
|
+
_this.ccFrameStore && _this.ccFrameStore.sendMessage({ type: CC_FRAME_CONF.HsyRouterClean, _ident_only_: CC_FRAME_CONF.identOnly });
|
825
800
|
}
|
826
801
|
});
|
827
802
|
|
828
|
-
case
|
803
|
+
case 40:
|
829
804
|
case 'end':
|
830
805
|
return _context4.stop();
|
831
806
|
}
|
@@ -953,8 +928,8 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
|
|
953
928
|
{ xl: width, md: width, className: 'portal-left-col', key: 'left' },
|
954
929
|
_react2.default.createElement('div', { className: 'portal-left-content' })
|
955
930
|
);
|
931
|
+
// return null;
|
956
932
|
}
|
957
|
-
|
958
933
|
var menuNode = menu.map(function (v) {
|
959
934
|
return v.container ? _react2.default.createElement(
|
960
935
|
'div',
|
@@ -962,7 +937,8 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
|
|
962
937
|
v.sub.map(function (vv) {
|
963
938
|
var item = vv;
|
964
939
|
if (vv.maybe === true) {
|
965
|
-
|
940
|
+
var status = !!(0, _tplusPoslogin.PosInitData)('ShowStorePrice');
|
941
|
+
item = status ? vv : vv.second;
|
966
942
|
}
|
967
943
|
return _react2.default.createElement(
|
968
944
|
'div',
|
@@ -1223,7 +1199,6 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
|
|
1223
1199
|
isVerticalTouch = _ref13.isVerticalTouch,
|
1224
1200
|
isHorizontalPad = _ref13.isHorizontalPad,
|
1225
1201
|
isHorizontalSunMi = _ref13.isHorizontalSunMi,
|
1226
|
-
isNewRetailBCPos = _ref13.isNewRetailBCPos,
|
1227
1202
|
isNewRetailBCPosTC = _ref13.isNewRetailBCPosTC;
|
1228
1203
|
|
1229
1204
|
_this.isVerticalTouch = !!isVerticalTouch;
|
@@ -1231,26 +1206,16 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
|
|
1231
1206
|
_this.isHorizontalSunMi = !!isHorizontalSunMi;
|
1232
1207
|
_this.isMobileEnvironment = !!isHorizontalPad || !!isHorizontalSunMi;
|
1233
1208
|
_this.FuPingIsLoaded = false;
|
1234
|
-
_this.isNewRetailBCPos = !!isNewRetailBCPos;
|
1235
1209
|
_this.isNewRetailBCPosTC = !!isNewRetailBCPosTC;
|
1236
1210
|
_this.new_retail_app = _mutantsMicrofx.localStore && _mutantsMicrofx.localStore.get('newRetailAppType');
|
1237
|
-
|
1238
|
-
|
1239
|
-
_this.
|
1240
|
-
_this.isEnablePromotion = !!(0, _tplusPoslogin.PosInitData)('isEnablePromotion'); //是否开启促销
|
1241
|
-
_this.isOfflineCash = (0, _tplusPoslogin.PosInitData)('IsOfflineCash');
|
1242
|
-
_this.tplusSiteUrl = (0, _tplusPoslogin.PosInitData)("TplusSite") || (0, _tplusPoslogin.PosInitData)("tplusinnersite");
|
1243
|
-
_this.idWarehouse = (0, _tplusPoslogin.PosInitData)('IdWarehouse') || '';
|
1244
|
-
_this.warehouseName = (0, _tplusPoslogin.PosInitData)('WarehouseName') || '';
|
1245
|
-
_this.performanceDistribution = (0, _tplusPoslogin.PosInitData)('PerformanceDistribution');
|
1246
|
-
_this.showStorePrice = (0, _tplusPoslogin.PosInitData)('ShowStorePrice');
|
1247
|
-
|
1211
|
+
_this.hsy_domain = _tplusApi.User && _tplusApi.User.getWebEntry();
|
1212
|
+
// 是否嵌套好生意的iframe
|
1213
|
+
_this.isHsyIframeInclude = !_this.isVerticalTouch && !_this.isMobileEnvironment;
|
1248
1214
|
//首页布局
|
1249
1215
|
_this.leftMenu = _this.getMenuByPosition('left');
|
1250
1216
|
_this.centerLeftMenu = _this.getMenuByPosition('centerLeft');
|
1251
1217
|
_this.centerRightMenu = _this.getMenuByPosition('centerRight');
|
1252
1218
|
_this.rightMenu = _this.getMenuByPosition('right');
|
1253
|
-
_this.hsy_domain = _tplusApi.User && _tplusApi.User.getWebEntry();
|
1254
1219
|
_this.randomWord = _this.randomWord.bind(_this);
|
1255
1220
|
(0, _mobx.autorun)(function () {
|
1256
1221
|
_this.hsyBasicInfoInit();
|
@@ -1316,14 +1281,24 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
|
|
1316
1281
|
key: 'componentDidMount',
|
1317
1282
|
value: function componentDidMount() {
|
1318
1283
|
this.initPageData();
|
1319
|
-
|
1320
|
-
this.initHsyPage();
|
1321
|
-
}
|
1284
|
+
this.isHsyIframeInclude && this.initCCFrameWin();
|
1322
1285
|
}
|
1286
|
+
// 初始化好生意iframe
|
1323
1287
|
|
1324
|
-
|
1325
|
-
|
1326
|
-
|
1288
|
+
}, {
|
1289
|
+
key: 'initCCFrameWin',
|
1290
|
+
value: function initCCFrameWin() {
|
1291
|
+
var that = this;
|
1292
|
+
this.ccFrameStore = new _mutantsMicrofx.stores.IframeStore(document.getElementById(CC_FRAME_CONF.id), this.hsy_domain, function (e, instance) {
|
1293
|
+
console.log(e, instance, 'cciframe 接收消息');
|
1294
|
+
if (e.data && e.data.type === CC_FRAME_CONF.HsyLoadFinish) {
|
1295
|
+
!that.state.isHsyLoadFinish && that.setState({ isHsyLoadFinish: true });
|
1296
|
+
}
|
1297
|
+
}, function (e, instance) {
|
1298
|
+
console.log("ccFrameWin 加载成功========>", e, instance);
|
1299
|
+
instance.sendMessage({ type: CC_FRAME_CONF.initConnect, _ident_only_: CC_FRAME_CONF.identOnly });
|
1300
|
+
}, CC_FRAME_CONF.identOnly);
|
1301
|
+
}
|
1327
1302
|
// 初始化商米副屏
|
1328
1303
|
|
1329
1304
|
}, {
|
@@ -1362,6 +1337,7 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
|
|
1362
1337
|
}, {
|
1363
1338
|
key: 'componentWillUnmount',
|
1364
1339
|
value: function componentWillUnmount() {
|
1340
|
+
this.ccFrameStore && this.ccFrameStore.destroy();
|
1365
1341
|
var _context$headHook = this.context.headHook;
|
1366
1342
|
_context$headHook = _context$headHook === undefined ? {} : _context$headHook;
|
1367
1343
|
var removeClass = _context$headHook.removeClass;
|
@@ -1442,7 +1418,7 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
|
|
1442
1418
|
_react2.default.createElement(
|
1443
1419
|
'div',
|
1444
1420
|
{ className: loadHsyPage ? 'portal-hsy-tc-container' : 'portal-hsy-tc-container portal-hsy-tc-container-hide' },
|
1445
|
-
_react2.default.createElement('iframe', { src: loadHsyURL, width: '100%', height: '93%', frameborder: 'no', border: '0', marginwidth: '0', marginheight: '0', scrolling: 'yes', allowtransparency: 'true', id:
|
1421
|
+
_react2.default.createElement('iframe', { src: loadHsyURL, width: '100%', height: '93%', frameborder: 'no', border: '0', marginwidth: '0', marginheight: '0', scrolling: 'yes', allowtransparency: 'true', id: CC_FRAME_CONF.id })
|
1446
1422
|
),
|
1447
1423
|
_react2.default.createElement(
|
1448
1424
|
'div',
|