Commit 5cd4c442 by FE

kanjia to midlle page modify

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