收藏
回答

微信授权获取运动步数,有些手机会一直返回当天的步数为0?手机是授权了微信运动步数的

wx.getWeRunData,微信版本号是:version8.0.24,基础库是:2.21.4,

这样弄得客户不满意了呀

uni.authorize({
					scope: 'scope.werun',
					success() {
						wx.getWeRunData({
							success(res) {
								console.log(res)
								// 拿 encryptedData 到开发者后台解密开放数据
								const encryptedData = res.encryptedData
								const iv = res.iv
								generalRequest({
										url: "/wxminiprogram/getWeRunData",
										method: "POST",
										urltype:"test",
										data: {
											encryptedData: encryptedData,
											iv: iv,
											openid: uni.getStorageSync('openid').openid
										}


									})
									.then((res) => {
										console.log(res)
										let list = res.data.data.stepInfoList
										_this.werun_number = list[list.length - 1].step
										uni.hideLoading()
										
										
									})
									.catch(err => {
										uni.hideLoading()
										throw Error(err)
									})


							},
							fail(err) {
								uni.hideLoading()
								console.log(err.errMsg)
							}
						})
					}
				})
回答关注问题邀请回答
收藏
登录 后发表内容