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
e4d8431b
Commit
e4d8431b
authored
Aug 16, 2019
by
xuzhenghua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug
parent
c0d44fc0
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
16 deletions
+44
-16
src/components/classify/index.js
+4
-4
src/components/my/edit.js
+7
-3
src/components/myOrders/index.js
+32
-8
src/components/order/index.js
+1
-1
No files found.
src/components/classify/index.js
View file @
e4d8431b
import
React
,
{
Component
}
from
'react'
;
import
React
,
{
Component
}
from
'react'
;
import
{
WithTab
}
from
'@/HOCs'
import
{
WithTab
}
from
'@/HOCs'
import
'./index.scss'
;
import
'./index.scss'
;
import
{
http
}
from
"@/utils"
;
import
{
http
}
from
"@/utils"
;
import
{
Link
}
from
'react-router-dom'
import
{
Link
}
from
'react-router-dom'
import
{
Toast
}
from
'antd-mobile'
import
{
Toast
}
from
'antd-mobile'
import
{
HeaderBar
}
from
"@/common"
import
{
HeaderBar
}
from
"@/common"
...
@@ -32,14 +32,14 @@ class Classify extends Component {
...
@@ -32,14 +32,14 @@ class Classify extends Component {
if
(
res
.
data
.
data
.
common
.
length
>
0
)
{
if
(
res
.
data
.
data
.
common
.
length
>
0
)
{
this
.
setState
({
this
.
setState
({
basics
:
res
.
data
.
data
.
common
[
0
],
basics
:
res
.
data
.
data
.
common
[
0
],
advanced
:
res
.
data
.
data
.
common
[
1
],
advanced
:
res
.
data
.
data
.
common
[
1
]
||
[]
,
})
})
}
}
if
(
res
.
data
.
data
.
special
.
length
>
0
)
{
if
(
res
.
data
.
data
.
special
.
length
>
0
)
{
this
.
setState
({
this
.
setState
({
camp
:
res
.
data
.
data
.
special
[
0
],
camp
:
res
.
data
.
data
.
special
[
0
],
employment
:
res
.
data
.
data
.
special
[
1
],
employment
:
res
.
data
.
data
.
special
[
1
]
||
[]
,
special
:
res
.
data
.
data
.
special
[
2
],
special
:
res
.
data
.
data
.
special
[
2
]
||
[]
,
})
})
}
}
}
else
{
}
else
{
...
...
src/components/my/edit.js
View file @
e4d8431b
...
@@ -18,10 +18,10 @@ class MyEdut extends PureComponent {
...
@@ -18,10 +18,10 @@ class MyEdut extends PureComponent {
}
}
// 点击编辑
// 点击编辑
toEditName
=
()
=>
{
toEditName
=
(
name
)
=>
{
this
.
setState
({
this
.
setState
({
isShow
:
true
,
isShow
:
true
,
value
:
''
value
:
name
})
})
}
}
// 取消
// 取消
...
@@ -61,6 +61,10 @@ class MyEdut extends PureComponent {
...
@@ -61,6 +61,10 @@ class MyEdut extends PureComponent {
})
})
this
.
props
.
updateUser
({
data
:
{
username
:
this
.
state
.
value
}})
this
.
props
.
updateUser
({
data
:
{
username
:
this
.
state
.
value
}})
Toast
.
info
(
'修改成功'
,
2
)
Toast
.
info
(
'修改成功'
,
2
)
}
else
if
(
res
.
data
.
code
===
4008
)
{
this
.
setState
({
isShow
:
false
})
}
else
{
}
else
{
Toast
.
info
(
res
.
data
.
msg
,
2
)
Toast
.
info
(
res
.
data
.
msg
,
2
)
}
}
...
@@ -80,7 +84,7 @@ class MyEdut extends PureComponent {
...
@@ -80,7 +84,7 @@ class MyEdut extends PureComponent {
<
div
className
=
'my-mess'
>
<
div
className
=
'my-mess'
>
<
img
src
=
{
avatar
}
alt
=
""
/>
<
img
src
=
{
avatar
}
alt
=
""
/>
<
span
className
=
"name"
>
{
username
}
<
/span
>
<
span
className
=
"name"
>
{
username
}
<
/span
>
<
span
onClick
=
{
this
.
toEditName
}
className
=
"edit"
>
编辑
<
/span
>
<
span
onClick
=
{
this
.
toEditName
.
bind
(
this
,
username
)
}
className
=
"edit"
>
编辑
<
/span
>
<
/div
>
<
/div
>
<
div
className
=
"out-login"
onClick
=
{
this
.
outLogin
}
>
<
div
className
=
"out-login"
onClick
=
{
this
.
outLogin
}
>
退出登录
退出登录
...
...
src/components/myOrders/index.js
View file @
e4d8431b
...
@@ -6,35 +6,47 @@ import {http, api} from "@/utils"
...
@@ -6,35 +6,47 @@ import {http, api} from "@/utils"
import
{
Link
}
from
'react-router-dom'
import
{
Link
}
from
'react-router-dom'
import
{
Modal
,
Toast
}
from
'antd-mobile'
import
{
Modal
,
Toast
}
from
'antd-mobile'
import
Loading
from
'@/common/Loading'
import
Loading
from
'@/common/Loading'
import
InfiniteScroll
from
'react-infinite-scroller'
import
{
debounce
}
from
'lodash'
const
alert
=
Modal
.
alert
const
alert
=
Modal
.
alert
class
MyOrders
extends
Component
{
class
MyOrders
extends
Component
{
page
=
1
constructor
(
props
)
{
constructor
(
props
)
{
super
(
props
)
super
(
props
)
this
.
state
=
{
this
.
state
=
{
data
:
[],
data
:
[],
isLoading
:
true
pageNum
:
1
,
isLoading
:
true
,
total
:
0
,
}
}
}
}
componentDidMount
()
{
componentDidMount
()
{
this
.
getList
()
this
.
getList
(
this
.
page
)
}
getMore
=
debounce
(()
=>
{
if
(
this
.
state
.
data
.
length
%
10
===
0
){
this
.
getList
(
++
this
.
page
)
}
}
},
200
)
// 获取订单
// 获取订单
getList
=
()
=>
{
getList
=
()
=>
{
http
.
get
(
`
${
API
.
home
}
/m/my/orders/
1/1
`
,).
then
((
res
)
=>
{
http
.
get
(
`
${
API
.
home
}
/m/my/orders/
${
this
.
page
}
/10
`
,).
then
((
res
)
=>
{
if
(
res
.
data
.
code
===
200
)
{
if
(
res
.
data
.
code
===
200
)
{
this
.
setState
({
this
.
setState
({
data
:
res
.
data
.
data
,
data
:
this
.
state
.
data
.
concat
(
res
.
data
.
data
)
,
isLoading
:
false
isLoading
:
false
})
})
}
else
{
}
else
{
Toast
.
info
(
res
.
data
.
msg
,
2
);
Toast
.
info
(
res
.
data
.
msg
,
2
);
}
}
})
})
}
}
// 取消订单
// 取消订单
...
@@ -68,6 +80,13 @@ class MyOrders extends Component {
...
@@ -68,6 +80,13 @@ class MyOrders extends Component {
<
Loading
isLoading
=
{
this
.
state
.
isLoading
}
>
<
Loading
isLoading
=
{
this
.
state
.
isLoading
}
>
{
{
this
.
state
.
data
&&
this
.
state
.
data
.
length
>
0
?
this
.
state
.
data
&&
this
.
state
.
data
.
length
>
0
?
<
InfiniteScroll
pageStart
=
{
0
}
hasMore
=
{
true
}
loadMore
=
{
this
.
getMore
.
bind
(
this
)}
useWindow
=
{
true
}
>
{
this
.
state
.
data
.
map
((
item
,
index
)
=>
{
this
.
state
.
data
.
map
((
item
,
index
)
=>
{
return
(
return
(
<
div
className
=
"order-body"
key
=
{
index
}
>
<
div
className
=
"order-body"
key
=
{
index
}
>
...
@@ -82,14 +101,17 @@ class MyOrders extends Component {
...
@@ -82,14 +101,17 @@ class MyOrders extends Component {
<
/p
>
<
/p
>
<
p
className
=
'order-content text-overflow-2'
>
{
item
.
description
}
<
/p
>
<
p
className
=
'order-content text-overflow-2'
>
{
item
.
description
}
<
/p
>
<
p
className
=
'order-des'
>
<
p
className
=
'order-des'
>
<
span
className
=
'order-newprice'
>
¥
{
item
.
pay_amount
}
<
/span
>
<
span
<
span
className
=
'order-price'
>
¥
{
item
.
price0
}
<
/span
>
className
=
'order-newprice'
>
¥
{
item
.
pay_amount
}
<
/span
>
<
span
className
=
'order-price'
>
¥
{
item
.
price0
}
<
/span
>
<
/p
>
<
/p
>
<
/div
>
<
/div
>
)
)
return
(
return
(
<
div
className
=
"order-wrap"
key
=
{
index
}
>
<
div
className
=
"order-wrap"
key
=
{
index
}
>
<
OrderList
info
=
{
Info
}
src
=
{
item
.
image_name
}
isSign
=
{
item
.
is_aist
}
<
OrderList
info
=
{
Info
}
src
=
{
item
.
image_name
}
isSign
=
{
item
.
is_aist
}
id
=
{
item
.
course_id
}
><
/OrderList
>
id
=
{
item
.
course_id
}
><
/OrderList
>
<
/div
>
<
/div
>
)
)
...
@@ -99,11 +121,13 @@ class MyOrders extends Component {
...
@@ -99,11 +121,13 @@ class MyOrders extends Component {
<
PayInfo
item
=
{
item
}
cancel
=
{
this
.
cancel
}
/
>
<
PayInfo
item
=
{
item
}
cancel
=
{
this
.
cancel
}
/
>
<
/div
>
<
/div
>
)
)
})
:
<
div
className
=
"cart-tip"
>
})
}
<
/InfiniteScroll> : <div className="cart-tip"
>
<
p
className
=
'cart-mess'
>
您还没有订单哦,快去逛逛吧
~<
/p
>
<
p
className
=
'cart-mess'
>
您还没有订单哦,快去逛逛吧
~<
/p
>
<
Link
to
=
'/classify'
>
去逛逛
<
/Link
>
<
Link
to
=
'/classify'
>
去逛逛
<
/Link
>
<
/div
>
<
/div
>
}
}
<
/Loading
>
<
/Loading
>
<
/div
>
<
/div
>
)
)
...
...
src/components/order/index.js
View file @
e4d8431b
...
@@ -334,7 +334,7 @@ class Order extends Component {
...
@@ -334,7 +334,7 @@ class Order extends Component {
{
{
useBalance
?
(
useBalance
?
(
<>
<>
<
span
style
=
{{
color
:
'#FF2121'
,
fontSize
:
'15px'
,
marginRight
:
"6px"
}}
>
{
`-
${
offset
}
`
}
<
/span
>
<
span
style
=
{{
color
:
'#FF2121'
,
fontSize
:
'15px'
,
marginRight
:
"6px"
}}
>
{
`-
¥
${
offset
}
`
}
<
/span
>
<
i
className
=
{
`iconfont icondanseshixintubiao-5 balance-used`
}
onClick
=
{
throttle
(
this
.
useBalance
,
600
)}
><
/i
>
<
i
className
=
{
`iconfont icondanseshixintubiao-5 balance-used`
}
onClick
=
{
throttle
(
this
.
useBalance
,
600
)}
><
/i
>
<
/
>
<
/
>
)
:
(
)
:
(
...
...
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