帖子
帖子
用户
博客
课程
显示全部楼层
8
帖子
0
勋章
318
Y币

[插件使用] 微信分享总是闪一下就没了

[复制链接]
发表于 2015-8-26 13:51:56
config配置
<feature name="weixin">
    <param name="urlScheme" value="wx070fe4fd958cb2c3"/>  
    <param name="apiKey" value="wx070fe4fd958cb2c3"/>  
    <param name="apiSecret" value="dce908922c219a98475165498dff6359"/>
  </feature>

html+js代码
<html>
<body style=" background-color: #fff">
                <a class="share" tapmode="" style="font-size:50px;">分享</a>
                2dbc48e9940fbd128afe365598748535
        </body>
        <script type="text/javascript" src="api.js"></script>
        <script type="text/javascript">
                function share() {
                        var weiXin = api.require('weiXin');
                        weiXin.registerApp(function(ret, err) {
                                if (ret.status) {
                                        alert(ret.status);
                                        weiXin.sendRequest({
                                                scene : 'timeline',
                                                contentType : 'text',
                                                title : 'APICloud',
                                                description : 'APICloud分享了个有趣的活动,看看呐!',
                                                thumbUrl : 'icon/icon150x150.png',
                                                contentUrl : ''
                                        }, function(ret, err) {
                                                if (ret.status) {
                                                        api.alert({
                                                                title : '发表微信',
                                                                msg : '发表成功',
                                                                buttons : ['确定']
                                                        });
                                                } else {
                                                        api.alert({
                                                                title : '发表失败',
                                                                msg : err.msg,
                                                                buttons : ['确定']
                                                        });
                                                };
                                        });
                                } else {
                                        api.alert({
                                                msg : err.msg
                                        });
                                }
                        });
                }

                apiready = function() {
                };
        </script>
</html>


QQ截图20150826134411.jpg
QQ截图20150826134423.jpg
8
帖子
0
勋章
318
Y币
找到原因了。太坑爹了。<feature name="weixin"> 这里的weixin换成weiXin就好了。X要大写的!~
5
帖子
0
勋章
1万+
Y币
8
帖子
0
勋章
318
Y币
技术支持-M 发表于 2015-8-26 13:58
注意签名,https://community.apicloud.com/bbs/forum.php?mod=viewthread&tid=9307&extra=page%3D1%26filte ...

我的签名是用工具生成的,是正确的。来来回回対了很多遍了。
8
帖子
0
勋章
318
Y币
技术支持-M 发表于 2015-8-26 13:58
注意签名,https://community.apicloud.com/bbs/forum.php?mod=viewthread&tid=9307&extra=page%3D1%26filte ...


找到原因了。太坑爹了。<feature name="weixin"> 这里的weixin换成weiXin就好了。X要大写的!~
您需要登录后才可以回帖 登录

本版积分规则