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
5b54c38f
Commit
5b54c38f
authored
Apr 24, 2019
by
zhanghaozhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
exchange-coupons
parent
bbff4327
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
107 additions
and
26 deletions
+107
-26
src/components/coupons/common/Coupon/coupon.scss
+18
-2
src/components/coupons/common/Coupon/index.js
+12
-2
src/components/coupons/common/ExchangeBar/exchange-bar.scss
+24
-0
src/components/coupons/common/ExchangeBar/index.js
+31
-0
src/components/coupons/common/Input/index.js
+0
-0
src/components/coupons/common/Input/input.scss
+0
-0
src/components/coupons/exchange-coupons/coupons.scss
+0
-0
src/components/coupons/exchange-coupons/index.js
+20
-20
src/router.js
+2
-2
No files found.
src/components/coupons/Coupon/coupon.scss
→
src/components/coupons/
common/
Coupon/coupon.scss
View file @
5b54c38f
...
...
@@ -34,11 +34,27 @@ $bg_type2: #E0B97B;
&
.coupon-type1
{
background
:
$bg_type1
;
}
&
.coupon-type2
{
background
:
$E0B97B
;
}
&
>
.iconfont
{
$size
:
22px
;
position
:
absolute
;
top
:
50%
;
right
:
20px
;
transform
:
translateY
(
-50%
);
width
:
$size
;
height
:
$size
;
display
:
none
;
}
.check
{
display
:
block
;
}
ul
{
position
:
absolute
;
bottom
:
0
;
...
...
@@ -76,8 +92,8 @@ $bg_type2: #E0B97B;
padding
:
3px
8px
;
font-size
:
$font_12
;
color
:
$border_f31
;
border
:
1px
solid
$border_f31
;
border-radius
:
10px
;
border
:
1px
solid
$border_f31
;
border-radius
:
10px
;
background
:
transparent
;
-webkit-appearance
:
none
;
}
...
...
src/components/coupons/Coupon/index.js
→
src/components/coupons/
common/
Coupon/index.js
View file @
5b54c38f
...
...
@@ -3,13 +3,19 @@ import './coupon.scss'
import
classnames
from
'classnames'
const
Coupon
=
({
type
,
couponName
,
denomination
,
expire_time
,
limit
,
onClick
})
=>
{
const
Coupon
=
({
type
,
couponName
,
denomination
,
expire_time
,
limit
,
onClick
,
showUseButton
,
selected
})
=>
{
let
style
=
{
visibility
:
showUseButton
?
'visible'
:
'hidden'
}
return
(
<
li
className
=
'coupon'
>
<
div
className
=
{
classnames
(
'coupon-info'
,
`coupon-type
${
type
}
`
)}
>
<
p
className
=
'type'
>
{
couponName
}
<
/p
>
<
p
className
=
'denomination'
>
{
denomination
}
<
span
>
元
<
/span></
p
>
<
p
className
=
'expire'
>
有效期至:
{
expire_time
}
<
/p
>
<
i
className
=
{
classnames
(
'iconfont icondanseshixintubiao-5'
,
{
check
:
selected
})}
><
/i
>
<
ul
>
{
new
Array
(
19
).
fill
(
'a'
).
map
((
item
,
index
)
=>
{
...
...
@@ -20,7 +26,11 @@ const Coupon = ({type, couponName, denomination, expire_time, limit, onClick}) =
<
/div
>
<
div
className
=
"coupon-des"
>
<
span
className
=
'limit'
>
{
limit
}
<
/span
>
<
button
className
=
'use'
onClick
=
{
onClick
}
>
立即使用
<
/button
>
<
button
className
=
'use'
onClick
=
{
onClick
}
style
=
{
style
}
>
立即使用
<
/button
>
<
/div
>
<
/li
>
);
...
...
src/components/coupons/common/ExchangeBar/exchange-bar.scss
0 → 100644
View file @
5b54c38f
.exchange-bar
{
display
:
flex
;
justify-content
:
space-between
;
width
:
100%
;
padding
:
10px
12px
;
border-bottom
:
1px
solid
$border_e7eaf1
;
button
{
display
:
inline-block
;
width
:
84px
;
height
:
36px
;
line-height
:
36px
;
font-size
:
$font_16
;
color
:
$white
;
background-color
:
$bg_ccc
;
border
:
none
;
-webkit-appearance
:
none
;
&
.active
{
background-color
:
$active
;
}
}
}
\ No newline at end of file
src/components/coupons/common/ExchangeBar/index.js
0 → 100644
View file @
5b54c38f
import
React
,
{
Component
}
from
'react'
;
import
'./exchange-bar.scss'
import
Input
from
'../Input'
import
classnames
from
'classnames'
class
ExchangeBar
extends
Component
{
constructor
(
props
)
{
super
(
props
)
this
.
state
=
{}
}
render
()
{
const
{
onChange
,
exchangeNum
}
=
this
.
props
return
(
<
div
className
=
"exchange-bar"
>
<
Input
placeholder
=
{
'请输入优惠码'
}
onChange
=
{
onChange
}
type
=
{
'number'
}
/
>
<
button
className
=
{
classnames
({
active
:
exchangeNum
.
length
>
0
})}
>
兑换
<
/button
>
<
/div
>
);
}
}
export
default
ExchangeBar
;
\ No newline at end of file
src/components/coupons/Input/index.js
→
src/components/coupons/
common/
Input/index.js
View file @
5b54c38f
File moved
src/components/coupons/Input/input.scss
→
src/components/coupons/
common/
Input/input.scss
View file @
5b54c38f
File moved
src/components/coupons/coupons.scss
→
src/components/coupons/
exchange-coupons/
coupons.scss
View file @
5b54c38f
File moved
src/components/coupons/index.js
→
src/components/coupons/
exchange-coupons/
index.js
View file @
5b54c38f
...
...
@@ -3,9 +3,8 @@ import './coupons.scss'
// import { Toast } from "antd-mobile";
import
Input
from
"./Input"
import
classnames
from
'classnames'
import
Coupon
from
'./Coupon'
import
Coupon
from
'../common/Coupon'
import
ExchangeBar
from
'../common/ExchangeBar'
const
mockData
=
[
...
...
@@ -26,7 +25,7 @@ const mockData = [
]
class
Coupons
extends
Component
{
class
Exchange
Coupons
extends
Component
{
constructor
(
props
)
{
super
(
props
)
this
.
state
=
{
...
...
@@ -49,18 +48,15 @@ class Coupons extends Component {
render
()
{
return
(
<
div
id
=
'coupons'
>
<
div
className
=
"exchange"
>
<
Input
placeholder
=
{
'请输入优惠码'
}
onChange
=
{
this
.
onChange
}
type
=
{
'number'
}
/
>
<
button
className
=
{
classnames
({
active
:
this
.
state
.
exchangeNum
.
length
>
0
})}
>
兑换
<
/button
>
<
/div
>
<
Content
coupons
=
{
mockData
}
onClick
=
{
this
.
useCoupon
}
/
>
<
ExchangeBar
onChange
=
{
this
.
onChange
}
exchangeNum
=
{
this
.
state
.
exchangeNum
}
/
>
<
Content
coupons
=
{
mockData
}
onClick
=
{
this
.
useCoupon
}
showUseButton
=
{
true
}
/
>
<
/div
>
);
}
...
...
@@ -77,7 +73,7 @@ function Empty() {
)
}
function
Content
({
coupons
,
onClick
})
{
function
Content
({
coupons
,
onClick
,
...
rest
})
{
if
(
coupons
.
length
===
0
)
{
return
<
Empty
/>
}
...
...
@@ -85,7 +81,11 @@ function Content({coupons,onClick}) {
<
ul
className
=
'coupon-list'
>
{
mockData
.
map
((
item
,
index
)
=>
{
return
<
Coupon
{...
item
}
key
=
{
index
}
onClick
=
{
onClick
}
/
>
return
<
Coupon
{...
item
}
key
=
{
index
}
onClick
=
{
onClick
}
{...
rest
}
/
>
})
}
<
/ul
>
...
...
@@ -96,4 +96,4 @@ function Content({coupons,onClick}) {
return Toast.info(text, 1)
}*/
export
default
Coupons
;
\ No newline at end of file
export
default
ExchangeCoupons
;
\ No newline at end of file
src/router.js
View file @
5b54c38f
...
...
@@ -8,7 +8,7 @@ import Study from './components/study';
import
My
from
'./components/my'
;
import
CourseList
from
'./components/classify/courselist'
;
import
Examination
from
'./components/examination'
import
Coupons
from
'./components/
coupons'
import
ExchangeCoupons
from
'./components/coupons/exchange-
coupons'
const
router
=
()
=>
(
...
...
@@ -21,7 +21,7 @@ const router = () => (
<
Route
path
=
'/my'
component
=
{
My
}
><
/Route
>
<
Route
path
=
'/courselist'
component
=
{
CourseList
}
><
/Route
>
<
Route
path
=
'/examination'
component
=
{
Examination
}
><
/Route
>
<
Route
path
=
'/
coupons'
component
=
{
Coupons
}
><
/Route
>
<
Route
path
=
'/
exchange-coupons'
component
=
{
Exchange
Coupons
}
><
/Route
>
<
/Switch
>
<
Menu
/>
<
/Router
>
...
...
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