退堂鼓选手
退堂鼓选手
  • 发布:2018-03-15 01:29
  • 更新:2018-03-15 01:29
  • 阅读:1436

选择支付时报未安装undefined服务

分类:wap2app
// 支付请求  
function plusReady(){  
    // 获取支付通道  
    plus.payment.getChannels(function(channels){  
        for(var i in channels){  
            var channel=channels[i];  
            if(channel.id=='qhpay'||channel.id=='qihoo'){   // 过滤掉不支持的支付通道:暂不支持360相关支付  
                continue;  
            }  
            pays[channel.id]=channel;  
            checkServices(channel);  
        }  
    },function(e){  
         plus.nativeUI.toast('获取支付通道失败:'+e.message);  
    });  
}  
document.addEventListener('plusready', plusReady, false);  
// 检测是否安装支付服务  
function checkServices(pc){  
    if(!pc.serviceReady){  
        var txt=null;  
        switch(pc.id){  
            case 'alipay':  
            txt='检测到系统未安装“支付宝快捷支付服务”,无法完成支付操作,是否立即安装?';  
            break;  
            default:  
            txt='系统未安装“'+pc.description+'”服务,无法完成支付,是否立即安装?';  
            break;  
        }  
        plus.nativeUI.confirm(txt, function(e){  
            if(e.index==0){  
                pc.installService();  
            }  
        }, pc.description);  
    }  
}

使用的是 h5+中的代码,当跳转到该支付页面的时候会提示 “系统未安装“undefined”服务,无法完成支付,是否立即安装?”,安卓跟ios下都会提示,之前正常,配置信息也没修改过,更新到 HBuilder 9.0.1.201802011934 版本打包安装后才出现的,有遇到这种情况的吗?该怎么解决

2018-03-15 01:29 负责人:无 分享
已邀请:

该问题目前已经被锁定, 无法添加新回复