Commit 2a88d279 by FE

bargain and call app

parent d99a4dbe
......@@ -24,12 +24,21 @@ const options = {
class OpenApp extends Component {
callApp = new CallApp(options)
// callApp = new CallApp(options)
callApp = null
static defaultProps = {
text: '在APP打开'
}
componentWillMount() {
this.callApp = new CallApp({
...options,
path: this.props.path || '/'
});
}
handleClick = () => {
this.callApp.open({})
}
......
......@@ -124,9 +124,11 @@ class BargainMiddlePage extends Component {
// 获取助理好友
getBargainRankList = (id, type) => {
const bargain_code = getParam('bargaincode') || '';
let data = {
courseId: id,
type: type
type: type,
bargain_code
}
http.post(`${API.home}/m/bargain/rankList`, data).then((res) => {
if (res.data.code === 200) {
......
......@@ -33,12 +33,8 @@ class Bargain extends Component {
}
// 获取助理好友
getBargainRankList = (id, type) => {
let data = {
courseId: id,
type: type
}
http.post(`${API.home}/m/bargain/rankList`, data).then((res) => {
getBargainRankList = (params = {}) => {
http.post(`${API.home}/m/bargain/rankList`, params).then((res) => {
if (res.data.code === 200) {
this.setState({
list: res.data.data.list,
......@@ -57,20 +53,26 @@ class Bargain extends Component {
courseId: getParam('id')
}
http.post(`${API.home}/m/bargain/courseDetail`, data).then((res) => {
if (res.data.code === 200) {
const { code, data, msg = '' } = res.data;
if (code === 200) {
this.setState({
barInfo: res.data.data,
barInfo: data,
// info: res.data.data,
// limitPeople: res.data.data.limit_people,
// bargainCode: res.data.data.bargain_code
})
if (res.data.data.bargain_status === 0) {
this.getBargainRankList(getParam('id'), 0)
});
// 砍价状态 0-砍价中,1砍价结束,待支付,2砍价过期(没有砍价记录没有砍价信息),3已购买
if (data.bargain_status === 0) {
this.getBargainRankList({
type: 0,
bargain_code: data.bargain_code
});
}
} else {
Toast.info(res.data.msg, 2)
Toast.info(msg, 2);
}
})
});
}
// 查看更多
......
......@@ -461,7 +461,7 @@ class Detail extends Component {
cart={true}
toHref={href}
/>
<CallApp className='toapp'/>
<CallApp className='toapp' path={`/detail/id=${getParam('id')}`} />
{/*弹幕*/}
<Barrage isShow={course_info.is_show}/>
......
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