You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

97 lines
2.6 KiB

  1. <?php
  2. //不加参数
  3. require_once '../Common/Config.php';
  4. require_once '../Common/Function.php';
  5. $access_token=getAccesstoken();
  6. $url = "https://api.weixin.qq.com/cgi-bin/menu/create?access_token=".$access_token;
  7. $jsonmenu = '{
  8. "button":[
  9. {
  10. "name":"专题旅游",
  11. "sub_button":[
  12. {
  13. "type":"view",
  14. "name":"土楼专区",
  15. "url":"http://m.xmwtt.com/tour_list.php?catid=1&type=tl"
  16. },
  17. {
  18. "type":"view",
  19. "name":"周边游专区",
  20. "url":"http://m.xmwtt.com/tour_list.php?catid=1"
  21. },
  22. {
  23. "type":"view",
  24. "name":"住宿专区",
  25. "url":"http://m.xmwtt.com/hotels.php"
  26. },
  27. {
  28. "type":"view",
  29. "name":"特价门票",
  30. "url":"http://m.xmwtt.com/ticket.php"
  31. },
  32. {
  33. "type":"view",
  34. "name":"自由行",
  35. "url":"http://m.xmwtt.com/detail.php?id=10213"
  36. }]
  37. },
  38. {
  39. "name":"周边游",
  40. "sub_button":[
  41. {
  42. "type":"view",
  43. "name":"跟团旅游",
  44. "url":"http://m.xmwtt.com/tour_list.php?catid=1"
  45. },
  46. {
  47. "type":"view",
  48. "name":"租车包车",
  49. "url":"http://m.xmwtt.com/detail.php?id=10226"
  50. }]
  51. },
  52. {
  53. "name":"联系我们",
  54. "sub_button":[
  55. {
  56. "type":"click",
  57. "name":"旗舰店",
  58. "key":"XMWX_QIJIANDIAN"
  59. },
  60. {
  61. "type":"view",
  62. "name":"关于我们",
  63. "url":"http://m.xmwtt.com/about.php"
  64. },
  65. {
  66. "type":"view",
  67. "name":"限时优惠",
  68. "url":"http://m.xmwtt.com/detail.php?id=10226"
  69. },
  70. {
  71. "type":"click",
  72. "name":"投诉建议",
  73. "key":"XMWX_TOUSUJIANYI"
  74. },
  75. {
  76. "type":"view",
  77. "name":"荣升出境社",
  78. "url":"http://eqxiu.com/s/zHOGxEWg"
  79. }]
  80. }]
  81. }';
  82. /*
  83. ",
  84. {
  85. \"type\":\"view\",
  86. \"name\":\"帮助中心\",
  87. \"url\":\"http://mp.weixin.qq.com/s?__biz=MzIwNjI0MDAwOQ==&mid=502857753&idx=1&sn=a9039c8508a05f08f41027307296995f&scene=18#wechat_redirect\"
  88. }"
  89. */
  90. $result = http_request($url, $jsonmenu);
  91. var_dump($result);