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

微信运动ios严重bug

框架类型 问题类型 API/组件名称 终端类型 微信版本 基础库版本
小程序 Bug wx.getWeRunData(Object object) 微信iOS客户端 8.0.12 2.19.12

ios必须要进入微信运动页面才可以获取最新的微信步数 。如果不进入微信运动页面 ,就会一直是之前的运动步数的数据 。但是安卓可以不用进入微信运动页面就可以实时更新最新的运动步数数据 ,ios的问题可以解决吗?

影响了我们小程序主要功能的效能,会导致流失大量苹果手机用户。


getWeRunData:function(e){
    var that = this;
    if(!that.data.isArrive){
    wx.login({
      success:function(resLonin){
        wx.getWeRunData({
          success:function(resRun){
            wx.cloud.callFunction({
              name:'weRun',//云函数的文件名
              data:{
                weRunData: wx.cloud.CloudID(resRun.cloudID),
                obj:{
                  shareInfo: wx.cloud.CloudID(resRun.cloudID)
                }
              },
              success: function (res) {
                let step = res.result.event.weRunData.data.stepInfoList[30].step
                that.setData({
                  step:step.toFixed(0),
                  nowTime:parseInt(((new Date()).valueOf()-that.data.initialTime) / (1000 * 60)),
                });
                if(that.data.nowstep<((step-that.data.initialStep)/that.data.stepMultiple)){
                  that.setData({
                    nowstep:((step-that.data.initialStep)/that.data.stepMultiple).toFixed(0),
                  });
                  that.stepOn();
                  //console.log("step!");                 
                }
                //console.log("nowstep:"+(step-that.data.initialStep)/30);
                console.log("今日步数:",that.data.step)
              }
            })
          }
        })
      }
    });}

评论 抢沙发

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

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

云免签H5支付