Commit 582f9148 by xuzhenghua

支付

parent e381a2e5
...@@ -68,20 +68,19 @@ class ML extends Component { ...@@ -68,20 +68,19 @@ class ML extends Component {
signType: data.signType, //微信签名方式: signType: data.signType, //微信签名方式:
paySign: data.paySign //微信签名 paySign: data.paySign //微信签名
}, },
function (res) { function (res) {
if (res.err_msg == "get_brand_wcpsys/order_status/ay_request:ok") { if (res.err_msg == "get_brand_wcpay_request:ok") {
Toast.info('支付成功', 2) Toast.info('支付成功', 2)
_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) {
clearInterval(_this.intervalPayStatus) clearInterval(_this.intervalPayStatus)
_this.intervalPayStatus = null _this.intervalPayStatus = null
location.reload() location.href = '/ml?id=' + getParam('id')
} }
}) })
}, 1000) }, 1000)
} else {
Toast.info('支付失败', 2)
} }
} }
) )
...@@ -112,7 +111,7 @@ class ML extends Component { ...@@ -112,7 +111,7 @@ class ML extends Component {
if (res.data.errno === 401) { if (res.data.errno === 401) {
clearInterval(_this.intervalPayStatus) clearInterval(_this.intervalPayStatus)
_this.intervalPayStatus = null _this.intervalPayStatus = null
location.reload() location.href = '/ml?id=' + getParam('id')
} }
}) })
}, 1000) }, 1000)
......
...@@ -78,7 +78,8 @@ class PythonDes extends Component { ...@@ -78,7 +78,8 @@ class PythonDes extends Component {
weixinPay = (orderId) => { weixinPay = (orderId) => {
// 微信内部-支付 // 微信内部-支付
if (browser.isWeixin) { if (browser.isWeixin) {
window.location.href = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx23dac6775ac82877&redirect_uri=" + encodeURIComponent(window.location.href + "&aa=bb&oid=" + orderId).toLowerCase() + "&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect" let url = window.location.origin + location.pathname + '?id=' + getParam('id')
window.location.href = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx23dac6775ac82877&redirect_uri=" + encodeURIComponent(url + "&aa=bb&oid=" + orderId).toLowerCase() + "&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect";
} else { } else {
// 微信外部-支付 // 微信外部-支付
http.get(`${API['base-api']}/pay/wxpay/wap_charge/oid/${orderId}`).then((res) => { http.get(`${API['base-api']}/pay/wxpay/wap_charge/oid/${orderId}`).then((res) => {
......
...@@ -101,7 +101,8 @@ class PythonStudy extends Component { ...@@ -101,7 +101,8 @@ class PythonStudy extends Component {
weixinPay = (orderId) => { weixinPay = (orderId) => {
// 微信内部-支付 // 微信内部-支付
if (browser.isWeixin) { if (browser.isWeixin) {
window.location.href = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx23dac6775ac82877&redirect_uri=" + encodeURIComponent(window.location.href + "&aa=bb&oid=" + orderId).toLowerCase() + "&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect"; let url = window.location.origin + location.pathname + '?id=' + getParam('id')
window.location.href = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx23dac6775ac82877&redirect_uri=" + encodeURIComponent(url + "&aa=bb&oid=" + orderId).toLowerCase() + "&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect";
} else { } else {
// 微信外部-支付 // 微信外部-支付
http.get(`${API['base-api']}/pay/wxpay/wap_charge/oid/${orderId}`).then((res) => { http.get(`${API['base-api']}/pay/wxpay/wap_charge/oid/${orderId}`).then((res) => {
......
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