Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mr-julyedu
Overview
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
baiguangyao
mr-julyedu
Commits
5fd2370c
Commit
5fd2370c
authored
Oct 30, 2019
by
zhanghaozhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
定金bug
parent
c42220e1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
9 deletions
+20
-9
src/components/coupons/Coupon/index.js
+17
-6
src/components/coupons/myCoupons/index.js
+3
-3
No files found.
src/components/coupons/Coupon/index.js
View file @
5fd2370c
...
...
@@ -3,7 +3,9 @@ import './coupon.scss'
import
classnames
from
'classnames'
import
{
http
}
from
"@/utils"
import
showAlert
from
'@common/deposit/end-expansion-alert'
import
{
Toast
}
from
'antd-mobile'
import
{
Toast
}
from
'antd-mobile'
import
{
withRouter
}
from
"react-router-dom"
class
Coupon
extends
PureComponent
{
...
...
@@ -12,9 +14,18 @@ class Coupon extends PureComponent {
EXPAND
=
4
//膨胀全
pick
=
()
=>
{
let
{
useCoupon
,
invalid
}
=
this
.
props
pick
=
(
e
)
=>
{
let
{
useCoupon
,
invalid
,
start_amount
,
id
,
location
,
history
,
code
}
=
this
.
props
const
{
state
}
=
location
if
(
state
&&
state
.
from
&&
state
.
from
===
'/my'
){
history
.
push
(
`/expand/index?deposit_code=
${
code
}
`
)
return
}
if
(
start_amount
)
{
this
.
stopExpanding
(
id
,
e
)
}
else
{
!
invalid
&&
useCoupon
&&
useCoupon
(
this
.
props
.
id
)
}
}
...
...
@@ -38,8 +49,8 @@ class Coupon extends PureComponent {
.
then
(
res
=>
{
const
{
data
}
=
res
if
(
data
.
code
==
200
)
{
this
.
props
.
endExpansion
(
id
)
}
else
{
this
.
props
.
endExpansion
(
id
,
data
.
data
.
coupon_
id
)
}
else
{
Toast
.
info
(
data
.
msg
)
}
})
...
...
@@ -209,4 +220,4 @@ function BaseCoupon(
)
}
export
default
Coupon
export
default
withRouter
(
Coupon
)
src/components/coupons/myCoupons/index.js
View file @
5fd2370c
...
...
@@ -6,7 +6,6 @@ import Coupon from '../Coupon'
import
{
http
,
getParam
}
from
'@/utils'
import
{
WithFullSize
}
from
'@/HOCs'
import
{
Toast
}
from
'antd-mobile'
import
{
isEmpty
}
from
'lodash'
import
{
connect
}
from
'react-redux'
@
connect
()
...
...
@@ -278,11 +277,12 @@ class UseCoupon extends PureComponent {
})
}
endExpansion
=
id
=>
{
endExpansion
=
(
id
,
validId
)
=>
{
this
.
setState
({
couponList
:
this
.
state
.
couponList
.
map
(
item
=>
{
valid_coupons
:
this
.
state
.
valid_coupons
.
map
(
item
=>
{
if
(
item
.
id
===
id
)
{
delete
item
.
start_amount
item
.
id
=
validId
}
return
item
})
...
...
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