微信内pc浏览器端网页上调起微信支付是会稳定发生该报错。手机端没问题
system:function_not_implement/** * 微信支付 * @link https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=7_7&index=6 */ var wxPay = { to: function() { if (typeof WeixinJSBridge == "undefined"){ if( document.addEventListener ){ document.addEventListener('WeixinJSBridgeReady', wxPay._onBridgeReady, false); }else if (document.attachEvent){ document.attachEvent('WeixinJSBridgeReady', wxPay._onBridgeReady); document.attachEvent('onWeixinJSBridgeReady', wxPay._onBridgeReady); } }else{ wxPay._onBridgeReady(); } }, ok: function(ctx) { console.log(ctx); }, cancel: function(ctx) { console.log(ctx); }, fail: function(ctx) { console.log(ctx); }, other: function(ctx) { console.log(ctx); }, brandWCPayRequest:{ appId:'',//公众号名称,由商户传入 timeStamp:'',//时间戳,自1970年以来的秒数 nonceStr:'',//随机串 package:'', //订单详情扩展字符串 signType:'',//微信签名方式 paySign:'',//微信签名 }, _onBridgeReady: function () { try { WeixinJSBridge.invoke('getBrandWCPayRequest', wxPay.brandWCPayRequest, function(res) { switch (res.err_msg) { case 'get_brand_wcpay_request:ok': //支付成功 wxPay.ok({ result: res, param: wxPay.brandWCPayRequest }); break; case 'get_brand_wcpay_request:cancel': //支付过程中用户取消 wxPay.cancel({ result: res, param: wxPay.brandWCPayRequest }); break; case 'get_brand_wcpay_request:fail': // 支付失败 wxPay.fail({ result: res, param: wxPay.brandWCPayRequest }); break; default: wxPay.other({ result: res, param: wxPay.brandWCPayRequest }); } }); }catch (e) { wxPay.other({ exception:e.toString(), param: wxPay.brandWCPayRequest }); } } }; 以上是我的支付js,偶尔会发生异常:system:function_not_implement,请问是为什么呢
2023-03-03