当前位置 博文首页 > weixin_30587927的博客:小程序框架(内容中统一叫标签)总结

    weixin_30587927的博客:小程序框架(内容中统一叫标签)总结

    作者:[db:作者] 时间:2021-08-24 22:11

    组件:

    1、button属性,如;<button open-type="getUserInfo" bindgetuserinfo="onGotUserInfo">调用微信的接口</button>

      open-type : ?微信开放能力 ?; ?这里的值必须是微信提供的,及对应微信提供的能力。有 ?

                launchApp——打开APP、getPhoneNumber——获取用户手机号、getUserInfo——获取用户信息 ? 等几种

      bindgetuserinfo :这个属性必须要和open-type对应,button几个 bind前缀的属性是和 open-type对应的,具体的看 官方文档 ?

    (个人)微信标签中以bind开头的属性,值都是绑定事件函数的。

    ?

    ?

    ?

    ?

    事件:官方文档

    ?http://www.jb51.net/article/94936.htm

      bindtap ? ?点击事件

    ?

    ?

    ?

    ?

    微信API:

    1、http请求:

      GET请求:

    wx.request({
      url: 'test.php', //仅为示例,并非真实的接口地址
      data: {
         x: '' ,
         y: ''
      },
      header: {
          'content-type': 'application/json' // 默认值
      },
      success: function(res) {
        console.log(res.data)
      }
    })
    cs
    下一篇:没有了