没强制更新前点击没问题,更新后就出问题,点击无效
<form class=‘box’ >
<button class=‘stepExchange’ form-type=“submit” bindtap=‘stepExchangeFn’>
<view>当前金币数量</view>
<view>{{coins}}</view>
<view>今日步数<text>{{steps}}</text>步</view>
<view>{{steps == null ? “获取微信步数” : “步数换为金币”}} </view>
</button>
</form>
stepExchangeFn(){
let that = this;
app.getSetting((data) => {
if (data[1] == undefined) {//微信运动授权
wx.getWeRunData({
success(res) {
app.encryptedData = res.encryptedData;
that.getStepsFn();
that.authInfoSuccessFn();
}
})
} else if (data[1] == false) {
wx.showModal({
title: ‘提示’,
content: ‘抱歉,你还没有授权微信运动,点确定去设置页面打开微信运动’,
success(res) {
if (res.confirm) {
wx.openSetting({
success(res) {
wx.getWeRunData({
success(res) {
app.encryptedData = res.encryptedData;
that.getStepsFn();
that.authInfoSuccessFn();
}
})
}
})
}
}
})
} else if (that.data.steps <= 0) {
wx.showModal({
title: ‘提示’,
content: ‘没有可兑换的步数’,
showCancel: !1
})
} else {
wx.showModal({
title: ‘提示’,
content: that.data.steps + “步数兑换为” + (that.data.steps / 1000).toFixed(2) + “金币”,
success(res) {
if (res.confirm) {
wx.showLoading({
mask: !0,
})
if (!that.data.stepExchangeOff){
return false;
}
that.setData({
stepExchangeOff: false
})
wx.request({
url: app.Url + ‘/api/sport/stepExchange’,
method: ‘POST’,
header: {
‘Authorization’: app.Authorization
},
data: {
id: app.id,
formId: that.data.formId
},
success: function (res) {
if (res.data.code == 0) {
app.coins = res.data.data.coins;
that.setData({
coins: res.data.data.coins,
steps: 0,
popYhjbOff: true
})
that.audioCtx1.play()
} else {
wx.showModal({
title: ‘提示’,
content: res.data.message,
showCancel: false
})
}
},
complete() {
that.setData({
stepExchangeOff: true
})
wx.hideLoading()
}
})
}
}
})
}
})
}
遇到了一样的问题,最近公司小程序更新之后,无法跳转到其它小程序,此时将小程序杀死,然后再打开就又正常了。
经过搜索大家的反馈和测试,发现问题出在wx.showModal这个接口上,稳定重现的办法是,再同一个小程序的正式版、体验版、开发版之间跳转就可以测试出来。我用示例程序录了一个视频
https://fanli-cdn.oss-cn-hangzhou.aliyuncs.com/download/1564069145982486.mp4
这个问题比较影响我们的小程序,希望官方能尽快修复此问题