收藏
回答

获取运动步数没有隐私协议勾选框?

 wx.getWeRunData({

    success: async function (res) {

      const { encryptedData, iv } = res

      try {

        const pc = new WXBizDataCrypt(appid, session_key)

        const data = pc.decryptData(encryptedData, iv)

        func(data)

      } catch (e) {

        console.log('session_key 失效,重新登录', e)

        try {

          const newSessionKey = await getWXSessionKey()

          const pc = new WXBizDataCrypt(appid, newSessionKey)

          const data = pc.decryptData(encryptedData, iv)

          func(data)

        } catch (err) {

          func({ isFail: true })

        }

      }

    },

    fail (res) {

      let day = uni.getStorageSync('noOpenRun')

      let toDay = new Date().getDay()

      if (day !== toDay) {

        uni.setStorageSync('noOpenRun', toDay)

        wx.showModal({

          title: '提示',

          content: '获取微信运动步数,需要微信步数权限',

          success: function (res) {

            if (res.confirm) {

              wx.openSetting({})

            }

          }

        })

      }

      func({ isFail: true })

    }

  })

没有和官方一样的

麻烦解答下

回答关注问题邀请回答
收藏

1 个回答

  • 智能回答 智能回答 本次回答由AI生成
    01-04
    有用
    回复 2
    • 小浩 คิดถึง
      小浩 คิดถึง
      01-04
      都是最新的  而且配置了
      01-04
      回复
    • 智能回答 智能回答 本次回答由AI生成
      01-04回复小浩 คิดถึง
登录 后发表内容