Commit 73c79e8a by wangshuo

H5微信支付

parent aae2761d
......@@ -98,7 +98,6 @@ export default class PayOrder extends Component {
const {payType, orderId} = this.state;
if(payType === 0) {
this.alipayPay(orderId);
} else if (payType === 1) {
this.weixinPay(orderId)
}
......@@ -118,7 +117,7 @@ export default class PayOrder extends Component {
if (res.data.errno === 0) {
window.location.href = res.data.data.url + "&redirect_url=" + encodeURIComponent(window.location.href + "&weixinpay=1").toLowerCase();
} else {
Toast.info(res.data.msg + 'weixinPay', 2)
Toast.info(res.data.msg, 2)
}
})
}
......@@ -182,7 +181,7 @@ export default class PayOrder extends Component {
onBridgeReady();
}
} else {
Toast.info(res.data.msg + 'isweixinPay', 2)
Toast.info(res.data.msg, 2)
}
})
}
......@@ -199,12 +198,12 @@ export default class PayOrder extends Component {
clearInterval(_this.intervalPayStatus);
_this.intervalPayStatus = null;
// 获取课程类型
http.get(`${API.home}/m/app_order/detail/${getParam('oid')}`).then(res => {
if(res.data.data.course_type === '2') {
this.props.history.replace(`/togroup?id=${getParam('oid')}`);
http.get(`${API['base-api']}/m/app_order/detail/${getParam('oid')}`).then(res => {
if(Number(res.data.data.course_type) === 2) {
_this.props.history.replace(`/togroup?id=${getParam('oid')}`);
}else{
// 跳转到已购课程 /purchased 不需要传递任何参数
this.props.history.replace(`/purchased`);
_this.props.history.replace(`/purchased`);
}
});
......@@ -214,12 +213,8 @@ export default class PayOrder extends Component {
}
onBridgeReady1 = (data) => {
Toast.info(data.appId, 2);
console.log(`181 line data: ${JSON.stringify(data)}`);
let _this = this;
data = data || _this.BridgeData;
console.log(`184 line data: ${JSON.stringify(data)}`);
Toast.info(data.appId, 100);
WeixinJSBridge.invoke(
'getBrandWCPayRequest', {
......@@ -247,7 +242,7 @@ export default class PayOrder extends Component {
this.payCallback();
window.location = res.data.data.url;
} else {
Toast.info(res.data.msg + 'alipayPay', 2)
Toast.info(res.data.msg, 2)
}
})
}
......@@ -261,7 +256,7 @@ export default class PayOrder extends Component {
if (res.data.errno === 0) {
window.location = res.data.data.url;
} else {
Toast.info(res.data.msg + "huabeiPay", 2)
Toast.info(res.data.msg, 2)
}
});
}
......@@ -271,7 +266,7 @@ export default class PayOrder extends Component {
http.post(`${API['base-api']}/m/order/detail`, { order_id: this.state.orderId }).then((res) => {
console.log(res);
if (res.data.errno !== 200) {
Toast.info(res.data.msg + 'componentDidMount', 2);
Toast.info(res.data.msg, 2);
return;
}
const { course, pay_amount } = res.data.data;
......
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