Commit 2a88d279 by FE

bargain and call app

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