🚸 usability: 优化立减金、红包组件样式

This commit is contained in:
wangsongsole 2023-05-25 14:52:51 +08:00
parent 0879f03d1e
commit cf06f7a593
6 changed files with 108 additions and 81 deletions

View File

@ -1042,7 +1042,7 @@ export default class addKnockGold extends Component {
height={'36px'} height={'36px'}
unit='个' unit='个'
countShow={false} countShow={false}
width={'520px'} width={'304px'}
alignment={'left'} alignment={'left'}
/> />
<RadioGroup <RadioGroup
@ -1417,23 +1417,6 @@ export default class addKnockGold extends Component {
</FormItem> </FormItem>
</Form> </Form>
</Card> </Card>
{/* <h5>样式设置</h5> */}
<Card style={{ width: '70%', margin: '10px 0' }} title={'样式设置'}>
<Form ref='form3'>
<FormItem id='instruction' labelname='使用说明' required=''>
<WangEditor
pageType='detaileditor'
setEdittext={(text) => {
this.onHandleChange(text, 'instruction');
}}
width='520px'
text={this.state.model.instruction}
limitLength={500}
key={this.state.model.channel}
/>
</FormItem>
</Form>
</Card>
{/* <h5>预警规则</h5> */} {/* <h5>预警规则</h5> */}
<Card style={{ width: '70%', margin: '10px 0' }} title={'预警规则'}> <Card style={{ width: '70%', margin: '10px 0' }} title={'预警规则'}>
<Form model={this.state.model} rules={rules.warning} ref='form4'> <Form model={this.state.model} rules={rules.warning} ref='form4'>
@ -1525,6 +1508,24 @@ export default class addKnockGold extends Component {
/> />
</Dialog> </Dialog>
</Card> </Card>
{/* <h5>样式设置</h5> */}
<Card style={{ width: '70%', margin: '10px 0' }} title={'样式设置'}>
<Form ref='form3'>
<FormItem id='instruction' labelname='使用说明' required=''>
<WangEditor
pageType='detaileditor'
setEdittext={(text) => {
this.onHandleChange(text, 'instruction');
}}
// width='520px'
text={this.state.model.instruction}
limitLength={500}
key={this.state.model.channel}
/>
</FormItem>
</Form>
</Card>
<MobileComponent data={this.state.model} keyType={this.props.keyType} /> <MobileComponent data={this.state.model} keyType={this.props.keyType} />
</div> </div>
); );

View File

@ -18,6 +18,7 @@
overflow: scroll; overflow: scroll;
min-width: 375px !important; min-width: 375px !important;
width: auto !important; width: auto !important;
z-index: 99999;
.available_time { .available_time {
text-align: left; text-align: left;
@ -198,6 +199,31 @@
padding: 0; padding: 0;
} }
#wangeditorDom {
max-width: 800px;
min-width: 520px;
}
.w-e-text-container {
border-bottom: 0 !important;
}
.countBox_par {
display: inline-block;
.countBox {
max-width: 800px;
border: 1px solid #c9d8db;
border-top: 0;
min-width: 520px;
text-align: end;
color: #999;
z-index: 10001;
padding: 5px 10px;
box-sizing: border-box;
}
}
.form-Item { .form-Item {
margin-left: 20px; margin-left: 20px;
} }
@ -413,16 +439,3 @@
display: none; display: none;
} }
} }
.countBox_par {
position: relative;
display: inline-block;
.countBox {
position: absolute;
color: #999;
bottom: 5%;
z-index: 999999;
right: 3%;
}
}

View File

@ -1,30 +1,30 @@
import React from "react"; import React from 'react';
import Editor from "wangeditor"; import Editor from 'wangeditor';
import "./index.less"; import './index.less';
export default class wangEditor extends React.Component { export default class wangEditor extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
editorHtml: "", editorHtml: '',
count: 0 count: 0
}; };
} }
componentDidMount() { componentDidMount() {
let self = this; let self = this;
const editor = new Editor("#wangeditorDom"); const editor = new Editor('#wangeditorDom');
this.setState({ editor }); this.setState({ editor });
editor.config.colors = ["#696969", "#9093a2", "#fgddbb", "#e3e7eb"]; editor.config.colors = ['#696969', '#9093a2', '#fgddbb', '#e3e7eb'];
editor.config.pasteText = true; editor.config.pasteText = true;
// 500px // 500px
editor.config.height = 200; editor.config.height = 200;
editor.config.showFullScreen = false; editor.config.showFullScreen = false;
editor.config.menus = [ editor.config.menus = [
"bold", 'bold',
"foreColor", 'foreColor',
"italic", 'italic',
"indent", 'indent',
"link", 'link',
"justify" 'justify'
]; ];
// height create() // height create()
@ -33,7 +33,7 @@ export default class wangEditor extends React.Component {
var text = editor.txt.text(); var text = editor.txt.text();
if (text.length == 0) { if (text.length == 0) {
// //
self.props.setEdittext(""); self.props.setEdittext('');
} }
if (text.length > self.props.limitLength) { if (text.length > self.props.limitLength) {
let str = text.slice(0, self.props.limitLength); let str = text.slice(0, self.props.limitLength);
@ -57,7 +57,7 @@ export default class wangEditor extends React.Component {
<div className='countBox_par'> <div className='countBox_par'>
<div id='wangeditorDom' style={{ width: this.props.width }}></div> <div id='wangeditorDom' style={{ width: this.props.width }}></div>
<p className='countBox'> <p className='countBox'>
{this.state.count + "/" + this.props.limitLength} {this.state.count + '/' + this.props.limitLength}
</p> </p>
</div> </div>
); );

View File

@ -479,7 +479,7 @@ export default class addKnockGold extends Component {
render() { render() {
return ( return (
<div id='addKnockGold'> <div id='redPackets'>
{/* <h5>基本信息</h5> */} {/* <h5>基本信息</h5> */}
<Card style={{ width: '70%', margin: '10px 0' }} title={'基本信息'}> <Card style={{ width: '70%', margin: '10px 0' }} title={'基本信息'}>
<Form model={this.state.model} rules={rules.basic} ref='form'> <Form model={this.state.model} rules={rules.basic} ref='form'>
@ -665,7 +665,7 @@ export default class addKnockGold extends Component {
height={'36px'} height={'36px'}
unit='个' unit='个'
countShow={false} countShow={false}
width={'520px'} width={'306px'}
alignment={'left'} alignment={'left'}
/> />
<RadioGroup <RadioGroup
@ -906,23 +906,6 @@ export default class addKnockGold extends Component {
</FormItem> </FormItem>
</Form> </Form>
</Card> </Card>
{/* <h5>样式设置</h5> */}
<Card style={{ width: '70%', margin: '10px 0' }} title={'样式设置'}>
<Form ref='form3'>
<FormItem id='instruction' labelname='使用说明' required=''>
<WangEditor
pageType='detaileditor'
setEdittext={(text) => {
this.onHandleChange(text, 'instruction');
}}
width='520px'
text={this.state.model.instruction}
limitLength={500}
key={this.state.model.channel}
/>
</FormItem>
</Form>
</Card>
{/* <h5>预警规则</h5> */} {/* <h5>预警规则</h5> */}
<Card style={{ width: '70%', margin: '10px 0' }} title={'预警规则'}> <Card style={{ width: '70%', margin: '10px 0' }} title={'预警规则'}>
<Form model={this.state.model} rules={rules.warning} ref='form4'> <Form model={this.state.model} rules={rules.warning} ref='form4'>
@ -998,6 +981,23 @@ export default class addKnockGold extends Component {
</FormItem> </FormItem>
</Form> </Form>
</Card> </Card>
{/* <h5>样式设置</h5> */}
<Card style={{ width: '70%', margin: '10px 0' }} title={'样式设置'}>
<Form ref='form3'>
<FormItem id='instruction' labelname='使用说明' required=''>
<WangEditor
pageType='detaileditor'
setEdittext={(text) => {
this.onHandleChange(text, 'instruction');
}}
text={this.state.model.instruction}
limitLength={500}
key={this.state.model.channel}
/>
</FormItem>
</Form>
</Card>
{/* <MobileComponent data={this.state.model} keyType={this.props.keyType} /> */} {/* <MobileComponent data={this.state.model} keyType={this.props.keyType} /> */}
</div> </div>
); );

View File

@ -3,7 +3,7 @@
width: 0 !important width: 0 !important
} }
#reduceKnockGold { #redPacketsViews {
position: fixed !important; position: fixed !important;
top: 130px !important; top: 130px !important;
right: 90px !important; right: 90px !important;
@ -187,17 +187,44 @@
padding-bottom: 5px; padding-bottom: 5px;
box-sizing: border-box; box-sizing: border-box;
} }
} }
#addKnockGold { #redPackets {
& { & {
border: 0; border: 0;
margin: 0; margin: 0;
padding: 0; padding: 0;
} }
#wangeditorDom {
max-width: 800px;
min-width: 520px;
}
.w-e-text-container {
border-bottom: 0 !important;
}
.countBox_par {
display: inline-block;
.countBox {
max-width: 800px;
border: 1px solid #c9d8db;
border-top: 0;
min-width: 520px;
text-align: end;
color: #999;
z-index: 10001;
padding: 5px 10px;
box-sizing: border-box;
}
}
.form-Item { .form-Item {
margin-left: 20px; margin-left: 20px;
} }
@ -380,18 +407,4 @@
} }
} }
}
.countBox_par {
position: relative;
display: inline-block;
.countBox {
position: absolute;
color: #999;
bottom: 5%;
z-index: 999999;
right: 3%;
}
} }

View File

@ -78,7 +78,7 @@ export default ({ data, keyType }) => {
} }
return ( return (
<div id='reduceKnockGold' className='mobile'> <div id='redPacketsViews' className='mobile'>
<div className='couponShow'> <div className='couponShow'>
<div className='coupon-left'> <div className='coupon-left'>
<p className='coupon_money'> <p className='coupon_money'>