- 官方扩展vtabs问题,怎么初始化显示第n个标签?
[图片]比如这样,默认选中第5项
2020-06-04 - 新canvas接口 进行图片压缩处理,多次就会出现图片变形BUG?
安卓上目前没有问题,但是iphoneX上反复出现该bug,第一次选择图片是正常压缩,第二次开始就变形了 [图片] 代码片段: https://developers.weixin.qq.com/s/RuWzeWms7lgs
2020-04-28 - canvasToTempFilePath 在ios真机上一直是fail?安卓和模拟器上都正常
ios报错:fail no image return new Promise((resolve, reject) => { console.log("第二步处理中11") wx.canvasToTempFilePath({ destWidth: idestWidth, destHeight: idestHeight, canvas, quality: 1, success(res) { console.log("第二步处理中2") tempImages = res.tempFilePath; // const oldImages = that.data.tempImages; // tempImages = (oldImages).concat(tempImages) resolve(tempImages) // that.setData({ // tempImages: tempImages // }) }, fail:(err)=>{ console.log(err) } }) })
2020-04-26 - canvasToTempFilePath 之后setdata不生效?
片段: https://developers.weixin.qq.com/s/8EAGqNm67Ngv 一个最简单的demo,出问题,手机上测试也没有反应,setdata给image组件没有反应 const app = getApp() Page({ data: { }, onLoad: function () { wx.chooseImage({ success: (res) =>{ const tempImg = res.tempFilePaths[0]; let self = this; //这里是重点 新版本的type 2d 获取方法 const query = wx.createSelectorQuery(); query.select('#test').fields({ node: true, size: true }) .exec( async (res) => { console.log(res) //获取canvas实例 const canvas = res[0].node; const ctx = canvas.getContext('2d') const dpr = wx.getSystemInfoSync().pixelRatio canvas.width = res[0].width * dpr; canvas.height = res[0].height * dpr; ctx.scale(dpr, dpr); canvas.width = 400 canvas.height = 400 //加载图片进画布 const mainImg = canvas.createImage(); mainImg.src = tempImg; let mainImgPo = await new Promise((resolve, reject) => { mainImg.onload = () => { resolve(mainImg) } mainImg.onerror = (e) => { reject(e) } }); console.log(11); ctx.drawImage(mainImgPo, 0, 0, 333, 333, 0, 0, 320, 250); wx.canvasToTempFilePath({ x: 100, y: 200, width: 50, height: 50, destWidth: 100, destHeight: 100, canvas: canvas, success(res) { console.log(22) self.setData({ imgPath:res.tempFilePath }) } },self) }) }, }) }, })
2020-04-22 - canvasToTempFilePath 图片压缩回调没反应?
场景时需要将图片压缩到1M以内,但是这个方法怎么不起作用了?? //----------绘制图形并取出图片路径-------------- var ctx = wx.createCanvasContext('canvas', that) ctx.drawImage(res.path, 0, 0, canvasWidth, canvasHeight) console.log(3344) ctx.draw(false, () => { //留一定的时间绘制canvas console.log(1100) setTimeout(() => { console.log(2222) wx.canvasToTempFilePath({ canvasId: 'canvas', destWidth: canvasWidth, destHeight: canvasHeight, success:(res) => { console.log(1) console.log(res.tempFilePath) //最终图片路径 }, fail: (res) => { console.log(2) console.log(res.errMsg) } }, that) }, 5000) })
2020-04-21 - canvasToTempFilePath 回调不执行?
//----------绘制图形并取出图片路径-------------- var ctx = wx.createCanvasContext('canvas', that) ctx.drawImage(res.path, 0, 0, canvasWidth, canvasHeight) console.log(3344) ctx.draw(false, () => { //留一定的时间绘制canvas console.log(1100) setTimeout(() => { console.log(2222) wx.canvasToTempFilePath({ canvasId: 'canvas', destWidth: canvasWidth, destHeight: canvasHeight, success:(res) => { console.log(1) console.log(res.tempFilePath) //最终图片路径 }, fail: (res) => { console.log(2) console.log(res.errMsg) } }, that) }, 5000) })
2020-04-21 - 云开发请求返回 access_token 问题? 就一个测试函数
[图片]
2020-04-12 - 新建云函数时报错,当前函数状态无法进行此操作?
[图片] Error: TencentCloud API error: {"Response": {"RequestId": "d36d9901-f0d3-4c3c-b526-55e31930d8a7", "Error": {"Message": "\u5f53\u524d\u51fd\u6570\u72b6\u6001\u65e0\u6cd5\u8fdb\u884c\u6b64\u64cd\u4f5c\uff0c\u8bf7\u5728\u51fd\u6570\u72b6\u6001\u6b63\u5e38\u65f6\u64cd\u4f5c\u3002", "Code": "FailedOperation.UpdateFunctionCode"}}} 翻译了下是:当前函数状态无法进行此操作,请在函数状态正常时操作。 这个是什么情况
2020-04-08