From e0aff8f4c0e9c8f16d1ba07863cf600638067514 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 13 四月 2021 15:08:47 +0800 Subject: [PATCH] 2021-04-13 --- src/pc/components/login/normal-login/index.jsx | 19 +++++++++++++++---- 1 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/pc/components/login/normal-login/index.jsx b/src/pc/components/login/normal-login/index.jsx index 9c364e4..3fe8cea 100644 --- a/src/pc/components/login/normal-login/index.jsx +++ b/src/pc/components/login/normal-login/index.jsx @@ -9,6 +9,7 @@ import MKEmitter from '@/utils/events.js' import zhCN from '@/locales/zh-CN/model.js' import enUS from '@/locales/en-US/model.js' +import { resetStyle } from '@/utils/utils-custom.js' import './index.scss' const LoginForm = asyncComponent(() => import('./loginform')) @@ -31,6 +32,7 @@ const { card } = this.props if (card.isNew) { + let ismob = sessionStorage.getItem('appType') === 'mob' let _card = { uuid: card.uuid, type: card.type, @@ -41,12 +43,20 @@ width: card.width || 24, name: card.name, subtype: card.subtype, - wrap: { name: card.name, width: card.width || 24, loginWays: ['uname_pwd', 'sms_vcode'] }, - style: { background: '#ffffff', width: '330px', borderRadius: '4px', marginLeft: '55vw' }, + wrap: { name: card.name, width: card.width || 24, loginWays: ['uname_pwd'] }, + style: { background: '#ffffff', width: '330px', borderRadius: '4px', marginLeft: '55vw'}, loginWays: [ {type: 'uname_pwd', label: '璐﹀彿瀵嗙爜', remember: 'true', labelStyle: {}, submitStyle: {}, submitLabel: '鐧诲綍'}, {type: 'sms_vcode', label: '鐭俊楠岃瘉鐮�', labelStyle: {}, submitStyle: {}, submitLabel: '鐧诲綍'} ] + } + + if (ismob) { + delete _card.style.width + delete _card.style.borderRadius + delete _card.style.marginLeft + + _card.style.paddingTop = '20px' } if (card.config) { @@ -128,9 +138,10 @@ render() { const { card, dict } = this.state + let style = resetStyle(card.style) return ( - <div className="login-edit-box" style={{...card.style}} onClick={this.clickComponent} id={card.uuid}> + <div className="login-edit-box" style={style} onClick={this.clickComponent} id={card.uuid}> <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ <div className="mk-popover-control"> <WrapComponent config={card} updateConfig={this.updateComponent} /> @@ -140,7 +151,7 @@ } trigger="hover"> <Icon type="tool" /> </Popover> - <LoginForm loginWays={card.loginWays} wrap={card.wrap} dict={dict} /> + <LoginForm loginWays={card.loginWays} wrap={card.wrap} menuId={card.uuid} dict={dict} /> </div> ) } -- Gitblit v1.8.0