위챗 엔터프라이즈 번호 만들기 메뉴가 표시되지 않음

2955 단어
활용단어참조https://github.com/dodgepudding/wechat-php-sdk    qywechat.class.php
 public function actionIndex()
    {
       $weObj = new Wechat([
            'token'=>'eVmGCO33J4jQhisqgHCHMKDB', // Token
             'encodingaeskey'=>'5V6sDk8AQoc7GqnwfR7TsUCwJD8107rnMDcsjkE65Cu', // EncodingAESKey
             'appid'=>'wxb7dd069b9094e0a2', // app id
             'appsecret'=>'nwgpSx0jMqZFNw06p45X1TVdE3eWDuZ0Al4iQowRMDXQVa8ZGUY1ANWBpLempF4u', // 
             'agentid'=>'25', // id
        ]);
        $weObj->valid(); 
        $type = $weObj->getRev()->getRevType();
        
        $menu =     array (
               'button' => array (
                  array (
                   'name' => ' ',
                   'sub_button' => array (
                       0 => array (
                         'type' => 'scancode_waitmsg',
                         'name' => ' ',
                         'key' => 'rselfmenu_0_0',
                       ),
                       1 => array (
                         'type' => 'scancode_push',
                         'name' => ' ',
                         'key' => 'rselfmenu_0_1',
                       ),
                   ),
                 ),
                  array (
                   'name' => ' ',
                   'sub_button' => array (
                       0 => array (
                         'type' => 'pic_sysphoto',
                         'name' => ' ',
                         'key' => 'rselfmenu_1_0',
                       ),
                       1 => array (
                         'type' => 'pic_photo_or_album',
                         'name' => ' ',
                         'key' => 'rselfmenu_1_1',
                       )
                   ),
                 ),
                  array (
                   'type' => 'location_select',
                   'name' => ' ',
                   'key' => 'rselfmenu_2_0'
                 ),
               ),
           );
        $weObj->createMenu($menu,25);  // 
        switch($type) {
            case Wechat::MSGTYPE_TEXT:
                    $weObj->text("hello, I'm wechat")->reply();
                    exit;
                    break;
            case Wechat::MSGTYPE_EVENT:
                    break;
            case Wechat::MSGTYPE_IMAGE:
                    break;
            default:
                    $weObj->text("help info")->reply();
        }
        
    
    }

좋은 웹페이지 즐겨찾기