微信h5调获取发票抬头chooseInvoiceTitle安卓完全可以。但到了苹果却唤起不了?
发布于 7 年前 作者 qfeng 1062 次浏览 来自 官方Issues

微信h5调获取发票抬头chooseInvoiceTitle安卓完全可以。但到了苹果却唤起不了.不知道是哪方面的问题,麻烦官方和各位大牛帮忙解决一下

2 回复

你好,无法唤起没有任何提示么?

//微信抬头选择
function jtwxlooks(){
    alert("test");
//$("#load").show();
$.ajax({
    url :baseUrl+ '/sing.do', // 后台请求路径
    type : "POST",
    data : {
        urls : encodeURIComponent(location.href.split('#')[0])
        // 获取输入框内容
    },
    success : function(datas) {
        alert(JSON.stringify(datas));
        if (datas.code==0) {
            wx.config({
                debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
                appId:'***************', // 必填,公众号的唯一标识
                timestamp:datas.data.timestamp, // 必填,生成签名的时间戳
                nonceStr:datas.data.noncestr, // 必填,生成签名的随机串
                signature:datas.data.signature,// 必填,签名
                jsApiList:['chooseInvoiceTitle'] // 必填,需要使用的JS接口列表
            });
        }
    }
});
wx.ready(function () {
    $("#load").hide();
    wx.invoke('chooseInvoiceTitle', {
        "scene":"1"
    },function(res) {
        //var ress=JSON.stringify(res);
        var err=JSON.parse(res.choose_invoice_title_info);
        //alert(err.taxNumber+"1234");
        //alert(err.taxNumber+"12345");
        $("#phone").val(err.telephone);  //手机
        $("#address").val(err.companyAddress);
        $("#taxNo").val(err.taxNumber);
        $("#buyName").val(err.title);
        $("#bankDeposit").val(err.bankName); //开户行
        $("#bankAccount").val(err.bankAccount); //开户行
        // 遮罩层
        var mask = document.getElementById("mask")
        mask.classList.add("mask-hide")

    });
})}
回到顶部