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
3ae77f0b
Commit
3ae77f0b
authored
Aug 22, 2019
by
FE
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
alipay and search font color
parent
f4becc9b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
59 additions
and
3 deletions
+59
-3
src/components/detail/single/index.js
+34
-0
src/components/order/payOrder/PayOrder.js
+4
-0
src/components/search/searchHead.js
+18
-3
src/components/search/search_header.scss
+3
-0
No files found.
src/components/detail/single/index.js
View file @
3ae77f0b
...
...
@@ -32,6 +32,38 @@ class Single extends Component {
if
(
browser
.
isWeixin
)
{
this
.
isweixinPay
()
}
const
{
location
:
{
state
=
{}
}
}
=
this
.
props
;
console
.
log
(
state
);
if
(
state
.
oid
)
{
http
.
get
(
`
${
API
[
'base-api'
]}
/sys/orderStatus/
${
state
.
oid
}
`
).
then
((
res
)
=>
{
if
(
res
.
data
.
data
.
errno
==
'200'
)
{
// 正常购买单集成功
this
.
setState
({
status
:
6
})
}
else
if
(
res
.
data
.
data
.
errno
==
'201'
)
{
// 0元参团
this
.
setState
({
status
:
4
})
}
else
if
(
res
.
data
.
data
.
errno
==
'202'
)
{
// 0元购
this
.
setState
({
status
:
3
})
}
else
if
(
res
.
data
.
data
.
errno
==
'203'
)
{
// 三天内特价
this
.
setState
({
nowPrice
:
res
.
data
.
data
.
data
.
now_price
,
laterPrice
:
res
.
data
.
data
.
data
.
three_day_later_price
,
status
:
2
})
}
else
{
Toast
.
info
(
res
.
data
.
data
.
msg
,
2
)
}
})
}
}
// 选择支付方式
...
...
@@ -72,9 +104,11 @@ class Single extends Component {
}
// 支付宝支付
alipayPay
=
(
orderId
)
=>
{
const
courseId
=
getParam
(
'id'
);
http
.
get
(
`
${
API
[
'base-api'
]}
/pay/alipay/wap_charge_new/oid/
${
orderId
}
`
).
then
((
res
)
=>
{
if
(
res
.
data
.
errno
===
0
)
{
window
.
location
=
res
.
data
.
data
.
url
;
courseId
&&
window
.
localStorage
.
setItem
(
'payCourse'
,
courseId
);
}
else
{
Toast
.
info
(
res
.
data
.
msg
,
2
)
}
...
...
src/components/order/payOrder/PayOrder.js
View file @
3ae77f0b
...
...
@@ -58,6 +58,10 @@ export default class PayOrder extends Component {
// type订单类型 0普通订单 1团购 2小团 3砍价 4单集购买 5定金课定金 6定金课尾款
if
(
parseInt
(
type
,
10
)
===
2
)
{
history
.
push
(
`/togroup?id=
${
oid
}
`
);
}
else
if
(
parseInt
(
type
,
10
)
===
4
)
{
courseId
&&
window
.
localStorage
.
setItem
(
'payCourse'
,
courseId
);
const
courseId
=
window
.
localStorage
.
getItem
(
'payCourse'
)
courseId
&&
history
.
push
(
`/detail?id=
${
courseId
}
`
,{
oid
});
}
else
{
history
.
push
(
'/purchased'
);
}
...
...
src/components/search/searchHead.js
View file @
3ae77f0b
import
React
,
{
PureComponent
}
from
'react'
import
{
SearchBar
}
from
'antd-mobile'
import
{
withRouter
}
from
'react-router-dom'
import
classnames
from
'classnames'
;
import
'./search_header.scss'
class
SearchHead
extends
PureComponent
{
state
=
{
isFocus
:
false
}
returnPage
=
()
=>
{
this
.
props
.
history
.
go
(
-
1
)
...
...
@@ -24,8 +29,16 @@ class SearchHead extends PureComponent {
value
&&
localStorage
.
setItem
(
'searchHistory'
,
JSON
.
stringify
([...
searchHistory
,
value
]))
}
changeFontColor
=
(
isFocus
)
=>
{
this
.
setState
({
isFocus
});
}
render
()
{
const
{
isFocus
}
=
this
.
state
;
const
cls
=
classnames
(
'submit-btn'
,
{
'submit-btn--active'
:
isFocus
})
console
.
log
(
isFocus
);
return
(
<
div
className
=
"search-head"
>
...
...
@@ -41,11 +54,13 @@ class SearchHead extends PureComponent {
ref
=
"search"
focus
=
{
true
}
onChange
=
{
this
.
props
.
handleChange
}
placeholder
=
"搜索课程"
/>
placeholder
=
"搜索课程"
onFocus
=
{()
=>
this
.
changeFontColor
(
true
)}
onBlur
=
{()
=>
this
.
changeFontColor
(
false
)}
/
>
<
/div
>
<
div
className
=
"right right-btn"
onClick
=
{
this
.
search
}
>
<
div
className
=
"submit-btn"
>
搜索
<
/div
>
<
div
className
=
{
cls
}
>
搜索
<
/div
>
<
/div
>
<
/div
>
)
...
...
src/components/search/search_header.scss
View file @
3ae77f0b
...
...
@@ -66,6 +66,9 @@
font-size
:
$font_14
;
color
:
$color_333
;
}
.submit-btn--active
{
color
:
$active
;
}
}
}
...
...
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