public function setMenu($access_token){
$menu = '{
"button": [
{
"type": "miniprogram",
"name": "**用户端",//名称不能超过5个字
"url": "http://mp.weixin.qq.com",
"appid": "*********",//小程序appid
"pagepath": "pages/tabBar/index/index"//小程序首页路径
} ,
{
"type": "miniprogram",
"name": "**师傅端",//名称不能超过5个字
"url": "http://mp.weixin.qq.com",
"appid": "*********",//小程序appid
"pagepath": "pages/tabBar/homePage/homePage"
}
]
}';
$url = "https://api.weixin.qq.com/cgi-bin/menu/create?access_token=$access_token";
$res=$this->curl_post($url,urldecode($menu));
return $res;
}
public function setMenu()
{
$info = input();
$wxMessage = new WxMessages(1);
$accessToken = $wxMessage->getMiniAccessToken();
$res = $wxMessage->setMenu($accessToken['access_token']);
$echostr = $_GET['echostr'];
echo $echostr;
dump($res);
}