Commit 2ab202a4 by 姜雷

Merge branch 'develop' into 'test'

Develop See merge request !9
parents 4190cadd d95b03dd
......@@ -153,6 +153,12 @@ class PublicCarItem extends Component {
{this.getCategoryValue(data.categoryName)}
</div>
</div>,
<div key="line" className={styles.listLine}>
<div className={styles.listLabel}>用车路线:</div>
<div className={styles.listValue}>
{data.lineDescription}
</div>
</div>,
]}
</div>
</div>
......
......@@ -17,6 +17,7 @@ import store from '../../store/index';
import UserInfoContext from '../../context/userinfo-context';
import offCheckIcon from '../../images/Check/radio_off_btn@2x.png';
import onCheckIcon from '../../images/Check/radio_on_btn@2x.png';
import { emojiFilter } from '../../utils/index';
class ReprtRepair extends Component {
constructor(props) {
......@@ -29,9 +30,9 @@ class ReprtRepair extends Component {
repairCellphone: props.userinfo.cellphone,
applyIdentity: '学生',
area: '',
areaId: '',
areaId: [],
term: '',
termId: '',
termId: [],
address: '',
uploadImg: [null, null, null],
},
......@@ -79,9 +80,9 @@ class ReprtRepair extends Component {
repairCellphone: userinfo.cellphone,
applyIdentity: '学生',
area: '',
areaId: '',
areaId: [],
term: '',
termId: '',
termId: [],
address: '',
uploadImg: [null, null, null],
},
......@@ -92,7 +93,7 @@ class ReprtRepair extends Component {
this.setState(({ applyForm }) => ({
applyForm: {
...applyForm,
[name]: value,
[name]: emojiFilter(value),
},
}));
};
......@@ -141,11 +142,11 @@ class ReprtRepair extends Component {
Toast.fail('请选择报修人身份!');
return;
}
if (!applyForm.areaId) {
if (!applyForm.areaId.length) {
Toast.fail('请选择报修区域!');
return;
}
if (!applyForm.termId) {
if (!applyForm.termId.length) {
Toast.fail('请选择报修项目!');
return;
}
......@@ -200,18 +201,22 @@ class ReprtRepair extends Component {
.then(res => {
console.log(res);
const { data } = res;
if (data.code && data.code === 1000) {
const { data } = res;
const { history } = this.props;
console.log('resetForm');
this.resetApplyForm();
// Toast.hide();
Toast.success(data.msg);
history.replace('/repair/RepairList');
} else {
throw { msg: data.msg };
}
})
.catch(err => {
console.log(err);
const { data } = err;
// Toast.hide();
Toast.fail(data.msg || '提交失败!');
Toast.fail(err.msg || '提交失败!');
});
};
resetDialog = () => {
......@@ -369,7 +374,7 @@ class ReprtRepair extends Component {
this.setState(({ applyForm }) => ({
applyForm: {
...applyForm,
address: val.replace(/\n/, ''),
address: emojiFilter(val.replace(/\n/, '')),
},
}))
}
......
......@@ -118,7 +118,7 @@ class RepairItem extends Component {
</div>,
<div key="address" className={styles.listLineArea}>
<div className={styles.listLabel}>报修事项:</div>
<div className={styles.listValue}>{data.address}</div>
<div className={styles.listValue}>{data.affair}</div>
</div>,
]}
</div>
......
......@@ -71,7 +71,7 @@
text-overflow: ellipsis;
}
.listValueMutLine {
white-space: pre-wrap;
white-space: wrap;
word-break: break-all;
}
.listLabel {
......
......@@ -3,6 +3,7 @@
flex: auto;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
padding-bottom: 20px;
}
.footerTopLine {
position: absolute;
......@@ -21,6 +22,7 @@
align-items: center;
font-size: 30px;
border-top: 1px solid #dee0de;
overflow: hidden;
}
.line {
width: 2px;
......
......@@ -30,3 +30,7 @@ export function formatDate(date, fmt) {
function padLeftZero(str) {
return ('00' + str).substr(str.length);
}
export const emojiFilter = str => {
return str.replace(/\uD83C[\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F]/g, '');
};
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