Commit c39df64c by 姜雷

Merge branch 'develop' into 'test'

Develop See merge request !10
parents 2ab202a4 e718b2dc
...@@ -83,7 +83,7 @@ ...@@ -83,7 +83,7 @@
color: #3695c0; color: #3695c0;
} }
.canclbtn::before { .canclbtn::before {
border-color: #3695c0; border-color: #3695c0 !important;
} }
.vcodeDialog { .vcodeDialog {
......
...@@ -40,10 +40,15 @@ class PublicCarApply extends Component { ...@@ -40,10 +40,15 @@ class PublicCarApply extends Component {
}); });
} }
selectCategory = id => { selectCategory = id => {
this.setState({ const { showAllCategory } = this.state;
categoryId: id, if (!showAllCategory) {
showAllCategory: false, this.toggleCategoryOptions();
}); } else {
this.setState({
categoryId: id,
showAllCategory: false,
});
}
}; };
toggleCategoryOptions = () => { toggleCategoryOptions = () => {
this.setState(({ showAllCategory }) => ({ this.setState(({ showAllCategory }) => ({
...@@ -149,15 +154,17 @@ class PublicCarApply extends Component { ...@@ -149,15 +154,17 @@ class PublicCarApply extends Component {
<div className={styles.listItemAutoHeight}> <div className={styles.listItemAutoHeight}>
<div className={styles.itemLabel}>用车类型</div> <div className={styles.itemLabel}>用车类型</div>
<div className={styles.itemValue}> <div className={styles.itemValue}>
<div {categoryId ? null : (
className={styles.selectInput} <div
onClick={this.toggleCategoryOptions} className={styles.selectInput}
> onClick={this.toggleCategoryOptions}
请选择 >
<span className={styles.arrow}> 请选择
<img src={arrIcon} alt="" /> <span className={styles.arrow}>
</span> <img src={arrIcon} alt="" />
</div> </span>
</div>
)}
{showAllCategory {showAllCategory
? categoryList.map(i => ( ? categoryList.map(i => (
<div <div
......
...@@ -72,8 +72,14 @@ class PublicCarItem extends Component { ...@@ -72,8 +72,14 @@ class PublicCarItem extends Component {
</div> </div>
</div>, </div>,
<div key="department" className={styles.listLine}> <div key="department" className={styles.listLine}>
<div className={styles.listLabel}>用车部门:</div> <div className={styles.mLineItem}>
<div className={styles.listValue}>{data.department}</div> <div className={styles.listLabel}>用车部门:</div>
<div className={styles.listValue}>{data.department}</div>
</div>
<div className={styles.mLineItem}>
<div className={styles.listLabel}>申请人:</div>
<div className={styles.listValue}>{data.name}</div>
</div>
</div>, </div>,
<div key="userCount" className={styles.listLine}> <div key="userCount" className={styles.listLine}>
<div className={styles.listLabel}>用车人数:</div> <div className={styles.listLabel}>用车人数:</div>
...@@ -147,6 +153,16 @@ class PublicCarItem extends Component { ...@@ -147,6 +153,16 @@ class PublicCarItem extends Component {
<div className={styles.listLabel}>用车时间:</div> <div className={styles.listLabel}>用车时间:</div>
<div className={styles.listValue}>{data.createDate}</div> <div className={styles.listValue}>{data.createDate}</div>
</div>, </div>,
<div key="department" className={styles.listLine}>
<div className={styles.mLineItem}>
<div className={styles.listLabel}>用车部门:</div>
<div className={styles.listValue}>{data.department}</div>
</div>
<div className={styles.mLineItem}>
<div className={styles.listLabel}>申请人:</div>
<div className={styles.listValue}>{data.name}</div>
</div>
</div>,
<div key="type" className={styles.listLine}> <div key="type" className={styles.listLine}>
<div className={styles.listLabel}>用车类型:</div> <div className={styles.listLabel}>用车类型:</div>
<div className={styles.listValue}> <div className={styles.listValue}>
...@@ -155,9 +171,7 @@ class PublicCarItem extends Component { ...@@ -155,9 +171,7 @@ class PublicCarItem extends Component {
</div>, </div>,
<div key="line" className={styles.listLine}> <div key="line" className={styles.listLine}>
<div className={styles.listLabel}>用车路线:</div> <div className={styles.listLabel}>用车路线:</div>
<div className={styles.listValue}> <div className={styles.listValue}>{data.lineDescription}</div>
{data.lineDescription}
</div>
</div>, </div>,
]} ]}
</div> </div>
......
...@@ -43,6 +43,10 @@ ...@@ -43,6 +43,10 @@
.listValueMutLine { .listValueMutLine {
composes: listValueMutLine from '../../Repair/components/style.css'; composes: listValueMutLine from '../../Repair/components/style.css';
} }
.mLineItem {
width: 50%;
display: flex;
}
.dealingColor { .dealingColor {
color: #ff3131; color: #ff3131;
} }
......
import React, { Component } from 'react';
import styles from './style.css';
import SelectIcon from './images/more_item_btn@2x.png';
class Select extends Component {
constructor(props) {
super(props);
this.state = {
showOptions: false,
};
}
componentWillMount() {
console.log(this.props.children);
if (this.props.children.length) {
this.props.onChange(this.props.children[0].props.value);
}
}
toggleOptions = () => {
console.log('in click');
this.setState(({ showOptions }) => ({
showOptions: !showOptions,
}));
};
selectHandle = (e, val) => {
e.preventDefault();
e.stopPropagation();
console.log(val);
this.setState({
showOptions: false,
});
this.props.onChange(val);
};
render() {
const { showOptions } = this.state;
const { value } = this.props;
return (
<div className={styles.selectWrap} onClick={this.toggleOptions}>
<div className={styles.selectValue}>
<div className={styles.selectOption}>{value}</div>
{showOptions && (
<div className={styles.selectOptionsBox}>
{this.props.children.map((i, idx) => (
<div
className={styles.selectOption}
key={idx}
onClick={e => this.selectHandle(e, i.props.value)}
>
{i}
</div>
))}
</div>
)}
</div>
<div className={styles.selectIcon}>
<img src={SelectIcon} alt="" />
</div>
</div>
);
}
}
export default Select;
...@@ -8,10 +8,10 @@ import { ...@@ -8,10 +8,10 @@ import {
fetchCarPlateList, fetchCarPlateList,
} from '../../api/index'; } from '../../api/index';
// import Select from '../../components/Input/Select/Select'; // import Select from '../../components/Input/Select/Select';
import SelectIcon from './images/more_item_btn@2x.png';
import offCheckIcon from '../../images/Check/radio_off_btn@2x.png'; import offCheckIcon from '../../images/Check/radio_off_btn@2x.png';
import onCheckIcon from '../../images/Check/radio_on_btn@2x.png'; import onCheckIcon from '../../images/Check/radio_on_btn@2x.png';
import UserInfoContext from '../../context/userinfo-context'; import UserInfoContext from '../../context/userinfo-context';
import Select from './Select';
class PublicCarDeal extends Component { class PublicCarDeal extends Component {
constructor(props) { constructor(props) {
...@@ -181,9 +181,7 @@ class PublicCarDeal extends Component { ...@@ -181,9 +181,7 @@ class PublicCarDeal extends Component {
Toast.fail(err.msg || '处理失败!'); Toast.fail(err.msg || '处理失败!');
}); });
}; };
onSelectHandle = e => { onSelectHandle = val => {
console.log(e);
const val = e.target.value;
this.setState(({ selected }) => ({ this.setState(({ selected }) => ({
selected: { selected: {
...selected, ...selected,
...@@ -201,7 +199,7 @@ class PublicCarDeal extends Component { ...@@ -201,7 +199,7 @@ class PublicCarDeal extends Component {
}; };
render() { render() {
const { const {
selected: { value, dealOpinion }, selected: { value, dealOpinion, carPlate },
dealDialogVisible, dealDialogVisible,
carPlateList, carPlateList,
} = this.state; } = this.state;
...@@ -273,22 +271,18 @@ class PublicCarDeal extends Component { ...@@ -273,22 +271,18 @@ class PublicCarDeal extends Component {
{value === 2 ? ( {value === 2 ? (
<div key="agree" className={styles.agree}> <div key="agree" className={styles.agree}>
<span className={styles.dialogAgreeLabel}>派车车牌</span> <span className={styles.dialogAgreeLabel}>派车车牌</span>
<div className={styles.selectWrap}> <div className={styles.selectWrapBox}>
<div className={styles.selectIcon}> <Select
<img src={SelectIcon} alt="" />
</div>
<select
className={styles.select} className={styles.select}
onChange={this.onSelectHandle} onChange={this.onSelectHandle}
defaultValue="-1" value={carPlate}
> >
<option disabled value="-1" >请选择</option>
{carPlateList.map(i => ( {carPlateList.map(i => (
<option key={i.value} value={i.lable}> <div key={i.value} value={i.lable}>
{i.lable} {i.lable}
</option> </div>
))} ))}
</select> </Select>
</div> </div>
</div> </div>
) : value === 3 ? ( ) : value === 3 ? (
......
...@@ -46,22 +46,39 @@ ...@@ -46,22 +46,39 @@
font-size: 26px; font-size: 26px;
color: #333; color: #333;
} }
.selectWrapBox {
width: 310px;
/* height: 60px; */
height: auto;
}
.selectWrap { .selectWrap {
box-sizing: border-box;
position: relative; position: relative;
width: 310px; width: 100%;
height: 60px; height: 100%;
line-height: 60px; line-height: 60px;
background-color: #f2f2f2;
border-radius: 8px; border-radius: 8px;
display: flex;
}
.selectValue {
padding-left: 26px; padding-left: 26px;
flex: 1;
background-color: #f2f2f2;
} }
.selectIcon { .selectIcon {
position: absolute;
right: 0;
top: 0;
width: 46px; width: 46px;
height: 60px; height: 60px;
} }
.selectOptionsBox {
z-index: 999;
width: 100%;
text-align: left;
}
.selectOption {
text-align: left;
height: 60px;
border-bottom: 1px solid #fff;
}
.select { .select {
border: none; border: none;
appearance: none; appearance: none;
......
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
} }
.listLineArea { .listLineArea {
composes: listLine; composes: listLine;
line-height: 26px; line-height: 30px;
} }
.listLine2Item { .listLine2Item {
display: flex; display: flex;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment