jsapi ticket java_jsapi ticket 失效

Re苹果手机使用JSAPI扫码功能提示scan err,安卓正常,什么情况?!?!

钉钉自带的扫描在苹果下也可以用,微应用里使用JSAPI就不行,苹果手机权限也看了,全都放开着呢,为什么啊?!?

-------------------------

Re苹果手机使用JSAPI扫码功能提示scan err,安卓正常,什么情况?!?!

/** * Created by liqiao on 8/10/15. *///logger.i('Here we go...');//logger.i(location.href);/** * _config comes from server-side template. see views/index.jade */dd.config({    agentId: _config.agentId,    corpId: _config.corpId,    timeStamp: _config.timeStamp,    nonceStr: _config.nonceStr,    signature: _config.signature,    jsApiList: [        'runtime.info',        'device.notification.prompt',        'biz.chat.pickConversation',        'device.notification.confirm',        'device.notification.alert',        'device.notification.prompt',        'biz.chat.open',        'biz.util.open',        'biz.user.get',        'biz.contact.choose',        'biz.telephone.call',        'biz.ding.post',        'biz.util.scan']});dd.userid = 0;dd.ready(function () {    //logger.i('dd.ready rocks!');    dd.runtime.info({        onSuccess: function (info) {            //logger.i('runtime info: ' + JSON.stringify(info));        },        onFail: function (err) {            logger.e('fail: ' + JSON.stringify(err));        }    });    dd.runtime.permission.requestAuthCode({        corpId: _config.corpId, //企业id        onSuccess: function (info) {            //logger.i('authcode: ' + info.code);            $.ajax({                url: '/sendMsg.php',                type: "POST",                data: { "event": "get_userinfo", "code": info.code },                dataType: 'json',                timeout: 900,                success: function (data, status, xhr) {                    var info = JSON.parse(data);                    if (info.errcode === 0) {                        //logger.i('user id: ' + info.userid);                        dd.userid = info.userid;                    }                    else {                        logger.e('auth error: ' + data);                    }                },                error: function (xhr, errorType, error) {                    if(error!=null)                        logger.e(errorType + ', ' + error);                }            });        },        onFail: function (err) {            logger.e('requestAuthCode fail: ' + JSON.stringify(err));        }    });    dd.biz.user.get({        onSuccess: function (info) {            //logger.e('userGet success: ' + JSON.stringify(info));        },        onFail: function (err) {            logger.e('userGet fail: ' + JSON.stringify(err));        }    });    $('.chooseonebtn').on('click', function () {        dd.biz.chat.pickConversation({            corpId: _config.corpId, //企业id            isConfirm: 'false', //是否弹出确认窗口,默认为true            onSuccess: function (data) {                var chatinfo = data;                if (chatinfo) {                    console.log(chatinfo.cid);                    dd.device.notification.prompt({                        message: "发送消息",                        title: chatinfo.title,                        buttonLabels: ['发送', '取消'],                        onSuccess: function (result) {                            var text = result.value;                            if (text == '') {                                return false;                            }                            $.ajax({                                url: '/sendMsg.php',                                type: "POST",                                data: { "event": "send_to_conversation", "cid": chatinfo.cid, "sender": dd.userid, "content": text },                                dataType: 'json',                                timeout: 900,                                success: function (data, status, xhr) {                                    var info = data;                                    //logger.i('sendMsg: ' + JSON.stringify(data));                                    if (info.errcode == 0) {                                        //logger.i('sendMsg: 发送成功');                                        /**                                         * 跳转到对话界面                                         */                                        dd.biz.chat.open({                                            cid: chatinfo.cid,                                            onSuccess: function (result) {                                            },                                            onFail: function (err) { }                                        });                                    } else {                                        logger.e('sendMsg: 发送失败' + info.errmsg);                                    }                                },                                error: function (xhr, errorType, error) {                                    logger.e(errorType + ', ' + error);                                }                            });                        },                        onFail: function (err) { }                    });                }            },            onFail: function (err) {            }        });    });    $('.scan').on('click', function () {        dd.biz.util.scan({            type: String,//type为qrCode或者barCode            onSuccess: function (data) {                //onSuccess将在扫码成功之后回调                /* data结构                  { 'text': String}                */                window.location.href = "?ma=" + data.text;            },            onFail: function (err) {                alert("scan err");            }        });    });    $('.phonecall').on('click', function () {        dd.biz.contact.choose({            startWithDepartmentId: 0, //-1表示打开的通讯录从自己所在部门开始展示, 0表示从企业最上层开始,(其他数字表示从该部门开始:暂时不支持)            multiple: false, //是否多选: true多选 false单选; 默认true            users: [], //默认选中的用户列表,userid;成功回调中应包含该信息            corpId: _config.corpId, //企业id            max: 10, //人数限制,当multiple为true才生效,可选范围1-1500            onSuccess: function (data) {                if (data && data.length > 0) {                    var selectUserId = data[0].emplId;                    if (selectUserId > 0) {                        dd.biz.telephone.call({                            users: [selectUserId], //用户列表,工号                            corpId: _config.corpId, //企业id                            onSuccess: function (info) {                                //logger.i('biz.telephone.call: info' + JSON.stringify(info));                            },                            onFail: function (err) {                                logger.e('biz.telephone.call: error' + JSON.stringify(err));                            }                        })                    } else {                        return false;                    }                } else {                    return false;                }            },            onFail: function (err) { }        });    });});dd.error(function (err) {    logger.e('dd error: ' + JSON.stringify(err));});

-------------------------

Re苹果手机使用JSAPI扫码功能提示scan err,安卓正常,什么情况?!?!

                                                
            

重新扫一扫

        
        

车主信息

        
            
                
                    车牌号                
                
        
        
            
                
                    车主姓名                
                
        
        

办卡信息

        
            
                
                    卡号                
                
        
        
            
                
                    办卡时间                
                
        
        
            
                
                    有效期                
                
                                        至                                    
            
        
        
            
                
                    卡状态                
                
        
        

进出车记录(限最近50条)        

        
                                                
                        

->

                    
                                    
            

-------------------------

Re苹果手机使用JSAPI扫码功能提示scan err,安卓正常,什么情况?!?!

全部代码都在上面了,苹果手机扫描失败!安卓正常!

-------------------------

Re苹果手机使用JSAPI扫码功能提示scan err,安卓正常,什么情况?!?!

学习了!!大神就是牛X

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值