Commit a797b86e by 姜雷

修改提示文字

parent 3828a0ec
...@@ -8,7 +8,7 @@ const path = config.SERVER_URL; ...@@ -8,7 +8,7 @@ const path = config.SERVER_URL;
// 创建axios实例 // 创建axios实例
const service = axios.create({ const service = axios.create({
baseURL: path, // api的base_url baseURL: path, // api的base_url
timeout: 10000, timeout: 20000,
}); });
// request拦截器 // request拦截器
service.interceptors.request.use( service.interceptors.request.use(
...@@ -33,7 +33,7 @@ service.interceptors.request.use( ...@@ -33,7 +33,7 @@ service.interceptors.request.use(
conf.params = data; conf.params = data;
} }
Toast.loading('Loading...', 10); Toast.loading('Loading...', 99);
conf.headers = { conf.headers = {
...conf.headers, ...conf.headers,
reqSource: 'wx', reqSource: 'wx',
......
import React, { Component } from 'react'; import React, { Component } from 'react';
import { ListView, PullToRefresh, Modal, Toast } from 'antd-mobile'; import { PullToRefresh, Modal, Toast } from 'antd-mobile';
import styles from './style.css'; import styles from './style.css';
import RepairItem from './components/RepairItem'; import RepairItem from './components/RepairItem';
import { fetchRepairList } from '../../api/index'; import { fetchRepairList } from '../../api/index';
......
...@@ -154,7 +154,7 @@ class ReprtRepair extends Component { ...@@ -154,7 +154,7 @@ class ReprtRepair extends Component {
if (!this.validateForm()) { if (!this.validateForm()) {
return; return;
} }
Toast.loading('请求中', 99); Toast.loading('', 99);
let formData = new FormData(); let formData = new FormData();
this.state.applyForm.uploadImg.map(i => { this.state.applyForm.uploadImg.map(i => {
if (i) { if (i) {
...@@ -183,14 +183,16 @@ class ReprtRepair extends Component { ...@@ -183,14 +183,16 @@ class ReprtRepair extends Component {
reportRepair(formData) reportRepair(formData)
.then(res => { .then(res => {
console.log(res); console.log(res);
const { data } = res;
console.log('resetForm'); console.log('resetForm');
this.resetApplyForm(); this.resetApplyForm();
Toast.hide(); Toast.hide();
Toast.success(res.msg); Toast.success(data.msg);
}) })
.catch(err => { .catch(err => {
console.log(err); console.log(err);
Toast.hide(); const { data } = err;
Toast.hide(data.msg || '提交失败!');
}); });
}; };
resetDialog = () => { resetDialog = () => {
......
...@@ -59,9 +59,7 @@ class RepairItem extends Component { ...@@ -59,9 +59,7 @@ class RepairItem extends Component {
? [ ? [
<div key="time" className={styles.listLine}> <div key="time" className={styles.listLine}>
<div className={styles.listLabel}>报修时间:</div> <div className={styles.listLabel}>报修时间:</div>
<div className={styles.listValue}> <div className={styles.listValue}>{data.createDate}</div>
{formatDate(new Date(data.createDate), 'yyyy-MM-dd')}
</div>
</div>, </div>,
<div key="area" className={styles.listLine}> <div key="area" className={styles.listLine}>
<div className={styles.listLine2ItemLeft}> <div className={styles.listLine2ItemLeft}>
...@@ -105,9 +103,7 @@ class RepairItem extends Component { ...@@ -105,9 +103,7 @@ class RepairItem extends Component {
: [ : [
<div key="time" className={styles.listLine}> <div key="time" className={styles.listLine}>
<div className={styles.listLabel}>报修时间:</div> <div className={styles.listLabel}>报修时间:</div>
<div className={styles.listValue}> <div className={styles.listValue}>{data.createDate}</div>
{formatDate(new Date(data.createDate), 'yyyy-MM-dd')}
</div>
</div>, </div>,
<div key="name" className={styles.listLine}> <div key="name" className={styles.listLine}>
<div className={styles.listLine2ItemLeft}> <div className={styles.listLine2ItemLeft}>
......
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