Commit 73c79e8a by wangshuo

H5微信支付

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