Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
addInsured-AIA-POC
Project
Project
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
liujianghai
addInsured-AIA-POC
Commits
010ac2c3
Commit
010ac2c3
authored
Mar 08, 2020
by
marsandheart
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug 产品重复添加现在给与提示
parent
a6a0885f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
4 deletions
+12
-4
InsuredInfo.jsx
src/pages/InsuredInfo.jsx
+9
-2
ProductListModal.jsx
src/pages/insuredsInfo.components/ProductListModal.jsx
+3
-2
No files found.
src/pages/InsuredInfo.jsx
View file @
010ac2c3
...
@@ -101,15 +101,22 @@ const InsuredInfo = (props) => {
...
@@ -101,15 +101,22 @@ const InsuredInfo = (props) => {
showLoading
();
showLoading
();
await
sleep
(
500
);
await
sleep
(
500
);
hideLoading
();
hideLoading
();
const
newTableData
=
tableData
.
filter
((
ele
)
=>
ele
.
key
!==
key
);
const
newTableData
=
tableData
.
filter
((
ele
)
=>
ele
.
key
!==
key
);
setTableData
(
newTableData
);
setTableData
(
newTableData
);
};
};
const
addTableData
=
async
(
product
)
=>
{
const
addTableData
=
async
(
product
)
=>
{
const
key
=
`add-
${
product
.
id
}
`
;
if
(
tableData
.
some
((
t
)
=>
t
.
key
===
key
))
{
alert
(
'该产品已添加过,请勿重复添加'
);
return
;
}
showLoading
();
showLoading
();
await
sleep
(
500
);
await
sleep
(
500
);
hideLoading
();
hideLoading
();
const
key
=
String
(
tableData
.
length
+
1
);
setSelectedDataKey
(
key
);
setSelectedDataKey
(
key
);
setTableData
([
setTableData
([
...
tableData
,
...
tableData
,
...
@@ -189,7 +196,7 @@ const InsuredInfo = (props) => {
...
@@ -189,7 +196,7 @@ const InsuredInfo = (props) => {
<
span
>
付款账号:622********3042
</
span
>
<
span
>
付款账号:622********3042
</
span
>
</
div
>
</
div
>
<
div
className=
{
styles
.
premLine
}
>
<
div
className=
{
styles
.
premLine
}
>
<
span
>
原保费:
68
0元
</
span
>
<
span
>
原保费:
86
0元
</
span
>
<
span
>
<
span
>
下一期保费:
<
span
className=
{
styles
.
actText
}
>
{
tableData
.
length
*
180
+
500
}
元
</
span
>
下一期保费:
<
span
className=
{
styles
.
actText
}
>
{
tableData
.
length
*
180
+
500
}
元
</
span
>
</
span
>
</
span
>
...
...
src/pages/insuredsInfo.components/ProductListModal.jsx
View file @
010ac2c3
...
@@ -90,9 +90,9 @@ export default function(props) {
...
@@ -90,9 +90,9 @@ export default function(props) {
}
else
{
}
else
{
showLoading
();
showLoading
();
setTimeout
(()
=>
{
setTimeout
(()
=>
{
setProductId
(
id
);
hideLoading
();
hideLoading
();
},
Math
.
random
()
*
1000
);
setProductId
(
id
);
},
Math
.
random
()
*
500
);
}
}
};
};
...
@@ -104,6 +104,7 @@ export default function(props) {
...
@@ -104,6 +104,7 @@ export default function(props) {
const
selectedProduct
=
productList
.
find
((
p
)
=>
p
.
id
===
productId
);
const
selectedProduct
=
productList
.
find
((
p
)
=>
p
.
id
===
productId
);
if
(
selectedProduct
)
{
if
(
selectedProduct
)
{
addTableData
(
selectedProduct
);
addTableData
(
selectedProduct
);
setProductId
(
''
);
}
}
close
();
close
();
};
};
...
...
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