html52.com
我爱小程序-开发者交流社区

有人写过小程序摇一摇吗!求教!


wx.onAccelerometerChange(function (e) {
       if (e.x > 0.2 && e.y > 0.2) {
           request(api.lootery, 'post', { openid: wx.getStorageSync('openid') }).then((res) => {
               console.log(res)
               that.setData({
                   show: true,
                   message: res.data.Message
               })
           })
       }
   })

现在这种情况摇晃的时候会一直请求接口

网友回复

醉霜林ᶜᵒʳʸ:

你写的,就是有0.2的晃动就请求接口啊

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

真正的个人免签约支付接口

云免签H5支付