Commit 22d27f71 by wangshuo

单集购买

parent 6c926cda
...@@ -80,25 +80,7 @@ class Single extends Component { ...@@ -80,25 +80,7 @@ class Single extends Component {
} }
}) })
} }
onBridgeReady = (data) => {
WeixinJSBridge.invoke(
'getBrandWCPayRequest', {
"appId": data.appId, //公众号名称,由商户传入
"timeStamp": data.timeStamp, //时间戳,自1970年以来的秒数
"nonceStr": data.nonceStr, //随机串
"package": data.package,
"signType": data.signType, //微信签名方式:
"paySign": data.paySign //微信签名
},
function (res) {
if (res.err_msg == "get_brand_wcpay_request:ok") {
this.payCallback()
} else {
alert('支付失败')
}
}
)
}
// 微信内部支付 // 微信内部支付
isweixinPay = () => { isweixinPay = () => {
let _this = this; let _this = this;
...@@ -130,6 +112,7 @@ class Single extends Component { ...@@ -130,6 +112,7 @@ class Single extends Component {
_this.intervalPayStatus = null; _this.intervalPayStatus = null;
// 获取课程类型 // 获取课程类型
http.get(`${API['base-api']}/class_order_status/${getParam('oid')}`).then((res) => { http.get(`${API['base-api']}/class_order_status/${getParam('oid')}`).then((res) => {
Toast.info(Number(res.data.data.errno));
if (Number(res.data.data.errno) === 200) { if (Number(res.data.data.errno) === 200) {
// 正常购买单集成功 // 正常购买单集成功
this.setState({ this.setState({
...@@ -186,6 +169,7 @@ class Single extends Component { ...@@ -186,6 +169,7 @@ class Single extends Component {
// 支付完成之后获取状态 // 支付完成之后获取状态
payCallback = () => { payCallback = () => {
const _this = this; const _this = this;
if(getParam('oid')) {
_this.intervalPayStatus = setInterval(function () { _this.intervalPayStatus = setInterval(function () {
http.get(`${API['base-api']}/m/orderState/oid/${getParam('oid')}`).then(res => { http.get(`${API['base-api']}/m/orderState/oid/${getParam('oid')}`).then(res => {
if (res.data.errno === 401) { if (res.data.errno === 401) {
...@@ -224,6 +208,8 @@ class Single extends Component { ...@@ -224,6 +208,8 @@ class Single extends Component {
}, 1000) }, 1000)
} }
}
// 特价购买全集 // 特价购买全集
toBuyAll = () => { toBuyAll = () => {
......
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