Commit 5cd4c442 by FE

kanjia to midlle page modify

parent 06587250
......@@ -135,25 +135,25 @@ class Bargain extends Component {
type: type, // 1 用户自己砍价 2 使用砍价神器 3 好友助力砍价 4 好友第二次助力
parent_uid: uid // 被助力人id 【自己本人操作传0】
}
const { history } = this.props;
http.post(`${API.home}/m/bargain/toBargain`, data).then((res) => {
if (res.data.code === 200) {
const { data: { data, code } } = res;
if (code === 200) {
if (type === 2) {
this.setState({
isShowOverlay: true,
status: 2,
})
} else {
if (res.data.data.user_status === 2) {
if (data.user_status === 2) {
this.setState({
isShowOverlay: true,
status: 3,
})
} else {
// this.getBargainInfo()
document.location.reload()
history.push(`/bargain-middle-page?id=${getParam('id')}&bargaincode=${data.bargain_code}&is_originator=1`)
}
}
} else {
Toast.info(res.data.msg, 2)
}
......
......@@ -179,22 +179,23 @@ class BtnStatus extends Component {
}
// 砍价接口
toKanjia = () => {
const {user} = this.props
const uid = user && user.data && user.data.uid
const {user, history} = this.props;
const uid = user && user.data && user.data.uid;
const course_id = getParam('id');
if (!uid) {
this.props.history.push('/passport/login')
} else {
let data = {
course_id: getParam('id'),
course_id,
type: 1, // 1 用户自己砍价 2 使用砍价神器 3 好友助力砍价 4 好友第二次助力
parent_uid: 0 // 被助力人id 【自己本人操作传0】
}
http.post(`${API.home}/m/bargain/toBargain`, data).then((res) => {
if (res.data.code === 200) {
// this.props.getBargainInfo()
document.location.reload()
const {data: {data, code, msg}} = res;
if (code === 200) {
history.push(`/bargain-middle-page?id=${course_id}&bargaincode=${data.bargain_code}&is_originator=1`)
} else {
Toast.info(res.data.msg, 2)
Toast.info(msg, 2)
}
})
}
......
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