Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

configForShareAddress #482

Closed
greedying opened this issue Aug 4, 2016 · 2 comments
Closed

configForShareAddress #482

greedying opened this issue Aug 4, 2016 · 2 comments

Comments

@greedying
Copy link
Contributor

greedying commented Aug 4, 2016

如上。刚开始研究微信,感谢分享。
但是发现分享地址的时候,使用JSSDK获取配置文件就足够了,似乎上面的函数用不到。

php代码

      $js = $this->wechat->js;
      $jsconfig = $js->config([
           'checkJsApi',
           'editAddress',
           'chooseWXPay',
           'getLatestAddress',
       ], YII_DEBUG);

js代码

wx.config(<?=$jsconfig;?>);
wx.ready(function () {
    $("#address").click(function() {
        wx.openAddress({
            trigger: function (res) {
                alert('用户开始拉出地址');
            },
            success: function (res) {
                alert('用户成功拉出地址');
            },
            cancel: function () {
                alert('用户取消拉出地址');
            }
        });
    });
});
@overtrue
Copy link
Collaborator

overtrue commented Aug 4, 2016

@greedying 那也许是他们做了兼容吧,反正文档上有这个,就写上了。

@greedying
Copy link
Contributor Author

哦,可能是版本问题吧。我现在看的文档里已经没有这部分了,和调用其他js 接口一样

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants