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
5aef9c96
Commit
5aef9c96
authored
Jun 12, 2019
by
wangshuo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
订单页以及接口
parent
f6faedcc
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
103 additions
and
86 deletions
+103
-86
src/common/OrderList/index.js
+4
-1
src/components/order/index.js
+0
-0
src/components/order/order.scss
+8
-5
src/components/order/orderinfo.js
+91
-80
No files found.
src/common/OrderList/index.js
View file @
5aef9c96
...
...
@@ -14,12 +14,15 @@ import './orderlist.scss';
const
OrderItem
=
({
info
,
tab
,
children
,
...
restProps
})
=>
{
// tab 没有值
// info 是文字信息
// children 是 order-prefer优惠券
return
(
<
div
className
=
'public-list-item'
>
<
div
className
=
"public-content"
>
{
tab
}
<
div
className
=
"public-cover"
>
<
img
src
=
'https://julyedu-img-public.oss-cn-beijing.aliyuncs.com/Public/Image/4c5ccac604.jpg'
alt
=
""
/>
<
img
src
=
{
restProps
.
image_name
}
alt
=
""
/>
<
/div
>
{
info
}
<
/div
>
...
...
src/components/order/index.js
View file @
5aef9c96
This diff is collapsed.
Click to expand it.
src/components/order/order.scss
View file @
5aef9c96
...
...
@@ -98,6 +98,11 @@
.order-info
{
color
:
$color_666
;
font-size
:
$font_14
;
min-width
:
160px
;
flex
:
1
1
auto
;
display
:
flex
;
flex-direction
:
column
;
justify-content
:
space-around
;
.order-title
{
height
:
16px
;
...
...
@@ -107,16 +112,11 @@
}
.order-content
{
margin-top
:
10px
;
color
:
$color_666
;
font-size
:
$font_14
;
line-height
:
18px
;
}
.order-des
{
margin-top
:
10px
;
}
.order-newprice
{
color
:
$redprice
;
font-size
:
$font_16
;
...
...
@@ -189,6 +189,9 @@
-webkit-text-size-adjust
:
100%
;
border
:
1px
solid
transparent
;
}
.has-info
{
background-color
:
#FF3131
;
}
.v-list-item
{
margin-top
:
8px
;
...
...
src/components/order/orderinfo.js
View file @
5aef9c96
import
React
,
{
Component
}
from
'react'
;
import
{
Flex
,
NavBar
,
List
,
InputItem
,
Button
,
WhiteSpace
,
WingBlank
,
Toast
}
from
'antd-mobile'
;
import
{
Formik
,
Field
,
Form
,
withFormik
}
from
'formik'
;
class
orderinfo
extends
Component
{
submit
=
()
=>
{
this
.
props
.
form
.
validateFields
((
error
,
value
)
=>
{
console
.
log
(
error
,
value
);
if
(
error
!==
null
)
{
if
(
error
.
realName
)
{
Toast
.
info
(
error
.
realName
.
errors
[
0
].
message
,
undefined
,
undefined
,
false
);
return
;
}
if
(
error
.
phone
)
{
Toast
.
info
(
error
.
phone
.
errors
[
0
].
message
,
undefined
,
undefined
,
false
);
return
;
}
if
(
error
.
qqNumber
)
{
Toast
.
info
(
error
.
qqNumber
.
errors
[
0
].
message
,
undefined
,
undefined
,
false
);
return
;
}
}
this
.
props
.
history
.
push
({
pathname
:
'/order'
,
state
:
value
});
const
InnerForm
=
({
values
,
errors
,
touched
,
setFieldValue
,
handleBlur
,
handleSubmit
,
isSubmitting
,
})
=>
(
<
form
>
<
InputItem
clear
name
=
"real_name"
onChange
=
{(
value
)
=>
setFieldValue
(
'real_name'
,
value
)}
placeholder
=
"请输入您的真实姓名"
>
姓名
<
/InputItem
>
<
InputItem
clear
type
=
'phone'
name
=
'cellphone'
placeholder
=
"请输入您的手机号码"
onChange
=
{(
value
)
=>
setFieldValue
(
'cellphone'
,
value
)}
>
电话
<
/InputItem
>
<
InputItem
clear
name
=
'qq'
placeholder
=
"请输入您的QQ号码"
maxLength
=
'15'
onChange
=
{(
value
)
=>
setFieldValue
(
'qq'
,
value
)}
>
QQ
<
/InputItem
>
<
div
style
=
{{
marginTop
:
'21px'
}}
>
<
WingBlank
>
<
Button
type
=
'primary'
onClick
=
{
handleSubmit
}
>
确认
<
/Button
>
<
/WingBlank
>
<
/div
>
<
/form
>
);
const
MyForm
=
withFormik
({
mapPropsToValues
:
props
=>
({
real_name
:
''
,
cellphone
:
''
,
qq
:
''
}),
validate
:
(
values
,
props
)
=>
{
const
errors
=
{};
return
errors
;
},
handleSubmit
:
(
values
,
FormBag
)
=>
{
if
(
!
values
.
real_name
)
{
Toast
.
info
(
'请输入姓名!'
,
undefined
,
undefined
,
false
);
return
;
}
if
(
!
values
.
cellphone
)
{
Toast
.
info
(
'请输入手机号!'
,
undefined
,
undefined
,
false
);
return
;
}
else
if
(
!
/1
\d{10}
/g
.
test
(
values
.
cellphone
.
replace
(
/
\s
+/g
,
''
)))
{
Toast
.
info
(
'请输入正确的手机号!'
,
undefined
,
undefined
,
false
);
return
;
}
if
(
!
values
.
qq
)
{
Toast
.
info
(
'请输入QQ号!'
,
undefined
,
undefined
,
false
);
return
;
}
else
if
(
!
/
\d{5,}
/g
.
test
(
values
.
qq
))
{
Toast
.
info
(
'请输入正确QQ号!'
,
undefined
,
undefined
,
false
);
return
;
}
FormBag
.
props
.
history
.
push
({
pathname
:
'/order'
,
state
:
values
});
},
})(
InnerForm
);
class
Orderinfo
extends
Component
{
constructor
(
props
)
{
super
(
props
);
}
render
()
{
const
{
getFieldProps
}
=
this
.
props
.
form
;
return
(
<
Flex
>
<
Flex
.
Item
>
<
NavBar
style
=
{{
"height"
:
"44px"
}}
className
=
"order-tab"
mode
=
"light"
icon
=
{
<
i
className
=
"iconfont iconiconfront-68"
><
/i>
}
>
报名信息
<
/NavBar
>
<
div
>
<
List
>
<
InputItem
{...
getFieldProps
(
'realName'
,
{
rules
:
[
{
required
:
true
,
message
:
'请输入您的姓名!'
},
],
})}
clear
placeholder
=
"请输入您的真实姓名"
>
姓名
<
/InputItem
>
<
InputItem
{...
getFieldProps
(
'phone'
,
{
rules
:
[
{
required
:
true
,
message
:
'请输入手机号!'
},
{
pattern
:
/^1
\d{10}
$/
,
message
:
'请输入正确手机号码!'
}
]
})}
clear
placeholder
=
"请输入您的手机号码"
maxLength
=
'11'
>
电话
<
/InputItem
>
<
InputItem
{...
getFieldProps
(
'qqNumber'
,
{
rules
:
[
{
required
:
true
,
message
:
'请输入QQ号!'
},
{
pattern
:
/^
\d{5,}
$/
,
message
:
'请输入正确QQ号码!'
}
]
})}
clear
placeholder
=
"请输入您的QQ号码"
maxLength
=
'15'
>
QQ
<
/InputItem
>
<
/List
>
<
WhiteSpace
/>
<
div
style
=
{{
marginTop
:
'21px'
}}
>
<
WingBlank
>
<
Button
type
=
"primary"
onClick
=
{
this
.
submit
}
>
确认
<
/Button
>
<
/WingBlank
>
<
/div
>
<
/div
>
<
/Flex.Item
>
<
/Flex
>
<
div
>
<
NavBar
style
=
{{
"height"
:
"44px"
,
backgroundColor
:
'#F7F9FC'
}}
className
=
"order-tab"
mode
=
"light"
icon
=
{
<
i
className
=
"iconfont iconiconfront-68"
><
/i>
}
>
报名信息
<
/NavBar
>
<
MyForm
history
=
{
this
.
props
.
history
}
/
>
<
/div
>
)
}
}
};
export
default
orderinfo
;
\ No newline at end of file
export
default
Orderinfo
;
\ No newline at end of file
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