LaneWeChat

PHP微信开发框架,高效开发微信公众号应用。简洁而又轻量

GitHub下载 查看手册

添加微信自定义菜单

Visits: 15130 Date: 2014-11-05 15:34:19 Power By 李轩Lane

    

        场景描述:微信公众号底部的导航栏按钮


        场景举例:自定义菜单可以更加快捷方便的为用户服务。而不需要用户每次都要打字发送消息来获取所需要的信息。轻轻一点按钮,马上拥有!


        注:微信官方仅供认证号使用自定义菜单。


        代码:


            <?php

            include 'lanewechat.php';


            $menuList = array(

                array('id'=>'1', 'pid'=>'0', 'name'=>'菜单1', 'type'=>'', 'code'=>''),

                array('id'=>'2', 'pid'=>'0', 'name'=>'菜单2', 'type'=>'', 'code'=>''),

                array('id'=>'3', 'pid'=>'0', 'name'=>'地理位置', 'type'=>'location_select', 'code'=>'key_7'),

                array('id'=>'4', 'pid'=>'1', 'name'=>'点击推事件', 'type'=>'click', 'code'=>'key_1'),

                array('id'=>'5', 'pid'=>'1', 'name'=>'跳转URL', 'type'=>'view', 'code'=>'http://www.lanecn.com/'),

                array('id'=>'6', 'pid'=>'2', 'name'=>'扫码推事件', 'type'=>'scancode_push', 'code'=>'key_2'),

                array('id'=>'7', 'pid'=>'2', 'name'=>'扫码等收消息', 'type'=>'scancode_waitmsg', 'code'=>'key_3'),

                array('id'=>'8', 'pid'=>'2', 'name'=>'系统拍照发图', 'type'=>'pic_sysphoto', 'code'=>'key_4'),

                array('id'=>'9', 'pid'=>'2', 'name'=>'弹拍照或相册', 'type'=>'pic_photo_or_album', 'code'=>'key_5'),

                array('id'=>'10', 'pid'=>'2', 'name'=>'弹微信相册', 'type'=>'pic_weixin', 'code'=>'key_6'),

            );


            $result = \LaneWeChat\Core\Menu::setMenu($menuList);


Reply: njnukevin On 2015-01-16 13:58:25

本文档的场景描述出错了哦~

回复

Reply: Lane On 2015-02-11 10:49:36

抱歉。。已经修正!

回复

Reply: 你好,自定义菜怎么在公众号中显示出来? 用户进入公众号,就弹出自定义菜单! On 2015-03-04 16:47:08

你好,自定义菜怎么在公众号中显示出来? 用户进入公众号,就弹出自定义菜单!

回复

Reply: Lane On 2015-03-27 00:25:17

理论请看:http://lanewechat.lanecn.com/doc/main/aid-15 实战请看:http://lanewechat.lanecn.com/doc/main/aid-25 在设置成功后,因为微信的缓存机制,需要取消关注然后重新关注,或者24小时以内自动变更。

回复

Reply: 123 On 2015-05-11 17:48:22

2131

回复

Reply: kennny On 2015-05-14 13:56:57

你好、为什么我还是设置不出来自定义菜单呢?可以给我讲解一下吗?

回复

Reply: ML On 2015-06-17 18:50:27

这段代码我应该贴在wechat.php中还是贴在其他地方呢?

回复

Reply: ML On 2015-06-18 11:39:00

实验之后终于明白了,希望对以后的读者有帮助。新建一份文件,如menu.php,复制这段代码。然后再浏览器里运行。http://项目名称/menu.php。如果需要修改菜单,只要在这份文件里修改,然后重新运行。为了能即时看到效果,请先取消关注然后再关注。谢谢Lane分享的代码!

回复

Reply: 111 On 2015-06-20 00:07:51

为啥我试了不行呢??

回复

Reply: ML On 2015-06-23 13:38:29

我不清楚你怎么操作的呢。我的流程是:1)修改config.php,填写所有相关验证字段;2)运行wechat.php;3)复制本页代码到menu.php;4)浏览器运行输入地址http://项目域名/menu.php。希望我的流程对你有帮助!

回复

Reply: Abby On 2015-09-09 23:42:35

May 14, 2014 - New Unlimited No cost Gems Clash of Clans cheats analysis hack, Server part exploit without download required.

回复

Reply: hansoy On 2015-11-18 11:22:52

1、menu.php 中 $menuList = array( array('id'=>'1', 'pid'=>'0', 'name'=>'主页', 'type'=>'view', 'code'=>'http://www.lanecn.com/'), array('id'=>'2', 'pid'=>'0', 'name'=>'关于我们', 'type'=>'click', 'code'=>'key_aboutus') ); 2、找到core\wechatrequest.lib.php中的eventClick方法,增加下面代码 switch ($eventKey) { case 'key_aboutus': $content = '这是关于我们显示的文本'; break; default: $content = '收到点击菜单事件,您设置的key是' . $eventKey; break; }

回复

Reply: jason On 2016-02-02 18:46:00

这个是不是要认证用户才能使用,我是个人的好像说没有授权?

回复

Reply: yoyo On 2016-02-23 15:49:53

请问,文件lanewechat 怎么调用呢? 比如我用sae 把文件上面上去了,有个文件夹lanewechat .但是我想在这个外面的文件夹调用,index.php 里面 调用,接受用户的你好,回复 hello. 该怎么写代码呢,找了很久都没找到相关信息,只有 include 和 什么命名空间。 导入下面怎么写呢,还有微信那面认证网址 是那里呢?

回复

Reply: C6H5OH On 2016-05-16 10:16:41

我在本地测试自定义菜单,需要把accesstoken类中的_getAccessToken和checkAccessToken改成public才能得到accesstoken。请问这是什么原因?

回复

Reply: tot On 2016-11-28 22:41:14

file_get_contents(access_token): failed to open stream 我出现这个错误,但是我打印_getAccessToken()里面的return返回值是有东西的,为什么会是这样呢

回复

Reply: Eleowep On 2020-03-10 15:39:53

Zithromax Ok During Pregnancy http://apcialisle.com/# - Cialis Buying Viagra Overnight Delivery <a href=http://apcialisle.com/#>Buy Cialis</a> Want To Buy Discount No Rx Acticin

回复

Reply: Eleowep On 2020-03-18 20:01:44

Propecia Libido Increase https://apcialisle.com/# - cialis 5mg Cephalexin And Chlamydia <a href=https://apcialisle.com/#>Buy Cialis</a> On Line Bentyl Ibs Can I Purchase

回复

Reply: MocFew On 2020-05-03 23:20:18

Cheap Captopril 50 Mg Paypal <a href=https://viacialisns.com/#>Cialis</a> Viagra Magenbeschwerden <a href=https://viacialisns.com/#>Cialis</a> Cialis 20 Mg Preiswert

回复

Reply: Stacey On 2020-06-04 21:07:30

I was recommended this blog by my cousin. I am not sure whether this post is written by him as no one else know such detailed about my difficulty. You are amazing! Thanks!

回复

Reply: Owereemiz On 2020-06-26 12:32:04

Amoxicillin Infection https://bbuycialisss.com/ - buy cialis online using paypal Uri Amoxil <a href=https://bbuycialisss.com/#>Buy Cialis</a> tomar viagra precaucion

回复

Reply: cialis online On 2020-07-17 14:02:49

Hydrochlorothiazide In Internet Drugs Express Delivery California Lelefuerse https://ascialis.com/# - Cialis tumjuptImpam Baclofene Efficacite irralymN <a href=https://ascialis.com/#>cialis canada</a> goormapoge generic cialis next day delivery

回复

Reply: cialis online pharmacy On 2020-08-29 20:32:37

Buy Prednisone Lelefuerse https://cialiser.com/ - Cialis tumjuptImpam Buy Levitra Overnight Shipping irralymN <a href=https://cialiser.com/#>Cialis</a> goormapoge Kamagra Pfizer Achat

回复

Reply: Hannah On 2020-10-30 22:38:45

It's natural for you to assume that if you aren't sleeping well, your baby isn't either. viagra without a prescription (saleviabuy.com) viagra in india

回复

Reply: Calvin On 2020-10-30 22:53:40

Trich can happen at the same time with other STDs, such as chlamydia and gonorrhea. saleviabuy.com viagra online

回复

Reply: Kmrfisona On 2020-11-09 02:00:32

best generic viagra online reviews http://usggrxmed.com/ <a href="http://usggrxmed.com/#">100mg generic viagra</a> canadian viagra generic

回复

Reply: Jildcisona On 2020-11-10 11:01:19

generic viagra online canadian pharmacy http://fmedrx.com/ <a href="http://fmedrx.com/#">buy female viagra online</a> online viagra cheapest

回复

Reply: Fevbisona On 2020-11-16 01:21:24

natural viagra over the counter <a href="https://wowviaprice.com/#">i need viagra</a> buy generic viagra online usa

回复

Reply: FrbhAlado On 2020-11-16 10:02:14

viagra in australia online <a href="https://paradiseviagira.com/#">https://paradiseviagira.com</a> where to buy viagra in calgary

回复

Reply: DevkAlado On 2020-11-16 23:10:29

viagra exchange <a href="https://paradiseviagira.com/#">generic viagra 60 pills</a> viagra super active plus

回复

Reply: JivhApery On 2020-11-17 08:38:37

viagra cut in half <a href="https://purevigra.com/#">el tata viagra y los indomables</a> viagra by accident

回复

Reply: Fbsgisona On 2020-11-18 02:38:24

temps d'action viagra <a href="https://buybuyviamen.com/#">giving viagra to a woman</a> viagra in singapore forum

回复

Reply: Fevbisona On 2020-11-18 05:27:50

viagra super force <a href="https://wowviaprice.com/#">wowviaprice.com</a> viagra gel

回复

Reply: Fhsbisona On 2020-11-19 14:05:44

venta de viagra en arica <a href="https://buybuyviamen.com/#">https://buybuyviamen.com/</a> commander du viagra par telephone

回复

Reply: Kmrfprot On 2020-11-19 19:07:03

viagra goat weed <a href="https://purevigra.com/#">purevigra.com</a> viagra online auf rechnung

回复

Reply: FdbvAlado On 2020-11-21 08:15:08

viagra for sale in us <a href="https://hopeviagrin.com/#">buy sildenafil pills</a> order viagra on line

回复

Reply: DbsfAlado On 2020-11-24 16:19:28

buy cheap viagra online canadian pharmacy <a href="https://lightvigra.com/#">cheap viagra from mexico</a> where can you buy viagra in australia

回复

Reply: Fnrhisona On 2020-11-24 19:01:41

best place to buy viagra paypal <a href="https://genqpviag.com/#">free viagra canada</a> cheap viagra in australia

回复

Reply: JsweApery On 2020-11-25 06:24:49

cheap viagra online pharmacy <a href="https://mygoviagar.com/#">viagra for sale paypal</a> generic viagra prices in canada

回复

Reply: Fmsgisona On 2020-11-26 02:49:09

verkaufspreis viagra schweiz <a href="https://siviagmen.com/#">viagra msnbc</a> how do i know if viagra is working

回复

Reply: Fnrdisona On 2020-11-27 03:36:13

asking your doctor, young, viagra <a href="https://llviabest.com/#">viagra online, 24 hour delivery</a> viagra generic

回复

Reply: Fbsbisona On 2020-11-27 13:36:02

viagra alternativo en argentina <a href="https://genericrxxx.com/#">viagra tablets side effects in urdu</a> passiert wenn viagra abgelaufen

回复

Reply: Kbrgprot On 2020-11-27 15:16:47

how to get viagra over the counter <a href="https://miraclevigra.com/#">female viagra pills online buy</a> can you buy viagra in australia over the counter

回复

Reply: DvscAlado On 2020-11-29 21:55:11

pay to do college math homework <a href="https://dissertationhelpvfh.com/#">covering letter cv</a> common app essay help

回复

Reply: Fqfisona On 2020-11-30 02:46:03

find research papers <a href="https://essaywritingservicesjy.com/#">work personal statement</a> cmp homework help 7th grade

回复

Reply: JgscApery On 2020-11-30 11:29:25

teaching essay writing middle school <a href="https://thesisbyd.com/#">argumentative persuasive</a> writing an essay in college

回复

Reply: Ftghisona On 2020-11-30 22:58:55

college essays about failure <a href="https://thesiswritinghelpsjj.com/#">help for math homework</a> custom written essay

回复

Reply: Fnsbisona On 2020-12-01 14:59:30

phd dissertation help <a href="https://customessaywriterbyz.com/#">my paper writer</a> home work help

回复

Reply: Fsfisona On 2020-12-01 23:24:04

persuasive and argumentative essay <a href="https://essayhelpbgs.com/#">homework hotline</a> research paper tools

回复

Reply: Kwgdprot On 2020-12-03 01:21:17

purpose of essay writing <a href="https://researchpaperssfk.com/#">write thesis proposal</a> law school personal statement

回复

Reply: FgnsAlado On 2020-12-09 07:00:31

cialis using paypal in australia <a href="https://tadafcialirx.com/#">cialis in malaysia</a> cialis professional vs cialis

回复

Reply: DvncAlado On 2020-12-09 19:37:48

generic cialis bestelle <a href="https://vipmenciall.com/#">cialis black</a> black cialis overnight

回复

Reply: Fbsbisona On 2020-12-11 08:25:47

generic cialis no prescription paypal <a href="https://cialmenon.com/#">cialis gernic</a> cialis onine

回复

Reply: Fgrsisona On 2020-12-12 05:26:18

viagra australia <a href="https://xviagrnorx.com/#">generic viagra low cost</a> brand viagra on the web

回复

Reply: Khedprot On 2020-12-14 15:57:34

where to buy plizer 100mg viagra <a href="https://buyviagrrxon.com/#">free viagra voucher</a> viagra walmart prices

回复

Reply: DvnjAlado On 2020-12-14 17:13:10

viagra in kuwait <a href="https://hopeviagrin.com/#">paypal for viagra</a> walgreen viagra cost per pill

回复

Reply: NllpAlado On 2021-01-10 07:29:42

mens ed pills http://pharmacy-onlineasxs.com/ tops pharmacy

回复

Reply: JlloApery On 2021-01-10 13:07:04

pharmacies near me <a href="http://canadianonline-pharmacydazc.com/#">24 hour drug store near me</a> ed pills online

回复

Reply: Khthprot On 2021-01-11 17:13:46

canadian pharmacy <a href="http://onlinepharmacyzefb.com/#">us online pharmacy</a> pharmacy coupons

回复

Reply: Jtmfisona On 2021-01-12 08:14:22

pharmacy open near me <a href="http://canadadrugsonlinevbyh.com/#">ed pills online</a> my canadian pharmacy

回复

Reply: FgvdAlado On 2021-01-12 09:53:42

approved canadian online pharmacies <a href="http://canadapharmacyonlinestbh.com/#">pharmacy cheap</a> wall drug store

回复

Reply: NlbxAlado On 2021-01-14 11:34:22

lowest price viagra without prescription <a href="http://viashoprx.com/#">viagra no presription</a> military viagra viagra <a href="http://xviagarrx.com/#">viagra on line without prescription</a> viagra on line nz cheap viagra generic 100mg <a href="http://viagraviagria.com/#">viagra cheap australia</a> generic viagra australia how to buy viagra <a href="http://asgenviagria.com/#">difference between viagra</a> buy viagra in canada toronto buy genaric viagra <a href="http://viagengen.com/#">discount viagra india</a> viagra no prescription

回复

Reply: JvcxApery On 2021-01-15 08:36:37

viagra online paypal paiement <a href="http://fmedrx.com/#">viagra\\</a> online drug store viagra 800mg viagra gold <a href="http://edabcrx.com/#">viagra with script</a> viagra by pfizer viagra without prescription in australia <a href="http://abcrxmed.com/#">free brand viagra</a> buy viagra online usa drugs like viagra <a href="http://cialedrx.com/#">viagra uk</a> is viagra over the counter in canada buy viagra no persecpiton <a href="http://hitrxmenvia.com/#">viagra vs cialis vs levitra reviews</a> buy viagra online without a prescription with overnight delivery

回复

Reply: FgnhAlado On 2021-01-16 12:47:13

viagra onlinre? <a href="http://ltdviagragogo.com/#">viagra online</a> best viagra online sites geneic viagra <a href="http://hdgenericviagraxk.com/#">viagra gum</a> buy viagra online overnight shipping viagra buy australia no delivery <a href="http://buygenericviarga.com/#">generic viagra free online</a> viagra on sale online what are the different types of viagra <a href="http://buyhdpillvia.com/#">viagra india buy</a> buying viagra or cialis min canada viagra paypal payment canada <a href="http://genericviagrix.com/#">free viagra sample pack</a> food viagra

回复

Reply: Klioprot On 2021-01-16 17:33:49

cialis vs viagra canadian pharmacy <a href="http://bestviagrx.com/#">discrete viagra online paypal australia</a> viagra canada by paypal generic soft viagra <a href="http://viarxhd.com/#">buy viagra cheap</a> generic viagra from canada where to find viagra online <a href="http://viagetpill.com/#">generic viagra overnight</a> viagra canada paypal payment viagra online <a href="http://pillexrx.com/#">vardenafil vs viagra</a> buy viagra discover card buy generic viagra and cials on line <a href="http://usggrxmed.com/#">buy viagra in quebec</a> viagra online no prescription

回复

Add Comment
©2014 lanewechat.lanecn.com , All rights reserved. Power By LaneWeChat 微信PHP开发框架.  京ICP备14005030号-1