Commit b1e29db3 by FE

pc to m param error

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