Commit b1e29db3 by FE

pc to m param error

parent 30e40b6d
......@@ -171,6 +171,7 @@ class BargainMiddlePage extends Component {
// }
// })
}
// 我要砍价列表的去支付
toCartBottom = (id) => {
http.get(`${API['base-api']}/m/cart/addtopreorder/[${id}]`).then((res) => {
......@@ -195,6 +196,7 @@ class BargainMiddlePage extends Component {
isShowMore: true
})
}
// 自组件传给父组件的boxHide
boxHide = (val) => {
this.setState({isShowMore: val})
......@@ -202,8 +204,9 @@ class BargainMiddlePage extends Component {
// 领取砍价神器
toArtifact = () => {
const { course: { course_id = '' } } = this.state;
let data = {
courseId: getParam('id')
courseId: getParam('id')? getParam('id') : course_id
}
http.post(`${API.home}/m/bargain/receiveLimit`, data).then((res) => {
if (res.data.code === 200) {
......@@ -219,7 +222,9 @@ class BargainMiddlePage extends Component {
// 使用砍价神器
useArtifact = () => {
this.toKanjia(getParam('id'), 2, 0)
const { course: { course_id = '' } } = this.state;
const id = getParam('id')? getParam('id') : course_id;
this.toKanjia(id, 2, 0);
}
// 砍价接口
......@@ -298,12 +303,16 @@ class BargainMiddlePage extends Component {
// 帮好友砍价第一刀
friendBargainFirst = () => {
this.toKanjia(getParam('id'), 3, this.state.originatorUid)
const { course: { course_id = '' } } = this.state;
const id = getParam('id')? getParam('id') : course_id;
this.toKanjia(id, 3, this.state.originatorUid);
}
// 帮好友砍价第二刀
friendBargainSecond = () => {
this.toKanjia(getParam('id'), 4, this.state.originatorUid)
const { course: { course_id = '' } } = this.state;
const id = getParam('id')? getParam('id') : course_id;
this.toKanjia(id, 4, this.state.originatorUid);
}
// 邀请好友砍价
......@@ -312,8 +321,7 @@ class BargainMiddlePage extends Component {
isShowOverlay: true,
status: 7,
isshowYindao: browser.isWeixin ? true : false
})
});
wxShare({
title: `我发现一门好课,快来帮我砍价吧!`,
......@@ -328,7 +336,7 @@ class BargainMiddlePage extends Component {
this.setState({
isShowOverlay: false,
status: '',
})
});
}
toCourseDetail = (id) => {
......
......@@ -22,7 +22,8 @@ export default (state = {}, action) => {
return {
...state,
num: '',
code: ''
code: '',
from: ''
};
default:
return state;
......
......@@ -47,11 +47,11 @@ class Country extends Component {
}
toParentPage = (e, num) => {
// console.log(this.props);
const { history, addCountryNum } = this.props;
addCountryNum({
num,
code: getParam('share_code')
code: getParam('share_code'),
from: getParam('from')
});
history.push(`/detail?id=${getParam('id')}`);
e.preventDefault();
......
......@@ -108,7 +108,6 @@ class BargainInfo extends Component {
}else {
Toast.info(msg);
}
console.log(res);
});
......@@ -202,7 +201,7 @@ class BargainInfo extends Component {
>
<a
className="bargain-phone-popup__button--num"
href={`/country?id=${getParam('id')}`}
href={`/country?id=${getParam('id')}&from=bargain`}
>
+{country}
<i className="iconfont iconiconfront-69"></i>
......
......@@ -34,11 +34,10 @@ class Bargain extends Component {
this.judgePopupTypeFromCountry();
}
// // 选择区号后进入
judgePopupTypeFromCountry = () => {
// console.log(this.props);
// 选择区号后进入
judgePopupTypeFromCountry = () => {
const { country, delCountryNum } = this.props;
if(country.num) {
if(country.from && country.from === 'bargain') {
this.setState({
country: country.num,
isShowOverlay: true,
......
......@@ -618,7 +618,10 @@ class Detail extends Component {
*/}
{
course_info.is_baoming === 0 && (!course_info.is_aist) && course_info.is_bargain &&
<Bargain country={this.props.country} delCountryNum={this.props.delCountryNum} />
<Bargain
country={this.props.country}
delCountryNum={this.props.delCountryNum}
/>
}
{/*课程介绍、大纲*/}
......
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