zoukankan      html  css  js  c++  java
  • 微信企业号创建自定义菜单

    微信企业号创建菜单

    <?php
    define('CorpID',        "wx82e2c31215d9a5a7");
    define('CorpSecret',    ""); //当前管理组 设置->功能设置->权限管理->系统管理组->深圳管理(新建的管理组)->Secret
    define('AgentID',        "24");     //当前应用ID
    
    
    require_once("../../class/wxqiye.class.php");
    $weixin = new class_wxqiye();
    
    $button = array(array('name' => "点击跳转",
                          'sub_button' => array(
                                            array('type' => "click",
                                                  'name' => bytes_to_emoji(0x1F3C3)."点击推事件",
                                                  'key'  => "COMPANY"
                                                  ),
                                            array('type' => "view",
                                                  'name' => bytes_to_emoji(0x1F4C5)."跳转URL",
                                                  'url'  => "http://www.fangbei.org/"
                                                 ),
                                        )
                          ),
                    array('name' => "扫码发图",
                          'sub_button' => array(
                                            array('type' => "scancode_waitmsg",
                                                  'name' => "扫码带提示",
                                                  'key'  => "rselfmenu_2_1"
                                                  ),
                                            array('type' => "scancode_push",
                                                  'name' => "扫码推事件",
                                                  'key'  => "rselfmenu_2_2"
                                                  ),
                                            array('type' => "pic_sysphoto",
                                                  'name' => "系统拍照发图",
                                                  'key'  => "rselfmenu_2_3"
                                                  ),
                                            array('type' => "pic_photo_or_album",
                                                  'name' => "拍照或相册发图",
                                                  'key'  => "rselfmenu_2_3"
                                                  ),
                                            array('type' => "pic_weixin",
                                                  'name' => "微信相册发图",
                                                  'key'  => "rselfmenu_2_5"
                                                  )
                                        )
                          ),
                    array('type' => "location_select",
                          'name' => "发送位置",
                          'key'  => "rselfmenu_3_0",
                          )
                    );
    function bytes_to_emoji($cp)
    {
        if ($cp > 0x10000){       # 4 bytes
            return chr(0xF0 | (($cp & 0x1C0000) >> 18)).chr(0x80 | (($cp & 0x3F000) >> 12)).chr(0x80 | (($cp & 0xFC0) >> 6)).chr(0x80 | ($cp & 0x3F));
        }else if ($cp > 0x800){   # 3 bytes
            return chr(0xE0 | (($cp & 0xF000) >> 12)).chr(0x80 | (($cp & 0xFC0) >> 6)).chr(0x80 | ($cp & 0x3F));
        }else if ($cp > 0x80){    # 2 bytes
            return chr(0xC0 | (($cp & 0x7C0) >> 6)).chr(0x80 | ($cp & 0x3F));
        }else{                    # 1 byte
            return chr($cp);
        }
    }
        
    $result = $weixin->create_menu($button);
    
    var_dump($result);
    ?>
  • 相关阅读:
    什么是web标准、可用性、可访问性
    前端面试>逻辑推理题~~
    git 安装
    wcf生成客户端代理的四种方法
    mysql 安装
    理解Linux 的处理器负载均值load averages
    高性能服务器架构
    事务日志
    Epoll工作模式详解
    事务和两阶段提交
  • 原文地址:https://www.cnblogs.com/txw1958/p/11189009.html
Copyright © 2011-2022 走看看