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

自定义菜单返回应该把个性化自定义菜单也一起返回 #231

Closed
vcanson opened this issue Jan 10, 2016 · 1 comment
Closed

Comments

@vcanson
Copy link

vcanson commented Jan 10, 2016

/**
 * 获取菜单.
 *
 * @return array
 */
public function get()
{
    $menus = $this->http->get(self::API_GET);

    return empty($menus['menu']['button']) ? array() : $menus['menu']['button'];
}

自定义菜单返回应该把个性化自定义菜单也一起返回,
现在只是返回普通自定义菜单,没有返回个性化自定义菜单

@overtrue
Copy link
Collaborator

@vcanson
Copy link
Author

vcanson commented Jan 10, 2016

这个接口获取是:selfmenu_info
获取自定义菜单配置接口

https://api.weixin.qq.com/cgi-bin/get_current_selfmenu_info?access_token=ACCESS_TOKEN

不是:conditionalmenu (个性化菜单)
微信官方文档有说明:http://mp.weixin.qq.com/wiki/5/f287d1a5b78a35a8884326312ac3e4ed.html

请求说明
http请求方式:GET
https://api.weixin.qq.com/cgi-bin/menu/get?access_token=ACCESS_TOKEN

返回说明(有个性化菜单时)

{
"menu": {
"button": [
{
"type": "click",
"name": "今日歌曲",
"key": "V1001_TODAY_MUSIC",
"sub_button": [ ]
}
],
"menuid": 208396938
},
"conditionalmenu": [
{
"button": [
{
"type": "click",
"name": "今日歌曲",
"key": "V1001_TODAY_MUSIC",
"sub_button": [ ]
},
{
"name": "菜单",
"sub_button": [
{
"type": "view",
"name": "搜索",
"url": "http://www.soso.com/",
"sub_button": [ ]
},
{
"type": "view",
"name": "视频",
"url": "http://v.qq.com/",
"sub_button": [ ]
},
{
"type": "click",
"name": "赞一下我们",
"key": "V1001_GOOD",
"sub_button": [ ]
}
]
}
],
"matchrule": {
"group_id": 2,
"sex": 1,
"country": "中国",
"province": "广东",
"city": "广州",
"client_platform_type": 2
},
"menuid": 208396993
}
]

}

注:menu为默认菜单,conditionalmenu为个性化菜单列表。字段说明请见个性化菜单接口页的说明。

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