同遇到,不执行
canvasToTempFilePath 安卓无法执行 iOS正常家中两部安卓 一部魅蓝note5 一部小米MIX2 版本都是微信版本 6.6.7 2.2.1 在canvasPutImageData的 success回调中执行draw 后无法再次执行canvasToTempFilePath 但是IOS上的基础库版本2.1.3 微信版本6.6.7 相同的代码却正常执行 [代码]let windowSize = [代码][代码]this[代码][代码].windowSize[代码][代码] [代码][代码]let bookmark = [代码][代码]this[代码][代码].bookmark[代码][代码] [代码][代码]let mainCtx = [代码][代码]this[代码][代码].mainCtx[代码][代码] [代码][代码]let $store = [代码][代码]this[代码][代码].$store[代码][代码] [代码][代码]let that = [代码][代码]this[代码][代码] [代码][代码]wx.canvasGetImageData({[代码][代码] [代码][代码]canvasId: [代码][代码]'canvas'[代码][代码],[代码][代码] [代码][代码]x: 0,[代码][代码] [代码][代码]y: ((windowSize.windowHeight * 0.9) - bookmark.backgroundImage.style.height) / 2,[代码][代码] [代码][代码]width: windowSize.windowWidth,[代码][代码] [代码][代码]height: bookmark.backgroundImage.style.height,[代码][代码] [代码][代码]success (res) {[代码][代码] [代码][代码]let d = res.data[代码][代码] [代码][代码]let filterData = filters[type](d, {[代码][代码] [代码][代码]height: bookmark.backgroundImage.style.height,[代码][代码] [代码][代码]width: bookmark.backgroundImage.style.width[代码][代码] [代码][代码]})[代码][代码] [代码][代码]wx.canvasPutImageData({[代码][代码] [代码][代码]canvasId: [代码][代码]'canvas'[代码][代码],[代码][代码] [代码][代码]data: filterData,[代码][代码] [代码][代码]x: 0,[代码][代码] [代码][代码]y: ((windowSize.windowHeight * 0.9) - bookmark.backgroundImage.style.height) / 2,[代码][代码] [代码][代码]width: windowSize.windowWidth,[代码][代码] [代码][代码]height: bookmark.backgroundImage.style.height,[代码][代码] [代码][代码]success: (res) => {[代码] [代码][代码] // 安卓上执行到这一步没反应 打印mainCtx也有对象 iOS正常 [代码] [代码][代码]mainCtx.draw([代码][代码]true[代码][代码], () => {[代码][代码] [代码][代码]console.log(wx)[代码][代码] [代码][代码]wx.canvasToTempFilePath({[代码][代码] [代码][代码]canvasId: [代码][代码]'canvas'[代码][代码],[代码][代码] [代码][代码]height: windowSize.windowHeight * 0.9,[代码][代码] [代码][代码]y: 0,[代码][代码] [代码][代码]success: (e) => {[代码][代码] [代码][代码]console.log(e)[代码][代码] [代码][代码]$store.dispatch([代码][代码]'SET_BACKGROUND_IMAGE'[代码][代码], e.tempFilePath)[代码][代码] [代码][代码]},[代码][代码] [代码][代码]fail: (e) => {[代码][代码] [代码][代码]},[代码][代码] [代码][代码]complete: (e) => {[代码][代码] [代码][代码]console.log([代码][代码]'complete'[代码][代码])[代码][代码] [代码][代码]}[代码][代码] [代码][代码]}, that)[代码][代码] [代码][代码]})[代码][代码] [代码][代码]}[代码][代码] [代码][代码]})[代码][代码] [代码][代码]}[代码][代码] [代码][代码]})[代码] 我提交到体验版了 不知管理员能不能直接打开体验版查一下问题
2018-08-09同遇到问题,https://developers.weixin.qq.com/blogdetail?action=get_post_info&docid=00082a65e48c682efe275daf556c00&token=1387101208&lang=zh_CN success,fail,complete,try..catch都试了,没输出。。
wx.canvasToTempFilePath[代码]eventGetImage(event) {[代码][代码] [代码][代码]console.log(event);[代码][代码] [代码][代码]const _that = [代码][代码]this[代码][代码];[代码][代码] [代码][代码]if[代码] [代码](event.detail.errMsg == [代码][代码]'canvasdrawer:ok'[代码][代码]){[代码][代码] [代码][代码]if[代码] [代码]([代码][代码]this[代码][代码].data.result.flowPriceUnit < 0 || [代码][代码]this[代码][代码].data.result.flowPriceUnit > 100){[代码][代码] [代码][代码]console.log([代码][代码]'haohaoaoh'[代码][代码])[代码][代码] [代码][代码]//这个地方就也不执行了[代码][代码] [代码][代码]wx.canvasToTempFilePath({[代码][代码] [代码][代码]x: 0,[代码][代码] [代码][代码]y: 0,[代码][代码] [代码][代码]width: 345,[代码][代码] [代码][代码]height: 520,[代码][代码] [代码][代码]canvasId: [代码][代码]'canvasdrawer'[代码][代码],[代码][代码] [代码][代码]success(resFilePath) {[代码][代码] [代码][代码]console.log(resFilePath);[代码][代码] [代码][代码]wx.saveImageToPhotosAlbum({[代码][代码] [代码][代码]filePath: resFilePath.tempFilePath,[代码][代码] [代码][代码]success(res) {[代码][代码] [代码][代码]wx.hideLoading()[代码][代码] [代码][代码]console.log([代码][代码]'绘图成功'[代码][代码])[代码][代码] [代码][代码]wx.showToast({[代码][代码] [代码][代码]title: [代码][代码]'保存图片成功'[代码][代码],[代码][代码] [代码][代码]icon: [代码][代码]'success'[代码][代码],[代码][代码] [代码][代码]duration: 2000[代码][代码] [代码][代码]})[代码][代码] [代码][代码]}[代码][代码] [代码][代码]})[代码][代码] [代码][代码]}[代码][代码] [代码][代码]}, _that.canvasdrawerComponent);[代码][代码] [代码][代码]return[代码][代码] [代码][代码]}[代码][代码] [代码][代码]console.log([代码][代码]'单价在0至100之间'[代码][代码])[代码][代码] [代码][代码]wx.canvasGetImageData({[代码][代码] [代码][代码]canvasId: [代码][代码]'mychart-line'[代码][代码],[代码][代码] [代码][代码]x: 0,[代码][代码] [代码][代码]y: 0,[代码][代码] [代码][代码]width: 304,[代码][代码] [代码][代码]height: 122,[代码][代码] [代码][代码]success(res) {[代码][代码] [代码][代码]console.log(res)[代码][代码] [代码][代码]wx.canvasPutImageData({[代码][代码] [代码][代码]canvasId: [代码][代码]'canvasdrawer'[代码][代码],[代码][代码] [代码][代码]data: res.data,[代码][代码] [代码][代码]x: 20,[代码][代码] [代码][代码]y: 285,[代码][代码] [代码][代码]width: 304,[代码][代码] [代码][代码]height: 122,[代码][代码] [代码][代码]success(res) {[代码][代码] [代码][代码]console.log(res);[代码][代码] [代码][代码]console.log([代码][代码]'绘画完成'[代码][代码])[代码][代码] [代码][代码]console.log([代码][代码]'开始保存'[代码][代码])[代码][代码] [代码][代码]//这个地方就不在执行了[代码][代码] [代码][代码]wx.canvasToTempFilePath({[代码][代码] [代码][代码]x: 0,[代码][代码] [代码][代码]y: 0,[代码][代码] [代码][代码]width: 345,[代码][代码] [代码][代码]height: 520,[代码][代码] [代码][代码]canvasId: [代码][代码]'canvasdrawer'[代码][代码],[代码][代码] [代码][代码]success(resFilePath) {[代码][代码] [代码][代码]console.log(resFilePath);[代码][代码] [代码][代码]wx.saveImageToPhotosAlbum({[代码][代码] [代码][代码]filePath: resFilePath.tempFilePath,[代码][代码] [代码][代码]success(res) {[代码][代码] [代码][代码]wx.hideLoading()[代码][代码] [代码][代码]console.log([代码][代码]'绘图成功'[代码][代码])[代码][代码] [代码][代码]wx.showToast({[代码][代码] [代码][代码]title: [代码][代码]'保存图片成功'[代码][代码],[代码][代码] [代码][代码]icon: [代码][代码]'success'[代码][代码],[代码][代码] [代码][代码]duration: 2000[代码][代码] [代码][代码]})[代码][代码] [代码][代码]}[代码][代码] [代码][代码]})[代码][代码] [代码][代码]}[代码][代码] [代码][代码]}, _that.canvasdrawerComponent)[代码][代码] [代码][代码]}[代码][代码] [代码][代码]}, _that.canvasdrawerComponent)[代码][代码] [代码][代码]}[代码][代码] [代码][代码]}, _that.echartsComponnet)[代码][代码] [代码][代码]}[代码][代码]},[代码]每次走到[代码] [代码][代码]wx.canvasToTempFilePath函数就不再执行了,也不知道为什么,不报错[代码]
2018-08-09设置了还在啊
button的边框问题[图片] 我在button标签里直接放了两个图片,但是会有边框,代码里找了一下,相对应的标签并没有border的样式
2018-08-06hello ,everyone,已解决,成功加载了地图,实现了散点
echarts 绘制中国地图- 需求的场景描述(希望解决的问题) 由于业务需求,我需要绘制中国地图,再在上面加一些散点,由于声明支持echarts,所以决定使用echarts,但是echarts绘制地图需要引用 china.js,我从echart官网实例下载了china.js,但是微信小程序一直提示引入失败,对比了github和官网的china.js是同一份,但打开来看都是有存在乱码现象,但他们能正常加载中国地图 - 希望提供的能力 看了下子的china.js已经是utf-8编码了,尝试过转成gbk还是一样的无法读取china.js,卡在这了求助。 或者有没有其他方式绘制中国地图的?西瓜足迹地图是怎么实现中国地图的? china.js源码地址:http://gallery.echartsjs.com/dep/echarts/map/js/china.js
2018-08-02ok , i see onTabItemTapclosed
how to capture tabs touch evnet?- 需求的场景描述(希望解决的问题) 我有四个tabbar,点击各个页面切换,现在我希望当前正在某个tab内,再次点击这个tab可以触发界面的refresh功能,或者能够让我捕获到点击事件也好 - 希望提供的能力 捕获tabbar的点击事件
2018-06-26