Commit 7ad10835 by 姜雷

修改用车类型选择方式

parent 562de120
...@@ -40,10 +40,15 @@ class PublicCarApply extends Component { ...@@ -40,10 +40,15 @@ class PublicCarApply extends Component {
}); });
} }
selectCategory = id => { selectCategory = id => {
const { showAllCategory } = this.state;
if (!showAllCategory) {
this.toggleCategoryOptions();
} else {
this.setState({ this.setState({
categoryId: id, categoryId: id,
showAllCategory: false, showAllCategory: false,
}); });
}
}; };
toggleCategoryOptions = () => { toggleCategoryOptions = () => {
this.setState(({ showAllCategory }) => ({ this.setState(({ showAllCategory }) => ({
...@@ -149,6 +154,7 @@ class PublicCarApply extends Component { ...@@ -149,6 +154,7 @@ 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}>
{categoryId ? null : (
<div <div
className={styles.selectInput} className={styles.selectInput}
onClick={this.toggleCategoryOptions} onClick={this.toggleCategoryOptions}
...@@ -158,6 +164,7 @@ class PublicCarApply extends Component { ...@@ -158,6 +164,7 @@ class PublicCarApply extends Component {
<img src={arrIcon} alt="" /> <img src={arrIcon} alt="" />
</span> </span>
</div> </div>
)}
{showAllCategory {showAllCategory
? categoryList.map(i => ( ? categoryList.map(i => (
<div <div
......
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