开发者社区> 问答> 正文

jssdk日期选择框访问问题



<div data-role="page" id="pageone">
  <button class="btn btn-block btn-default J_method_alert_btn" >alert</button>
  <button class="btn btn-block btn-default J_method_confirm_btn" >confirm</button>
  <button class="btn btn-block btn-default J_method_datepicker_btn" >datepicker</button>
</div>
<script>
    $(function() {
        dd.config({
            appId: '${appId}', // 必填,微应用ID
            corpId: '${corpId}',//必填,企业ID
            timeStamp: ${timeStamp}, // 必填,生成签名的时间戳
            nonceStr: '${nonceStr}', // 必填,生成签名的随机串
            signature: '${signature}', // 必填,签名
            jsApiList: ['device.notification.alert', 'dd.runtime.info', 'device.notification.confirm','dd.device.notification.vibrate','dd.biz.util.datepicker'] // 必填,需要使用的jsapi列表
        });    
        
        dd.error(function(error){
            alert(error);
        });
        
        dd.ready(function(){
            $('.J_method_alert_btn').on('click', function() {
                dd.device.notification.alert({
                    message: 'dd.device.notification.alert',
                    title: 'This is title',
                    buttonName: 'button',
                    onSuccess: function(result) {
                        alert('win: ' + JSON.stringify(result));
                    },
                    onFail: function(err) {
                        alert('fail: ' + JSON.stringify(err));
                    }
                });
                
                dd.runtime.info({
                    onSuccess: function(result) {
                        alert('win: ' + JSON.stringify(result.ability));
                    /*{
                        ability: '0.0.6' //容器版本,用来标识JSAPI能力,可根据该版本来决定能否使用jsapi
                    }*/
                    }
                });
             });
            
             $('.J_method_confirm_btn').on('click', function() {
                dd.device.notification.confirm({
                    message: '确定删除?',
                    title: '提示',
                    buttonLabels: ['确认', '取消'],
                    onSuccess : function(result) {
                        alert('win: ' + JSON.stringify(result.buttonIndex));
                        /*
                        {
                            buttonIndex: 0 //被点击按钮的索引值,Number类型,从0开始
                        }
                        */
                    },
                    onFail : function(err) {}
                });
             });
            
             $('.J_method_datepicker_btn').on('click', function() {
                dd.biz.util.datepicker({
                    format: 'yyyy-MM-dd',
                    value: '2015-04-17', //默认显示日期
                    onSuccess : function(result) {
                        alert('win: ' + JSON.stringify(result.value));
                        /*{
                            value: "2015-02-10"
                        }
                        */
                    },
                    onFail : function(err) {
                        alert('fail: ' + JSON.stringify(err));
                    }
                });
             });
            
            
        });    
        
        
    });
</script>


为什么我点击alert可用正常弹出钉钉的提示框。
而点击datepicker无法弹出选择日期的框呢?
提示"Not authorized", "errorcode":是7





展开
收起
天晴lcs 2015-09-07 14:08:42 4225 0
2 条回答
写回答
取消 提交回答
  • Rejssdk日期选择框访问问题
    尝试把jsApiList: ['device.notification.alert', 'dd.runtime.info', 'device.notification.confirm','dd.device.notification.vibrate','dd.biz.util.datepicker'] // 必填,需要使用的jsapi列表 改为jsApiList: ['device.notification.alert', 'dd.runtime.info', 'device.notification.confirm','device.notification.vibrate','biz.util.datepicker'] // 必填,需要使用的jsapi列表
    2015-09-11 11:14:53
    赞同 展开评论 打赏
  • 申请为应用的时候勾选了相关jsapi权限了吗?
    2015-09-11 10:47:02
    赞同 展开评论 打赏
问答分类:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载