Commit 3ae77f0b by FE

alipay and search font color

parent f4becc9b
...@@ -32,6 +32,38 @@ class Single extends Component { ...@@ -32,6 +32,38 @@ class Single extends Component {
if (browser.isWeixin) { if (browser.isWeixin) {
this.isweixinPay() 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 { ...@@ -72,9 +104,11 @@ class Single extends Component {
} }
// 支付宝支付 // 支付宝支付
alipayPay = (orderId) => { alipayPay = (orderId) => {
const courseId = getParam('id');
http.get(`${API['base-api']}/pay/alipay/wap_charge_new/oid/${orderId}`).then((res) => { http.get(`${API['base-api']}/pay/alipay/wap_charge_new/oid/${orderId}`).then((res) => {
if (res.data.errno === 0) { if (res.data.errno === 0) {
window.location = res.data.data.url; window.location = res.data.data.url;
courseId && window.localStorage.setItem('payCourse', courseId);
} else { } else {
Toast.info(res.data.msg, 2) Toast.info(res.data.msg, 2)
} }
......
...@@ -58,6 +58,10 @@ export default class PayOrder extends Component { ...@@ -58,6 +58,10 @@ export default class PayOrder extends Component {
// type订单类型 0普通订单 1团购 2小团 3砍价 4单集购买 5定金课定金 6定金课尾款 // type订单类型 0普通订单 1团购 2小团 3砍价 4单集购买 5定金课定金 6定金课尾款
if (parseInt(type, 10) === 2) { if (parseInt(type, 10) === 2) {
history.push(`/togroup?id=${oid}`); 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 { } else {
history.push('/purchased'); history.push('/purchased');
} }
......
import React, { PureComponent } from 'react' import React, { PureComponent } from 'react'
import { SearchBar } from 'antd-mobile' import { SearchBar } from 'antd-mobile'
import { withRouter } from 'react-router-dom' import { withRouter } from 'react-router-dom'
import classnames from 'classnames';
import './search_header.scss' import './search_header.scss'
class SearchHead extends PureComponent { class SearchHead extends PureComponent {
state = {
isFocus: false
}
returnPage = () => { returnPage = () => {
this.props.history.go(-1) this.props.history.go(-1)
} }
...@@ -24,8 +29,16 @@ class SearchHead extends PureComponent { ...@@ -24,8 +29,16 @@ class SearchHead extends PureComponent {
value && localStorage.setItem('searchHistory', JSON.stringify([...searchHistory, value])) value && localStorage.setItem('searchHistory', JSON.stringify([...searchHistory, value]))
} }
changeFontColor = (isFocus) => {
this.setState({
isFocus
});
}
render() { render() {
const { isFocus } = this.state;
const cls = classnames('submit-btn', {'submit-btn--active': isFocus})
console.log(isFocus);
return ( return (
<div className="search-head"> <div className="search-head">
...@@ -41,11 +54,13 @@ class SearchHead extends PureComponent { ...@@ -41,11 +54,13 @@ class SearchHead extends PureComponent {
ref="search" ref="search"
focus={true} focus={true}
onChange={this.props.handleChange} onChange={this.props.handleChange}
placeholder="搜索课程"/> placeholder="搜索课程"
onFocus={() => this.changeFontColor(true)}
onBlur={() => this.changeFontColor(false)}
/>
</div> </div>
<div className="right right-btn" onClick={this.search}> <div className="right right-btn" onClick={this.search}>
<div className="submit-btn">搜索 <div className={cls}>搜索</div>
</div>
</div> </div>
</div> </div>
) )
......
...@@ -66,6 +66,9 @@ ...@@ -66,6 +66,9 @@
font-size: $font_14; font-size: $font_14;
color: $color_333; color: $color_333;
} }
.submit-btn--active {
color: $active;
}
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment