Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
cdsf-wx-app
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
姜雷
cdsf-wx-app
Commits
cc385435
Commit
cc385435
authored
Oct 15, 2018
by
姜雷
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改初始化参数
parent
5fa401c7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
10 deletions
+13
-10
ReprtRepair.js
src/containers/Repair/ReprtRepair.js
+9
-10
index.js
src/utils/index.js
+4
-0
No files found.
src/containers/Repair/ReprtRepair.js
View file @
cc385435
...
...
@@ -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
;
}
...
...
@@ -203,14 +204,12 @@ class ReprtRepair extends Component {
const
{
history
}
=
this
.
props
;
console
.
log
(
'resetForm'
);
this
.
resetApplyForm
();
Toast
.
hide
();
Toast
.
success
(
data
.
msg
);
history
.
replace
(
'/repair/RepairList'
);
})
.
catch
(
err
=>
{
console
.
log
(
err
);
const
{
data
}
=
err
;
Toast
.
hide
();
Toast
.
fail
(
data
.
msg
||
'提交失败!'
);
});
};
...
...
@@ -369,7 +368,7 @@ class ReprtRepair extends Component {
this
.
setState
(({
applyForm
})
=>
({
applyForm
:
{
...
applyForm
,
address
:
val
.
replace
(
/
\n
/
,
''
),
address
:
emojiFilter
(
val
.
replace
(
/
\n
/
,
''
)
),
},
}))
}
...
...
src/utils/index.js
View file @
cc385435
...
...
@@ -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
(
/
\u
D83C
[\u
DF00-
\u
DFFF
]
|
\u
D83D
[\u
DC00-
\u
DE4F
]
/g
,
''
);
};
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment