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
264a3d9a
Commit
264a3d9a
authored
Nov 01, 2019
by
xuzhenghua
Browse files
Options
Browse Files
Download
Plain Diff
pull
parents
c7210be4
7c092772
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
62 additions
and
39 deletions
+62
-39
src/components/blessingPreheat/collectBlessing/index.js
+16
-6
src/components/blessingPreheat/live/index.js
+1
-0
src/components/coupons/Coupon/index.js
+17
-6
src/components/coupons/myCoupons/index.js
+23
-24
src/components/detail/index.scss
+1
-0
src/components/expand/share.js
+1
-2
src/components/expand/share.scss
+2
-0
src/components/myOrders/index.js
+1
-1
No files found.
src/components/blessingPreheat/collectBlessing/index.js
View file @
264a3d9a
...
@@ -231,16 +231,22 @@ class CollectBlessing extends Component {
...
@@ -231,16 +231,22 @@ class CollectBlessing extends Component {
<
i
className
=
"collect-blessing__num"
>
{
index
+
1
}
<
/i
>
<
i
className
=
"collect-blessing__num"
>
{
index
+
1
}
<
/i
>
<
p
className
=
"collect-blessing__title"
>
{
item
}
<
/p
>
<
p
className
=
"collect-blessing__title"
>
{
item
}
<
/p
>
{
{
index
===
0
&&
(
isLogin
&&
isSign
)
&&
index
===
0
&&
<>
{
(
isLogin
&&
isSign
)
?
(
<
a
className
=
"collect-blessing__content"
data
-
status
=
"done"
>
<
a
className
=
"collect-blessing__content"
data
-
status
=
"done"
>
+
5
点
<
br
/>
福气值
+
5
点
<
br
/>
福气值
<
/a
>
<
/a
>
}
)
{
:
(
index
===
0
&&
(
!
isLogin
||
!
isSign
)
&&
<
span
onClick
=
{
toLogin
}
className
=
"collect-blessing__content"
>
<
span
onClick
=
{
toLogin
}
className
=
"collect-blessing__content"
>
点击
<
br
/>
签到
点击
<
br
/>
签到
<
/span
>
<
/span
>
)
}
<
/
>
}
}
{
{
index
===
1
&&
index
===
1
&&
...
@@ -281,7 +287,9 @@ class CollectBlessing extends Component {
...
@@ -281,7 +287,9 @@ class CollectBlessing extends Component {
index
===
4
&&
index
===
4
&&
<
a
className
=
"collect-blessing__content"
onClick
=
{
handleToShowInvite
}
>
<
a
className
=
"collect-blessing__content"
onClick
=
{
handleToShowInvite
}
>
<
span
>
邀请链接
<
/span
>
<
span
>
邀请链接
<
/span
>
<
i
>
已加
{
inviteBlessing
}
点
<
/i
>
{
inviteBlessing
>
0
&&
<
i
>
已加
{
inviteBlessing
}
点
<
/i
>
}
<
/a
>
<
/a
>
}
}
{
{
...
@@ -290,7 +298,9 @@ class CollectBlessing extends Component {
...
@@ -290,7 +298,9 @@ class CollectBlessing extends Component {
className
=
"collect-blessing__content"
className
=
"collect-blessing__content"
onClick
=
{
toSection
}
>
onClick
=
{
toSection
}
>
<
span
>
去选课
<
/span
>
<
span
>
去选课
<
/span
>
<
i
>
已加
{
buyBlessing
}
点
<
/i
>
{
buyBlessing
>
0
&&
<
i
>
已加
{
buyBlessing
}
点
<
/i
>
}
<
/a
>
<
/a
>
}
}
<
/div
>
<
/div
>
...
...
src/components/blessingPreheat/live/index.js
View file @
264a3d9a
...
@@ -115,6 +115,7 @@ class Live extends Component {
...
@@ -115,6 +115,7 @@ class Live extends Component {
tabBarInactiveTextColor
=
{
'#FFF604'
}
tabBarInactiveTextColor
=
{
'#FFF604'
}
tabBarUnderlineStyle
=
{{
display
:
'none'
}}
tabBarUnderlineStyle
=
{{
display
:
'none'
}}
initialPage
=
{
today
}
initialPage
=
{
today
}
swipeable
=
{
false
}
>
>
{
{
this
.
props
.
isFormal
this
.
props
.
isFormal
...
...
src/components/coupons/Coupon/index.js
View file @
264a3d9a
...
@@ -3,7 +3,9 @@ import './coupon.scss'
...
@@ -3,7 +3,9 @@ import './coupon.scss'
import
classnames
from
'classnames'
import
classnames
from
'classnames'
import
{
http
}
from
"@/utils"
import
{
http
}
from
"@/utils"
import
showAlert
from
'@common/deposit/end-expansion-alert'
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
{
class
Coupon
extends
PureComponent
{
...
@@ -12,9 +14,18 @@ class Coupon extends PureComponent {
...
@@ -12,9 +14,18 @@ class Coupon extends PureComponent {
EXPAND
=
4
//膨胀全
EXPAND
=
4
//膨胀全
pick
=
()
=>
{
pick
=
(
e
)
=>
{
let
{
useCoupon
,
invalid
}
=
this
.
props
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
)
!
invalid
&&
useCoupon
&&
useCoupon
(
this
.
props
.
id
)
}
}
}
...
@@ -38,8 +49,8 @@ class Coupon extends PureComponent {
...
@@ -38,8 +49,8 @@ class Coupon extends PureComponent {
.
then
(
res
=>
{
.
then
(
res
=>
{
const
{
data
}
=
res
const
{
data
}
=
res
if
(
data
.
code
==
200
)
{
if
(
data
.
code
==
200
)
{
this
.
props
.
endExpansion
(
id
)
this
.
props
.
endExpansion
(
id
,
data
.
data
.
coupon_
id
)
}
else
{
}
else
{
Toast
.
info
(
data
.
msg
)
Toast
.
info
(
data
.
msg
)
}
}
})
})
...
@@ -209,4 +220,4 @@ function BaseCoupon(
...
@@ -209,4 +220,4 @@ function BaseCoupon(
)
)
}
}
export
default
Coupon
export
default
withRouter
(
Coupon
)
src/components/coupons/myCoupons/index.js
View file @
264a3d9a
...
@@ -6,7 +6,6 @@ import Coupon from '../Coupon'
...
@@ -6,7 +6,6 @@ import Coupon from '../Coupon'
import
{
http
,
getParam
}
from
'@/utils'
import
{
http
,
getParam
}
from
'@/utils'
import
{
WithFullSize
}
from
'@/HOCs'
import
{
WithFullSize
}
from
'@/HOCs'
import
{
Toast
}
from
'antd-mobile'
import
{
Toast
}
from
'antd-mobile'
import
{
isEmpty
}
from
'lodash'
import
{
connect
}
from
'react-redux'
import
{
connect
}
from
'react-redux'
@
connect
()
@
connect
()
...
@@ -110,19 +109,13 @@ class UseCoupon extends PureComponent {
...
@@ -110,19 +109,13 @@ class UseCoupon extends PureComponent {
getMyCoupons
=
()
=>
{
getMyCoupons
=
()
=>
{
Promise
.
all
([
Promise
.
all
([
http
.
get
(
`
${
API
.
home
}
/m/coupon/all
`
),
http
.
get
(
`
${
API
.
home
}
/m/coupon/expansion
`
),
http
.
get
(
`
${
API
.
home
}
/m/coupon/expansion
`
)
http
.
get
(
`
${
API
.
home
}
/m/coupon/all
`
)
]).
then
((
coupons
)
=>
{
]).
then
((
coupons
)
=>
{
let
myCoupons
=
[]
let
myCoupons
=
[]
const
[
allCoupons
,
expansion
Coupons
]
=
coupons
const
[
expansionCoupons
,
all
Coupons
]
=
coupons
const
{
data
:
all
}
=
allCoupons
const
{
data
:
all
}
=
allCoupons
const
{
data
:
expansion
}
=
expansionCoupons
const
{
data
:
expansion
}
=
expansionCoupons
if
(
all
.
code
==
200
)
{
Array
.
isArray
(
all
.
data
)
&&
(
myCoupons
=
myCoupons
.
concat
(
all
.
data
))
}
else
{
Toast
.
info
(
all
.
msg
)
}
if
(
expansion
.
code
==
200
)
{
if
(
expansion
.
code
==
200
)
{
Array
.
isArray
(
expansion
.
data
)
Array
.
isArray
(
expansion
.
data
)
&&
(
expansion
.
data
=
expansion
.
data
.
map
(
item
=>
(
item
.
ctype
=
4
,
item
)))
&&
(
expansion
.
data
=
expansion
.
data
.
map
(
item
=>
(
item
.
ctype
=
4
,
item
)))
...
@@ -130,6 +123,11 @@ class UseCoupon extends PureComponent {
...
@@ -130,6 +123,11 @@ class UseCoupon extends PureComponent {
}
else
{
}
else
{
Toast
.
info
(
expansion
.
msg
)
Toast
.
info
(
expansion
.
msg
)
}
}
if
(
all
.
code
==
200
)
{
Array
.
isArray
(
all
.
data
)
&&
(
myCoupons
=
myCoupons
.
concat
(
all
.
data
))
}
else
{
Toast
.
info
(
all
.
msg
)
}
this
.
setState
({
this
.
setState
({
couponList
:
myCoupons
couponList
:
myCoupons
...
@@ -139,12 +137,21 @@ class UseCoupon extends PureComponent {
...
@@ -139,12 +137,21 @@ class UseCoupon extends PureComponent {
getAllCoupons
=
()
=>
{
getAllCoupons
=
()
=>
{
Promise
.
all
([
Promise
.
all
([
http
.
post
(
`
${
API
.
home
}
/m/coupon/select`
,
{
course_id
:
this
.
state
.
courseId
}
),
http
.
get
(
`
${
API
.
home
}
/m/coupon/expansion`
),
http
.
get
(
`
${
API
.
home
}
/m/coupon/expansion`
)
http
.
post
(
`
${
API
.
home
}
/m/coupon/select`
,
{
course_id
:
this
.
state
.
courseId
}
)
]).
then
((
coupons
)
=>
{
]).
then
((
coupons
)
=>
{
const
[
selectCoupons
,
expansion
Coupons
]
=
coupons
const
[
expansionCoupons
,
select
Coupons
]
=
coupons
const
{
data
:
select
}
=
selectCoupons
const
{
data
:
select
}
=
selectCoupons
const
{
data
:
expansion
}
=
expansionCoupons
const
{
data
:
expansion
}
=
expansionCoupons
if
(
expansion
.
code
==
200
)
{
Array
.
isArray
(
expansion
.
data
)
&&
(
expansion
.
data
=
expansion
.
data
.
map
(
item
=>
(
item
.
ctype
=
4
,
item
)))
&&
(
this
.
setState
({
valid_coupons
:
this
.
state
.
valid_coupons
.
concat
(
expansion
.
data
)
}))
}
else
{
Toast
.
info
(
expansion
.
msg
)
}
if
(
select
.
code
===
200
)
{
if
(
select
.
code
===
200
)
{
const
inuse_coupon
=
select
.
data
[
'inuse_coupon'
]
const
inuse_coupon
=
select
.
data
[
'inuse_coupon'
]
this
.
setState
({
this
.
setState
({
...
@@ -158,15 +165,6 @@ class UseCoupon extends PureComponent {
...
@@ -158,15 +165,6 @@ class UseCoupon extends PureComponent {
}
else
{
}
else
{
Toast
.
info
(
data
.
msg
)
Toast
.
info
(
data
.
msg
)
}
}
if
(
expansion
.
code
==
200
)
{
Array
.
isArray
(
expansion
.
data
)
&&
(
expansion
.
data
=
expansion
.
data
.
map
(
item
=>
(
item
.
ctype
=
4
,
item
)))
&&
(
this
.
setState
({
valid_coupons
:
this
.
state
.
valid_coupons
.
concat
(
expansion
.
data
)
}))
}
else
{
Toast
.
info
(
expansion
.
msg
)
}
})
})
...
@@ -278,11 +276,12 @@ class UseCoupon extends PureComponent {
...
@@ -278,11 +276,12 @@ class UseCoupon extends PureComponent {
})
})
}
}
endExpansion
=
id
=>
{
endExpansion
=
(
id
,
validId
)
=>
{
this
.
setState
({
this
.
setState
({
couponList
:
this
.
state
.
couponList
.
map
(
item
=>
{
valid_coupons
:
this
.
state
.
valid_coupons
.
map
(
item
=>
{
if
(
item
.
id
===
id
)
{
if
(
item
.
id
===
id
)
{
delete
item
.
start_amount
delete
item
.
start_amount
item
.
id
=
validId
}
}
return
item
return
item
})
})
...
...
src/components/detail/index.scss
View file @
264a3d9a
...
@@ -60,6 +60,7 @@
...
@@ -60,6 +60,7 @@
font-size
:
14px
;
font-size
:
14px
;
color
:
$color_666
;
color
:
$color_666
;
margin-top
:
10px
;
margin-top
:
10px
;
line-height
:
16px
;
}
}
.des
{
.des
{
...
...
src/components/expand/share.js
View file @
264a3d9a
...
@@ -164,8 +164,7 @@ class ExpandShare extends Component {
...
@@ -164,8 +164,7 @@ class ExpandShare extends Component {
step
:
2
,
step
:
2
,
helpData
:
data
helpData
:
data
})
})
this
.
getListorData
()
console
.
log
(
data
)
}
else
if
(
errno
===
17018
||
errno
===
17020
)
{
}
else
if
(
errno
===
17018
||
errno
===
17020
)
{
this
.
setState
({
this
.
setState
({
isShow
:
true
,
isShow
:
true
,
...
...
src/components/expand/share.scss
View file @
264a3d9a
...
@@ -569,6 +569,7 @@
...
@@ -569,6 +569,7 @@
color
:
#fff
;
color
:
#fff
;
font-size
:
15px
;
font-size
:
15px
;
margin-top
:
20px
;
margin-top
:
20px
;
border
:
none
;
}
}
}
}
...
@@ -596,6 +597,7 @@
...
@@ -596,6 +597,7 @@
border-radius
:
17px
;
border-radius
:
17px
;
color
:
#fff
;
color
:
#fff
;
font-size
:
15px
;
font-size
:
15px
;
border
:
none
;
}
}
}
}
...
...
src/components/myOrders/index.js
View file @
264a3d9a
...
@@ -193,7 +193,7 @@ function PayInfo(props) {
...
@@ -193,7 +193,7 @@ function PayInfo(props) {
<
/p
>
<
/p
>
<
p
>
<
p
>
<
span
className
=
'payable'
>
已优惠:
<
/span
>
<
span
className
=
'payable'
>
已优惠:
<
/span
>
<
span
className
=
'price'
>
¥
{
props
.
item
.
d
eposit_cu
t
}
<
/span
>
<
span
className
=
'price'
>
¥
{
props
.
item
.
d
iscoun
t
}
<
/span
>
<
/p
>
<
/p
>
<
/div
>
<
/div
>
...
...
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