- wx.miniprogram.postmessage获取数据
//h5页面 var jsondata='aa' wx.miniProgram.postMessage({data: {foo: jsondata}}) //小程序 <web-view src='{{h5Url}}' bindmessage="message"></web-view> message: function (e) { var that = this that.shareData = e.detail.data[0].foo console.log(that.shareData) }, h5页面A嵌套在小程序里面。第一次进入h5页面A的时候点击右上角分享按钮,可以触发messge方法,接收到参数shareData为aa,h5页面A上有个一按钮,点击按钮会跳转到(window.location.href='新连接地址')一个新的h5页面B,手机返回键返回到A页面的时候会给jsondata重新赋值‘bb’,然后点击分享按钮,获取到的shareData值还是aa而不是重新赋值的bb,请问这是什么原因
2018-11-19 - 读取缓存出现的错误
收到有不少客户的反映,大部分是iPhone6s的说我们的小程序提示错误。从后台日志看到了以下错误,从错误提示上理解,应该是调用 getStorage出现了异常,这个是什么问题呀? webviewSDKScriptError Failed get storage group metadata;getGlobalStorage:fail:access denied Error: Failed get storage group metadata at Ke (<anonymous>:44:20578) at <anonymous>:44:23185 at Object.w (<anonymous>:41:2398) at Object.ret.invokeCallbackHandler (<anonymous>:21:28) at <anonymous>:1:67 堆栈信息 error webviewSDKScriptError Failed get storage group metadata;getGlobalStorage:fail:access denied Error: Failed get storage group metadata at Ke (<anonymous>:44:20578) at <anonymous>:44:23185 at Object.w (<anonymous>:41:2398) at Object.ret.invokeCallbackHandler (<anonymous>:21:28) at <anonymous>:1:67 webviewSDKScriptError Failed get storage group metadata;getGlobalStorage:fail:access denied Error: Failed get storage group metadata at Ke (<anonymous>:44:20578) at <anonymous>:44:23185 at Object.w (<anonymous>:41:2398) at Object.ret.invokeCallbackHandler (<anonymous>:21:28) at <anonymous>:1:67 以下是在app.js写的调用方法 //获取缓存 getStorage(key) { return new Promise((resolve, reject) => { wx.getStorage({ key: key, success: function (res) { resolve(res.data); }, fail: function (res) { resolve(null); } }) }) }
2018-09-17