HTML5¼¼Êõ

΢ÐÅС³ÌÐò¿ª·¢¡ª¿ìËÙÕÆÎÕ×é¼þ¼°APIµÄ·½·¨ - iyifei

×ÖºÅ+ ×÷ÕߣºH5Ö®¼Ò À´Ô´£ºH5Ö®¼Ò 2017-01-05 16:02 ÎÒÒªÆÀÂÛ( )

΢ÐÅС³ÌÐò¿ò¼ÜΪ¿ª·¢ÕßÌṩÁËһϵÁеÄ×é¼þºÍAPI½Ó¿Ú¡£ ×é¼þÖ÷ÒªÍê³ÉС³ÌÐòµÄÊÓͼ²¿·Ö£¬ÀýÈçÎÄ×Ö¡¢Í¼Æ¬ÏÔʾ¡£APIÖ÷ÒªÍê³ÉÂß¼­¹¦ÄÜ£¬ÀýÈçÍøÂçÇëÇó¡¢Êý¾Ý´æ´¢¡¢ÒôÊÓƵ²¥·Å¿ØÖÆ£¬ÒÔ¼°Î¢ÐÅ¿ª·ÅµÄ΢ÐŵǼ¡¢Î¢ÐÅÖ§¸¶µÈ¹¦ÄÜ¡£ ×é¼þ ¹Ù·½Îĵµ£ºhttps://mp.weixin.qq

΢ÐÅС³ÌÐò¿ò¼ÜΪ¿ª·¢ÕßÌṩÁËһϵÁеÄ×é¼þºÍAPI½Ó¿Ú¡£

×é¼þÖ÷ÒªÍê³ÉС³ÌÐòµÄÊÓͼ²¿·Ö£¬ÀýÈçÎÄ×Ö¡¢Í¼Æ¬ÏÔʾ¡£APIÖ÷ÒªÍê³ÉÂß¼­¹¦ÄÜ£¬ÀýÈçÍøÂçÇëÇó¡¢Êý¾Ý´æ´¢¡¢ÒôÊÓƵ²¥·Å¿ØÖÆ£¬ÒÔ¼°Î¢ÐÅ¿ª·ÅµÄ΢ÐŵǼ¡¢Î¢ÐÅÖ§¸¶µÈ¹¦ÄÜ¡£

×é¼þ

¹Ù·½Îĵµ£ºhttps://mp.weixin.qq.com/debug/wxadoc/dev/component/

¶ÔÓÚ¿ª·¢Îĵµ£¬¸öÈ˽¨ÒéÏÈÁ˽âÆäÕûÌå¿ò¼Ü£¬Á˽âÆäÌṩÁËÄÄЩ×é¼þ£¬ÔÙÁªÏëµ½ÕâЩ×é¼þ»áÓÃÔÚÄÄЩ²úÆ·µÄÄÄЩ¹¦ÄÜ¡£¶ÔÓÚ½Ó¿ÚÒ²ÊÇÒ»Ñù£¬ÕûÌåÁ˽⣬¶ø²»ÐèҪϸ¿´¡£

ÊìϤÁËÎĵµµÄ½á¹¹£¬ÄÇôÔÚ¿ª·¢µÄ¹ý³ÌÖУ¬¿ª·¢µ½ÏàÓ¦¹¦ÄܵÄʱºò¾Í¿ÉÒÔÖ±½ÓÕÒµ½×Ô¼ºÐèÒªÓõ½µÄµØ·½£¬ÔÚʹÓõĹý³ÌÖÐÀí½âºÍÕÆÎÕ£¬ÕâÑùÊÇÎÒÈÏΪ¸üÓÐЧÂʵÄѧϰ·½·¨¡£

С³ÌÐòÌṩÁËÈçÏÂ×é¼þ£º 

ÕâÀïдͼƬÃèÊö

API

¹Ù·½Îĵµ£ºhttps://mp.weixin.qq.com/debug/wxadoc/dev/api/

ͬÑùÎÒÃÇÏÈÁ˽â΢ÐÅAPIµÄ½á¹¹£º 

ÕâÀïдͼƬÃèÊö

Á˽âÁËÎĵµ½á¹¹ºó£¬ÎÒÃǾͿÉÒÔ¿ªÊ¼ÊµÕ½ÁË¡£´Ó¼òµ¥µÄ¿ªÊ¼£¬µ±ÄãÐèҪʵÏÖij¸ö½çÃæ»ò¹¦ÄÜʱ£¬Äܹ»¿ìËÙ¶¨Î»µ½Ó¦¸Ã¿´ÄIJ¿·ÖÎĵµ¡£

ʵÀý·ÖÎö

ÏÂÃæÒÔ¶¹°êµçÓ°APPΪÀý£¬·ÖÎöÈçºÎÈ¥²éÕÒÎĵµ²¢¿ìËÙ¿ª·¢¡£

ÕâÀïдͼƬÃèÊö

ͨ¹ýÇ°Ãæ¶ÔС³ÌÐò¿ò¼ÜµÄÁ˽⣬ÎÒÃǺÜÈÝÒ׾ͿÉÒÔ·ÖÎö³öÈçºÎʵÏÖ¶¹°êµçÓ°APPÕâÑùÒ»¸öС³ÌÐò¡£

µ×²¿µ¼º½

µ×²¿µ¼º½µÄʵÏÖ£¬ÔÚÇ°Ãæ¿ò¼ÜÁ˽âÊÇÔÚС³ÌÐòÅäÖÃÎļþʵÏֵģ¬ÉèÖÃtabBarÊôÐÔ¡£¶ÔÓÚÆä¾ßÌåÊôÐÔµÄÉèÖÿÉÒÔ¿ìËÙ¶¨Î»µ½Îĵµ£ºhttps://mp.weixin.qq.com/debug/wxadoc/dev/framework/config.html 
ÆäʵÏÖ´úÂëÈçÏ£º

: { : , :, :, : [{ : , : , : , : }, { : , : , : , : }, { : , : , : , : } ] }

 

¶¥²¿BannerʵÏÖ

Banner¿ÉÒÔ×Ô¶¯×óÓÒ»¬¶¯µÄ×é¼þ£¬Í¨¹ýÇ°ÃæµÄÁ˽⣬ÎÒÃÇ¿ÉÒԺܿìÁ˽⵽ʹÓÃswiper×é¼þ¡£²éÕÒ·½·¨£º×é¼þ¡ªÊÓͼÈÝÆ÷¡ªswiperÕÒµ½Îĵµ£¬È»ºó¸´Öƹٷ½ÊµÀý£º

<swiper indicator-dots= autoplay=interval=duration=> <block wx:> <swiper-item> <image src==width=height=/> </swiper-item> </block> </swiper> Page({ data: { imgUrls: [ , , ], indicatorDots: false, autoplay: false, interval: 5000, duration: 1000 } })

 

 

²é¿´Ð§¹û³öÏÖºó£¬ÔÙ¸ù¾Ý×Ô¼ºµÄÐèÒª¶ÔÕÕÎĵµÐÞ¸ÄÊôÐÔʵÏÖ×Ô¼ºÏëÒªµÄ¹¦Äܼ´¿É¡£

µçӰչʾ²¿·Ö

µçӰչʾ²¿·Ö°üº¬ÁËͼƬ¡¢ÎÄ×ֵȣ¬¶øÿ²¿Ó°Æ¬µÄ½éÉÜÓÖÊÇÒ»×飬²»¶ÏÑ­»·Öظ´¡£ 
Òò´ËÎÒÃÇ»áÓõ½ÊÓͼÈÝÆ÷view¡¢Ã½Ìå×é¼þimage¡¢»ù´¡ÄÚÈÝ×é¼þtextµÈ¡£ÕâЩ¶¼ÊÇ»ù±¾µÄ×é¼þ£¬ÊìϤÁËÎĵµ½á¹¹ºó£¬ÔÚ×é¼þĿ¼ÏÂÃæ²éÕÒ¶ÔÓ¦×é¼þÓ÷¨¼´¿É¡£

ÍøÂçÇëÇó

С³ÌÐò½çÃæÏÔʾµÄµçÓ°ÐÅÏ¢µÈÄÚÈÝ£¬¾ùÊÇÀ´×ÔÍøÂç¡£¶¹°êµçÓ°¿ª·ÅÁËAPI½Ó¿Ú£¬½Ó¿Ú˵Ã÷Ò³Ã棺https://developers.douban.com/wiki/?title=movie_v2

ͨ¹ýÍøÂç½Ó¿Ú»ñÈ¡Êý¾ÝÐèÒªÓõ½ÍøÂçÇëÇ󣬵±È»ÀûÓÃjsÒ²¿ÉÒÔʵÏÖ£¬µ«ÎÒÃÇÇ°ÃæÁ˽âÁË΢ÐÅÌṩÁËÍøÂç·½ÃæµÄ½Ó¿Ú£¬API¡ªÍøÂ硪ÍøÂçÇëÇó£¬Í¨¹ýÕâ¸ö½Ó¿Ú¿ÉÒÔ½øÐÐÍøÂçÊý¾ÝµÄÇëÇó¡£

ʾÀý´úÂ룺

; wx.request({ url: url, method: , // OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, CONNECT header: { :}, // ÉèÖÃÇëÇóµÄ header success: function(res){ console.log(res.data.subjects); that.setData({ movies:res.data.subjects }); } })

 

ÉÏÃæ½Ó¿Ú¼´¿É»ñÈ¡µ½¶¹°êµçÓ°µÄÕýÔÚÉÏÓ³µçÓ°ÐÅÏ¢¡£Ê¹ÓÃÆðÀ´Ò²»¹ÊǺܷ½±ãµÄ£¬Ö§³ÖhttpºÍhttps£¨µ÷ÊÔģʽÏ£©¡£

Êý¾Ý½»»¥

ÓÐÁ˽çÃ棬ÓÐÁËÊý¾Ý¡£ÄÇôÈçºÎ½«Êý¾ÝÏÔʾµ½½çÃ棬ÒÔ¼°ÈçºÎ½«½çÃæÊý¾ÝÌṩ¸øÂß¼­²ã£¬ÕâʱÎÒÃÇ¿ÉÒÔÕÒµ½Êý¾Ý°ó¶¨²¿·ÖµÄÎĵµ¡£ 
ʾÀý´úÂ룺

<view> {{ message }} </view> Page({ data: { message: } })

 

ÕâÑùºÜÈÝÒ×¾ÍÁ˽âÁËÈçºÎ½«Âß¼­²ãµÄÊý¾Ý´«¸øÊÓͼ²ã¡£

ÄÇôÈçºÎ½«ÊÓͼ²ãµÄ²Ù×÷´«¸øÂß¼­²ãÄØ£¿Ð¡³ÌÐòµÄ×é¼þÌṩÁËʼþ£¬¿ò¼Ü¡ªÊÓͼ²ã¡ªWXML¡ªÊ¼þ£¬ÕÒµ½ÏàÓ¦µÄÎĵµ£º 
https://mp.weixin.qq.com/debug/wxadoc/dev/framework/view/wxml/event.html 
ÏÂÃæÊǼòµ¥µÄʼþʹÓõÄʵÀý£º

<view id=data-hi=bindtap=> Click me! </view> Page({ tapName: function(event) { console.log(event) } })

 

ÊÓͼ²ãͨ¹ýevent½«Ïà¹ØÊý¾Ý´«Êä¸øÂß¼­²ã£¬½øÐд¦Àí¡£

ÕâЩÎÊÌâ½â¾öÁË£¬ÏàÐÅÕâ¸öС³ÌÐòÒ²Íê³ÉµÄ°Ë¾Å²»ÀëÊ®£¬¶ÔС³ÌÐòµÄ¿ò¼ÜÁ˽âÒ²»á¸üÉîÈëÒ»²½¡£ÏàÐÅÕâÖÖ·½Ê½±È´¿´âµÄ¿´Îĵµ¡¢Öð¸ö×é¼þµÄÀ´Ñ§Ï°¸üÓÐÎüÒýÁ¦£¬Ò²¸üÈÝÒ×ÉîÈëÀí½â¡£

 

¡¡

1.±¾Õ¾×ñÑ­ÐÐÒµ¹æ·¶£¬ÈκÎתÔصĸå¼þ¶¼»áÃ÷È·±ê×¢×÷ÕߺÍÀ´Ô´£»2.±¾Õ¾µÄÔ­´´ÎÄÕ£¬ÇëתÔØʱÎñ±Ø×¢Ã÷ÎÄÕÂ×÷ÕߺÍÀ´Ô´£¬²»×ðÖØÔ­´´µÄÐÐΪÎÒÃǽ«×·¾¿ÔðÈΣ»3.×÷ÕßͶ¸å¿ÉÄܻᾭÎÒÃDZ༭Ð޸Ļò²¹³ä¡£

Ïà¹ØÎÄÕÂ
  • ¡¾Î¢ÐÅС³ÌÐò¿ª·¢ÏµÁÐÎÄÕÂÁù¡¿ÉúÃüÖÜÆںͷÓÉ - iyifei

    ¡¾Î¢ÐÅС³ÌÐò¿ª·¢ÏµÁÐÎÄÕÂÁù¡¿ÉúÃüÖÜÆںͷÓÉ - iyifei

    2017-01-05 15:04

  • ΢ÐÅС³ÌÐò¿ª·¢Èռǡª¡ª¸ß·ÂÖªºõÈÕ±¨£¨Ï£© - iyifei

    ΢ÐÅС³ÌÐò¿ª·¢Èռǡª¡ª¸ß·ÂÖªºõÈÕ±¨£¨Ï£© - iyifei

    2017-01-05 08:01

  • ΢ÐÅС³ÌÐòµÄ»ú»áÔÚÓÚÖØÐÂÀí½âȺ×éÓë¶þάÂë - ÌÚѶ¹¥³Çʦlee

    ΢ÐÅС³ÌÐòµÄ»ú»áÔÚÓÚÖØÐÂÀí½âȺ×éÓë¶þάÂë - ÌÚѶ¹¥³Çʦlee

    2017-01-04 18:03

  • ΢ÐÅС³ÌÐò¿ª·¢Èռǡª¡ª¸ß·ÂÖªºõÈÕ±¨£¨ÖУ© - iyifei

    ΢ÐÅС³ÌÐò¿ª·¢Èռǡª¡ª¸ß·ÂÖªºõÈÕ±¨£¨ÖУ© - iyifei

    2017-01-04 18:02

ÍøÓѵãÆÀ
¹