Commit 3ae77f0b by FE

alipay and search font color

parent f4becc9b
......@@ -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)
}
......
......@@ -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');
}
......
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>
)
......
......@@ -66,6 +66,9 @@
font-size: $font_14;
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